CN115934479B - Interface service control method, device, storage medium and equipment - Google Patents

Interface service control method, device, storage medium and equipment Download PDF

Info

Publication number
CN115934479B
CN115934479B CN202310247114.5A CN202310247114A CN115934479B CN 115934479 B CN115934479 B CN 115934479B CN 202310247114 A CN202310247114 A CN 202310247114A CN 115934479 B CN115934479 B CN 115934479B
Authority
CN
China
Prior art keywords
interface service
parameter information
operation mode
service
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310247114.5A
Other languages
Chinese (zh)
Other versions
CN115934479A (en
Inventor
左磊
李扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianju Dihe Suzhou Technology Co ltd
Original Assignee
Tianju Dihe Suzhou Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianju Dihe Suzhou Technology Co ltd filed Critical Tianju Dihe Suzhou Technology Co ltd
Priority to CN202310247114.5A priority Critical patent/CN115934479B/en
Publication of CN115934479A publication Critical patent/CN115934479A/en
Application granted granted Critical
Publication of CN115934479B publication Critical patent/CN115934479B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a control method, a device, a storage medium and equipment of interface service, and belongs to the technical field of computers. The method comprises the following steps: acquiring parameter information sent by a service monitoring system, wherein the parameter information is obtained by monitoring a docking port interface by the service monitoring system, and comprises resource parameter information and a return proportion of a preset state code; determining an operation mode of the interface service according to the parameter information; when the operation mode is that the POD corresponding to the interface port is operated, the POD corresponding to the interface port is expanded or contracted; when the operation mode is to operate the interface service, the interface service is degraded. According to the method and the device, the capacity of the POD is automatically expanded or contracted, so that the resource utilization rate of the server is improved, and the system performance and reliability are improved; and the automatic interface service degradation, the quick response to the problem and the repair in the fault stage, and the service operation efficiency and the customer satisfaction are improved.

Description

Interface service control method, device, storage medium and equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a storage medium, and a device for controlling an interface service.
Background
Currently, most Internet enterprises use SOA (Service-oriented architecture) and Kubernetes to implement interface services. The zookeeper of the SOA stores configuration information of the interface service, and the Kubernetes can create a resource pool according to the configuration information and provide the interface service by scheduling the PODs in the resource pool.
In the process of scheduling the interface service, the interface service needs to be monitored, so that the capacity of the POD can be expanded or contracted according to the use condition of resources, and degradation and recovery can be performed when the interface service fails. However, in the prior art, the configuration information needs to be manually modified by a developer, and the capacity expansion or contraction of the pod and the degradation and restoration of the interface service are performed according to the modified configuration information.
Because the configuration information may not be modified timely manually, the resource utilization rate in the server is low, and the response in the failure stage is slow, which may affect the normal operation of the interface service.
Disclosure of Invention
The application provides a control method, a device, a storage medium and equipment for interface service, which are used for solving the problems that the manual modification of configuration information is not timely, so that the resource utilization rate in a server is low, the response in a fault stage is slow, and the normal operation of the interface service is influenced. The technical scheme is as follows:
in one aspect, a method for controlling an interface service is provided, the method including:
acquiring parameter information sent by a service monitoring system, wherein the parameter information is obtained by monitoring a port service by the service monitoring system and comprises resource parameter information and a return proportion of a preset status code;
determining an operation mode of the interface service according to the parameter information;
when the operation mode is to operate the POD corresponding to the interface service, expanding or shrinking the POD corresponding to the interface service;
and when the operation mode is to operate the interface service, degrading the interface service.
In one possible implementation manner, the determining the operation mode of the interface service according to the parameter information includes:
when the acquisition period of the resource parameter information is a first period, respectively quantizing the average value of each parameter in the resource parameter information in the first period to obtain the score of each parameter;
and when the total score is greater than or equal to a score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service.
In one possible implementation manner, the determining the operation mode of the interface service according to the parameter information includes:
when the acquisition period of the resource parameter information is a second period and the second period is larger than the first period, respectively quantizing the maximum value, the upper limit region value and the average value of each parameter in the resource parameter information in the second period to obtain the score of each parameter, wherein the upper limit region value is a value of a preset proportion of the first sequence selected after the values of each parameter are arranged in the sequence from large to small;
and when the total score is smaller than a score threshold value, determining that the operation mode is to shrink the POD corresponding to the interface service.
In one possible implementation, the method further includes:
acquiring a preset window duration;
starting timing after capacity expansion, and acquiring parameter information sent by the service monitoring system again when the timing duration reaches the window duration;
and determining the operation mode of the interface service according to the parameter information.
In one possible implementation manner, the determining the operation mode of the interface service according to the parameter information includes:
detecting whether the return proportion of the preset state code is larger than or equal to a proportion threshold value;
if the return proportion of the preset state code is greater than or equal to the proportion threshold value, respectively quantizing the average value of each parameter in the resource parameter information in a first period to obtain the fraction of each parameter;
when the total score is greater than or equal to a score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service;
and when the total score is smaller than a score threshold value, determining that the operation mode is to degrade the interface service.
In one possible implementation, the method further includes:
detecting whether the interface service is available after degradation;
and after determining that the interface service is available, recovering the interface service.
In one possible implementation, the method further includes:
acquiring historical resource parameter information of a preset number of days spaced from the current moment;
obtaining a pre-trained prediction model;
processing the historical resource parameter information by using the prediction model to obtain predicted resource parameter information at a future moment;
and expanding the capacity of the POD corresponding to the interface service according to the predicted resource parameter information.
In a possible implementation manner, the expanding or shrinking the POD corresponding to the interface service includes:
acquiring the number of PODs configured in a zookeeper of an SOA architecture;
if the capacity is required to be expanded, increasing the number of the PODs by a preset number;
and if the capacity reduction is required, subtracting a preset quantity from the quantity of the PODs.
In one possible implementation manner, the degrading the interface service includes:
the switch state of a degradation switch configured in a zookeeper of the SOA architecture is set to an on state.
In one aspect, there is provided a control apparatus of an interface service, the apparatus comprising:
the system comprises an acquisition module, a service monitoring system and a control module, wherein the acquisition module is used for acquiring parameter information sent by the service monitoring system, the parameter information is obtained by monitoring a docking port service by the service monitoring system, and the parameter information comprises resource parameter information and a return proportion of a preset state code;
the determining module is used for determining the operation mode of the interface service according to the parameter information;
the expansion and contraction module is used for expanding or contracting the capacity of the POD corresponding to the interface service when the operation mode is to operate the POD corresponding to the interface service;
and the degradation module is used for degrading the interface service when the operation mode is to operate the interface service.
In one aspect, a computer readable storage medium having stored therein at least one instruction loaded and executed by a processor to implement a method of controlling an interface service as described above is provided.
In one aspect, a computer device is provided, the computer device comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement a method of controlling an interface service as described above.
The beneficial effects of the technical scheme that this application provided include at least:
the method comprises the steps that parameter information of interface service is obtained through a service monitoring system, and then the operation mode of the interface service is determined according to the resource parameter information in the parameter information and the return proportion of a preset state code, so that the capacity expansion or the capacity reduction of the POD corresponding to the interface service is automatically realized, resources in a server can be effectively utilized, the resource utilization rate in the server is improved, and the system performance and the reliability are improved; or degrading the interface service automatically, rapidly responding to the problem and repairing the problem in the fault stage, ensuring that the interface service can normally operate, and improving the service operation efficiency and the customer satisfaction.
After degradation, whether the interface service is available is detected, and after the interface service is determined to be available, the interface service is recovered, so that the self-healing of the service can be realized, and the availability and the stability of the system are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a method flow diagram of a control method for an interface service provided by one embodiment of the present application;
FIG. 2 is a method flow diagram of a control method for an interface service provided in another embodiment of the present application;
FIG. 3 is a block diagram of an interface service control device according to another embodiment of the present application;
fig. 4 is a block diagram of a control device for an interface service according to still another embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for controlling an interface service according to an embodiment of the present application is shown, where the method for controlling an interface service may be applied to a computer device. The control method of the interface service can comprise the following steps:
step 101, acquiring parameter information sent by a service monitoring system, wherein the parameter information is obtained by monitoring a docking port service by the service monitoring system, and comprises resource parameter information and a return proportion of a preset state code.
The service monitoring system may be promethaus. The Prometheus is an open-source system monitoring and time sequence database monitoring system, and the performance and health state of the whole system can be monitored through the Prometheus.
In this embodiment, the service monitoring system may monitor the interface service, and periodically send the monitored parameter information to the computer device, where the computer device receives the parameter information. The period of the parameter information may be set according to the service requirement, for example, the period may be 30 seconds, 1 minute, etc.
The resource parameter information may include, but is not limited to: CPU (Central Processing Unit ) usage, memory usage, TCP (Transmission Control Protocol ) connection number, network traffic, resource pool capacity.
The predetermined status code may be a 5xx HTTP (Hyper Text Transfer Protocol ) status code. The computer device may count the number of the predetermined status codes and all status codes fed back by the interface service over a period of time, and divide the number of the predetermined status codes by the number of all status codes to obtain a return proportion of the predetermined status codes.
And 102, determining an operation mode of the interface service according to the parameter information.
The operation mode comprises the expansion or contraction of the POD. Where POD is the smallest deployable unit in Kubernetes, which may also be referred to as a container group. POD represents a stand-alone application running instance in Kubernetes, which may consist of a single container or several containers coupled closely together. It can be understood that when the resources of the interface service occupy more resources, the computer device needs to expand the capacity of the POD; when the resources of the interface service occupy less, the computer device needs to shrink the POD.
The method of operation includes degrading the interface service. The degradation refers to policy degradation of some services and pages according to current service conditions and traffic under the condition of rapid increase of server pressure, so that server resources are released to ensure normal operation of core tasks. It will be appreciated that when an interface service fails, the computer device needs to downgrade the interface service.
The computing device may calculate the parameter information, and determine an operation manner according to a result of the calculation, and a specific calculation manner is described in detail below, which is not described herein.
Step 103, when the operation mode is to operate the POD corresponding to the interface service, the POD corresponding to the interface service is expanded or contracted.
When the capacity expansion is determined to be needed, the computer equipment can newly establish the POD; when it is determined that the shrink is required, the computer device may delete the already existing POD.
Step 104, when the operation mode is to operate the interface service, degrading the interface service.
When degradation is required, the computer device turns on the degradation switch.
In summary, according to the control method for the interface service provided by the embodiment of the application, the parameter information of the interface service is obtained through the service monitoring system, and then the operation mode of the interface service is determined according to the resource parameter information in the parameter information and the return proportion of the predetermined status code, so that the capacity expansion or the capacity reduction of the POD corresponding to the interface service is automatically realized, resources in the server can be effectively utilized, the resource utilization rate in the server is improved, and the system performance and the reliability are improved; or degrading the interface service automatically, rapidly responding to the problem and repairing the problem in the fault stage, ensuring that the interface service can normally operate, and improving the service operation efficiency and the customer satisfaction.
Referring to fig. 2, a flowchart of a method for controlling an interface service according to an embodiment of the present application is shown, where the method for controlling an interface service may be applied to a computer device. The control method of the interface service can comprise the following steps:
step 201, obtaining parameter information sent by a service monitoring system, wherein the parameter information is obtained by monitoring a docking port service by the service monitoring system, and comprises resource parameter information and a return proportion of a preset status code.
The service monitoring system may be promethaus. The Prometheus is an open-source system monitoring and time sequence database monitoring system, and the performance and health state of the whole system can be monitored through the Prometheus.
In this embodiment, the service monitoring system may monitor the interface service, and periodically send the monitored parameter information to the computer device, where the computer device receives the parameter information. The period of the parameter information may be set according to the service requirement, for example, the period may be 30 seconds, 1 minute, etc.
The resource parameter information may include, but is not limited to: CPU utilization, memory usage, number of TCP connections, network traffic, resource pool capacity.
The predetermined status code may be a 5xx HTTP (Hyper Text Transfer Protocol ) status code. The computer device may count the number of the predetermined status codes and all status codes fed back by the interface service over a period of time, and divide the number of the predetermined status codes by the number of all status codes to obtain a return proportion of the predetermined status codes.
Step 202, determining the operation mode of the interface service according to the parameter information.
The operation mode comprises the expansion or contraction of the POD. Where POD is the smallest deployable unit in Kubernetes, which may also be referred to as a container group. POD represents a stand-alone application running instance in Kubernetes, which may consist of a single container or several containers coupled closely together. It can be understood that when the resources of the interface service occupy more resources, the computer device needs to expand the capacity of the POD; when the resources of the interface service occupy less, the computer device needs to shrink the POD.
When determining whether to expand or contract the POD, the computer device may use a combination algorithm, such as a resource allocation index (RankingAlgorithm), to convert all parameters into scores, and comprehensively consider the importance of each parameter to determine to expand or contract the POD.
Specifically, when judging whether capacity expansion is required, determining an operation mode for the interface service according to the parameter information may include: when the acquisition period of the resource parameter information is a first period, respectively quantizing the average value of each parameter in the resource parameter information in the first period to obtain the score of each parameter; when the total score is greater than or equal to the score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service. The duration of the first period is relatively short, such as 30 seconds, 1 minute, etc.
For each parameter, we can determine its influencing factor and quantify it as a score that can be compared. For example, for parameters such as CPU usage, memory usage, and TCP connection number, it may be considered to compare the value of each parameter with a threshold value, thereby deriving a score. For network traffic, network traffic between nodes may be monitored in real-time to derive a score. For resource pool capacity, the system resource usage can be monitored in real time to derive a score.
After obtaining the score of each parameter, the computer equipment can summarize the scores according to the score and the importance score of each parameter, and if the summarized score is greater than or equal to a score threshold value, the capacity expansion of the POD is determined to be required; if the total score is smaller than the score threshold, it is determined that the POD does not need to be expanded.
Specifically, when determining whether the capacity reduction is required, determining an operation mode for the interface service according to the parameter information may include: when the acquisition period of the resource parameter information is a second period and the second period is larger than the first period, respectively quantizing the maximum value, the upper limit region value and the average value of each parameter in the resource parameter information in the second period to obtain the fraction of each parameter, wherein the upper limit region value is a value of a preset proportion of the values of each parameter which are arranged in the order from large to small and then are selected to be ranked at the front; and when the total score is smaller than the score threshold value, determining that the operation mode is to shrink the POD corresponding to the interface service. Wherein the period of the second period is longer than the period of the first period, such as 1 day, 2 days, etc.
The predetermined proportion corresponding to the upper limit area value may be set according to the service requirement, for example, when the predetermined proportion is set to 95%, the selected upper limit area value may be represented as upper_95.
The quantization mode of the parameters when the computer device determines whether the expansion and the contraction are needed is the same, and detailed description is omitted herein.
After the score of each parameter is obtained, the computer equipment can summarize the score according to the score and the importance score of each parameter, and if the summarized score is smaller than a score threshold value, the POD is determined to be required to be contracted; if the total score is greater than or equal to the score threshold, it is determined that the POD does not need to be scaled.
The method of operation includes degrading the interface service. The degradation refers to policy degradation of some services and pages according to current service conditions and traffic under the condition of rapid increase of server pressure, so that server resources are released to ensure normal operation of core tasks. It will be appreciated that when an interface service fails, the computer device needs to downgrade the interface service.
When judging whether the interface service needs to be degraded, the computer equipment detects whether the return proportion of the preset state code is larger than or equal to a proportion threshold value; if the return proportion of the preset state code is greater than or equal to the proportion threshold value, respectively quantizing the average value of each parameter in the resource parameter information in the first period to obtain the fraction of each parameter; when the total score is greater than or equal to the score threshold, determining that the operation mode is expanding the POD corresponding to the interface service; when the summed score is less than the score threshold, the operational mode is determined to be degrading the interface service.
The proportion threshold may be set according to the service requirement, which is not limited in this embodiment.
When judging whether degradation is needed, the quantization and comparison modes of the parameters by the computer equipment are the same as the modes when judging whether capacity expansion and capacity contraction are needed, and detailed description is given above, and the detailed description is omitted here.
In step 203, when the operation mode is to operate the POD corresponding to the port, the POD corresponding to the port is expanded or contracted.
In this embodiment, the number of PODs is pre-stored in the zookeeper of the SOA architecture, so expanding or shrinking the POD is equivalent to modifying the number of PODs, so that Kubernetes creates or deletes the POD according to the number of PODs.
Specifically, the computer device may obtain the number of PODs configured in the zookeeper of the SOA architecture; if the capacity expansion is needed, increasing the number of PODs by a preset number; if the capacity reduction is required, the number of PODs is subtracted by a predetermined number. The predetermined number may be set according to the service requirement, for example, the predetermined number is 1 or 2.
In the zookeeper, the maximum number and the minimum number of PODs are configured, and the final number of PODs after the expansion and the contraction should be between the maximum number and the minimum number.
After capacity expansion, the newly-built POD needs to be operated for a period of time to play a role in relieving resource occupation, so that the computer equipment can also acquire a preset window duration; starting timing after capacity expansion, and acquiring parameter information sent by the service monitoring system again when the timing duration reaches the window duration; and determining the operation mode of the interface service according to the parameter information. The window duration may be set according to the service requirement, which is not limited in this embodiment.
Step 204, degrading the interface service when the operation mode is the operation of the interface service.
In this embodiment, a degradation switch is preconfigured in the zookeeper of the SOA architecture, and when degradation is required, the computer device may set the on-off state of the degradation switch configured in the zookeeper of the SOA architecture to the on state.
Step 205, detecting whether interface service is available after degradation; after determining that the interface service is available, the interface service is restored.
In this embodiment, the computer may also implement self-healing of the interface service. In particular, the computer device may detect whether an interface service is available after degradation; after determining that the interface service is available, the interface service is restored. When recovery is required, the computer device may set the on-off state of the degradation switch configured in the zookeeper of the SOA architecture to the off state.
Of course, the computer device may additionally set a health status monitoring interface, and detect whether the health status monitoring interface is available after degradation; after determining that the health status monitoring interface is available, the interface is restored to the docking port.
The computer device can analyze the historical data, and when the fact that the occupation of resources is always more in a certain period is analyzed, the POD which can meet the use requirement can be created in advance, so that the maximization of the utilization of the resources is guaranteed. Specifically, the computer device may obtain historical resource parameter information separated from the current time by a predetermined number of days; obtaining a pre-trained prediction model; processing the historical resource parameter information by using a prediction model to obtain predicted resource parameter information at a future moment; and expanding the capacity of the POD corresponding to the interface service according to the predicted resource parameter information. The predetermined number of days may be plural, for example, the predetermined number of days may be 1 st day, 14 th day, 30 th day, or the like from the beginning of the day.
The prediction model may be a machine learning model created based on a prediction algorithm, and is obtained by training the machine learning model by using a training sample. The prediction algorithm may be varied in many ways, for example, a time series prediction algorithm (ARIMA), etc.
In the embodiment, through combining the SOA architecture of the zookeeper, prometheus and Kubernetes, the automatic capacity expansion and contraction of the POD corresponding to the interface service can be realized, and the POD can be automatically degraded and restored when the interface service fails, so that the high availability and service quality of the system are ensured.
In summary, according to the control method for the interface service provided by the embodiment of the application, the parameter information of the interface service is obtained through the service monitoring system, and then the operation mode of the interface service is determined according to the resource parameter information in the parameter information and the return proportion of the predetermined status code, so that the capacity expansion or the capacity reduction of the POD corresponding to the interface service is automatically realized, resources in the server can be effectively utilized, the resource utilization rate in the server is improved, and the system performance and the reliability are improved; or degrading the interface service automatically, rapidly responding to the problem and repairing the problem in the fault stage, ensuring that the interface service can normally operate, and improving the service operation efficiency and the customer satisfaction.
After degradation, whether the interface service is available is detected, and after the interface service is determined to be available, the interface service is recovered, so that the self-healing of the service can be realized, and the availability and the stability of the system are improved.
Referring to fig. 3, a block diagram of an interface service control device according to an embodiment of the present application is shown, where the interface service control device may be applied to a computer device. The control device of the interface service may include:
the acquiring module 310 is configured to acquire parameter information sent by the service monitoring system, where the parameter information is obtained by monitoring the interface service by the service monitoring system, and the parameter information includes resource parameter information and a return proportion of a predetermined status code;
a determining module 320, configured to determine an operation mode for the interface service according to the parameter information;
the expansion and contraction module 330 is configured to expand or contract the POD corresponding to the port when the operation mode is to operate the POD corresponding to the port;
the degradation module 340 is configured to degrade the interface service when the operation mode is to operate the interface service.
In an alternative embodiment, the determining module 320 is further configured to:
when the acquisition period of the resource parameter information is a first period, respectively quantizing the average value of each parameter in the resource parameter information in the first period to obtain the score of each parameter;
when the total score is greater than or equal to the score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service.
In an alternative embodiment, the determining module 320 is further configured to:
when the acquisition period of the resource parameter information is a second period and the second period is larger than the first period, respectively quantizing the maximum value, the upper limit region value and the average value of each parameter in the resource parameter information in the second period to obtain the fraction of each parameter, wherein the upper limit region value is a value of a preset proportion of the values of each parameter which are arranged in the order from large to small and then are selected to be ranked at the front;
and when the total score is smaller than the score threshold value, determining that the operation mode is to shrink the POD corresponding to the interface service.
In an alternative embodiment, the determining module 320 is further configured to:
acquiring a preset window duration;
starting timing after capacity expansion, and acquiring parameter information sent by the service monitoring system again when the timing duration reaches the window duration;
and determining the operation mode of the interface service according to the parameter information.
In an alternative embodiment, the determining module 320 is further configured to:
detecting whether the return proportion of the preset state code is larger than or equal to a proportion threshold value;
if the return proportion of the preset state code is greater than or equal to the proportion threshold value, respectively quantizing the average value of each parameter in the resource parameter information in the first period to obtain the fraction of each parameter;
when the total score is greater than or equal to the score threshold, determining that the operation mode is expanding the POD corresponding to the interface service;
when the summed score is less than the score threshold, the operational mode is determined to be degrading the interface service.
Referring to fig. 4, in an alternative embodiment, the apparatus further includes:
a detection module 350, configured to detect whether an interface service is available after degradation;
and the recovery module 360 is configured to recover the interface service after determining that the interface service is available.
In an alternative embodiment, the expansion and contraction module 330 is further configured to:
acquiring historical resource parameter information of a preset number of days spaced from the current moment;
obtaining a pre-trained prediction model;
processing the historical resource parameter information by using a prediction model to obtain predicted resource parameter information at a future moment;
and expanding the capacity of the POD corresponding to the interface service according to the predicted resource parameter information.
In an alternative embodiment, the expansion and contraction module 330 is further configured to:
acquiring the number of PODs configured in a zookeeper of an SOA architecture;
if the capacity expansion is needed, increasing the number of PODs by a preset number;
if the capacity reduction is required, the number of PODs is subtracted by a predetermined number.
In an alternative embodiment, the downgrade module 340 is further configured to:
the switch state of a degradation switch configured in a zookeeper of the SOA architecture is set to an on state.
In summary, the control device for interface service provided in the embodiment of the present application obtains parameter information of the interface service through the service monitoring system, and then determines an operation mode for the interface service according to the resource parameter information in the parameter information and a return proportion of a predetermined status code, so as to automatically implement capacity expansion or capacity shrinkage for a POD corresponding to the interface service, so that resources in a server can be effectively utilized, resource utilization in the server is improved, and system performance and reliability are improved; or degrading the interface service automatically, rapidly responding to the problem and repairing the problem in the fault stage, ensuring that the interface service can normally operate, and improving the service operation efficiency and the customer satisfaction.
After degradation, whether the interface service is available is detected, and after the interface service is determined to be available, the interface service is recovered, so that the self-healing of the service can be realized, and the availability and the stability of the system are improved.
One embodiment of the present application provides a computer-readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement a method of controlling an interface service as described above.
One embodiment of the present application provides a computer device including a processor and a memory having at least one instruction stored therein, the instruction being loaded and executed by the processor to implement a method of controlling an interface service as described above.
It should be noted that: in the control device for interface service provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the control device for interface service is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the control device for the interface service provided in the above embodiment and the method embodiment for controlling the interface service belong to the same concept, and the specific implementation process is detailed in the method embodiment, which is not repeated here.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description is not intended to limit the embodiments of the present application, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the embodiments of the present application are intended to be included within the scope of the embodiments of the present application.

Claims (11)

1. A method for controlling an interface service, the method comprising:
acquiring parameter information sent by a service monitoring system, wherein the parameter information is obtained by monitoring a port service by the service monitoring system, the parameter information comprises resource parameter information and a return proportion of preset state codes, and the return proportion of the preset state codes is obtained by dividing the number of the preset state codes by the number of all the state codes;
determining an operation mode of the interface service according to the parameter information;
when the operation mode is to operate the POD corresponding to the interface service, expanding or shrinking the POD corresponding to the interface service;
when the operation mode is to operate the interface service, degrading the interface service;
the determining the operation mode of the interface service according to the parameter information comprises the following steps: detecting whether the return proportion of the preset state code is larger than or equal to a proportion threshold value; if the return proportion of the preset state code is greater than or equal to the proportion threshold value, respectively quantizing the average value of each parameter in the resource parameter information in a first period to obtain the fraction of each parameter; when the total score is greater than or equal to a score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service; and when the total score is smaller than a score threshold value, determining that the operation mode is to degrade the interface service.
2. The method for controlling an interface service according to claim 1, wherein determining an operation mode for the interface service according to the parameter information comprises:
when the acquisition period of the resource parameter information is a first period, respectively quantizing the average value of each parameter in the resource parameter information in the first period to obtain the score of each parameter;
and when the total score is greater than or equal to a score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service.
3. The method for controlling an interface service according to claim 2, wherein determining an operation mode for the interface service according to the parameter information comprises:
when the acquisition period of the resource parameter information is a second period and the second period is larger than the first period, respectively quantizing the maximum value, the upper limit region value and the average value of each parameter in the resource parameter information in the second period to obtain the score of each parameter, wherein the upper limit region value is a value of a preset proportion of the first sequence selected after the values of each parameter are arranged in the sequence from large to small;
and when the total score is smaller than a score threshold value, determining that the operation mode is to shrink the POD corresponding to the interface service.
4. The method for controlling an interface service according to claim 2, characterized in that the method further comprises:
acquiring a preset window duration;
starting timing after capacity expansion, and acquiring parameter information sent by the service monitoring system again when the timing duration reaches the window duration;
and determining the operation mode of the interface service according to the parameter information.
5. The method for controlling an interface service according to claim 1, characterized in that the method further comprises:
detecting whether the interface service is available after degradation;
and after determining that the interface service is available, recovering the interface service.
6. The method for controlling an interface service according to any one of claims 1 to 5, further comprising:
acquiring historical resource parameter information of a preset number of days spaced from the current moment;
obtaining a pre-trained prediction model;
processing the historical resource parameter information by using the prediction model to obtain predicted resource parameter information at a future moment;
and expanding the capacity of the POD corresponding to the interface service according to the predicted resource parameter information.
7. The method for controlling an interface service according to claim 1, wherein the expanding or shrinking the POD corresponding to the interface service comprises:
acquiring the number of PODs configured in a zookeeper of an SOA architecture;
if the capacity is required to be expanded, increasing the number of the PODs by a preset number;
and if the capacity reduction is required, subtracting a preset quantity from the quantity of the PODs.
8. The method for controlling an interface service according to claim 1, wherein said degrading the interface service comprises:
the switch state of a degradation switch configured in a zookeeper of the SOA architecture is set to an on state.
9. An interface service control apparatus, the apparatus comprising:
the system comprises an acquisition module, a service monitoring system and a control module, wherein the acquisition module is used for acquiring parameter information sent by the service monitoring system, the parameter information is obtained by monitoring a received service by the service monitoring system, the parameter information comprises resource parameter information and a return proportion of preset state codes, and the return proportion of the preset state codes is obtained by dividing the number of the preset state codes by the number of all the state codes;
the determining module is used for determining the operation mode of the interface service according to the parameter information;
the expansion and contraction module is used for expanding or contracting the capacity of the POD corresponding to the interface service when the operation mode is to operate the POD corresponding to the interface service;
the degradation module is used for degrading the interface service when the operation mode is to operate the interface service;
the determining module is further configured to: detecting whether the return proportion of the preset state code is larger than or equal to a proportion threshold value; if the return proportion of the preset state code is greater than or equal to the proportion threshold value, respectively quantizing the average value of each parameter in the resource parameter information in a first period to obtain the fraction of each parameter; when the total score is greater than or equal to a score threshold, determining that the operation mode is to expand the capacity of the POD corresponding to the interface service; and when the total score is smaller than a score threshold value, determining that the operation mode is to degrade the interface service.
10. A computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the method of controlling an interface service of any of claims 1 to 8.
11. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to implement the method of controlling an interface service of any of claims 1 to 8.
CN202310247114.5A 2023-03-15 2023-03-15 Interface service control method, device, storage medium and equipment Active CN115934479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310247114.5A CN115934479B (en) 2023-03-15 2023-03-15 Interface service control method, device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310247114.5A CN115934479B (en) 2023-03-15 2023-03-15 Interface service control method, device, storage medium and equipment

Publications (2)

Publication Number Publication Date
CN115934479A CN115934479A (en) 2023-04-07
CN115934479B true CN115934479B (en) 2023-07-25

Family

ID=86554569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310247114.5A Active CN115934479B (en) 2023-03-15 2023-03-15 Interface service control method, device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN115934479B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017000589A1 (en) * 2015-06-29 2017-01-05 中兴通讯股份有限公司 Flexible capacity expansion method, apparatus and system
CN108513271A (en) * 2018-06-22 2018-09-07 武汉斑马快跑科技有限公司 Short message distribution method and equipment based on multiple short message channels
CN110597701A (en) * 2019-09-12 2019-12-20 上海道客网络科技有限公司 System and method for scoring health stable operation degree of container cloud platform
CN113282392A (en) * 2021-05-24 2021-08-20 挂号网(杭州)科技有限公司 Interface service calling method and device, electronic equipment and storage medium
CN114461335A (en) * 2021-12-24 2022-05-10 新奥新智科技有限公司 Elastic expansion method, device and equipment for virtual machine and container in cloud computing environment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7661054B2 (en) * 2005-09-30 2010-02-09 Intel Corporation Methods and arrangements to remap degraded storage blocks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017000589A1 (en) * 2015-06-29 2017-01-05 中兴通讯股份有限公司 Flexible capacity expansion method, apparatus and system
CN108513271A (en) * 2018-06-22 2018-09-07 武汉斑马快跑科技有限公司 Short message distribution method and equipment based on multiple short message channels
CN110597701A (en) * 2019-09-12 2019-12-20 上海道客网络科技有限公司 System and method for scoring health stable operation degree of container cloud platform
CN113282392A (en) * 2021-05-24 2021-08-20 挂号网(杭州)科技有限公司 Interface service calling method and device, electronic equipment and storage medium
CN114461335A (en) * 2021-12-24 2022-05-10 新奥新智科技有限公司 Elastic expansion method, device and equipment for virtual machine and container in cloud computing environment

Also Published As

Publication number Publication date
CN115934479A (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN109586952B (en) Server capacity expansion method and device
CN108632365B (en) Service resource adjusting method, related device and equipment
Matos et al. Sensitivity analysis of a hierarchical model of mobile cloud computing
CN107247651B (en) Cloud computing platform monitoring and early warning method and system
CN109308252A (en) A kind of fault location processing method and processing device
CN101408861A (en) Real time monitoring system and method of application program
US11777824B2 (en) Anomaly detection method and apparatus
CN101808351A (en) Method and system for business impact analysis
CN112115031A (en) Cluster state monitoring method and device
CN111176783A (en) High-availability method and device for container treatment platform and electronic equipment
CN112087334A (en) Alarm root cause analysis method, electronic device and storage medium
CN113704018A (en) Application operation and maintenance data processing method and device, computer equipment and storage medium
JP5949785B2 (en) Information processing method, apparatus and program
CN114168375A (en) Method for quickly positioning and eliminating database system abnormity
CN115934479B (en) Interface service control method, device, storage medium and equipment
CN110704223B (en) Recovery system and method for single-node abnormity of database
CN111428356A (en) Maintenance method and system for newly developed degraded equipment
CN111274111A (en) Prediction and anti-aging method for microservice aging
CN112269693B (en) Node self-coordination method, device and computer readable storage medium
CN111694705A (en) Monitoring method, device, equipment and computer readable storage medium
Malefaki et al. Modeling software rejuvenation on a redundant system using Monte Carlo simulation
Koutras et al. Availability and reliability estimation for a system undergoing minimal, perfect and failed rejuvenation
CN112711510A (en) Automatic adaptation method and system for monitoring service continuity operation
CN111400023A (en) Resource pool redundancy rate adjusting method, device, medium and equipment
CN115002042B (en) Special line flow control method and device based on machine learning and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant