Micro-service execution efficiency optimization method and device and readable storage medium
By analyzing microservice programs and optimizing data models, the problems of difficult maintenance and unbalanced resource utilization in traditional microservice architectures are solved, and efficient performance optimization and intelligent management are achieved.
Patent Information
- Application Number
- CN202510765240.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-16
AI Technical Summary
Traditional microservice architectures have difficulties in system maintenance, inconvenient upgrades, poor scalability, uneven resource utilization, and a lack of real-time monitoring and optimization, resulting in low efficiency and making it difficult for developers to iterate and respond quickly.
By analyzing microservice programs, building a data model database, obtaining application results and recommended solutions input by users, and optimizing the data model to improve performance.
It achieves dynamic adaptation, continuous optimization and efficient resource utilization, significantly improving the overall performance of microservices and the level of system intelligence.
Smart Images

Figure CN120653255A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, device, and readable storage medium for optimizing microservice execution efficiency. Background Art
[0002] Microservices, an emerging software architecture pattern, can break down complex applications into multiple small service modules, each of which can be independently developed, deployed, and maintained. Each microservice is responsible for a specific function and interacts through lightweight communication mechanisms, enhancing system flexibility and scalability. Leveraging the microservices architecture pattern enables all aspects of a system to operate more efficiently and intelligently.
[0003] Traditional systems typically employ a monolithic architecture, tightly coupling all functional modules. This results in difficult maintenance, inconvenient upgrades, and poor scalability. This architecture complicates the development and deployment of service functions, requiring extensive changes to the entire system to add or modify a single feature.
[0004] Furthermore, traditional technologies often lack real-time monitoring and optimization of microservice performance, resulting in uneven resource utilization and inefficient services. Developers often rely on static analysis and manual monitoring to debug and optimize traditional systems, which is often time-consuming and labor-intensive, making rapid iteration and responsiveness difficult. Summary of the Invention
[0005] The technical problem to be solved by this application is to provide a microservice execution efficiency optimization method, device and readable storage medium to solve the problems existing in the prior art in response to the above-mentioned deficiencies in the prior art.
[0006] In the first aspect, the present application provides a method for optimizing microservice execution efficiency.
[0007] Methods include:
[0008] A1. Analyze the microservice program and obtain analysis data.
[0009] A2. Determine the service efficiency of the first microservice program based on the analysis data, and obtain a first application recommendation solution for the microservice program;
[0010] A3. Obtain a first microservice application result input by a user, and construct a data model database based on the first microservice application result and the fitting result of the first application suggestion solution;
[0011] A4. Obtain application data input by the user, and build a data model based on the application data and the data model database;
[0012] A5. Obtain the user's selection result for the constructed data model, and optimize the data model according to the selection result to obtain an optimization result.
[0013] In some embodiments, A1 includes:
[0014] S1. Get the successfully registered microservice program;
[0015] S201, read the source code of the microservice program, parse and extract the data structure of the microservice program;
[0016] S202: Extracting the input and output data of the microservice program and corresponding application instructions based on the acquired source code data structure;
[0017] S203. Obtain relevant parameters of the application instruction according to the execution process of the microservice program;
[0018] S204: Construct an analysis data set of the microservice program according to the relevant parameters of the obtained application instructions.
[0019] In some embodiments, A2 includes:
[0020] S3. Determine the first service characteristic coefficient of the microservice program based on the analysis data;
[0021] S4. Determine a first data model based on the first service characteristic coefficient and the analysis data, and obtain actual values of the first data model parameters;
[0022] S5. Determine the service efficiency of the first microservice program according to the actual value of the first data model parameter, and obtain a first application recommendation solution for the microservice program.
[0023] In some embodiments, S3 includes:
[0024] S301, obtaining data length, complexity and frequency parameters of application instructions based on analysis data;
[0025] S302: Determine a first service characteristic coefficient according to data length, complexity, and frequency parameters of the application instruction.
[0026] In some embodiments, S5 includes:
[0027] S501: Determine a first service efficiency of the microservice program based on a first service characteristic coefficient, a data length, a complexity, and a frequency parameter of an application instruction;
[0028] S502: Obtain a first application recommendation solution according to the source code data structure of the microservice program, relevant parameters of the application instruction, and the first service efficiency.
[0029] In some embodiments, A3 includes:
[0030] S701: Construct a fitting function based on the first microservice application result and the fitting result of the first application suggestion solution;
[0031] S702. Obtain optimal service characteristic coefficients of different microservice programs according to the fitting function;
[0032] S703: Obtain actual values of data model parameters of the optimal microservice program based on the optimal service characteristic coefficient and the analysis data, and construct a data model database of the microservice program based on the actual values of the parameters.
[0033] In some embodiments, A4 includes:
[0034] S8. Receive application data input by the user;
[0035] S9. Obtain actual values of data model parameters of the microservice program according to the application data and the data model database, construct a second data model, and obtain a second data model construction result.
[0036] In some embodiments, S9 includes:
[0037] S901. Obtain actual values of data model parameters of the microservice program based on the application data and the data model database, and construct a second data model.
[0038] S902: Acquire parameters of the second data model according to the second data model, and acquire parameter values of the second data model according to the parameters of the second data model;
[0039] S903: According to the parameter values of the second data model, taking the first microservice application result as an independent variable, obtain the second microservice application result, and construct a second data model construction result.
[0040] In some embodiments, A5 includes:
[0041] S10: construct a data model optimization list based on the second data model construction result, and output the data model optimization list to the user;
[0042] S11. Obtain the user's selection result for the data model optimization list, and obtain the actual value of the second data model optimization parameter based on the user's selection result, use the actual value of the second data model optimization parameter to replace the actual value of the parameter in the second data model, and build a data model database.
[0043] In some embodiments, S10 includes:
[0044] S1001. Construct an optimized data set of a data model database according to the second data model construction result;
[0045] S1002: Obtain actual values of the data model parameters of the optimized data set, and obtain an optimization solution for the user's data model parameters based on the actual values of the data model parameters;
[0046] S1003: Construct a data model optimization list based on the optimization scheme of the actual values of the data model parameters, and output the data model optimization list to the user.
[0047] In some embodiments, S11 includes:
[0048] S1101. Obtain the user's selection result for the data model optimization list, and obtain the optimization operation instruction according to the selection result;
[0049] S1102. Acquire actual values of optimization parameters of the second data model according to the optimization operation instruction, use the actual values of the optimization parameters of the second data model to replace the actual values of the parameters in the second data model, and build a data model database.
[0050] In some embodiments, in S1102, obtaining actual values of optimization parameters of the second data model according to the optimization operation instruction includes:
[0051] S1102a, obtaining the relationship between the parameters, constant coefficients and independent variables of the application data analysis function according to the optimization operation instruction;
[0052] S1102b. Analyze the relationship between the parameters, constant coefficients, and independent variables of the application data function, use the first microservice application result of the microservice program as the independent variable, and obtain the actual value of the second data model optimization parameter based on the independent variable.
[0053] In a second aspect, the present application provides a device for optimizing microservice execution efficiency, the device comprising:
[0054] A program analysis module is configured to analyze the microservice program and obtain analysis data;
[0055] an application suggestion module, configured to determine a service efficiency of the first microservice program based on the analysis data and obtain a first application suggestion solution for the microservice program;
[0056] A first construction module is configured to obtain a first microservice application result input by a user, and construct a data model database according to a fitting result of the first microservice application result and the first application suggestion solution;
[0057] a second building module configured to obtain application data input by a user and build a data model based on the application data and the data model database;
[0058] The model optimization module is configured to obtain the user's selection result for the constructed data model, optimize the data model according to the selection result, and obtain an optimization result.
[0059] In a third aspect, the present application provides a microservice execution efficiency optimization device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the microservice execution efficiency optimization method described in the first aspect above.
[0060] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for optimizing the execution efficiency of microservices described in the first aspect above is implemented.
[0061] The present application provides a method, device, and readable storage medium for optimizing microservice execution efficiency. The method includes: analyzing a microservice program to obtain analysis data; determining the service efficiency of a first microservice program based on the analysis data, and obtaining a first application recommendation solution for the microservice program; obtaining a first microservice application result input by a user, and constructing a data model database based on the fitting result of the first microservice application result and the first application recommendation solution; obtaining application data input by a user, and constructing a data model based on the application data and the data model database; obtaining a user's selection result for the constructed data model, and optimizing the data model based on the selection result to obtain an optimization result. The present application proposes a method for optimizing microservice execution efficiency, which can achieve dynamic adaptation, continuous optimization, and efficient resource utilization through systematic data analysis and optimization strategies, thereby significantly improving the overall performance of microservices and the intelligence level of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0063] Figure 1 A flowchart of a method for optimizing microservice execution efficiency provided in an embodiment of the present application;
[0064] Figure 2 A schematic diagram of obtaining analysis data by analyzing a microservice program provided in an embodiment of the present application;
[0065] Figure 3 A schematic diagram of determining the first service efficiency of a microservice program provided in an embodiment of the present application;
[0066] Figure 4 A schematic diagram of data model optimization provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of the structure of a microservice execution efficiency optimization device provided in an embodiment of the present application;
[0068] Figure 6 A schematic diagram of the structure of another microservice execution efficiency optimization device provided in an embodiment of the present application.
[0069] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0070] In order to enable those skilled in the art to better understand the technical solution of the present application, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0071] It should be understood that the specific embodiments and drawings described herein are only used to explain the present application, rather than to limit the present application.
[0072] It can be understood that, in the absence of conflict, the various embodiments and features in the embodiments of the present application can be combined with each other.
[0073] It will be understood that, for the sake of ease of description, the drawings of this application only show the parts related to this application, while the parts not related to this application are not shown in the drawings.
[0074] It can be understood that each unit and module involved in the embodiments of the present application may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0075] It can be understood that the terms "first", "second", etc. in the embodiments of the present application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0076] It is understandable that, in the absence of conflict, the functions and steps marked in the flowcharts and block diagrams of the present application may occur in an order different from that marked in the drawings.
[0077] It is understood that the flowcharts and block diagrams of the present application illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present application. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or by a combination of hardware and computer instructions.
[0078] It can be understood that the units and modules involved in the embodiments of the present application can be implemented by software or hardware, for example, the units and modules can be located in a processor.
[0079] Traditional systems typically utilize a monolithic architecture, with all functional modules tightly coupled together. This leads to difficult system maintenance, inconvenient upgrades, and poor scalability. Under this architecture, service development and deployment are complex, requiring large-scale changes to the entire system to add or modify a single feature. Furthermore, traditional technologies often lack real-time monitoring and optimization of microservice performance, resulting in uneven resource utilization and inefficient services. When debugging and optimizing traditional systems, developers rely on static analysis and manual monitoring, which is often time-consuming and labor-intensive, making rapid iteration and responsiveness difficult.
[0080] Existing traditional technologies suffer from numerous flaws, including difficulty dynamically adapting to business changes, inadequate performance optimization measures, uneven resource allocation, and a lack of real-time, data-driven decision support. These limitations hinder the full potential of microservices and lead to inefficiencies.
[0081] Addressing the challenges of traditional technologies, this application proposes a microservice execution efficiency evaluation and optimization method. Through systematic data analysis and optimization strategies, this method enables dynamic adaptation, continuous optimization, and efficient resource utilization, significantly improving the overall performance of microservices and the intelligence level of the system. This innovative approach addresses the shortcomings of traditional technologies and provides a new direction for the future development of microservices.
[0082] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0083] The present application provides a method for optimizing microservice execution efficiency. The working process of the method can be implemented by electronic devices, such as computers, handheld smart terminals, etc. For the convenience of explanation, the embodiments of the present application are described with the method execution subject being a computer.
[0084] Figure 1 A schematic diagram of a method for optimizing microservice execution efficiency provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the present application provides a method for optimizing microservice execution efficiency, which includes steps A1 to A5, as follows:
[0085] A1. Analyze the microservice program and obtain analysis data.
[0086] Figure 2 A schematic diagram of analyzing data obtained by analyzing a microservice program provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, in some embodiments, A1 includes:
[0087] S1. Get the successfully registered microservice program;
[0088] S201, read the source code of the microservice program, parse and extract the data structure of the microservice program;
[0089] Data structure acquisition is based on static analysis of the source code. By parsing variable declarations, function definitions, and data flow within the code, we can accurately capture the input and output data formats within the source code. If the source code contains a section that defines an input data structure in JSON format, we can determine the structure of the input data by analyzing the properties and types of the JSON object.
[0090] S202: Extracting the input and output data of the microservice program and corresponding application instructions based on the acquired source code data structure;
[0091] Application instructions are identified by analyzing operations such as function calls, API interfaces, and database queries. When a function calls an external API, the API call is a typical application instruction. This step also involves building an application instruction database to record basic information about each application instruction, including input and output data, functional descriptions, and execution conditions.
[0092] S203. Obtain relevant parameters of the application instruction according to the execution process of the microservice program;
[0093] This step is achieved through dynamic analysis of microservice execution. During the execution of the microservice, parameters such as the execution time, frequency, and input and output data length of each application instruction are recorded. These parameters form the basis for further analysis. If an application instruction is called 10 times in a complete business process, and the input data length varies for each call, the dynamic behavior characteristics of the application are captured by recording the specific input and output data lengths and the corresponding execution time for each call.
[0094] When building analytical data for microservices, the parameter data of application instructions is particularly important. To calculate the impact of each application instruction on the performance of the entire microservice, the following formula is used to represent the execution characteristics of the application instruction:
[0095]
[0096] Where T(i) is the total execution time of application instruction i, P(i,k) is the execution frequency of application instruction i during the kth call, and D(i,k) is the data transfer volume during the kth call. This formula indicates that the total execution time of an application instruction is equal to the sum of the product of the execution frequency and the data transfer volume during its multiple calls.
[0097] Example: Assume a microservice program contains an API interface that requires the transmission of 100KB of data per call and is called 50 times in a working day. The total execution time of the application instructions is expressed as:
[0098]
[0099] S204: Construct an analysis data set of the microservice program according to the relevant parameters of the obtained application instructions.
[0100] In this application, an analysis dataset is generated based on key parameters such as the execution frequency, data transfer volume, and execution time of each application instruction. This data is used to further optimize the performance of microservice programs. This can be achieved by reducing system overhead by reducing certain low-frequency instructions with large data volumes, or by parallelizing certain high-frequency calls to improve the overall response speed of microservices. Ultimately, by combining the analytical data from the analysis dataset, effective optimization strategies can be developed for microservice programs, providing a reference for further improved microservice designs.
[0101] A2. Determine the service efficiency of the first microservice program based on the analysis data, and obtain a first application recommendation solution for the microservice program;
[0102] In some embodiments, A2 includes:
[0103] S3. Determine the first service characteristic coefficient of the microservice program based on the analysis data;
[0104] S4. Determine a first data model based on the first service characteristic coefficient and the analysis data, and obtain actual values of the first data model parameters;
[0105] S5. Determine the service efficiency of the first microservice program according to the actual value of the first data model parameter, and obtain a first application recommendation solution for the microservice program.
[0106] In some embodiments, S3 includes:
[0107] S301, obtaining data length, complexity and frequency parameters of application instructions based on analysis data;
[0108] S302: Determine a first service characteristic coefficient according to data length, complexity, and frequency parameters of the application instruction.
[0109] The calculation process of the first service characteristic coefficient is:
[0110]
[0111] Among them, S(z) is the first service characteristic coefficient, L(x) is the output data length of the analysis data x, z(n) is the nth data length of the output data of the analysis data x, N is the total number of output data, μ(n) is the data complexity corresponding to the nth data of the output data of the analysis data x, l is the data length of the input data of the analysis data x; θ is the weight adjustment coefficient, and its value is 0 to 1. When θ is 0, it means that the influence of the data length of the input data is not considered. f(x) is the application frequency of the microservice program; α is the calculation factor, and its value is 2.
[0112] Figure 3 A schematic diagram of determining the first service efficiency of a microservice program provided in an embodiment of the present application is shown as follows: Figure 3 As shown, in some embodiments, S5 includes:
[0113] S501: Determine a first service efficiency of the microservice program based on a first service characteristic coefficient, a data length, a complexity, and a frequency parameter of an application instruction;
[0114] In this application, service efficiency E(x) is a key indicator for measuring the performance of microservice programs. It reflects the overall performance and resource utilization efficiency of microservices when processing data. The calculation of service efficiency is expressed by the following formula:
[0115]
[0116] Where E(x) is the service efficiency of the microservice program, S(z) is the first service characteristic coefficient, and T(x) is the total execution time of the microservice program. The total execution time T(x) depends on the time it takes the microservice program to process input data and the complexity of the data processing. To more accurately describe service efficiency, it is necessary to refine the calculation of total execution time.
[0117] The execution time of a microservice program is estimated based on the length of input and output data, the complexity of the data, and its execution frequency. Suppose the length of data processed by a microservice program is L in (input data length) and Lout (output data length), data complexity is C(x), and frequency parameter is f(x). The total execution time T(x) is expressed as:
[0118] T(x)=α·L in ·C(x)+β·L out f(x)
[0119] In the above formula:
[0120] α and β are weight factors used to adjust the total execution time of input and output data pairs, and their specific values depend on the computing performance of the system.
[0121] L in It is the input data length, which reflects the amount of data at the beginning of processing of the microservice program.
[0122] L out It is the output data length, which reflects the size of the final output data of the microservice program.
[0123] C(x) is the complexity of the input data. The more complex the data, the longer the processing time.
[0124] f(x) is the execution frequency of application instructions, that is, the number of calls to the microservice program. The higher the frequency, the longer the execution time.
[0125] This application calculates the service efficiency E(x) of the microservice program by combining the first service characteristic coefficient S(z) and the total execution time T(x).
[0126] For example, if the input data length of a microservice is 400KB, the output data length is 600KB, the complexity C(x) is 1.5, and the execution frequency is 10 times, then the total execution time is:
[0127] T(x)=2·400·1.5+3·600·10=1200+18000=19200
[0128] If the first service characteristic coefficient S(z) has been calculated as 5000 through the above steps, the service efficiency is:
[0129]
[0130] S502: Obtain a first application recommendation solution according to the source code data structure of the microservice program, relevant parameters of the application instruction, and the first service efficiency.
[0131] The proposed solutions primarily focus on improving the performance of microservice programs. By analyzing the source code's data structure, particularly the size and complexity of input and output data, we identify bottlenecks affecting microservice performance and propose corresponding optimization suggestions.
[0132] Case: If analysis shows that the input data structure of a microservice is very complex and there is a lot of repeated calculations during processing, the following optimization suggestions are proposed:
[0133] Optimize the input data structure, simplify the data format, and reduce redundant data transmission. Simplify the nested JSON format into a flat array format.
[0134] Use a caching mechanism to reduce repeated calculations and cache the results of frequently called high-frequency instructions to avoid the performance overhead caused by repeated calculations.
[0135] When the amount of output data is large, compression algorithms are used to reduce the size of the output data, thereby reducing the data transmission time.
[0136] Assume that the input data structure of the microservice program is too complex, resulting in a high computational complexity C(x). After optimization, C(x) is reduced from 1.5 to 1.1, and the output data length L is reduced. out The compression algorithm reduces the size to 400KB, and the optimized execution time is:
[0137] T′(x)=2·400·1.1+3·400·10=880+12000=12880
[0138] After optimization, the new service efficiency is:
[0139]
[0140] Through these optimizations, the microservice efficiency increased from 0.26 to 0.39, a significant performance improvement. This is the core of the solution recommended by the first application. By optimizing the input and output data structures, the computational complexity and data transmission time are reduced, thereby improving the operational efficiency of the entire microservice.
[0141] A3. Obtain a first microservice application result input by a user, and construct a data model database based on the first microservice application result and the fitting result of the first application suggestion solution;
[0142] In this application, a first microservice application result of the application efficiency and application feedback level input by the user is obtained, the first microservice application result is transmitted to the data management server, and a data optimization model of the data management server is constructed; according to the data optimization model, the user's data optimization requirements are obtained, and according to the data optimization requirements, a second application result is obtained.
[0143] In some embodiments, A3 includes:
[0144] S701: Construct a fitting function based on the first microservice application result and the fitting result of the first application suggestion solution;
[0145] S702. Obtain optimal service characteristic coefficients of different microservice programs according to the fitting function;
[0146] S703: Obtain actual values of data model parameters of the optimal microservice program based on the optimal service characteristic coefficient and the analysis data, and construct a data model database of the microservice program based on the actual values of the parameters.
[0147] A4. Obtain application data input by the user, and build a data model based on the application data and the data model database;
[0148] Figure 4 A schematic diagram of data model optimization provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, in some embodiments, A4 includes:
[0149] S8. Receive application data input by the user;
[0150] S9. Obtain actual values of data model parameters of the microservice program according to the application data and the data model database, construct a second data model, and obtain a second data model construction result.
[0151] In some embodiments, S9 includes:
[0152] S901. Obtain actual values of data model parameters of the microservice program based on the application data and the data model database, and construct a second data model.
[0153] S902: Acquire parameters of the second data model according to the second data model, and acquire parameter values of the second data model according to the parameters of the second data model;
[0154] S903: According to the parameter values of the second data model, taking the first microservice application result as an independent variable, obtain the second microservice application result, and construct a second data model construction result.
[0155] The calculation method of the second microservice application result is:
[0156] a=F(Y)·b+H(z)+J
[0157] Among them, a is the application result of the second microservice, b is the application result of the first microservice, Y is the parameter value of the second data model, F(Y) is the second service characteristic coefficient, H(z) is the application data analysis function, and J is the actual value of the parameter of the second data model.
[0158] The following is a detailed explanation of the above formula:
[0159] The first part F(Y)·b: adjusts the first microservice application result b by the second service characteristic coefficient F(Y) to reflect the impact of the characteristics of the second microservice on the result.
[0160] The second part H(z): application data analysis function H(z) further modifies the results to take into account the influence of specific information extracted from the application data.
[0161] The third part J: represents the actual value of the second data model parameter, which serves as a constant term to supplement the overall calculation of the microservice application results.
[0162] Through these steps, the application result of the second microservice is constructed and calculated, and the result is based on the application result of the first microservice and the parameter adjustment of the second data model.
[0163] A5. Obtain the user's selection result for the constructed data model, and optimize the data model according to the selection result to obtain an optimization result.
[0164] In some embodiments, A5 includes:
[0165] S10: construct a data model optimization list based on the second data model construction result, and output the data model optimization list to the user;
[0166] S11. Obtain the user's selection result for the data model optimization list, and obtain the actual value of the second data model optimization parameter based on the user's selection result, use the actual value of the second data model optimization parameter to replace the actual value of the parameter in the second data model, and build a data model database.
[0167] In some embodiments, S10 includes:
[0168] S1001. Construct an optimized data set of a data model database according to the second data model construction result;
[0169] S1002: Obtain actual values of the data model parameters of the optimized data set, and obtain an optimization solution for the user's data model parameters based on the actual values of the data model parameters;
[0170] S1003: Construct a data model optimization list based on the optimization scheme of the actual values of the data model parameters, and output the data model optimization list to the user.
[0171] In some embodiments, S11 includes:
[0172] S1101. Obtain the user's selection result for the data model optimization list, and obtain the optimization operation instruction according to the selection result;
[0173] S1102. Acquire actual values of optimization parameters of the second data model according to the optimization operation instruction, use the actual values of the optimization parameters of the second data model to replace the actual values of the parameters in the second data model, and build a data model database.
[0174] In some embodiments, in S1102, obtaining actual values of optimization parameters of the second data model according to the optimization operation instruction includes:
[0175] S1102a, obtaining the relationship between the parameters, constant coefficients and independent variables of the application data analysis function according to the optimization operation instruction;
[0176] S1102b. Analyze the relationship between the parameters, constant coefficients, and independent variables of the application data function, use the first microservice application result of the microservice program as the independent variable, and obtain the actual value of the second data model optimization parameter based on the independent variable.
[0177] This application proposes a method for optimizing microservice execution efficiency. Through systematic data analysis and optimization strategies, it can achieve dynamic adaptation, continuous optimization and efficient resource utilization, thereby significantly improving the overall performance of microservices and the intelligence level of the system.
[0178] It should be understood that, although the various steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they may be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times, and their execution order is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of sub-steps or stages of other steps.
[0179] Figure 5 A schematic diagram of a microservice execution efficiency optimization device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the present application provides a microservice execution efficiency optimization device, the device comprising:
[0180] A program analysis module 11 is configured to analyze the microservice program and obtain analysis data;
[0181] an application suggestion module 12, configured to determine the service efficiency of the first microservice program based on the analysis data and obtain a first application suggestion solution for the microservice program;
[0182] A first construction module 13 is configured to obtain a first microservice application result input by a user, and construct a data model database according to a fitting result of the first microservice application result and the first application suggestion solution;
[0183] A second building module 14 is configured to obtain application data input by a user and build a data model based on the application data and the data model database;
[0184] The model optimization module 15 is configured to obtain the user's selection result for the constructed data model, and optimize the data model according to the selection result to obtain an optimization result.
[0185] Regarding the definition of the microservice execution efficiency optimization device, reference may be made to the definition of the microservice execution efficiency optimization method in the above embodiments of the present application, which will not be repeated in this embodiment.
[0186] Figure 6 Another schematic diagram of the microservice execution efficiency optimization device provided in the embodiment of the present application is as follows Figure 6 As shown, the device includes a memory 22 and a processor 21, the memory stores a computer program, and the processor is configured to run the computer program to execute the methods in the above embodiments of the present application.
[0187] The memory is connected to the processor, the memory may be a flash memory, a read-only memory or other memory, and the processor may be a central processing unit or a single-chip microcomputer.
[0188] In some embodiments, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the methods in the above embodiments of the present application are implemented.
[0189] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0190] It is understood that the above embodiments are merely exemplary embodiments for illustrating the principles of the present application, and the present application is not limited thereto. Those skilled in the art may make various modifications and improvements without departing from the spirit and substance of the present application, and such modifications and improvements are also considered to be within the scope of protection of the present application.
Claims
1. A method for optimizing microservice execution efficiency, characterized in that: The method comprises: A1. Analyze the microservice program and obtain analysis data. A2. Determine the service efficiency of the first microservice program based on the analysis data, and obtain a first application recommendation solution for the microservice program; A3. Obtain a first microservice application result input by a user, and construct a data model database based on the first microservice application result and the fitting result of the first application suggestion solution; A4. Obtain application data input by the user, and build a data model based on the application data and the data model database; A5. Obtain the user's selection result for the constructed data model, and optimize the data model according to the selection result to obtain an optimization result.
2. The microservice execution efficiency optimization method according to claim 1, characterized in that: A1, including: S1. Get the successfully registered microservice program; S201, read the source code of the microservice program, parse and extract the data structure of the microservice program; S202: Extracting the input and output data of the microservice program and corresponding application instructions based on the acquired source code data structure; S203. Obtain relevant parameters of the application instruction according to the execution process of the microservice program; S204: Construct an analysis data set of the microservice program according to the relevant parameters of the obtained application instructions.
3. The microservice execution efficiency optimization method according to claim 1, characterized in that: A2, including: S3. Determine the first service characteristic coefficient of the microservice program based on the analysis data; S4. Determine a first data model based on the first service characteristic coefficient and the analysis data, and obtain actual values of the first data model parameters; S5. Determine the service efficiency of the first microservice program according to the actual value of the first data model parameter, and obtain a first application recommendation solution for the microservice program.
4. The microservice execution efficiency optimization method according to claim 3, characterized in that: S3, including: S301, obtaining data length, complexity and frequency parameters of application instructions based on analysis data; S302: Determine a first service characteristic coefficient according to data length, complexity, and frequency parameters of the application instruction.
5. The microservice execution efficiency optimization method according to claim 4, characterized in that: S5, including: S501: Determine a first service efficiency of the microservice program based on a first service characteristic coefficient, a data length, a complexity, and a frequency parameter of an application instruction; S502: Obtain a first application recommendation solution according to the source code data structure of the microservice program, relevant parameters of the application instruction, and the first service efficiency.
6. The microservice execution efficiency optimization method according to claim 1, characterized in that: A3, including: S701: Construct a fitting function based on the first microservice application result and the fitting result of the first application suggestion solution; S702. Obtain optimal service characteristic coefficients of different microservice programs according to the fitting function; S703: Obtain actual values of data model parameters of the optimal microservice program based on the optimal service characteristic coefficient and the analysis data, and construct a data model database of the microservice program based on the actual values of the parameters.
7. The microservice execution efficiency optimization method according to claim 1, characterized in that: A4, including: S8. Receive application data input by the user; S9. Obtain actual values of data model parameters of the microservice program according to the application data and the data model database, construct a second data model, and obtain a second data model construction result.
8. The microservice execution efficiency optimization method according to claim 7, characterized in that: S9, including: S901. Obtain actual values of data model parameters of the microservice program based on the application data and the data model database, and construct a second data model. S902: Acquire parameters of the second data model according to the second data model, and acquire parameter values of the second data model according to the parameters of the second data model; S903: According to the parameter values of the second data model, taking the first microservice application result as an independent variable, obtain the second microservice application result, and construct a second data model construction result.
9. The microservice execution efficiency optimization method according to claim 7 or 8, characterized in that: A5, including: S10: construct a data model optimization list based on the second data model construction result, and output the data model optimization list to the user; S11. Obtain the user's selection result for the data model optimization list, and obtain the actual value of the second data model optimization parameter based on the user's selection result, use the actual value of the second data model optimization parameter to replace the actual value of the parameter in the second data model, and build a data model database.
10. The microservice execution efficiency optimization method according to claim 9, characterized in that: S10, including: S1001. Construct an optimized data set of a data model database according to the second data model construction result; S1002: Obtain actual values of the data model parameters of the optimized data set, and obtain an optimization solution for the user's data model parameters based on the actual values of the data model parameters; S1003: Construct a data model optimization list based on the optimization scheme of the actual values of the data model parameters, and output the data model optimization list to the user.
11. The microservice execution efficiency optimization method according to claim 9, characterized in that: S11, including: S1101. Obtain the user's selection result for the data model optimization list, and obtain the optimization operation instruction according to the selection result; S1102. Acquire actual values of optimization parameters of the second data model according to the optimization operation instruction, use the actual values of the optimization parameters of the second data model to replace the actual values of the parameters in the second data model, and build a data model database.
12. The microservice execution efficiency optimization method according to claim 11, characterized in that: In S1102, obtaining actual values of optimization parameters of the second data model according to the optimization operation instruction includes: S1102a, obtaining the relationship between the parameters, constant coefficients and independent variables of the application data analysis function according to the optimization operation instruction; S1102b. Analyze the relationship between the parameters, constant coefficients, and independent variables of the application data function, use the first microservice application result of the microservice program as the independent variable, and obtain the actual value of the second data model optimization parameter based on the independent variable.
13. A device for optimizing microservice execution efficiency, characterized in that: The device comprises: A program analysis module is configured to analyze the microservice program and obtain analysis data; an application suggestion module, configured to determine a service efficiency of the first microservice program based on the analysis data and obtain a first application suggestion solution for the microservice program; A first construction module is configured to obtain a first microservice application result input by a user, and construct a data model database according to a fitting result of the first microservice application result and the first application suggestion solution; a second building module configured to obtain application data input by a user and build a data model based on the application data and the data model database; The model optimization module is configured to obtain the user's selection result for the constructed data model, optimize the data model according to the selection result, and obtain an optimization result.
14. A device for optimizing microservice execution efficiency, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the microservice execution efficiency optimization method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the microservice execution efficiency optimization method according to any one of claims 1 to 12.