Function call parameter adjustment method, device, storage medium and electronic device
By detecting the historical call and resource usage information of the function, the recycling duration is dynamically adjusted to solve the problem of low function recycling efficiency and achieve more efficient resource utilization.
Patent Information
- Application Number
- CN202411773222.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The recycling efficiency of function in the existing technology is low and lacks flexibility, resulting in insufficient resource utilization.
By detecting the historical call information and resource usage information of the target function, an adjustment parameter is generated to adjust the initial recovery duration, ensuring that its matching degree with the function meets the matching conditions, thereby generating the target recovery duration and realizing dynamic adjustment.
Improves the efficiency of function recycling, ensures that the recycling time is more in line with the actual operation of the function, and improves resource utilization.
Smart Images

Figure CN119806641B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing, and more specifically, to a method, device, storage medium, and electronic device for adjusting function call parameters. Background Art
[0002] Function Compute, a fully managed computing service in a serverless architecture, requires the platform to provide load scheduling capabilities for functions. Due to the nature of Function Compute, function instances must undergo a cold start in the function call chain before becoming hot instances. After the call chain ends, if no other requests reuse the hot instance, it must be recycled after a certain period of time. Specifically, if a hot instance is not called within a fixed period of time after the last call, it is marked as pending recycling. If the instance is reused before actual recycling, the pending recycling status is removed. A regular scan of all marked hot instances is performed, and if an instance marked as pending recycling is found, the function is recycled. The above fixed-time recycling scheme is used for different functions and different platform states, resulting in unsatisfactory function recycling results.
[0003] Currently, no effective solution has been proposed to address the problem of low recycling efficiency of function recycling in related technologies. Summary of the Invention
[0004] The main purpose of this application is to provide a method, device, storage medium and electronic device for adjusting function call parameters to solve the problem of low recovery efficiency of function recovery in related technologies.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for adjusting function call parameters is provided. The method includes: detecting the matching degree between the initial recovery duration configured on the running device and the target function based on reference call information of the target function on the running device in a reference period before the current moment and reference usage information of the running device, wherein the reference call information is used to indicate the situation in which the target function is called by the running device in the reference period, and the reference usage information is used to indicate the usage of the running resources on the running device in the reference period, and the initial recovery duration is the duration for which the target function is allowed to occupy the allocated running resources when the target function is called by the running device; generating an adjustment parameter for the initial recovery duration based on the matching degree, wherein the adjustment parameter is used to indicate an adjustment method for the initial recovery duration, and the adjustment method is used to adjust the matching degree to meet the matching condition between the initial recovery duration and the target function; generating a target recovery duration based on the adjustment parameter and the initial recovery duration; and adjusting the configuration on the running device from the initial recovery duration to the target recovery duration.
[0006] As an optional implementation, the detection of the degree of match between the initial recovery duration configured on the running device and the target function based on the reference call information of the target function on the running device in the reference period before the current moment and the reference usage information of the running device includes: extracting the reference call parameters of the target function from the reference call information, and extracting the reference allocation parameters of the target function and multiple reference remaining parameters of the running device from the reference usage information, wherein the reference call parameters are used to indicate the number of times the target function is called in the reference period, the reference allocation parameters are used to indicate the number of times the running device allocates running resources to the target function in the reference period, and each of the reference remaining parameters is used to indicate the remaining amount of running resources of the running device after the running device allocates running resources to the target function each time; and calculating the degree of match based on the reference call parameters, the reference allocation parameters and multiple reference remaining parameters.
[0007] As an optional implementation, the calculating the degree of matching based on the reference call parameter, the reference allocation parameter and the plurality of reference remaining parameters includes: calculating a parameter ratio between the reference call parameter and the reference allocation parameter, and calculating an average value of the plurality of reference remaining parameters; calculating a first difference between the parameter ratio and a ratio threshold, and calculating a second difference between the average value and a remaining threshold; and calculating the degree of matching based on the first difference and the second difference.
[0008] As an optional implementation, generating the adjustment parameter of the initial recovery duration based on the matching degree includes: detecting the size relationship between the matching degree and the matching threshold, wherein the matching condition is that the matching degree is greater than or equal to the matching threshold; when it is detected that the matching degree is greater than or equal to the matching threshold, determining the adjustment parameter to indicate that the adjustment method for the initial recovery duration is not to adjust; when it is detected that the matching degree is less than the matching threshold, calculating the adjustment parameter based on the reference call information and the reference usage information.
[0009] As an optional implementation, the calculating the adjustment parameter based on the reference call information and the reference usage information includes: extracting multiple reference call moments at which the target function is called within the reference period from the reference call information; searching from the reference usage information for multiple reference remaining amounts of the running resources on the running device corresponding to the multiple reference call moments before the running resources are allocated to the target function; and filtering out the adjustment parameter from multiple first alternative parameters based on the time relationship between the multiple reference call moments and the multiple reference remaining amounts corresponding to the multiple reference call moments, wherein the degree of match between the target recovery time corresponding to the adjustment parameter and the target function within the reference period is greater than or equal to the matching threshold.
[0010] As an optional implementation, the calculation of the adjustment parameter based on the reference call information and the reference usage information includes: updating a reference model based on the reference call information and the reference usage information to obtain a target model, wherein the target model maintains an association relationship between a time period and the call moment of the target function in the call information, and an association relationship between the time period and the remaining amount of the running resource on the running device corresponding to the call moment in the usage information before the running resource is allocated to the target function, and the time period includes the reference period and the target period; using the target model to predict multiple target call moments within the target period and multiple target remaining amounts corresponding to the multiple target call moments; filtering out the adjustment parameter from multiple second alternative parameters based on the time relationship between the multiple target call moments and the multiple target remaining amounts corresponding to the multiple target call moments, wherein the adjustment method indicated by the adjustment parameter is used to adjust the matching degree to be greater than or equal to the matching threshold within the target period.
[0011] As an optional implementation, generating a target recovery duration based on the adjustment parameters and the initial recovery duration includes: extracting a target value and an adjustment direction from the adjustment parameters, wherein the target value is used to indicate an adjustment amplitude of the initial recovery duration, and the adjustment direction includes an extension direction and a shortening direction; adjusting the initial recovery duration by the target value along the adjustment direction to obtain the target recovery duration.
[0012] To achieve the above-mentioned object, according to another aspect of the present application, a device for adjusting function call parameters is provided. The device comprises: a detection module for detecting the degree of match between the initial recycle duration configured on the running device and the target function based on reference call information of the target function on the running device in a reference period before the current moment and reference usage information of the running device, wherein the reference call information is used to indicate whether the target function is called by the running device in the reference period, the reference usage information is used to indicate the usage of the running resources on the running device in the reference period, and the initial recycle duration is the duration that the target function is allowed to occupy the allocated running resources when the target function is called by the running device; a first generation module for generating an adjustment parameter for the initial recycle duration based on the degree of match, wherein the adjustment parameter is used to indicate an adjustment method for the initial recycle duration, the adjustment method being used to adjust the degree of match to satisfy a matching condition between the initial recycle duration and the target function; a second generation module for generating a target recycle duration based on the adjustment parameter and the initial recycle duration; and an adjustment module for adjusting the configuration on the running device from the initial recycle duration to the target recycle duration.
[0013] As an optional embodiment, the detection module includes: a first extraction unit, used to extract the reference call parameters of the target function from the reference call information, and extract the reference allocation parameters of the target function and multiple reference remaining parameters of the running device from the reference usage information, wherein the reference call parameters are used to indicate the number of times the target function is called within the reference cycle, the reference allocation parameters are used to indicate the number of times the running device allocates running resources to the target function within the reference cycle, and each of the reference remaining parameters is used to indicate the remaining amount of running resources of the running device after the running device allocates running resources to the target function each time; a first calculation unit, used to calculate the matching degree based on the reference call parameters, the reference allocation parameters and multiple reference remaining parameters.
[0014] As an optional embodiment, the first calculation unit is also used to: calculate the parameter ratio of the reference call parameter and the reference allocation parameter, and calculate the average value of multiple reference remaining parameters; calculate the first difference between the parameter ratio and the ratio threshold, and calculate the second difference between the average value and the remaining threshold; calculate the matching degree based on the first difference and the second difference.
[0015] As an optional embodiment, the first generation module includes: a detection unit, used to detect the size relationship between the matching degree and the matching threshold, wherein the matching condition is that the matching degree is greater than or equal to the matching threshold; a determination unit, used to determine the adjustment parameter for indicating that the adjustment method for the initial recovery time is not to adjust when it is detected that the matching degree is greater than or equal to the matching threshold; a second calculation unit, used to calculate the adjustment parameter based on the reference call information and the reference usage information when it is detected that the matching degree is less than the matching threshold.
[0016] As an optional implementation, the second calculation unit is further used to: extract multiple reference call moments at which the target function is called within the reference period from the reference call information; search from the reference usage information for multiple reference remaining amounts of the running resources on the running device corresponding to the multiple reference call moments before the running resources are allocated to the target function; and filter out the adjustment parameter from multiple first alternative parameters based on the time relationship between the multiple reference call moments and the multiple reference remaining amounts corresponding to the multiple reference call moments, wherein the degree of match between the target recovery time corresponding to the adjustment parameter and the target function within the reference period is greater than or equal to the matching threshold.
[0017] As an optional embodiment, the second calculation unit is also used to: update the reference model according to the reference call information and the reference usage information to obtain a target model, wherein the target model maintains the association relationship between the time period and the call moment of the target function in the call information and the association relationship between the time period and the remaining amount of the running resources on the running device corresponding to the call moment in the usage information before the running resources are allocated to the target function, and the time period includes the reference period and the target period; use the target model to predict multiple target call moments within the target period and multiple target remaining amounts corresponding to the multiple target call moments; filter out the adjustment parameter from multiple second alternative parameters according to the time relationship between the multiple target call moments and the multiple target remaining amounts corresponding to the multiple target call moments, wherein the adjustment method indicated by the adjustment parameter is used to adjust the matching degree to be greater than or equal to the matching threshold within the target period.
[0018] As an optional embodiment, the second generation module includes: a second extraction unit, used to extract the target value and adjustment direction from the adjustment parameter, wherein the target value is used to indicate the adjustment amplitude of the initial recovery period, and the adjustment direction includes an extension direction and a shortening direction; an adjustment unit, used to adjust the initial recovery period by the target value along the adjustment direction to obtain the target recovery period.
[0019] In an embodiment of the present application, a method is adopted in which the match between the initial recovery duration configured on the running device and the target function is detected based on reference call information of the target function on the running device in a reference period before the current moment and reference usage information of the running device, an adjustment parameter for the initial recovery duration is generated based on the match, a target recovery duration is generated based on the adjustment parameter and the initial recovery duration, and the configuration on the running device is adjusted from the initial recovery duration to the target recovery duration. The match between the initial recovery duration and the target function is determined based on historical call conditions and historical resource usage, and an adjustment parameter for the initial recovery duration is generated based on the match to further adjust the initial recovery duration to a target recovery duration whose match with the target function meets the matching conditions as the new recovery duration of the target function. That is, the recovery duration of the target function is adjusted in combination with the specific operating conditions, taking into account both the function call frequency and resource utilization perspectives, so that the recovery duration of the function is set to be more in line with the specific operating conditions of the function, thereby achieving the purpose of improving the recovery efficiency of function recovery and achieving the technical effect of improving the recovery efficiency of function recovery, thereby solving the technical problem of low recovery efficiency of function recovery caused by the inflexibility of the function recovery scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0021] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for adjusting function call parameters is shown;
[0022] Figure 2 is a flowchart of a method for adjusting function call parameters provided in an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a device for adjusting function call parameters provided in an embodiment of the present application;
[0024] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings 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 in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:
[0028] Function Compute: Function Compute is a form of serverless architecture, designed for functional programming and providing a fully managed, event-driven computing service. With Function Compute, users no longer need to manage infrastructure like servers. They simply write and upload their code, and the Function Compute platform prepares computing resources for them, running their code in a flexible and reliable manner.
[0029] Function cold start: A cold start refers to the startup process in the function call chain, which includes code download, runtime initialization, and code initialization.
[0030] Function recycling: After a function instance is started and no requests are made for a period of time, the platform destroys it and reclaims the resources it occupies.
[0031] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation portals for users to choose to agree or refuse the automated decision-making results; if the user chooses to refuse, the expert decision-making process will be entered.
[0032] Example 1
[0033] According to an embodiment of the present application, a method embodiment for adjusting function call parameters is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for adjusting function call parameters is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (illustrated as 102a, 102b, ..., 102n in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for adjusting function call parameters in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned method for adjusting function call parameters. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0037] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0038] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0039] Under the above operating environment, this application provides Figure 2 The method for adjusting function call parameters is shown. Figure 2 This is a flow chart of the method for adjusting function call parameters according to Example 1 of the present application. Figure 2 As shown, the adjustment method includes the following steps:
[0040] Step S201: detecting a degree of match between an initial reclaim duration configured on the running device and the target function based on reference call information of the target function on the running device within a reference period before the current moment and reference usage information of the running device, wherein the reference call information is used to indicate a situation in which the target function is called by the running device within the reference period, the reference usage information is used to indicate a situation in which running resources on the running device are used within the reference period, and the initial reclaim duration is a period of time during which the target function is allowed to occupy the allocated running resources when the target function is called by the running device;
[0041] Step S202: generating an adjustment parameter for the initial recycle time based on the matching degree, wherein the adjustment parameter indicates a method for adjusting the initial recycle time, and the adjustment method is used to adjust the matching degree to satisfy a matching condition between the initial recycle time and the objective function;
[0042] Step S203, generating a target recycling duration according to the adjustment parameters and the initial recycling duration;
[0043] Step S204: Adjust the configuration on the running device from the initial recycling duration to the target recycling duration.
[0044] The function call parameter adjustment method provided in an embodiment of the present application detects the degree of match between the initial recovery duration configured on the running device and the target function based on reference call information of the target function on the running device in a reference period before the current moment and reference usage information of the running device, then generates an adjustment parameter for the initial recovery duration based on the matching degree, generates a target recovery duration based on the adjustment parameter and the initial recovery duration, and adjusts the configuration on the running device from the initial recovery duration to the target recovery duration. The degree of match between the initial recovery duration and the target function is determined based on historical call conditions and historical resource usage, and an adjustment parameter for the initial recovery duration is generated based on the matching degree to further adjust the initial recovery duration to a target recovery duration whose matching degree with the target function meets the matching conditions as the new recovery duration of the target function. This achieves the adjustment of the recovery duration of the target function based on the specific operating conditions, taking into account both the function call frequency and resource utilization perspectives, so that the recovery duration of the function is set to be more in line with the specific operating conditions of the function, solves the technical problem of low recovery efficiency of function recovery caused by the inflexibility of the function recovery scheme, and achieves the technical effect of improving the recovery efficiency of function recovery.
[0045] Optionally, in the embodiment provided in step S201 of the present application, the reference period may be, but is not limited to, a time period closest to the current moment before the current moment, and the reference period may also be, but is not limited to, a time period that is most representative of the function call situation selected from multiple time periods before the current moment. The present application does not make specific limitations on this.
[0046] Optionally, in an embodiment of the present application, the operating device may be, but is not limited to, a cloud computing platform, and the operating device may be, but is not limited to, providing operating resources for the target function. The operating device may be, but is not limited to, running multiple functions, that is, the operating device also provides operating resources for other functions in addition to the target function. Therefore, when adjusting the recycling duration of the target function, it is necessary to pay attention to the calling status of the target function, so that the target function can reuse the already allocated operating resources as much as possible, reducing the number of times operating resources are allocated to the target function, and ensuring that the target function's occupation of operating resources does not excessively affect other functions running on the operating device or other functions supported by the operating device, thereby avoiding excessive occupation of operating resources.
[0047] Optionally, in an embodiment of the present application, detecting the degree of match between the initial recovery time configured on the running device and the target function based on the reference call information of the target function on the running device in the reference period before the current moment and the reference usage information of the running device may also include, but is not limited to: detecting the duration for which the amount of allocated running resources occupied by the target function recorded in the reference usage information exceeds the resource threshold, and when the duration exceeds the allowed duration, determining that the degree of match does not meet the matching condition; when the duration does not exceed the allowed duration, determining multiple adjacent time differences based on each call moment of the target function recorded in the reference call information, wherein the adjacent time difference is the time difference between each two adjacent call moments in each call moment; searching for the minimum adjacent time difference from the multiple adjacent time differences, and comparing the minimum adjacent time difference with the time difference threshold, and when the minimum adjacent time difference is less than the time difference threshold, determining that the degree of match does not meet the matching condition; when the duration does not exceed the allowed duration and the minimum adjacent time difference is greater than or equal to the time difference threshold, determining that the degree of match meets the matching condition.
[0048] Optionally, in the embodiment provided in step S202 of the present application, the adjustment parameters may include, but are not limited to, an adjustment value and an adjustment direction. The adjustment value may include, but is not limited to, indicating an adjustment amplitude of the initial recovery duration. The adjustment direction includes, but is not limited to, shortening the initial recovery duration or delaying the initial recovery duration.
[0049] Optionally, in an embodiment of the present application, possible problem factors that cause the matching degree to fail to meet the matching requirements, the correlation between the factor manifestations of the above possible problem factors and the adjustment parameters can be recorded on the running device, but is not limited to. The adjustment parameters for the initial recovery time generated according to the matching degree include but are not limited to finding the problem factors that cause the matching degree to fail to meet the matching conditions when the matching degree does not meet the matching conditions, finding the factor values of the problem factors, and matching the adjustment parameters for the initial recovery time according to the problem factors, factor values and the above correlation relationships.
[0050] Optionally, in the embodiment provided in step S203 of the present application, the adjustment parameter can also be, but is not limited to, a parameter value that can be positive or negative. Generating the target recovery time based on the adjustment parameter and the initial recovery time includes but is not limited to calculating the sum of the initial recovery time and the adjustment parameter to obtain the target recovery time.
[0051] Optionally, in the function call parameter adjustment method provided in an embodiment of the present application, the matching degree between the initial recovery duration configured on the running device and the target function is detected based on the reference call information of the target function on the running device in the reference period before the current moment and the reference usage information of the running device, including: extracting the reference call parameters of the target function from the reference call information, and extracting the reference allocation parameters of the target function and multiple reference remaining parameters of the running device from the reference usage information, wherein the reference call parameters are used to indicate the number of times the target function is called in the reference period, the reference allocation parameters are used to indicate the number of times the running device allocates running resources to the target function in the reference period, and each reference remaining parameter is used to indicate the remaining amount of running resources of the running device after the running device allocates running resources to the target function each time; and calculating the matching degree based on the reference call parameters, the reference allocation parameters and the multiple reference remaining parameters.
[0052] Through the above steps, the matching degree between the initial recycling duration and the objective function is measured by combining the resource usage performance and call status as well as the resource allocation operation status. Taking multiple angles into consideration, the matching degree evaluation of the initial recycling duration is more in line with the actual operation of the objective function.
[0053] As an optional implementation, the matching degree is calculated based on the reference call parameters, the reference allocation parameters and multiple reference remaining parameters, including: calculating the parameter ratio of the reference call parameters and the reference allocation parameters, and calculating the average value of multiple reference remaining parameters; calculating a first difference between the parameter ratio and the ratio threshold, and calculating a second difference between the average value and the remaining threshold; and calculating the matching degree based on the first difference and the second difference.
[0054] Optionally, in this embodiment, including but not limited to setting a first weight of the first difference and a second weight of the second difference according to requirements, calculating a weighted sum of the first difference and the second difference to determine the matching degree.
[0055] Through the above steps, a simple and feasible matching metric quantification scheme that takes into account both resource usage and call conditions is proposed, which provides a basis for adjusting the recycling time of the content adjustment objective function taking into account the above two perspectives.
[0056] As an optional implementation, an adjustment parameter for the initial recovery time is generated based on the matching degree, including: detecting the size relationship between the matching degree and the matching threshold, wherein the matching condition is that the matching degree is greater than or equal to the matching threshold; when it is detected that the matching degree is greater than or equal to the matching threshold, determining the adjustment parameter to indicate that the adjustment method for the initial recovery time is not to adjust; when it is detected that the matching degree is less than the matching threshold, calculating the adjustment parameter based on the reference call information and the reference usage information.
[0057] Optionally, in this embodiment, the matching threshold may be, but is not limited to, manually set, or determined based on the matching degree between the objective function in the previous time period before the reference period and the recycling duration in the time period.
[0058] Through the above steps, whether to adjust the initial recycle duration is determined based on the relationship between the matching degree and the matching threshold. The recycle duration is adjusted only when the matching degree is less than the matching threshold. This ensures that the recycle duration adjustment operation is performed only when there is sufficient demand, avoiding unnecessary adjustment operations and saving operation resources.
[0059] As an optional implementation, the adjustment parameters are calculated based on the reference call information and the reference usage information, including: extracting multiple reference call moments at which the target function is called within a reference period from the reference call information; searching the reference usage information for multiple reference remaining amounts of running resources on the running device corresponding to the multiple reference call moments before allocating running resources to the target function; and screening out the adjustment parameters from multiple first alternative parameters based on the time relationship between the multiple reference call moments and the multiple reference remaining amounts corresponding to the multiple reference call moments, wherein the degree of match between the target recovery time corresponding to the adjustment parameter and the target function within the reference period is greater than or equal to a matching threshold.
[0060] Through the above steps, referring to the call time within the reference period and the amount of allocatable running resources within the reference period, an adjustment parameter for adjusting the recovery duration is screened from multiple first candidate parameters. The resulting target recovery duration is determined by combining the function call situation and resource supply capacity. The determined target recovery duration is consistent with the running performance of the target function and is more helpful in improving the recovery efficiency of function recovery compared to a fixed recovery duration.
[0061] As an optional implementation, the adjustment parameters are calculated based on the reference call information and the reference usage information, including: updating the reference model based on the reference call information and the reference usage information to obtain a target model, wherein the target model maintains the association between the time period and the call moment of the target function in the call information and the association between the time period and the remaining amount of running resources on the running device corresponding to the call moment in the usage information before the running resources are allocated to the target function, and the time period includes a reference period and a target period; using the target model to predict multiple target call moments within the target period and multiple target remaining amounts corresponding to the multiple target call moments; filtering out the adjustment parameters from multiple second alternative parameters based on the time relationship between the multiple target call moments and the multiple target remaining amounts corresponding to the multiple target call moments, wherein the adjustment method indicated by the adjustment parameter is used to adjust the matching degree to be greater than or equal to the matching threshold within the target period.
[0062] Optionally, in this embodiment, the reference model can be, but is not limited to, trained using call time data of the target function in multiple time periods before the current moment and remaining amount data of the running resources corresponding to each call time.
[0063] Through the above steps, the reference model is updated using the reference call information and reference usage information within the reference cycle, and the updated target model is used to predict the future target function call performance and operating resource performance. Data that is closer to future usage can be obtained as the basis for determining the adjustment parameters, and further, the target recovery time of the target function that is more suitable for the target cycle can be obtained, thereby improving the recovery efficiency of function recovery.
[0064] As an optional implementation, a target recovery time is generated based on the adjustment parameters and the initial recovery time, including: extracting a target value and an adjustment direction from the adjustment parameters, wherein the target value is used to indicate the adjustment amplitude of the initial recovery time, and the adjustment direction includes an extension direction and a shortening direction; adjusting the initial recovery time by the target value along the adjustment direction to obtain the target recovery time.
[0065] Through the above steps, the initial recycling duration is adjusted using the adjustment amplitude and adjustment direction indicated by the adjustment parameters, and the target recycling duration that meets the matching conditions is obtained to control the future function recycling mechanism. This provides a simple and feasible method for obtaining the target recycling duration, providing a basis for improving the recycling efficiency of function recycling.
[0066] As an optional implementation, this application also provides a serverless function hot instance recovery method based on machine learning, which supports function scheduling time (i.e., reference call information), resource remaining amount (i.e., reference usage information), and actual function recovery time (i.e., initial recovery duration) as input, and predicts the next reasonable recovery time of the function through machine learning methods.
[0067] The specific implementation steps of this method are:
[0068] Step S1: Obtain and confirm the resource requirement information of each function, and calibrate the amount of resources required for one scheduling of the function based on the requirement information;
[0069] Step S2: Obtain the time of each function scheduling, the remaining amount of the resource pool at each scheduling time, and the actual recycling time of the hot instance started after the function is triggered;
[0070] Step S3: Analyze the time characteristics of the function request and the time characteristics of the next request based on the machine learning model to predict future function requests. Analyze the remaining quantity information based on the machine learning model to predict future remaining quantity information. Based on the future remaining quantity information and future function requests, determine a reasonable time T as the interval for new function recycling.
[0071] Step S4: Immediately reclaim the running resources occupied by the function when a reasonable time T is reached;
[0072] Step S5: Repeat the above steps S2-S4 to optimize the resource recovery time T in each time period.
[0073] Through the above steps, the cold start characteristics, resource surplus, and scheduling frequency characteristics of the function instance are processed and analyzed in a timely manner, and the recycling time of the hot instance is reasonably and dynamically adjusted to improve resource utilization. At the same time, the machine learning model is used to implement intelligent resource recycling and dynamically set different recycling strategies for different functions. The recycling strategy is adjusted in real time based on the scheduling characteristics and resource occupancy characteristics of the actual environment, which can alleviate the contradiction of cold restarting a function within a short period of time after being recycled.
[0074] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0075] Example 2
[0076] The present application also provides a device for adjusting function call parameters. It should be noted that the device for adjusting function call parameters in the present application can be used to execute the method for adjusting function call parameters provided in the present application. The following describes the device for adjusting function call parameters provided in the present application.
[0077] According to an embodiment of the present application, a device for implementing the above-mentioned method for adjusting function call parameters is also provided, such as Figure 3 As shown, the device includes:
[0078] A detection module 301 is configured to detect a degree of match between an initial reclaim duration configured on a running device and a target function based on reference call information of the target function on the running device within a reference period before a current moment and reference usage information of the running device, wherein the reference call information indicates whether the target function was called by the running device within the reference period, the reference usage information indicates whether the running resources on the running device were used within the reference period, and the initial reclaim duration is the duration for which the target function is allowed to occupy the allocated running resources when the target function is called by the running device;
[0079] A first generating module 302 is configured to generate an adjustment parameter for the initial recycling duration based on the matching degree, wherein the adjustment parameter indicates a method for adjusting the initial recycling duration, and the adjustment method is configured to adjust the matching degree to satisfy a matching condition between the initial recycling duration and the objective function;
[0080] The second generating module 303 is configured to generate a target recycling duration according to the adjustment parameter and the initial recycling duration;
[0081] The adjustment module 304 is configured to adjust the configuration on the running device from the initial recycling duration to the target recycling duration.
[0082] The function call parameter adjustment device provided in an embodiment of the present application detects the degree of match between the initial recovery duration configured on the running device and the target function based on reference call information of the target function on the running device within a reference period before the current moment and reference usage information of the running device, then generates an adjustment parameter for the initial recovery duration based on the matching degree, generates a target recovery duration based on the adjustment parameter and the initial recovery duration, and adjusts the configuration on the running device from the initial recovery duration to the target recovery duration. The device determines the degree of match between the initial recovery duration and the target function based on historical call conditions and historical resource usage, and generates an adjustment parameter for the initial recovery duration based on the matching degree to further adjust the initial recovery duration to the target recovery duration whose matching degree with the target function satisfies the matching conditions, serving as the new recovery duration of the target function. This achieves adjustment of the recovery duration of the target function based on the specific operating conditions, taking into account both the function call frequency and resource utilization, so that the recovery duration of the function is set to be more in line with the specific operating conditions of the function, thereby solving the technical problem of low recovery efficiency of function recovery caused by the inflexibility of the function recovery scheme, and achieving the technical effect of improving the recovery efficiency of function recovery.
[0083] As an optional embodiment, the detection module includes: a first extraction unit, used to extract reference call parameters of the target function from the reference call information, and extract reference allocation parameters of the target function and multiple reference remaining parameters of the running device from the reference usage information, wherein the reference call parameters are used to indicate the number of times the target function is called within the reference cycle, the reference allocation parameters are used to indicate the number of times the running device allocates running resources to the target function within the reference cycle, and each reference remaining parameter is used to indicate the remaining amount of running resources of the running device after the running device allocates running resources to the target function each time; a first calculation unit, used to calculate the matching degree based on the reference call parameters, the reference allocation parameters and the multiple reference remaining parameters.
[0084] As an optional embodiment, the first calculation unit is also used to: calculate the parameter ratio of the reference call parameter and the reference allocation parameter, and calculate the average value of multiple reference remaining parameters; calculate the first difference between the parameter ratio and the ratio threshold, and calculate the second difference between the average value and the remaining threshold; calculate the matching degree based on the first difference and the second difference.
[0085] As an optional implementation, the first generation module includes: a detection unit for detecting the size relationship between the matching degree and the matching threshold, wherein the matching condition is that the matching degree is greater than or equal to the matching threshold; a determination unit for determining the adjustment parameter for indicating that the adjustment method for the initial recovery time is not to adjust when it is detected that the matching degree is greater than or equal to the matching threshold; and a second calculation unit for calculating the adjustment parameter based on the reference call information and the reference usage information when it is detected that the matching degree is less than the matching threshold.
[0086] As an optional implementation, the second computing unit is further used to: extract multiple reference call moments at which the target function is called within the reference period from the reference call information; search from the reference usage information for multiple reference remaining amounts of running resources on the running device corresponding to the multiple reference call moments before allocating running resources to the target function; and filter out adjustment parameters from multiple first alternative parameters based on the time relationship between the multiple reference call moments and the multiple reference remaining amounts corresponding to the multiple reference call moments, wherein the target recovery time corresponding to the adjustment parameter has a matching degree with the target function within the reference period that is greater than or equal to a matching threshold.
[0087] As an optional implementation, the second computing unit is further used to: update the reference model according to the reference call information and the reference usage information to obtain a target model, wherein the target model maintains the association relationship between the time period and the call moment of the target function in the call information and the association relationship between the time period and the remaining amount of running resources on the running device corresponding to the call moment in the usage information before the running resources are allocated to the target function, and the time period includes a reference period and a target period; use the target model to predict multiple target call moments within the target period and multiple target remaining amounts corresponding to the multiple target call moments; filter out an adjustment parameter from multiple second alternative parameters according to the time relationship between the multiple target call moments and the multiple target remaining amounts corresponding to the multiple target call moments, wherein the adjustment method indicated by the adjustment parameter is used to adjust the matching degree to be greater than or equal to the matching threshold within the target period.
[0088] As an optional implementation, the second generation module includes: a second extraction unit, used to extract the target value and adjustment direction from the adjustment parameters, wherein the target value is used to indicate the adjustment amplitude of the initial recovery period, and the adjustment direction includes an extension direction and a shortening direction; an adjustment unit, used to adjust the initial recovery period along the adjustment direction to the target value to obtain the target recovery period.
[0089] It should be noted that the detection module 301, the first generation module 302, the second generation module 303, and the adjustment module 304 correspond to steps S201 to S204 in Example 1. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above-mentioned modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0090] Example 3
[0091] An embodiment of the present application may provide an electronic device, Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 Only one is shown) processor 402, memory 404, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0092] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0093] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: detect the matching degree between the initial recovery time configured on the running device and the target function based on the reference call information of the target function on the running device in the reference period before the current moment and the reference usage information of the running device, wherein the reference call information is used to indicate the situation in which the target function is called by the running device in the reference period, and the reference usage information is used to indicate the usage of the running resources on the running device in the reference period, and the initial recovery time is the time duration for which the target function is allowed to occupy the allocated running resources when the target function is called by the running device; generate an adjustment parameter for the initial recovery time based on the matching degree, wherein the adjustment parameter is used to indicate the adjustment method for the initial recovery time, and the adjustment method is used to adjust the matching degree to meet the matching conditions between the initial recovery time and the target function; generate a target recovery time based on the adjustment parameter and the initial recovery time; and adjust the configuration on the running device from the initial recovery time to the target recovery time.
[0094] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: extract the reference call parameters of the target function from the reference call information, and extract the reference allocation parameters of the target function and multiple reference remaining parameters of the operating device from the reference usage information, wherein the reference call parameters are used to indicate the number of times the target function is called within the reference cycle, the reference allocation parameters are used to indicate the number of times the operating device allocates operating resources to the target function within the reference cycle, and each reference remaining parameter is used to indicate the remaining amount of operating resources of the operating device after the operating device allocates operating resources to the target function each time; calculate the matching degree based on the reference call parameters, the reference allocation parameters and the multiple reference remaining parameters.
[0095] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: calculating the parameter ratio of the reference call parameter and the reference allocation parameter, and calculating the average value of multiple reference remaining parameters; calculating the first difference between the parameter ratio and the ratio threshold, and calculating the second difference between the average value and the remaining threshold; calculating the matching degree based on the first difference and the second difference.
[0096] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: detect the size relationship between the matching degree and the matching threshold, where the matching condition is that the matching degree is greater than or equal to the matching threshold; when it is detected that the matching degree is greater than or equal to the matching threshold, determine the adjustment parameter to indicate that the adjustment method for the initial recovery time is not to adjust; when it is detected that the matching degree is less than the matching threshold, calculate the adjustment parameter based on the reference call information and the reference usage information.
[0097] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: extract multiple reference call moments at which the target function is called within the reference period from the reference call information; search from the reference usage information for multiple reference remaining amounts of running resources on the running device corresponding to the multiple reference call moments before allocating running resources to the target function; and filter out adjustment parameters from multiple first alternative parameters based on the time relationship between the multiple reference call moments and the multiple reference remaining amounts corresponding to the multiple reference call moments, wherein the target recovery time corresponding to the adjustment parameter has a matching degree with the target function within the reference period that is greater than or equal to a matching threshold.
[0098] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: update the reference model according to the reference call information and the reference usage information to obtain the target model, wherein the target model maintains the association relationship between the time period and the call moment of the target function in the call information and the association relationship between the time period and the remaining amount of running resources on the running device corresponding to the call moment in the usage information before the running resources are allocated to the target function, and the time period includes a reference period and a target period; use the target model to predict multiple target call moments within the target period and multiple target remaining amounts corresponding to the multiple target call moments; filter out the adjustment parameter from multiple second alternative parameters according to the time relationship between the multiple target call moments and the multiple target remaining amounts corresponding to the multiple target call moments, wherein the adjustment method indicated by the adjustment parameter is used to adjust the matching degree to be greater than or equal to the matching threshold within the target period.
[0099] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: extract the target value and adjustment direction from the adjustment parameters, wherein the target value is used to indicate the adjustment amplitude of the initial recovery time, and the adjustment direction includes an extension direction and a shortening direction; adjust the initial recovery time by the target value along the adjustment direction to obtain the target recovery time.
[0100] An embodiment of the present application provides a function call parameter adjustment scheme, which detects the degree of match between the initial recovery time configured on the running device and the target function based on reference call information of the target function on the running device in a reference period before the current moment and reference usage information of the running device, then generates an adjustment parameter for the initial recovery time based on the match, generates a target recovery time based on the adjustment parameter and the initial recovery time, and adjusts the configuration on the running device from the initial recovery time to the target recovery time. The degree of match between the initial recovery time and the target function is determined based on historical call conditions and historical resource usage, and the adjustment parameter for the initial recovery time is generated based on the match to further adjust the initial recovery time to the target recovery time that meets the matching conditions with the target function as the new recovery time of the target function. That is, the recovery time of the target function is adjusted in combination with the specific operating conditions, taking into account both the function call frequency and resource utilization perspectives, so that the recovery time of the function is set to be more in line with the specific operating conditions of the function, solving the technical problem of low recovery efficiency of function recovery caused by the inflexibility of the function recovery scheme, and achieving the technical effect of improving the recovery efficiency of function recovery.
[0101] It can be understood by those skilled in the art that Figure 4The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 4 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 4 Different configurations shown.
[0102] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0103] Example 4
[0104] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for adjusting function call parameters provided in the first embodiment.
[0105] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0106] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the method for adjusting function call parameters.
[0107] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0108] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0110] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0111] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0113] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for adjusting function call parameters, characterized in that: include: detecting a degree of match between an initial reclaim duration configured on the running device and the target function based on reference call information of the target function on the running device within a reference period before a current moment and reference usage information of the running device, wherein the reference call information is used to indicate a situation in which the target function is called by the running device within the reference period, the reference usage information is used to indicate a situation in which running resources on the running device are used within the reference period, and the initial reclaim duration is a duration during which the target function is allowed to occupy allocated running resources when the target function is called by the running device; generating an adjustment parameter for the initial recycling duration according to the matching degree, wherein the adjustment parameter is used to indicate an adjustment method for the initial recycling duration, and the adjustment method is used to adjust the matching degree to satisfy a matching condition between the initial recycling duration and the objective function; generating a target recycling duration according to the adjustment parameter and the initial recycling duration; Adjust the configuration on the running device from the initial recycling duration to the target recycling duration.
2. The method according to claim 1, characterized in that The detecting, based on reference call information of the target function on the running device in a reference period before the current moment and reference usage information of the running device, a matching degree between the initial recycling duration configured on the running device and the target function includes: Extracting reference call parameters of the target function from the reference call information, and extracting reference allocation parameters of the target function and a plurality of reference remaining parameters of the operating device from the reference usage information, wherein the reference call parameters are used to indicate the number of times the target function is called within the reference cycle, the reference allocation parameters are used to indicate the number of times the operating device allocates operating resources to the target function within the reference cycle, and each of the reference remaining parameters is used to indicate the remaining amount of the operating resources of the operating device after the operating device allocates operating resources to the target function each time; The matching degree is calculated according to the reference call parameter, the reference allocation parameter and a plurality of the reference remaining parameters.
3. The method according to claim 2, characterized in that The calculating the matching degree according to the reference call parameter, the reference allocation parameter and the plurality of reference remaining parameters includes: calculating a parameter ratio of the reference call parameter to the reference allocation parameter, and calculating an average value of a plurality of the reference remaining parameters; calculating a first difference between the parameter ratio and a ratio threshold, and calculating a second difference between the average value and a residual threshold; The matching degree is calculated according to the first difference and the second difference.
4. The method according to claim 1, wherein Generating the adjustment parameter of the initial recycling time according to the matching degree includes: Detecting a magnitude relationship between the matching degree and a matching threshold, wherein the matching condition is that the matching degree is greater than or equal to the matching threshold; When it is detected that the matching degree is greater than or equal to the matching threshold, determining the adjustment parameter to indicate that the adjustment mode for the initial recycling time is not to adjust; When it is detected that the matching degree is less than the matching threshold, the adjustment parameter is calculated according to the reference call information and the reference usage information.
5. The method according to claim 4, characterized in that The calculating the adjustment parameter according to the reference call information and the reference usage information includes: Extracting a plurality of reference call moments at which the target function is called within the reference period from the reference call information; searching, from the reference usage information, a plurality of reference remaining amounts of the running resource on the running device corresponding to the plurality of reference call moments before the running resource is allocated to the target function; The adjustment parameter is selected from multiple first candidate parameters based on the time relationship between the multiple reference call moments and the multiple reference remaining amounts corresponding to the multiple reference call moments, wherein the degree of match between the target recovery duration corresponding to the adjustment parameter and the objective function within the reference period is greater than or equal to the matching threshold.
6. The method according to claim 4, characterized in that The calculating the adjustment parameter according to the reference call information and the reference usage information includes: updating a reference model according to the reference call information and the reference usage information to obtain a target model, wherein the target model maintains an association relationship between a time period and a call moment of the target function in the call information, and an association relationship between the time period and a remaining amount of the running resource on the running device corresponding to the call moment in the usage information before the running resource is allocated to the target function, the time period including the reference period and the target period; Predicting, using the target model, a plurality of target call moments within the target period and a plurality of target remaining amounts corresponding to the plurality of target call moments; The adjustment parameter is selected from a plurality of second alternative parameters according to the time relationship between the plurality of target call moments and the plurality of target remaining amounts corresponding to the plurality of target call moments, wherein the adjustment method indicated by the adjustment parameter is used to adjust the matching degree to be greater than or equal to the matching threshold within the target period.
7. The method according to claim 1, characterized in that Generating a target recycling duration according to the adjustment parameter and the initial recycling duration includes: Extracting a target value and an adjustment direction from the adjustment parameter, wherein the target value is used to indicate an adjustment amplitude of the initial recycling time, and the adjustment direction includes an extension direction and a shortening direction; The initial recycling time is adjusted by the target value along the adjustment direction to obtain the target recycling time.
8. A device for adjusting function call parameters, characterized in that: include: a detection module, configured to detect a degree of match between an initial reclaim duration configured on the running device and the target function based on reference call information of the target function on the running device within a reference period before a current moment and reference usage information of the running device, wherein the reference call information is used to indicate a case where the target function is called by the running device within the reference period, the reference usage information is used to indicate a case where the running resources on the running device are used within the reference period, and the initial reclaim duration is a duration during which the target function is allowed to occupy the allocated running resources when the target function is called by the running device; a first generating module, configured to generate an adjustment parameter for the initial recycling duration based on the matching degree, wherein the adjustment parameter is used to indicate an adjustment method for the initial recycling duration, and the adjustment method is used to adjust the matching degree to satisfy a matching condition between the initial recycling duration and the objective function; A second generating module, configured to generate a target recycling duration according to the adjustment parameter and the initial recycling duration; An adjustment module is used to adjust the configuration on the running device from the initial recycling time to the target recycling time.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the method for adjusting function call parameters according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: a memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.
Citation Information
Patent Citations
Server-free computing dynamic dormancy method for resource optimization in edge scene and application
CN115543450A
Memory recovery processing method and device, electronic equipment and storage medium
CN118363877A