Event-driven edge FaaS dynamic cache updating and computing system

By introducing an event-driven edge FaaS dynamic cache update and computing system in distributed systems, the problems of untimely cache updates and high network latency in dynamic content processing are solved, and efficient and flexible computing logic deployment and a secure edge computing environment are realized.

CN119848057AInactive Publication Date: 2025-04-18刘宇
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411957050.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-29
Publication Date
2025-04-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing distributed systems face problems such as untimely cache updates, high network latency, and heavy central server load when processing highly dynamic content.

Method used

The event-driven edge FaaS dynamic cache update and computing system is adopted, including the central FaaS module, message queue system, edge FaaS module, dynamic computing logic deployment module and request routing module, and dynamic cache update and edge lightweight computing are realized through the event-driven mechanism.

Benefits of technology

It significantly improves the processing efficiency and response speed of dynamic content, reduces the problem of data inconsistency, reduces the load and bandwidth usage of central servers, realizes the dynamic deployment and update of computing logic, and provides a secure and isolated edge computing environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

The invention provides an edge FaaS dynamic cache updating and computing system based on event driving. The system comprises a center FaaS module, a message queue system, an edge FaaS module, a dynamic computing logic deployment module and a request routing module. The center FaaS module captures a core business event and generates a cache update message, and the cache update message is transmitted to the edge FaaS module through a message queue system. And the edge FaaS module receives the update message and executes local cache update and lightweight calculation. And the dynamic computing logic deployment module realizes real-time updating of the edge FaaS computing logic. The request routing module determines a request processing position according to a preset rule and a system load. The method has the beneficial effects that the processing efficiency and the response speed of the dynamic content are remarkably improved, the load and the bandwidth use of the central server are reduced, and powerful support is provided for constructing high-performance and low-delay global distributed application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed computing systems, and in particular to a dynamic cache update and lightweight computing system based on edge computing and Function as a Service (FaaS) architecture and an implementation method thereof. Background Art

[0002] In today's rapidly developing Internet era, distributed computing systems have important applications in the fields of global content distribution and real-time data processing. As users' requirements for response speed and real-time performance continue to increase, how to efficiently process and distribute dynamic content on a global scale while ensuring the scalability and performance of the system has become a major challenge facing the current technology field.

[0003] Currently, the solution to this problem is mainly a combination of content delivery network (CDN) and function as a service (FaaS). CDN deploys edge nodes around the world to cache static content at the location closest to the user, greatly reducing the latency of content transmission. FaaS provides a flexible serverless computing model that allows developers to run function code directly without managing the underlying infrastructure. The combination of these two technologies has improved the processing efficiency and distribution speed of dynamic content to a certain extent.

[0004] However, this solution still has significant problems when dealing with highly dynamic content. First, traditional CDNs are mainly optimized for static content. For frequently changing dynamic content, untimely cache updates will lead to data inconsistency. Second, when processing globally distributed requests, the centralized FaaS architecture may affect the response speed due to network latency. In addition, frequent cross-regional data transmission not only increases bandwidth costs, but also increases the load pressure on the central server.

[0005] To solve the above problems, some studies have proposed a solution to sink computing power to edge nodes. Although this method improves the response speed to a certain extent, how to effectively manage the update of computing logic in a distributed environment and how to achieve efficient load balancing between edge nodes and central servers are still urgent problems to be solved. At the same time, how to ensure the security and isolation of computing tasks performed on edge nodes is also an important challenge facing the industry.

[0006] Therefore, there is an urgent need for a new distributed system that can combine the advantages of event-driven mechanisms, edge computing, and FaaS to achieve real-time updates, efficient processing, and rapid distribution of dynamic content. Such a system should be able to intelligently distribute computing tasks between edge nodes and central servers, while providing a flexible computing logic deployment mechanism to adapt to changing business needs. Developing such a system has become a research hotspot in this field. It can not only improve the performance and user experience of global applications, but also optimize resource utilization and reduce operating costs. Summary of the invention

[0007] The main purpose of the present invention is to solve the problems faced by existing distributed systems when processing highly dynamic content, such as untimely cache updates, high network latency, and heavy central server load. In addition, the present invention also aims to provide a flexible edge computing framework to achieve dynamic deployment and update of computing logic while ensuring the security and isolation of edge node computing tasks.

[0008] To achieve the above objectives, the present invention provides an event-driven edge FaaS dynamic cache update and computing system, which is characterized by: including a central FaaS module, a message queue system, an edge FaaS module, a dynamic computing logic deployment module and a request routing module, and realizing dynamic cache updates and edge lightweight computing through an event-driven mechanism.

[0009] In some embodiments, the system can also be applied to a global content distribution network to achieve rapid updating and distribution of dynamic content.

[0010] Specifically, the central FaaS module includes event listeners and event-to-cache item mapping algorithms, which are used to accurately capture and process core business events such as data updates and content publishing, and generate corresponding cache update messages.

[0011] Furthermore, the message queue system adopts a low-latency, high-reliability distributed messaging mechanism to ensure that cache update messages can be delivered to the edge FaaS module quickly and accurately.

[0012] Preferably, the edge FaaS module contains a predefined computing function library for performing basic data processing and content assembly tasks, which not only performs local cache updates but also performs lightweight computing processing, thereby improving the response speed and efficiency of the system.

[0013] Optionally, the dynamic computing logic deployment module supports updating the computing logic of the edge FaaS without interrupting the service, and provides version control and rollback mechanisms.

[0014] In one embodiment, the request routing module intelligently decides whether the request is processed at the edge FaaS or forwarded to the central FaaS based on preset rules and current system load.

[0015] In some embodiments, the edge FaaS module also includes a container-based computing resource management system for achieving task isolation and resource optimization.

[0016] In addition, the present invention can also integrate a lightweight machine learning model in the edge FaaS module to achieve personalized content recommendation or anomaly detection.

[0017] In other embodiments, the system can be seamlessly integrated with existing CDN infrastructure to further improve the distribution efficiency of static and dynamic content.

[0018] In addition, the present invention also provides an event-driven edge FaaS dynamic caching and lightweight computing method, which includes the steps of capturing core business events through central FaaS, generating and transmitting cache update messages, edge FaaS updating local cache and performing lightweight computing.

[0019] The method also includes analyzing the received request through the request routing module, and determining the processing location of the request according to preset rules and the current system load.

[0020] In a preferred embodiment, the central FaaS module captures database write events in real time through an event listener, and uses an event-to-cache item mapping algorithm to determine the specific cache content that needs to be updated.

[0021] The cache update message is delivered to the relevant edge FaaS node through a highly reliable message queue. After receiving the message, the edge node immediately updates the local cache and performs necessary lightweight computing.

[0022] At the same time, the dynamic computing logic deployment module continuously monitors the computing logic version of the edge nodes, automatically pushes updates when necessary, and ensures smooth switching.

[0023] In another preferred embodiment, the system can be applied to global news websites to achieve real-time updating, personalized recommendations and rapid distribution of article content, greatly improving user experience and system performance.

[0024] By adopting the above scheme, the present invention has the following beneficial effects: 1. Significantly improved the processing efficiency and response speed of dynamic content and reduced the problem of data inconsistency; 2. Effectively reduce the load and bandwidth usage of the central server and optimize the utilization of system resources; 3. Realize the dynamic deployment and update of computing logic, improve the flexibility and maintainability of the system; 4. Through lightweight edge computing, cross-regional data transmission is reduced and network latency is reduced; 5. Provides a secure and isolated edge computing environment to ensure the stability and reliability of the system.

[0025] In summary, the present invention provides an innovative distributed computing architecture, which effectively solves the key problems in the prior art, provides strong technical support for building high-performance, low-latency, and highly scalable global applications, and has important practical application value and broad market prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 This is the overall system architecture diagram. It shows the relationship and main functions between the central FaaS module, message queue system, edge FaaS module, dynamic computing logic deployment module, and request routing module.

[0028] Figure 2 It is the central FaaS module diagram. It describes in detail the workflow of the event listener and event-to-cache item mapping algorithm, including event sources, dynamic mapping trees, and mapping processes.

[0029] Figure 3 It is a message queue system diagram. It shows the structure of the message producer interface, message distributor, message storage engine and message consumer interface, as well as features such as dynamic partitioning strategy, multi-level cache and intelligent compression.

[0030] Figure 4 It is a module diagram of edge FaaS. It describes the composition of predefined computing function library, local cache manager, lightweight computing engine and request processor, as well as innovations such as multi-level adaptive cache, microkernel architecture and incremental update mechanism.

[0031] Figure 5 It is a dynamic computing logic deployment module diagram. It shows the structure of the version control system, deployment scheduler, hot update engine and rollback manager, as well as features such as wave deployment, canary release and intelligent conflict resolution.

[0032] Figure 6 It is a request routing module diagram. It describes the composition of the request analyzer, decision engine, load balancer and performance monitor, as well as innovations such as multi-dimensional request feature vectors, adaptive multi-armed bandit and predictive routing.

[0033] Figure 7This is a diagram of the dynamic cache update method. It shows the complete process of event capture, event analysis, update message generation, message delivery, edge cache update and consistency verification, as well as technologies such as multi-source event stream fusion, incremental encoding and predictive update.

[0034] Figure 8 It is an application diagram of a global news website. It describes the structure of the central content management system, globally distributed edge nodes, user request processing layer and real-time analysis engine, as well as functions such as intelligent pre-fetching, dynamic routing and adaptive content distribution. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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.

[0036] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.

[0037] Example 1: Overall system architecture.

[0038] The overall architecture of the event-driven edge FaaS dynamic cache update and computing system provided by the present invention is as follows: Figure 1 The system mainly includes a central FaaS module 101, a message queue system 102, an edge FaaS module 103, a dynamic computing logic deployment module 104 and a request routing module 105.

[0039] The central FaaS module 101 is the core control unit of the system, responsible for capturing core business events and generating cache update messages. The module includes an event listener 1011 and an event-to-cache item mapping algorithm 1012. The event listener 1011 uses high-performance event stream processing technology to capture core business events such as database writes and content publishing in real time. After capturing an event, the event-to-cache item mapping algorithm 1012 quickly analyzes the event content and determines the specific cache item that needs to be updated. This mapping algorithm uses an optimized hash table structure to achieve O(1) time complexity, ensuring efficient performance in large-scale systems.

[0040] The message queue system 102 uses distributed message middleware technology to ensure that cache update messages can be quickly and reliably transmitted from the central FaaS to the edge FaaS. The system uses a high-throughput message queue based on Kafka, combined with a customized message compression and batch processing strategy, to ensure message reliability while keeping message delivery latency at a low level. In order to cope with network fluctuations, the system also implements a message retry and confirmation mechanism to ensure the "at least once" delivery semantics of messages.

[0041] The edge FaaS module 103 is a computing node distributed around the world, responsible for performing local cache updates and lightweight computing tasks. Each edge FaaS module contains a predefined computing function library 1031, a local cache manager 1032, and a lightweight computing engine 1033. The predefined computing function library 1031 contains a series of commonly used data processing and content assembly functions, such as JSON parsing, HTML template rendering, etc. The local cache manager 1032 adopts a multi-level cache strategy, combined with the LRU (Least Recently Used) and LFU (Least Frequently Used) algorithms to optimize the storage and access efficiency of cache items. The lightweight computing engine 1033 is implemented based on WebAssembly technology, supports multiple programming languages, and can quickly complete complex computing tasks.

[0042] The dynamic computing logic deployment module 104 is responsible for managing and updating the computing logic of the edge FaaS. This module implements a Git-based version control system that supports incremental updates and fast rollbacks of computing logic. The update process adopts a blue-green deployment strategy to ensure the continuous availability of the system during the update. In addition, this module also includes an intelligent scheduling algorithm that can automatically determine the priority and time window of the update based on factors such as geographic location and load conditions.

[0043] The request routing module 105 is the entrance to the system and is responsible for analyzing user requests and deciding where to process them. This module uses a machine learning model to predict the complexity and resource requirements of requests, and dynamically decides whether to process requests at the edge FaaS or forward them to the central FaaS based on the current system load and network conditions. To improve the accuracy of decision-making, the system continuously collects and analyzes actual performance data for request processing and regularly updates the decision model.

[0044] The innovation of this system is that it not only realizes efficient dynamic cache updates, but also introduces powerful computing power in edge nodes. Through the event-driven mechanism, the system can accurately identify and propagate cache updates, avoiding the waste of resources caused by traditional periodic refreshes. At the same time, the introduction of edge computing greatly reduces the amount of data transmission and significantly reduces network latency. In global application scenarios, such as news websites or social media platforms, this system can significantly improve the real-time nature of content updates while effectively reducing the load on the central server.

[0045] It should be noted that the above embodiment is only one of the preferred implementations of the present invention, and those skilled in the art can make appropriate adjustments to the system architecture according to actual needs. For example, more security mechanisms such as request encryption and identity authentication can be integrated into the edge FaaS module to enhance the security of the system. In addition, the system can also be seamlessly integrated with the existing CDN infrastructure to further improve the distribution efficiency of static and dynamic content.

[0046] In summary, the system architecture provided by the present invention provides a new idea for solving the problems of dynamic content processing and edge computing in a distributed environment, and has broad application prospects and important practical value.

[0047] Example 2: Central FaaS module.

[0048] This embodiment describes in detail the structure and working principle of the central FaaS module, which is the core control unit of the system of the present invention. Figure 2 As shown, the central FaaS module 201 mainly includes two key components: an event listener 2011 and an event-to-cache item mapping algorithm 2012.

[0049] Event Listener 2011 uses high-performance event stream processing technology to capture core business events in the system in real time. These events may come from multiple sources, such as database write operations, content management system publishing operations, user behavior, etc. The core of Event Listener is a stream processing engine based on Apache Flink. The engine first establishes connections with various event sources through custom connectors. For example, for database events, it uses change data capture (CDC) technology; for application events, it uses message queues such as Kafka for docking.

[0050] After receiving the original event, the event listener will perform a series of processing. First, through a configurable filter chain, relevant events are quickly filtered out according to predefined rules. This filter chain uses BloomFilter to improve efficiency and can complete preliminary screening within O(1) time complexity. For events that pass the preliminary screening, the event listener will perform event enhancement processing, including adding metadata (such as timestamps, event type identifiers, etc.) and performing preliminary event aggregation (such as merging events of the same type that occur within a short period of time). Finally, the enhanced events will be distributed to the event to cache item mapping algorithm 2012 for further processing.

[0051] The event-to-cache item mapping algorithm 2012 is the core innovation of this module. It uses a new type of "dynamic mapping tree" structure, which can complete the mapping of events to cache items within the time complexity of O(log n). When the system starts, the initial mapping tree is constructed according to the predefined mapping rules. Each leaf node represents one or a group of cache items, and the intermediate nodes represent the characteristics of the event. As the system runs, the algorithm will dynamically adjust the structure of the mapping tree according to the actual event pattern and cache access pattern. Frequently triggered mapping paths will be optimized to reduce the traversal depth.

[0052] When an event is received, the algorithm traverses the mapping tree starting from the root node. At each intermediate node, the next traversal path is selected based on the event characteristics until the leaf node is reached to determine the cache item that needs to be updated. In order to handle high-concurrency event streams, the algorithm implements a lock-free concurrency control mechanism and adopts a copy-on-write strategy to handle tree structure updates, ensuring performance and consistency under high concurrency.

[0053] The core of the mapping algorithm can be expressed as the following recursive function: Among them, the SelectChild function selects the next child node to be traversed according to the event characteristics.

[0054] The output of the central FaaS module is a series of cache update messages, each of which contains the updated cache item identifier, update type (such as addition, modification, deletion), updated content or content reference. These messages are passed to the corresponding edge FaaS module through the message queue system.

[0055] The central FaaS module in this embodiment significantly improves the system's response speed to dynamic content changes through its efficient event processing and precise cache item mapping. In practical applications, this method can control the latency of cache updates to the millisecond level, which is much better than the traditional periodic refresh method. At the same time, since only necessary cache items are updated, the system resource utilization is significantly improved.

[0056] It should be noted that, although this embodiment describes a specific technical implementation, the scope of the present invention is not limited thereto. For example, the event listener can select different stream processing engines according to the specific application scenario, and the mapping algorithm can also be implemented using other efficient data structures such as a prefix tree (Trie). In addition, this module can also integrate a machine learning algorithm to predict possible cache update modes by analyzing historical data to further optimize performance.

