Lightweight virtualization method and system
By analyzing the historical information of microservices on edge devices in the cloud-edge collaborative system and optimizing microservice deployment using the binary Levy flight mutation cuckoo algorithm, the problem of unnecessary data interaction in the cloud-edge collaborative system is solved, and efficient service response and resource utilization are achieved.
Patent Information
- Application Number
- CN202510915001.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-31
AI Technical Summary
In cloud-edge collaborative systems, existing technologies struggle to effectively reduce unnecessary data interactions between edge devices and cloud servers, leading to communication latency and bandwidth limitations. Furthermore, existing data compression and caching methods are ill-equipped to guarantee prediction accuracy and cache hit rate under dynamically changing user requests and microservice conditions.
By acquiring historical information about microservices on edge devices, and using the binary Levy flight mutation cuckoo algorithm to analyze the usage patterns of microservices, we can determine the most suitable microservices for deployment on edge devices and deploy them on edge devices, thereby reducing cloud-edge collaborative interaction traffic.
It significantly reduced cloud-edge collaborative interaction traffic, improved service response speed and overall system efficiency, reduced the storage burden on edge devices, and improved the processing efficiency of user requests.
Smart Images

Figure CN120872306A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud-edge collaboration, specifically to a lightweight virtualization method and system. Background Technology
[0002] Microservice architecture is widely used in cloud computing and edge computing. It breaks down complex applications into multiple independent small services that interact through lightweight interfaces. After microservice deployment, cloud computing platforms and edge computing devices typically need to work together. Edge devices handle local user requests, while the cloud handles more complex computing and data storage tasks. However, communication between edge devices and cloud servers suffers from latency and bandwidth limitations, and the traffic transmission during cloud-edge collaboration involves a large amount of unnecessary data interaction.
[0003] While significant progress has been made in optimizing cloud-edge collaborative traffic transmission, some notable drawbacks remain. On one hand, existing data compression and encoding techniques, though capable of reducing data transmission volume, often require complex configuration and optimization tailored to specific scenarios, potentially introducing additional computational overhead. On the other hand, some caching and prediction-based technologies attempt to improve efficiency by reducing redundant data transmission; however, these methods often struggle to guarantee prediction accuracy and cache hit rates when faced with dynamically changing user requests and microservice states. Summary of the Invention
[0004] To address the aforementioned issues, this invention proposes a lightweight virtualization method and system to reduce cloud-edge collaborative interaction traffic while ensuring service performance. This reduces interaction traffic during cloud-edge collaboration, thereby improving overall system performance. Specifically, this invention minimizes the storage space occupied by microservices. By acquiring the usage history information of each microservice in the edge device and using the binary Lévy flight mutation cuckoo algorithm to analyze the usage patterns of microservices, it determines the most suitable microservices for deployment on the edge device and deploys them accordingly, thereby reducing cloud-edge collaborative interaction traffic.
[0005] Specifically, the method of the present invention includes the following steps:
[0006] Step S1: Package the application code that provides services to users into microservice images to facilitate deployment and distribution, and optimize the storage footprint of each microservice image through lightweight technology.
[0007] Step S2: Each edge device collects historical usage information for the aforementioned microservices, including data such as request frequency, resource requirements, and processing time. This data is collected by the edge devices and transmitted to the server.
[0008] Step S3: The server analyzes the historical usage information of microservices using a heuristic algorithm. This algorithm comprehensively evaluates the suitability of each microservice for deployment on edge devices based on multiple factors, including response time, data transfer volume, and computational resource requirements. Through iterative optimization using random walks and probabilistic replacement mechanisms, the most suitable microservices for edge device deployment are determined.
[0009] Step S4: The server offloads the microservices identified in S3 to the edge device via the network. The edge device then provides services to the user based on the user's needs. When a user makes a request, if the corresponding microservice has been deployed on the edge device, the edge device processes the request locally; otherwise, it is processed by the cloud.
[0010] On the other hand, the present invention provides a lightweight virtualization system, including a microservice encapsulation module, a microservice management module, a log collection module, a heuristic algorithm module, a deployment control module, and a microservice execution module. The microservice encapsulation module is used to encapsulate applications into microservices and optimize the storage space usage of microservices; the microservice management module is used to obtain the usage history information of microservices on each edge device; the heuristic algorithm module is used to analyze the usage patterns and resource requirements of microservices based on the usage history information, and determine the microservices to be deployed on the edge devices; the deployment control module is used to deploy the determined microservices to the edge devices and ensure that cloud-edge collaborative interaction traffic is minimized; the log collection module is used to obtain the usage history information of each microservice on the edge devices; and the microservice execution module is used to execute independent microservices.
[0011] The beneficial effects of this invention are as follows: By packaging service programs into lightweight and optimized container images, microservices can be rapidly deployed and distributed. Combined with historical usage data automatically collected by edge devices, the server uses heuristic algorithms to intelligently analyze and determine the most suitable subset of microservices for deployment at the edge. This subset is then precisely offloaded to edge devices, enabling user requests to be processed efficiently at the edge. This significantly reduces the storage burden on resource-constrained edge devices and lowers dependence on the cloud and network transmission traffic, thereby improving service response speed and overall system efficiency. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is an application diagram of the cloud-edge collaborative interaction system provided in an embodiment of the present invention;
[0014] Figure 2 A flowchart of a lightweight virtualization method provided in an embodiment of the present invention;
[0015] Figure 3 This is a schematic diagram of a microservice architecture provided in an embodiment of the present invention;
[0016] Figure 4 A flowchart for minimizing microservice storage space usage provided in this embodiment of the invention;
[0017] Figure 5 A schematic diagram illustrating the process of analyzing and optimizing the binary Levy flight variant cuckoo algorithm provided in this embodiment of the invention;
[0018] Figure 6 A flowchart illustrating the binary Lévy flight variant cuckoo algorithm provided in this embodiment of the invention;
[0019] Figure 7 This is a schematic diagram of a cloud-edge interaction scenario after microservice deployment, provided in an embodiment of the present invention.
[0020] Figure 8 This is a schematic diagram of the structure of an edge device according to an embodiment of the present invention;
[0021] Figure 9 This is a schematic diagram of the structure of a server according to a first embodiment of the present invention;
[0022] Figure 10 Experimental results are shown in the figure to verify the effectiveness of the method described in the embodiments of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] To address the problems of existing technologies, this invention proposes a lightweight virtualization method and system. Based on the historical usage information of microservices on edge devices, the most suitable microservices for deployment on edge devices are determined through the binary Levy flight mutation cuckoo algorithm. After deployment, most requests are processed locally on the edge devices, and only requests that the edge devices cannot handle are processed by the cloud.
[0025] Figure 1This is an application diagram of the cloud-edge collaborative interaction system provided in an embodiment of the present invention. The system includes: a cloud server 01, at least one edge device 02 (also called an edge node) connected to the cloud server, and at least one user 03.
[0026] Edge device 02 is any terminal device with a processor. As a service provider, each edge device provides various services to multiple users 03 according to user needs. Furthermore, each edge device 02 connects wirelessly to cloud server 01 to exchange information, such as downloading microservices from cloud server 01, uploading microservice usage history information or microservice usage logs to cloud server 01, etc. Optionally, edge device 02 can connect to cloud server 01 wirelessly after being connected to a router.
[0027] The cloud server 01 synchronizes the selected microservices to at least one edge device 02, enabling the edge device to provide the corresponding services to the user 03.
[0028] User 03 requests a service from edge device 02. If edge device 02 is able to provide the service, it will provide the service; otherwise, the service will be provided by cloud server 01.
[0029] The lightweight virtualization mechanism and method provided in this embodiment enables the replacement of microservices on edge devices based on microservice usage logs, and continuously updates the optimal selection during the service process, thereby meeting user needs while reducing cloud-edge collaborative interaction traffic.
[0030] Figure 2 A flowchart illustrating the lightweight virtualization mechanism and method provided in this embodiment of the invention, the method comprising:
[0031] Step S1: Encapsulate all service programs provided to users into containers as microservices using lightweight virtualization technology, and optimize the storage size of each microservice using container lightweighting technology.
[0032] Step S2: Each edge device acquires historical usage information for each microservice, including data such as request frequency, resource requirements, and processing time. This data is automatically collected by the edge device's log collection module and transmitted to the server.
[0033] Step S3: The server analyzes the historical usage information of microservices using a heuristic algorithm. This algorithm comprehensively evaluates the suitability of each microservice for deployment on edge devices based on multiple factors, including response time, data transfer volume, and computational resource requirements. Through iterative optimization using random walks and probabilistic replacement mechanisms, the most suitable microservices for edge device deployment are determined.
[0034] Step S4: The server offloads the microservices identified in S3 to the edge device via the network. The edge device then provides services to the user based on the user's needs. The edge device handles most requests locally, and only requests that the edge device cannot handle are processed by the cloud.
[0035] This invention containerizes applications as microservices, and the microservice structure is as follows: Figure 3 As shown, a microservice mainly consists of two core parts: the application (04) and its dependencies / libraries (05). These two parts together form the container (06), which serves as a complete service unit, i.e., the microservice. Specifically, the application (04) is the core functional carrier of the microservice, responsible for executing specific business logic or tasks. The dependencies / libraries (05) contain all the external dependencies and library files necessary for the application (04) to run. These dependencies and library files ensure that the application can run smoothly in the target environment without worrying about environmental differences or missing dependencies.
[0036] By encapsulating these two parts within container 06, a self-sufficient, independently operating service unit is created. This service unit not only possesses high portability and scalability but also can easily integrate and interact with other microservices to jointly build a flexible and scalable microservice architecture.
[0037] Figure 4 The flowchart for minimizing the storage space of a microservice image provided in this embodiment of the invention uses a combination of static and dynamic analysis to identify the files and libraries that the microservice program truly needs, and optimizes the original microservice image accordingly.
[0038] Step S101: Static analysis extracts information from the file system of the microservice image, listing all files and dependencies in the microservice image.
[0039] Step S102: Dynamic analysis starts a container built based on the original image and monitors the container's actual runtime behavior. The dynamic analysis process monitors file access, process startup, and other operations within the container by running an agent program called slim, recording which files are actually accessed, executed, or loaded during container runtime.
[0040] S103: Based on the microservice image usage information obtained during static and dynamic analysis, generate a usage report of the original image, and based on this, remove unnecessary components (such as compilers, build tools, etc.) to generate a slimmed-down image containing only necessary components.
[0041] Figure 5 As shown Figure 2The flowchart for step S3 is shown below. The server uses the binary Lévy flight mutation cuckoo algorithm to analyze the usage history information of microservices and determine which microservices are most suitable for deployment on edge devices. The specific implementation method is as follows:
[0042] Step S301: Historical information data on microservice usage, including request frequency, processing time, data transfer volume, and computing resource requirements, is used as input data for the Binary Lévy Flight Mutation Cuckoo Algorithm. For example, as shown in Table 1, each column in Table 1 represents the historical usage information of a microservice. These analysis results will provide input for the Binary Lévy Flight Mutation Cuckoo Algorithm.
[0043] Table 1
[0044] Microservice identifier 1 2 ··· Microservice request frequency 15 38 ··· Processing time 1 1.1 ··· Data transfer volume 128 256 ··· Computing resource requirements 3 5 ··· Response time 1 2 ···
[0045] Step S302: Analyze the usage history of microservices using the binary Lévy flight mutation cuckoo algorithm to evaluate the resource requirements, response time, data transfer volume, and other characteristics of each microservice. At this stage, the algorithm evaluates and scores microservices based on these metrics, iterates multiple times to find the optimal solution, and saves the highest-scoring solution from the optimization process.
[0046] Step S303: The output of the binary Lévy flight mutation cuckoo algorithm determines which microservices should be deployed to edge devices and which need to be processed in the cloud. The output of this step has two directions:
[0047] Edge device deployment: Some of the most frequently used and latency-sensitive microservices are decided to be deployed on edge devices (low latency, low computing requirements, etc.).
[0048] Cloud deployment: The remaining microservices are decided to be deployed to the cloud, where they will provide services to users.
[0049] Figure 6 As shown Figure 5 The flowchart for step S302 is shown below. The binary Lévy flight mutation cuckoo algorithm finds the highest-scoring solution through iterative optimization. The specific implementation is as follows:
[0050] S3021: Based on information such as the type of microservice, perform mathematical modeling of microservices: Define the solution space dimension as N according to the type of microservice, and set the candidate pool size of each dimension to 4096 (2^12) possible combinations. Each decimal candidate value corresponds to a 12-bit binary encoding sequence. Each bit in the binary sequence represents the deployment status of a specific microservice instance (0 indicates not deployed, 1 indicates deployed).
[0051] S3022: A solution for randomly generating microservice deployments using random walks via Levy flight:
[0052]
[0053] Where u follows a mean of 0 and a standard deviation of σ. μ (β) is a normal distribution; v follows a normal distribution with a mean of 0 and a standard deviation of 1; β is the characteristic index of the Levy distribution, which controls the degree of "heavy tail" in the step distribution; This is vector addition (adding element by element); This represents the position of the j-th individual at time t; This represents the position of the j-th individual at time t+1, determined by the current position. With step vector Add them together to get the result.
[0054] S3023: Rate the solution and retain it (if it is better than the historical best solution):
[0055]
[0056] Where, p j For the frequency of use of microservice j, s j For the storage space occupied by microservice j, x j This is a flag indicating whether a microservice is deployed to an edge device. j Let be the usage interval of microservice j, and n be the number of microservice types. The current solution N is obtained by calculating the score of each microservice and summing the scores of the microservices deployed to the edge devices. i The final score F(N) i ).
[0057] Calculate the current population diversity after each iteration:
[0058]
[0059] Where V(t) is the population diversity after the t-th iteration, σ i (t) represents the standard deviation of the current population dimension i, and n is the number of dimensions. The equivalent time is calculated based on the current population diversity.
[0060]
[0061] Where γ is the diversity retention coefficient and V(0) is the initial population diversity.
[0062]
[0063] Then with probability Discarding some solutions, Tmax represents the maximum number of iterations. When the current population diversity is high, t eff=t, the probability of abandoning the nest decreases with the number of iterations, which facilitates optimization; when the current population diversity is low, the decay rate of Pa is dynamically slowed down to maintain the exploration ability, thereby escaping the local optimum.
[0064] Perform another random walk to generate a new solution. Repeat this process until the target number of iterations is reached; the solution at this point is the optimal solution.
[0065] Figure 7 As shown Figure 2 The flowchart for step S4 is shown. The deployment process deploys the most suitable microservices to edge devices. The specific implementation is as follows:
[0066] Step S401: The user submits a request, which is first sent to the edge device.
[0067] Step S402: If the edge device can provide services, the corresponding microservice will be instantiated and run on the edge device using container technology (such as Docker, Kubernetes).
[0068] Step S403: If the edge device is unable to provide service, the service request will be transferred to the cloud for service provision.
[0069] Figure 8 This is a schematic diagram of the structure of an edge device according to an embodiment of the present invention. The edge device 10 includes:
[0070] Log collection module 11 is used to obtain the usage history information of each microservice in the edge device.
[0071] Microservice execution module 12 is used to execute independent microservices.
[0072] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0073] Figure 9 This is a schematic diagram of the structure of a server according to a first embodiment of the present invention. The server 20 includes:
[0074] The microservice encapsulation module 21 encapsulates the application into microservices and optimizes the storage space usage of the microservices.
[0075] The microservice management module 22 collects usage history information for each microservice on the edge device. This information includes data such as the request frequency, request source, and processing time of the microservice.
[0076] Heuristic algorithm module 23 comprehensively evaluates whether each microservice is suitable for deployment on edge devices based on multiple factors such as microservice response time, data transmission volume, and computing resource requirements.
[0077] Deployment control module 24 deploys the identified microservices to edge devices and ensures that data interaction between microservices is optimized during cloud-edge collaboration to minimize data transmission volume.
[0078] Figure 10 The experimental results, shown in the figure, verify the effectiveness of the method described in this embodiment of the invention. As can be seen from the figure, the reduction in traffic and the task hit rate are directly proportional to the available storage space at the edge. By pre-deploying some microservices using the 1024MB space at the edge, the cloud-edge interaction traffic during microservice deployment can be reduced by 80%, thus verifying the effectiveness and availability of this method.
[0079] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A lightweight virtualization method, characterized in that, Includes the following steps: Step S1: Package the application code that provides services to users into microservice images, and optimize the storage footprint of each microservice image through lightweight technology; Step S2: Each edge device collects historical usage information of the microservices; Step S3: The server analyzes the historical usage information of microservices using heuristic algorithms to determine the microservices deployed on edge devices; Step S4: The server offloads the microservices determined in step S3 to the edge device via the network, and the edge device then provides services to the user according to the user's needs.
2. The lightweight virtualization method according to claim 1, characterized in that, The lightweight technology optimization is specifically implemented as follows: Step S101: Static analysis extracts information from the file system of the microservice image and lists all files and dependencies in the microservice image; Step S102: Dynamically analyze and start a container built based on the original image, and monitor the actual running behavior of the container; During dynamic analysis, an agent program is run to monitor file access and process startup operations within the container, recording which files are actually accessed, executed, or loaded during container runtime. Step S103: Generate a microservice image usage report based on the microservice image usage information obtained during static and dynamic analysis, and then remove unnecessary compilers and build tools to obtain a slimmed-down microservice image.
3. The lightweight virtualization method according to claim 2, characterized in that, The heuristic algorithm is as follows: The server uses the binary Lévy flight mutation cuckoo algorithm to analyze the usage history information of microservices and determine the microservices to be deployed on edge devices. The specific implementation is as follows: Step S301: The microservice uses historical information data, including the microservice's request frequency, processing time, and computing resource requirements, as input data for the binary Levy flight mutation cuckoo algorithm; Step S302: Analyze the usage history information of microservices using the binary Lévy flight mutation cuckoo algorithm to evaluate the resource requirements, response time, and data transmission volume characteristics of each microservice; During this stage, the microservices are evaluated and scored, and the optimization is iterated multiple times, saving the solution with the highest score in the optimization process. Step S303: The output scheme of the binary Levy flying variant cuckoo algorithm determines which microservices should be deployed to edge devices and which microservices should be processed in the cloud.
4. The lightweight virtualization method according to claim 3, characterized in that, In step S302, the binary Levy flying mutation cuckoo algorithm finds the highest-scoring solution through iterative optimization, as follows: Mathematical modeling of microservices: Define the solution space dimension as N according to the type of microservices, and set the candidate pool size of each dimension to 4096 (2^12) combinations. Each decimal candidate value corresponds to a 12-bit binary encoding sequence. Each bit in the binary sequence represents the deployment status of a specific microservice instance, with 0 indicating not deployed and 1 indicating deployed. A solution for randomly generating microservice deployments is achieved through random walks using Levy's flight path. Where u follows a mean of 0 and a standard deviation of σ. μ (β) is a normal distribution; v follows a normal distribution with a mean of 0 and a standard deviation of 1; β is the characteristic index of the Levy distribution, which controls the degree of "heavy tail" in the step distribution; This is vector addition; This represents the position of the j-th individual at time t; This represents the position of the j-th individual at time t+1, determined by the current position. With step vector Add them together to get; Rate the solution; if the rate is better than the historical best solution, the solution is retained. Where, p j For the frequency of use of microservice j, s j For the storage space occupied by microservice j, x j This is a flag indicating whether a microservice is deployed to an edge device. j Let n be the usage interval of microservice j, and n be the number of microservice types. The current solution N is obtained by calculating the score of each microservice and summing the scores of the microservices deployed to the edge devices. i The final score F(N) i ); Calculate the current population diversity after each iteration: Where V(t) is the population diversity after the t-th iteration, σ i (t) represents the standard deviation of the current population dimension i, where n is the number of dimensions, and the equivalent time is calculated based on the current population diversity. Where γ is the diversity preservation coefficient, and V(0) is the initial population diversity; Then with probability Discarding some solutions, Tmax is the maximum number of iterations; Perform another random walk to generate new solutions, repeating this process until the target number of iterations is reached and the optimal solution is obtained.
5. A lightweight virtualization method according to claim 6, characterized in that, The specific implementation method of step S303 is as follows: When a user submits a request, the request is first sent to the edge device. If the edge device can provide services, the corresponding microservice will be instantiated and run on the edge device using container technology; If the edge device is unable to provide service, the service request will be transferred to the cloud for service provision.
6. A lightweight virtualization system for implementing the lightweight virtualization method according to any one of claims 1 to 5, characterized in that, It includes a microservice encapsulation module, a microservice management module, a log collection module, a heuristic algorithm module, a deployment control module, and a microservice execution module; The microservice encapsulation module is used to encapsulate applications into microservices and optimize the storage space usage of microservices. The microservice management module is used to obtain historical information on the use of microservices on various edge devices; The heuristic algorithm module is used to analyze the usage patterns and resource requirements of microservices based on their usage history information, and to determine the microservices to be deployed on edge devices. The deployment control module is used to deploy the identified microservices to edge devices and ensure that cloud-edge collaborative interaction traffic is minimized. The log collection module is used to obtain the usage history information of each microservice in the edge device; The microservice execution module is used to execute independent microservices.