A method for optimizing microservice performance in embedded systems

By starting link tracking and simulating stress programs in the embedded system, counting service information and performing microservice migration, the resource non-optimization problem caused by microservice deployment is solved, and the optimal microservice deployment strategy under limited hardware resources is achieved, and the system performance is improved.

CN119292791BActive Publication Date: 2025-03-28NANJING ACOINFO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411818479.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-28
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

In embedded systems, random deployment of microservices may result in system resources not being optimal, resulting in increased resource usage, extended response time and extended execution time.

Method used

By starting the link tracking function and link collection service, the simulated pressure program is run to generate initial tracking information, count service information, and microservice migration is carried out based on the CPU usage ratio and service time consumption until the optimal deployment strategy is achieved.

Benefits of technology

With limited hardware resources, the optimization of microservice deployment strategies is achieved to improve system resource utilization, shorten response time and execution time, and ensure that the system can perform optimal performance in various scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292791B_ABST
    Figure CN119292791B_ABST
Patent Text Reader

Abstract

The present invention provides an embedded system microservice performance optimization method. Because embedded microservice deployment rules usually do not change frequently, different microservice combination scenarios can be statistically calculated based on the method provided by the solution, as well as microservice deployment strategies when simulating microservice failure scenarios, so that various scenarios can exert optimal service response results under limited hardware resources; by running a simulated stress program to generate an RPC call, and then generating corresponding link tracking information, there is no need to simulate the actual scenario, and corresponding different RPC calls can be generated according to actual needs, the simulation is convenient, and the application range is wide.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of microservice optimization in embedded operating systems, and in particular to a method for optimizing microservice performance in embedded systems. Background Art

[0002] In the microservice application scenario of embedded systems, the hardware resources used for microservice deployment are usually limited (usually fixed hardware resources are used to form a small cluster), such as a chassis composed of 4 boards, each of which is an independent embedded system or Linux. Microservices can be deployed on any board, and through communication between microservices, corresponding services can be provided for applications in the chassis or external applications.

[0003] However, the deployment of microservices is random. When these microservices are deployed arbitrarily, the resources in the system may not be in the optimal working state. It is possible that after multiple microservices are deployed, they will crowd out system resources, causing the microservices to occupy more resources, have longer response times, and longer execution times.

[0004] Therefore, there is an urgent need to provide an embedded system microservice performance optimization method to solve the defects and shortcomings in the above-mentioned prior art. Summary of the invention

[0005] In order to solve the defects and shortcomings in the prior art, the present invention provides a method for optimizing the performance of embedded system microservices.

[0006] The specific scheme provided by the present invention is:

[0007] A method for optimizing the performance of microservices in an embedded system, characterized in that it comprises the following steps:

[0008] S1: Distribute microservices in embedded systems;

[0009] S2: Start the link tracking function corresponding to each microservice and start the link collection service at the same time;

[0010] S3: Run the simulated stress program and send initial tracking information to the link collection service;

[0011] S4: After the link collection service collects the initial tracking information, it collects statistics on the service information therein;

[0012] S5: After all service information is collected, implement microservice migration as follows:

[0013] S51: Obtain the system that occupies the largest proportion of the system CPU, and then obtain the microservice that consumes the longest time in the system;

[0014] S52: Obtain the system that occupies the smallest proportion of the system CPU, and then obtain the microservice with the shortest time consumption in the system;

[0015] S53: Swap the microservice that takes the longest time with the microservice that takes the shortest time.

[0016] S54: re-run the simulated stress service, re-track the link and count the current tracking information;

[0017] S55: comparing the current tracking information with the initial tracking information to determine whether the preset conditions are met;

[0018] When the preset conditions are met, the current deployment strategy of the microservice is recorded;

[0019] When the preset conditions are not met, withdraw the deployment strategy of the current microservice;

[0020] S56: Repeat steps S51 to S55;

[0021] S6: Finally, the optimal microservice deployment strategy under the current resource constraints is obtained:

[0022] As a further preferred embodiment of the present invention, in step S1, the microservices are distributed in the embedded system in a random deployment manner.

[0023] As a further preferred embodiment of the present invention, in step S2, the link tracking function and link collection service corresponding to each microservice are automatically started to work.

[0024] As a further preferred embodiment of the present invention, the step S3 includes the following steps:

[0025] S31: Run the simulation pressure program;

[0026] S32: The simulation stress program generates RPC calls with reference to the actual application;

[0027] S33: automatically generate link tracking information;

[0028] S34: Send corresponding tracking information to the link collection service.

[0029] As a further preferred embodiment of the present invention, in step S32, the stress simulation program generates an RPC call by calling a microservice URL interface.

[0030] As a further preferred implementation of the present invention, in step S34, the corresponding tracking information sent to the link collection service includes system metric resource information.

[0031] As a further preferred implementation of the present invention, in step S4, the service information at least includes service time consumption information and service link information.

[0032] As a further preferred embodiment of the present invention,

[0033] In step S51, the system that occupies the largest proportion of the system CPU and the microservice that takes the longest time in the system are marked respectively;

[0034] In step S52, the system that occupies the smallest proportion of the system CPU and the microservice that consumes the shortest time in the system are marked respectively.

[0035] As a further preferred implementation of the present invention, in step S53, before the positions are interchanged, a scheduling request is sent to the service management program of the embedded system.

[0036] As a further preferred embodiment of the present invention, in step S55, the preset conditions at least include:

[0037] 1) The resource usage in the current tracking information is less than the resource usage in the current tracking information;

[0038] 2) The service response time in the current tracking information is less than the service response time in the initial tracking information.

[0039] Compared with the prior art, the present invention can achieve the following technical effects:

[0040] 1) The present invention provides a method for optimizing the performance of embedded system microservices. Since the deployment rules of embedded microservices usually do not change frequently, the combination scenarios of different microservices can be statistically calculated based on the method provided by the solution, as well as the microservice deployment strategy when simulating microservice failure scenarios, so that various scenarios can achieve the best service response results under limited hardware resources.

[0041] 2) The present invention provides an embedded system microservice performance optimization method, which generates RPC calls by running a simulated stress program, and then generates corresponding link tracking information. It does not require simulation of actual scenarios, and can generate corresponding different RPC calls according to actual needs. The simulation is convenient and has a wide range of applications.

[0042] 3) The present invention provides an embedded system microservice performance optimization method, which compares the current tracking information with the initial tracking information to determine whether it meets the preset conditions; when the preset conditions are met, the deployment strategy of the current microservice is recorded; when the preset conditions are not met, the deployment strategy of the current microservice is withdrawn, so that when the preset conditions are met, the performance of the microservice is optimized by interchangeably calling the microservice between different systems, and when the preset conditions are not met, the interchange call is withdrawn to avoid resource occupation and response time caused by erroneous calls.

[0043] 4) The present invention provides an embedded system microservice performance optimization method, which sets the preset conditions to include both the resource usage in the current tracking information being less than the resource usage in the current tracking information; and the service response time in the current tracking information being less than the service response time in the initial tracking information, thereby judging whether the current method of interchangeably calling microservices has achieved microservice performance optimization from multiple perspectives such as resource occupancy and response time, and the judgment basis is reliable, comprehensive and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] like Figure 1 Shown is a flowchart of the steps of an embedded system microservice performance optimization method provided by the present invention. DETAILED DESCRIPTION

[0045] 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.

[0046] In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "front end", "rear end", "two ends", "one end", "the other end" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the 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 orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

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

[0048] [First embodiment]

[0049] like Figure 1 The first embodiment of the present invention is shown, which provides an embedded system microservice performance optimization method, comprising the following steps:

[0050] S1: Distribute microservices in embedded systems; when distributing microservices, adopt a random deployment method to be consistent with the random deployment method of microservices in embedded systems in the prior art, so as to further improve the credibility and reliability of the performance optimization method;

[0051] S2: Start the link tracking function corresponding to each microservice and start the link collection service at the same time; in this embodiment, as the microservices are distributed, the link tracking function and link collection service corresponding to each microservice are automatically started to work, so as to ensure that the tracking information can be obtained in real time throughout the whole process;

[0052] S3: Run the simulated stress program to send initial tracking information to the link collection service; in this embodiment, step S3 includes the following steps:

[0053] S31: Run the simulation pressure program;

[0054] S32: The simulation stress program generates RPC calls with reference to the actual application; the simulation stress program can generate corresponding RPC calls by calling the microservice URL interface, etc.;

[0055] S33: automatically generate link tracking information;

[0056] S34: Send corresponding tracking information to the link collection service. The corresponding tracking information sent to the link collection service includes system metric resource information. By sending the system metric resource information to the link collection service, it is convenient to compare the microservice resource occupancy before and after the exchange call received by the subsequent link collection service.

[0057] By running the simulated stress program, RPC calls are generated, and then the corresponding link tracking information is generated. There is no need to simulate the actual scene, and different RPC calls can be generated according to actual needs. The simulation is convenient and has a wide range of applications.

[0058] S4: After the link collection service collects the initial tracking information, it collects statistics on the service information therein; the service information at least includes service time information and service link information; the service time information facilitates the subsequent service to compare the response time of the microservices before and after the received interchange call, and the service link information facilitates the subsequent interchange call of the microservices;

[0059] S5: After all service information is collected, implement microservice migration as follows:

[0060] S51: Obtain the system that occupies the largest proportion of the system CPU, and then obtain the microservice that takes the longest time in the system; and mark the system that occupies the largest proportion of the system CPU and the microservice that takes the longest time in the system respectively; so as to facilitate the exchange of calls and facilitate the subsequent recording of the deployment strategy;

[0061] S52: Obtain the system that occupies the smallest proportion of the system CPU, and then obtain the microservice with the shortest time consumption in the system; and mark the system that occupies the smallest proportion of the system CPU and the microservice with the shortest time consumption in the system respectively; so as to facilitate the interchangeable calling and the subsequent recording of the deployment strategy;

[0062] S53: swapping the microservice that takes the longest time with the microservice that takes the shortest time; before swapping the positions, sending a scheduling request to the service management program of the embedded system, so that the corresponding scheduling action can be implemented only after the request of the service management program is passed, and then through the intervention of the service management program, the occurrence of unexpected miscalling can be effectively avoided;

[0063] S54: re-run the simulated stress service, re-track the link and count the current tracking information;

[0064] S55: comparing the current tracking information with the initial tracking information to determine whether the preset conditions are met;

[0065] When the preset conditions are met, the current deployment strategy of the microservice is recorded;

[0066] When the preset conditions are not met, withdraw the deployment strategy of the current microservice;

[0067] By comparing the current tracking information with the initial tracking information, the performance of microservices can be optimized by interchangeably calling microservices between different systems when the preset conditions are met. When the preset conditions are not met, the interchange calls are withdrawn to avoid resource occupation and response time caused by erroneous calls.

[0068] In this embodiment, the preset conditions are set to at least include:

[0069] 1) The resource usage in the current tracking information is less than the resource usage in the current tracking information;

[0070] 2) The service response time in the current tracking information is less than the service response time in the initial tracking information;

[0071] Therefore, it is possible to judge whether the current method of interchangeably calling microservices has achieved the performance optimization of microservices from multiple angles such as resource usage and response time, and the judgment basis is reliable, comprehensive and accurate.

[0072] S56: Repeat steps S51 to S55;

[0073] S6: Finally, the optimal microservice deployment strategy under the current resource constraints is obtained:

[0074] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A method for optimizing the performance of microservices in an embedded system, characterized in that: The following steps are involved: S1: Distribute microservices in embedded systems; S2: Start the link tracking function corresponding to each microservice and start the link collection service at the same time; S3: Run the simulated stress program and send initial tracking information to the link collection service; S4: After the link collection service collects the initial tracking information, it collects statistics on the service information therein; S5: After all service information is collected, implement microservice migration as follows: S51: Obtain the system that occupies the largest proportion of the system CPU, and then obtain the microservice that consumes the longest time in the system; S52: Obtain the system that occupies the smallest proportion of the system CPU, and then obtain the microservice with the shortest time consumption in the system; S53: Swap the microservice that takes the longest time with the microservice that takes the shortest time. S54: re-run the simulated stress service, re-track the link and count the current tracking information; S55: comparing the current tracking information with the initial tracking information to determine whether the preset conditions are met; When the preset conditions are met, the current deployment strategy of the microservice is recorded; When the preset conditions are not met, withdraw the deployment strategy of the current microservice; S56: Repeat steps S51 to S55; S6: Finally, the optimal microservice deployment strategy under the current resource constraints is obtained; The step S3 includes the following steps: S31: Run the simulation pressure program; S32: The simulation stress program generates RPC calls with reference to the actual application; S33: automatically generate link tracking information; S34: Send corresponding tracking information to the link collection service; In the step S32, the simulation stress program generates an RPC call by calling the microservice URL interface; In the step S34, the corresponding tracking information sent to the link collection service includes system metric resource information; In step S4, the service information at least includes service time information and service link information; In step S55, the preset conditions at least include: 1) The resource usage in the current tracking information is less than the resource usage in the current tracking information; 2) The service response time in the current tracking information is less than the service response time in the initial tracking information.

2. The method for optimizing the performance of embedded system microservices according to claim 1, characterized in that: In the step S1, the microservices are distributed in the embedded system in a random deployment manner.

3. The method for optimizing the performance of embedded system microservices according to claim 1, characterized in that: In step S2, the link tracking function and link collection service corresponding to each microservice automatically start working.

4. The method for optimizing the performance of embedded system microservices according to claim 1, characterized in that: In step S51, the system that occupies the largest proportion of the system CPU and the microservice that takes the longest time in the system are marked respectively; In step S52, the system that occupies the smallest proportion of the system CPU and the microservice that consumes the shortest time in the system are marked respectively.

5. The method for optimizing the performance of embedded system microservices according to claim 1, characterized in that: In the step S53, before the positions are exchanged, a scheduling request is sent to the service management program of the embedded system.

Citation Information

Patent Citations

  • Container migration method and device, equipment and storage medium

    CN116126458A

  • Medium performance resource cost optimization method and system under micro-service architecture

    CN116149855A