[0057] In summary, as the core component of the system of the present invention, the innovative design of the central FaaS module lays the foundation for achieving efficient and accurate dynamic cache updates and provides a new idea for solving the real-time data consistency problem in distributed systems.

[0058] Embodiment 3: Message queue system.

[0059] This embodiment describes in detail the design and implementation of the message queue system, which is a key component of the present invention to achieve efficient and reliable central FaaS to edge FaaS communication. Figure 3 As shown, the message queue system 301 mainly includes a message producer interface 3011 , a message distributor 3012 , a message storage engine 3013 and a message consumer interface 3014 .

[0060] The message producer interface 3011 is responsible for receiving cache update messages from the central FaaS module. This interface adopts an asynchronous non-blocking design and can efficiently handle a large number of concurrent message production requests. In order to improve throughput, the interface implements a batch submission mechanism that can merge multiple small messages into a large batch submission. The batch size is configurable and is set by default to 1024 messages or 1MB of data, whichever comes first. This mechanism significantly reduces network transmission overhead and disk I / O operations, improving overall performance.

[0061] The message distributor 3012 is the core component of the system, responsible for routing messages to appropriate storage partitions. The present invention adopts an innovative "dynamic partitioning strategy" that can dynamically adjust the number and distribution of partitions according to the characteristics of the message and the system load. The partitioning strategy uses an algorithm based on consistent hashing to ensure that data migration is minimized when the number of partitions changes. The core function of the algorithm is as follows: partition=hash(key)%numPartitions (2) The hash function uses the MurmurHash3 algorithm, key is the unique identifier of the message, and numPartitions is the current number of partitions. The system periodically evaluates the load of each partition and triggers a partition rebalancing operation when an unbalanced load is detected.

[0062] The message storage engine 3013 uses a log-structured storage model to ensure high-throughput write performance. Each partition maintains an append-type log file, and new messages are always appended to the end of the log. In order to improve read performance, the system implements a multi-level cache mechanism: 1. Page cache: The operating system-level page cache is used to cache recently accessed disk data. 2. Message index: A B+ tree index maintained in memory, used to quickly locate the message location. 3. Message cache: off-heap memory cache, storing the hottest message data.

[0063] This multi-level cache design significantly improves the message reading performance, especially for frequently accessed hot data.

[0064] The message consumer interface 3014 is responsible for distributing messages to the edge FaaS module. This interface supports a push-pull messaging mode. Under normal circumstances, the system actively pushes new messages to consumers. When the consumer's processing capacity is insufficient, it can switch to pull mode, and the consumer actively requests messages. This flexible design ensures optimal performance under different load conditions.

[0065] In order to ensure reliable message delivery, this system implements an innovative "two-stage confirmation" mechanism. In the first stage, the consumer sends a pre-confirmation immediately after receiving the message. In the second stage, the final confirmation is sent after the message is successfully processed. This mechanism allows the system to quickly detect unprocessed messages when the consumer crashes and redistribute them, greatly improving the reliability of the system.

[0066] Another innovative feature of this message queue system is the "intelligent compression" function. The system will dynamically analyze the message content and select the most suitable compression algorithm. For text type messages, the LZ4 algorithm is used by default; for binary data, the Snappy algorithm is used. The selection of the compression algorithm is based on the following formula:

[0067] The system regularly evaluates the scores of different algorithms and automatically switches to the algorithm with the highest score. This intelligent compression mechanism significantly reduces network bandwidth usage while ensuring high throughput.

[0068] It should be noted that although this embodiment describes a specific technical implementation, the scope of the present invention is not limited thereto. For example, the storage engine can select different storage technologies according to specific needs, such as a storage structure based on an LSM tree. In addition, the system can also integrate a stream processing function to perform real-time data analysis and conversion during message transmission.

[0069] In summary, this message queue system provides an efficient and reliable communication mechanism between the central FaaS and the edge FaaS through its innovative design, and is a key component for achieving global consistency and real-time data updates. It not only solves the performance and reliability issues of traditional message systems in large-scale distributed environments, but also provides a flexible framework for future expansion and optimization.

[0070] Embodiment 4: Edge FaaS module.

[0071] This embodiment describes in detail the design and implementation of the edge FaaS module, which is the core component of the present invention to implement distributed edge computing and dynamic cache updates. Figure 4 As shown, the edge FaaS module 401 mainly includes a predefined computing function library 4011, a local cache manager 4012, a lightweight computing engine 4013 and a request processor 4014.

[0072] The predefined computing function library 4011 is a highly optimized function collection that includes commonly used data processing and content assembly operations. These functions are implemented using WebAssembly technology to ensure cross-platform compatibility and high performance. The function library includes but is not limited to JSON parsing, HTML template rendering, image processing, data encryption and other functions. In order to improve performance, this module innovatively introduces the "function preheating" mechanism. The system regularly analyzes the calling frequency and pattern of functions, and preloads and optimizes hot functions. The preheating process includes compiling the WebAssembly code into local machine code and caching the initialization state of the function in memory. This mechanism significantly reduces the cold start time of the function. In actual testing, it can reduce the delay of function calls to the microsecond level.

[0073] The local cache manager 4012 adopts an innovative "multi-level adaptive cache" structure. The structure includes three levels: memory cache, SSD cache, and disk cache. The memory cache uses an improved LRU-K algorithm, in which the K value is dynamically adjusted according to the cache hit rate. The SSD cache uses a storage structure based on the LSM tree to optimize write performance. The disk cache uses a tiered storage strategy to store hot data in disk areas with better performance. The cache manager also implements the "smart prefetch" function, which predicts data that may be accessed by analyzing historical access patterns and loads it into a higher-level cache in advance. The cache replacement strategy is based on the following formula: Among them, AccessFrequency is the access frequency of data, DataSize is the data size, StorageCost is the storage cost, and AccessLatency is the access latency. The system will give priority to replacing cache items with lower scores.

[0074] The lightweight computing engine 4013 is the core innovation of this module. It adopts a "microkernel" architecture and only contains the most basic scheduling and resource management functions. Other functions are implemented in the form of plug-ins. This design greatly improves the flexibility and scalability of the system. The computing engine supports multiple programming languages, including JavaScript, Python, and Rust. To ensure security, each function instance runs in an independent sandbox environment. The sandbox uses a seccomp-based system call filtering mechanism to strictly limit the system resources that the function can access. The computing engine also implements an innovative "dynamic resource allocation" algorithm that can adjust the allocation of CPU and memory in real time according to the execution of the function. The algorithm is optimized based on the following objective function: Among them, Throughput i is the throughput of the ith function, Resource i is the resource allocated to the i-th function, and TotalResource is the total system resource.

[0075] The request processor 4014 is responsible for receiving and processing requests from clients. It implements an innovative "adaptive request routing" mechanism. When a request is received, the processor decides whether to process it locally or forward it to the central FaaS based on the type of request, current system load, and historical performance data. The decision-making process uses a reinforcement learning-based model that can continuously optimize the routing strategy over time. The reward function of the model is defined as follows: Reward=-(α*ResponseTime+β*ResourceUsage+γ*NetworkCost) (6) Among them, α, β, and γ are adjustable weight parameters, ResponseTime is the request response time, ResourceUsage is the resource utilization rate, and NetworkCost is the network transmission cost.

[0076] Another innovation of the edge FaaS module is the "incremental update" mechanism. When receiving a cache update message from the message queue, the system analyzes the update content and only modifies the parts that need to be changed instead of replacing the entire cache item. This method greatly reduces the amount of data transmission and update time. In practical applications, for large data sets, incremental updates can reduce the update time from seconds to milliseconds.

[0077] It should be noted that although this embodiment describes a specific technical implementation, the scope of the present invention is not limited thereto. For example, the computing engine can integrate more types of runtime environments, such as WebGL for GPU computing. In addition, the system can also implement collaborative computing across edge nodes to further improve computing power and resource utilization.

[0078] In summary, this edge FaaS module achieves efficient, flexible, and secure edge computing and cache management through its innovative design. It not only solves the performance, security, and scalability issues faced by traditional edge computing systems, but also provides a strong technical foundation for future edge intelligence and real-time data processing.

[0079] Embodiment 5: Dynamic computing logic deployment module.

[0080] This embodiment describes in detail the design and implementation of the dynamic computing logic deployment module, which is a key component in the present invention to achieve flexible updates of edge FaaS computing logic. Figure 5 As shown, the dynamic computing logic deployment module 501 mainly includes a version control system 5011 , a deployment scheduler 5012 , a hot update engine 5013 and a rollback manager 5014 .

[0081] The version control system 5011 adopts a distributed version control architecture to ensure efficient management in large-scale edge environments. The system uses Git as the basis, but is deeply customized to meet the special needs of edge computing. Each computing logic version is represented as a Git commit, but unlike traditional Git, this system introduces the concept of "lightweight branches". Lightweight branches only store differences from the main branch, greatly reducing storage overhead and network transmission. The version control system also implements an innovative "incremental synchronization" algorithm that can quickly identify and transmit only necessary code changes. This approach has significantly improved deployment efficiency in practice, especially in edge environments with limited bandwidth. The core idea of ​​the incremental synchronization algorithm can be expressed in the following pseudocode: function incrementalSync(localVersion,remoteVersion): diff=computeDiff(localVersion,remoteVersion) if sizeOf(diff) <threshold: return applyPatch(localVersion,diff) else: return fullSync(remoteVersion)

[0082] The deployment scheduler 5012 is responsible for coordinating the entire deployment process. It implements a novel "wave deployment" strategy to minimize system risks by controlling the speed and scope of deployment. The deployment process is divided into multiple stages, and a portion of edge nodes are selected for update in each stage. The selection algorithm takes into account the node's geographic location, load conditions, and historical performance data. The deployment scheduler also introduces a "canary release" mechanism, which first deploys the new version on a small number of nodes, monitors its performance and stability, and only continues large-scale deployment after meeting the preset standards. This approach greatly reduces deployment risks and improves the overall reliability of the system. Deployment decisions are based on the following scoring function: DeploymentScore = w1*StabilityScore + w2*PerformanceGain - w3*DeploymentCost (7)Wherein, w1, w2, and w3 are weight coefficients, StabilityScore reflects the stability of the node, PerformanceGain is the expected performance improvement, and DeploymentCost is the deployment cost.

[0083] The hot update engine 5013 is the core innovation of this module. It can update the computing logic of edge FaaS without interrupting the service. The hot update process is divided into three steps: code preloading, state transfer, and traffic switching. In the code preloading phase, the new version of the code is loaded into the memory but not executed. In the state transfer phase, the system captures the current running state and converts it into a format that the new version can understand. In the traffic switching phase, the system gradually routes requests to the new version while keeping the old version running for a while to handle ongoing requests. The entire process is controlled by a state machine to ensure the atomicity and consistency of the update. The hot update engine also implements an innovative "double buffering" mechanism, which maintains the runtime environment of the new and old versions in memory at the same time, and achieves instantaneous updates through fast pointer switching, controlling the service interruption time to the microsecond level.

[0084] The Rollback Manager 5014 is responsible for handling problems that may arise during the deployment process. It implements a "multi-level rollback" strategy that can select different rollback solutions based on the severity of the problem. For minor problems, the system will attempt to perform a local rollback and only restore the affected components. For serious problems, the system will trigger a global rollback to restore the entire edge node to the last stable version. During the rollback process, the system will automatically perform data migration and state recovery to ensure business continuity. The Rollback Manager also introduces the concept of "progressive rollback", which gradually reduces the traffic of the new version during the rollback process while increasing the traffic of the old version to minimize the impact on users.

[0085] Another innovation of this dynamic computing logic deployment module is the "intelligent conflict resolution" mechanism. In a distributed environment, different edge nodes may make local modifications at the same time, resulting in version conflicts. The system resolves most conflicts through semantic analysis and automatic merging algorithms, and only requests manual intervention when it cannot be resolved automatically. This greatly improves the system's autonomy and deployment efficiency.

[0086] It should be noted that although this embodiment describes a specific technical implementation, the scope of the present invention is not limited thereto. For example, the version control system can be extended to support more complex branching strategies to adapt to different development processes. In addition, the deployment process can be further optimized by introducing machine learning algorithms to predict deployment risks and optimize deployment strategies.

[0087] In summary, this dynamic computing logic deployment module achieves efficient, secure, and flexible updates of computing logic in the edge FaaS environment through its innovative design. It not only solves the consistency and efficiency problems faced by traditional deployment systems in large-scale distributed environments, but also provides powerful dynamic update capabilities for future edge computing, laying the foundation for rapid iteration and continuous optimization of applications.

[0088] Embodiment 6: Request routing module.

[0089] This embodiment describes in detail the design and implementation of the request routing module, which is a key component for implementing intelligent request distribution and load balancing in the present invention. Figure 6 As shown, the request routing module 601 mainly includes a request analyzer 6011, a decision engine 6012, a load balancer 6013 and a performance monitor 6014.

[0090] Request Analyzer 6011 is responsible for deep parsing and feature extraction of received user requests. It uses the innovative "multi-dimensional request feature vector" technology to map various attributes of the request to a high-dimensional feature space. These features include but are not limited to request type, data size, estimated computational complexity, user location, etc. The feature extraction process uses an optimized deep learning model that can complete the analysis within milliseconds. The model architecture uses a lightweight MobileNet variant that greatly reduces the amount of computation through deep separable convolution while maintaining high accuracy. The generation of the feature vector can be expressed as: F(r)=CNN(r)·W+b (8) Where r is the original request, CNN represents the convolutional neural network operation, W and b are the weight matrix and bias vector respectively.

[0091] Decision Engine 6012 is the core innovation of this module. It uses a novel "adaptive multi-armed bandit" algorithm to dynamically decide the processing location of the request. The algorithm regards each possible processing location (such as local edge node, neighboring edge node or central FaaS) as a bandit arm and optimizes the decision strategy through continuous learning and exploration. The core of the algorithm is Thompson sampling, which can achieve a good balance between exploration and utilization. The decision-making process can be expressed as: Among them, a t is the action selected at time t, is the estimated benefit of action a, and n a is the number of times action a is selected, and t is the total number of decisions. In order to adapt to the dynamic characteristics of edge computing, the algorithm introduces a "context-aware" mechanism to dynamically adjust the decision strategy according to the current system status and request characteristics.

[0092] Load Balancer 6013 implements an innovative "elastic consistent hashing" algorithm. Traditional consistent hashing may cause a large number of request remapping when nodes are added or reduced, but this algorithm greatly reduces the need for remapping by introducing the concepts of "virtual nodes" and "dynamic weights". The core idea of ​​the algorithm is to map each physical node to multiple virtual nodes, and dynamically adjust the number and distribution of virtual nodes according to the load conditions of the nodes. This method not only improves the effect of load balancing, but also enhances the elasticity and scalability of the system. The objective function of load balancing can be expressed as: Among them, x ij represents the decision to assign request i to node j, c ij is the corresponding cost.

[0093] Performance Monitor 6014 uses distributed tracing and real-time analysis technology. It collects fine-grained performance data by injecting lightweight probes at various stages of request processing. This data is aggregated and analyzed in real time through an efficient stream processing pipeline to generate a health report for the system. The monitor also implements an innovative "anomaly detection" algorithm that can quickly identify performance anomalies and potential failures. The algorithm is based on time series analysis and clustering technology and can detect complex performance pattern changes. The core formula for anomaly detection is as follows: Among them, x t is the observed value at time t, t and t are the mean and standard deviation of historical data, and k is an adjustable sensitivity parameter.

[0094] Another innovation of the request routing module is the "predictive routing" mechanism. The system predicts the request distribution and system status in the future by analyzing historical request patterns and system load trends. Based on these predictions, the routing module can adjust resource allocation and routing strategies in advance, effectively avoiding performance degradation caused by burst traffic. The prediction model uses the LSTM (Long Short-Term Memory) network, which can capture complex temporal dependencies.

[0095] It should be noted that although this embodiment describes a specific technical implementation, the scope of the present invention is not limited to this. For example, the decision engine can integrate more complex reinforcement learning algorithms, such as deep Q network (DQN) or policy gradient method, to handle more complex decision scenarios. In addition, the system can also introduce federated learning technology to allow different edge nodes to collaborate to optimize the global routing strategy while protecting data privacy.

[0096] In summary, this request routing module achieves efficient, intelligent, and adaptive request distribution and load balancing through its innovative design. It not only solves the performance and scalability problems faced by traditional routing systems in dynamic edge environments, but also provides powerful decision support for future intelligent edge computing and lays the foundation for building high-performance and high-reliability distributed applications.

[0097] Embodiment 7: Dynamic cache update method.

[0098] This embodiment describes in detail the event-driven dynamic cache update method, which is the core of the present invention to achieve efficient and real-time data consistency. Figure 7 As shown, the dynamic cache update method 701 includes key steps such as event capture 702, event analysis 703, update message generation 704, message delivery 705, edge cache update 706 and consistency verification 707.

[0099] Event capture 702 is the starting point of the whole process. This method innovatively adopts the "multi-source event stream fusion" technology, which can simultaneously monitor and capture events from multiple sources such as databases, application servers, user operations, etc. In order to achieve efficient event capture, the system uses a distributed stream processing engine based on Apache Flink, with a custom event adapter. Each event source has a dedicated adapter that is responsible for converting the original event into a standard format. This design not only improves the scalability of the system, but also can handle heterogeneous data sources. The efficiency of event capture can be expressed by the following formula: Where E is the capture efficiency, N captured is the number of events successfully captured, N total is the total number of events, Tprocessing is the average processing time.

[0100] The "semantic understanding" technology was introduced in the event analysis 703 stage to classify and parse events through a deep learning model. The model uses the BERT (Bidirectional Encoder Representations from Transformers) architecture and is pre-trained with a large amount of log data to accurately understand the semantic meaning of events. The output of the model is a high-dimensional vector that represents the semantic features of the event. Based on these features, the system can quickly determine whether the event will cause a cache update and the scope of the impact. The accuracy of event analysis is defined as follows: Among them, TP is a true positive example, TN is a true negative example, FP is a false positive example, and FN is a false negative example.

[0101] The update message generation 704 is the core innovation of this method. It uses the "incremental encoding" technology to transmit only the changed data part, which greatly reduces the network transmission volume. The system uses a custom binary protocol that can efficiently encode various types of update operations. For complex data structures, the system will generate an operation tree that describes how to transform the current state into the target state. This method not only reduces the amount of data transmission, but also improves the flexibility of the update operation. The compression rate of the update message can be expressed as:

[0102] Messaging 705 uses an "adaptive routing" mechanism. The system dynamically selects the optimal transmission path based on network topology, link status, and message priority. In order to handle network fluctuations and partitions, the system implements a consensus algorithm based on the Raft protocol to ensure reliable message delivery. In the case of bandwidth constraints, the system automatically prioritizes and batches messages to maximize effective throughput. The latency of message delivery can be modeled using the following formula:

[0103] Edge cache update 706 introduces an "atomic update" mechanism. The update process is encapsulated in a transaction, which is either completely successful or completely rolled back. This ensures that the system can be restored to a consistent state if any errors occur during the update process. The update process also uses the "Copy-on-Write" technology, allowing updates to be performed without affecting current read operations. This approach significantly improves the concurrency performance of the system, especially in scenarios with more reads than writes. The performance of cache updates can be measured using the following metrics:

[0104] Consistency verification 707 is a key step to ensure global data consistency. The system uses an innovative "probabilistic consistency check" algorithm. The algorithm randomly selects a portion of data items for verification and estimates the overall consistency level through statistical inference. This method greatly reduces verification overhead while ensuring high credibility. When inconsistencies are detected, the system triggers an automatic repair process. The consistency level can be expressed by the following formula:

[0105] Another innovation of this dynamic cache update method is the "predictive update" mechanism. The system predicts data items that may change by analyzing historical update patterns and preheats these data to edge nodes in advance. This method significantly reduces the cache miss rate and improves the overall system performance. The prediction accuracy can be expressed as:

[0106] It should be noted that although this embodiment describes a specific technical implementation, the scope of the present invention is not limited thereto. For example, the event analysis phase can integrate a more complex causal reasoning model to more accurately predict the impact of updates. In addition, the system can also introduce blockchain technology to provide an unalterable audit log for key data updates.

[0107] In summary, this dynamic cache update method achieves efficient, reliable, and real-time distributed cache updates through its innovative design. It not only solves the consistency and performance problems faced by traditional cache systems, but also provides strong technical support for building large-scale, highly available edge computing applications. This method has a wide range of applications, from content distribution networks to IoT data processing, and can play an important role, providing a new paradigm for future distributed system design.

[0108] Example 8: Global News Website Application

[0109] This embodiment describes in detail the specific application of the event-driven edge FaaS dynamic cache update and computing system in a global news website. Figure 8 As shown, the application system 801 includes a central content management system (CMS) 802, globally distributed edge nodes 803, a user request processing layer 804, and a real-time analysis engine 805. This embodiment shows how to organically combine the aforementioned modules to build a high-performance, highly available global news distribution platform.

[0110] The central content management system 802 is the source of news content. It uses the central FaaS module of the present invention to achieve efficient event capture and processing. When an editor publishes or updates a news article, the system immediately generates a content update event. These events are captured in real time through event listeners, and the cache content that needs to be updated is quickly determined through the event-to-cache item mapping algorithm. For example, the update of a news article may affect the cache of multiple pages, including the homepage, category pages, and related recommendation lists. The efficiency of the mapping algorithm can be expressed by the following formula: Among them, N affected_cache_items is the number of cache items affected, T mapping is the time required for mapping.

[0111] The globally distributed edge nodes 803 are the core of this system. Each edge node is deployed with an edge FaaS module, which is responsible for local content caching and lightweight computing. When receiving an update message from the central CMS, the edge node will immediately update the local cache. In this embodiment, the edge node also implements an innovative "intelligent prefetching" mechanism. The system analyzes the user's reading patterns and news dissemination trends, predicts content that may be accessed, and loads this content into the local cache in advance. This approach significantly improves the cache hit rate, especially for breaking hot news. The prefetching efficiency can be measured by the following indicators:

[0112] The user request processing layer 804 adopts the request routing module of the present invention. When a user requests news content, the system will intelligently decide which edge node will handle the request based on the user's geographic location, network conditions, and request content. For most static or quasi-static content, the request will be directly processed by the nearest edge node. For content that requires real-time calculation or personalization, the system will evaluate whether to process it at the edge node or forward it to the central FaaS. This dynamic routing strategy greatly reduces response time and improves user experience. The quality of routing decisions can be expressed by the following formula: RoutingQuality = α·ResponseTime -1 +β·ResourceUtilization+γ·UserSatisfaction (21) Among them, α, β, and γ are weight coefficients and can be adjusted according to specific needs.

[0113] The real-time analysis engine 805 is one of the innovations of this application. It uses the computing power of edge nodes to perform real-time data analysis locally. For example, the system can calculate the real-time reading volume of articles, user stay time and other indicators at the edge nodes without transmitting the original data back to the central server. This method not only reduces network transmission, but also provides near real-time analysis results. The analysis engine adopts a streaming computing model that can continuously process data streams. The analysis performance can be measured by the following indicators:

[0114] Another innovation of this application system is the "adaptive content distribution" mechanism. The system dynamically adjusts the number of copies of the content on edge nodes according to the popularity of the content and the user distribution. For news that suddenly becomes popular, the system will quickly create copies on more edge nodes; for outdated content, the number of copies will be gradually reduced. This mechanism ensures the high availability of hot content while optimizing the use of storage resources. The efficiency of copy allocation can be expressed as:

[0115] It should be noted that although this embodiment describes the application in a news website, the scope of application of the present invention is far more than this. For example, the system can be easily adapted to social media platforms to process user-generated content and real-time interactions. In the field of e-commerce, the system can be used for real-time updates of product information and personalized recommendations. In the Internet of Things scenario, the system can handle real-time analysis and response of large amounts of sensor data.

[0116] In summary, this example demonstrates the powerful capabilities of the event-driven edge FaaS dynamic cache update and computing system in practical applications. It not only solves the performance and consistency issues of global content distribution, but also provides a complete technical solution for building highly interactive, real-time responsive large-scale distributed applications. The innovation and flexibility of this approach enables it to adapt to a variety of complex application scenarios and provides a new paradigm for future Internet application development.

Claims

1. An event-driven edge FaaS dynamic cache and lightweight computing system, characterized in that: include: (a) The central FaaS module is used to capture core business events and generate cache update messages; (b) a message queue system, used to transmit the cache update message; (c) an edge FaaS module, configured to receive the cache update message and perform lightweight computing; (d) a dynamic computing logic deployment module, used to update the computing logic on the edge FaaS module; (e) Request routing module, used to determine where a request is processed.

2. The system according to claim 1, characterized in that The central FaaS module also includes: (a) Event listener, used to capture data update and content publishing events; (b) An event-to-cache-item mapping algorithm is used to determine the cache items that need to be updated.

3. The system according to claim 1, characterized in that The message queue system adopts a low-latency, high-reliability distributed message delivery mechanism.

4. The system according to claim 1, characterized in that The edge FaaS module includes: (a) a library of predefined computational functions for performing basic data processing and content assembly; (b) Container-based computing resource management system for task isolation.

5. The system according to claim 1, characterized in that The dynamic computing logic deployment module includes: (a) A version control system, used to manage different versions of computing logic; (b) a hot update mechanism for updating computing logic without interrupting service; (c) A rollback mechanism to restore to the previous stable version when an update fails.

6. The system according to claim 1, characterized in that The request routing module decides whether to process the request in the edge FaaS module or forward it to the central FaaS module based on preset rules and the current system load.

7. An event-driven edge FaaS dynamic caching and lightweight computing method, characterized in that: The following steps are involved: (a) Capturing core business events through central FaaS; (b) Generate cache update messages and pass them to the edge FaaS through the message queue system; (c) The edge FaaS receives the cache update message and updates the local cache; (d) Edge FaaS performs lightweight computing to process requests; (e) Dynamically deploy and update the computing logic of edge FaaS.

8. The method according to claim 7, characterized in that The following steps are also included: (a) Analyze the received request through the request routing module; (b) Based on preset rules and current system load, decide whether to process the request at the edge FaaS or forward the request to the central FaaS.

9. The method according to claim 7, characterized in that: The steps of performing lightweight computing by edge FaaS include: (a) Calling a predefined computing function library to process data; (b) Execute computing tasks in a container-based isolated environment.

10. The method according to claim 7, characterized in that The steps to dynamically deploy and update edge FaaS computing logic include: (a) Manage different versions of computing logic through a version control system; (b) Use hot update mechanism to update computing logic without interrupting service; (c) When an update fails, restore to the previous stable version through a rollback mechanism.

Citation Information

Cited By

  • Industrial equipment control method and related device

    CN121143103A