CN116185568A - Container expansion method and device, electronic equipment and storage medium - Google Patents

Container expansion method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116185568A
CN116185568A CN202310127740.0A CN202310127740A CN116185568A CN 116185568 A CN116185568 A CN 116185568A CN 202310127740 A CN202310127740 A CN 202310127740A CN 116185568 A CN116185568 A CN 116185568A
Authority
CN
China
Prior art keywords
user request
time period
predicted
medical system
neural network
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.)
Pending
Application number
CN202310127740.0A
Other languages
Chinese (zh)
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.)
Hangzhou Chaohou Information Technology Co ltd
Original Assignee
Hangzhou Chaohou Information 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 Hangzhou Chaohou Information Technology Co ltd filed Critical Hangzhou Chaohou Information Technology Co ltd
Priority to CN202310127740.0A priority Critical patent/CN116185568A/en
Publication of CN116185568A publication Critical patent/CN116185568A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3824Operand accessing
    • G06F9/3826Bypassing or forwarding of data results, e.g. locally between pipeline stages or within a pipeline stage
    • G06F9/3828Bypassing or forwarding of data results, e.g. locally between pipeline stages or within a pipeline stage with global bypass, e.g. between pipelines, between clusters
    • 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

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The application provides a container expansion method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a time period to be predicted; inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted; determining the number of containers of the medical system in a period to be predicted according to the obtained target user request quantity; and expanding the capacity according to the determined number of the containers. According to the method and the device, the attention mechanism module can be introduced into the prediction model, the user request quantity changing along with the time period in the medical system can be accurately processed, the number of containers with the required expansion of the medical system can be further effectively predicted, and the high availability of the medical system is ensured.

Description

Container expansion method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a container expansion method, a device, an electronic apparatus, and a storage medium.
Background
With the continuous maturity of cloud computing technology, container technology gradually becomes a development hot spot in the industry, and each mainstream cloud computing platform provides container services. Kubernetes is an open source platform for realizing container management, is used for automatically deploying, expanding and managing containers, is used for managing the life cycle of the containers in the cluster, and combines the health check and error recovery mechanisms of the Kubernetes to realize the high availability of the containers in the cluster. The medical system has the characteristics of large daytime access quantity and small nighttime access quantity, so that the medical system is suitable for the real-time expansion of the containers of the medical system, and the high availability of the medical system is also a concern.
In the existing container expansion method, the neural network model is used for predicting the number of containers to realize expansion, but because the user request quantity of the medical system has a request quantity peak value along with the change of time, the existing neural network model is insensitive to the data change of the medical system, so that the prediction result is inaccurate, and finally, the high availability of the medical system is difficult to ensure.
Disclosure of Invention
In view of this, an object of the present application is to provide a container expansion method, apparatus, electronic device, and storage medium, which can introduce an attention mechanism module into a prediction model, and can accurately process a user request amount changing with time in a medical system, so as to effectively predict the number of containers required to be expanded in the medical system, and ensure high availability of the medical system.
In a first aspect, embodiments of the present application provide a container expansion method, applied to a medical system, the method including:
acquiring a time period to be predicted;
inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted;
determining the number of containers of the medical system in the period to be predicted according to the obtained target user request quantity;
and expanding the capacity according to the determined number of the containers.
In an alternative embodiment of the present application, the prediction model includes a neural network model and an attention mechanism module connected in sequence, and the prediction model with the attention mechanism module is trained by:
acquiring user request quantity samples of the medical system in a plurality of divided unit historical time periods;
inputting a user request amount sample in each divided unit historical time period into a neural network model and an attention mechanism module which are connected in sequence for training to obtain a trained prediction model with the attention mechanism module; the attention mechanism module is used for processing the initial user request quantity output by the neural network model to obtain a target user request quantity.
In an optional embodiment of the present application, the attention mechanism module is configured to process an initial user request amount output by the neural network model to obtain a target user request amount by:
acquiring a first model weight of the neural network model and a second model weight of a prediction model with an attention mechanism module;
determining a first calculation result corresponding to each divided unit historical time period according to the initial user request quantity and the first model weight in each divided unit historical time period obtained by the neural network model;
normalizing the first calculation result corresponding to each divided unit historical time period to obtain a second calculation result corresponding to each divided unit historical time period;
and carrying out weighted summation on the second calculation result corresponding to each divided unit historical time period and the second model weight to obtain the target user request quantity.
In an alternative embodiment of the present application, the neural network model includes a forgetting gate:
f t =σ(W f ·[h t-1 ,X t ]+f bias );
wherein f bias Indicating forgetting deviation, initializing to 1; sigma () is a sigmoid activation function; w (W) f A weight coefficient indicating the forgetting gate, h t-1 Representing the output of the hidden layer at the previous moment in the neural network model, X t Representing the unit history time divided by a plurality ofInput feature vector constructed by segment [ h ] t-1 ,X t ]Representing the dot product of the output of the hidden layer at the previous time and the input feature vector.
In an optional embodiment of the present application, the neural network model further includes two full-connection layers, where the two full-connection layers are used to output a one-dimensional target user request amount.
In an alternative embodiment of the present application, the step of determining the number of containers of the medical system in the period to be predicted according to the obtained user request amount includes:
and smoothing the obtained user request quantity by using a smoothing function to obtain the number of containers of the medical system in the time period to be predicted.
In an alternative embodiment of the present application, the smoothing function includes:
min(max_container,max(min_container,smooth_factor*request));
wherein, min () represents taking a minimum function, max () represents taking a maximum function, max_container represents the maximum container number, min_container represents the minimum container number, smooth_factor represents a smoothing factor, and request represents a user request amount obtained through a prediction model.
In a second aspect, embodiments of the present application further provide a container expansion device for use in a medical system, the device comprising:
the time period acquisition module is used for acquiring a time period to be predicted;
the request quantity prediction module is used for inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted;
the quantity determining module is used for determining the quantity of the containers of the medical system in the time period to be predicted according to the obtained target user request quantity;
and the system capacity expansion module is used for carrying out capacity expansion according to the determined number of the containers.
In a third aspect, embodiments of the present application further provide an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the container expansion method as described above.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a container expansion method as described above.
The embodiment of the application provides a container expansion method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a time period to be predicted; inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted; determining the number of containers of the medical system in a period to be predicted according to the obtained target user request quantity; and expanding the capacity according to the determined number of the containers. According to the method and the device, the attention mechanism module can be introduced into the prediction model, the user request quantity changing along with the time period in the medical system can be accurately processed, the number of containers with the required expansion of the medical system can be further effectively predicted, and the high availability of the medical system is ensured.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a container expansion method according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a prediction model according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a forgetting gate in a neural network model according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a container expansion device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an 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 clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. Based on the embodiments of the present application, every other embodiment that a person skilled in the art would obtain without making any inventive effort is within the scope of protection of the present application.
First, application scenarios applicable to the present application will be described. With the continuous maturity of cloud computing technology, container technology gradually becomes a development hot spot in the industry, and each mainstream cloud computing platform provides container services. Kubernetes is an open source platform for realizing container management, is used for automatically deploying, expanding and managing containers, is used for managing the life cycle of the containers in the cluster, and combines the health check and error recovery mechanisms of the Kubernetes to realize the high availability of the containers in the cluster. The medical system has the characteristics of large daytime access quantity and small nighttime access quantity, so that the medical system is suitable for the real-time expansion of the containers of the medical system, and the high availability of the medical system is also a concern.
In the existing container expansion method, the neural network model is used for predicting the number of containers to realize expansion, but because the user request quantity of the medical system has a request quantity peak value along with the change of time, the existing neural network model is insensitive to the data change of the medical system, so that the prediction result is inaccurate, and finally, the high availability of the medical system is difficult to ensure.
Based on this, the embodiment of the application provides a container expansion method, a device, an electronic device and a storage medium, which can introduce an attention mechanism module into a prediction model, and can accurately process the user request quantity changing along with the time period in a medical system, so as to effectively predict the number of containers required to be expanded by the medical system and ensure the high availability of the medical system.
Referring to fig. 1, fig. 1 is a flowchart of a container expansion method according to an embodiment of the present application. As shown in fig. 1, a container expansion method provided in an embodiment of the present application includes:
s101, acquiring a time period to be predicted;
s102, inputting a time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted;
s103, determining the number of containers of the medical system in a period to be predicted according to the obtained target user request quantity;
and S104, expanding the capacity according to the determined number of the containers.
The following is an exemplary explanation of the above steps S101 to S104:
in step S101, the period to be predicted refers to an arbitrary period of time during which the user accesses the medical system. Preferably, the period to be predicted is a hot period of time during which the user accesses the medical system, such as a period of time from 8 pm to 7 pm. Specifically, the time period to be predicted may be divided in units of hours, resulting in a unit time period. The period of time, e.g., 8 a.m. day to 7 a.m. night, may be divided into 11 unit periods of time.
In step S102, the input of the prediction model with the attention mechanism module is the period to be predicted, and the output is the target user request amount of the medical system in the period to be predicted.
In the embodiment of the application, the prediction model comprises a neural network model and an attention mechanism module which are sequentially connected, and the prediction model with the attention mechanism module is trained through the following steps:
acquiring user request quantity samples of the medical system in a plurality of divided unit historical time periods;
inputting a user request amount sample in each divided unit historical time period into a neural network model and an attention mechanism module which are connected in sequence for training to obtain a trained prediction model with the attention mechanism module; the attention mechanism module is used for processing the initial user request quantity output by the neural network model to obtain a target user request quantity.
In the above step, the plurality of divided unit history periods refer to unit history periods divided in units of hours, each unit history period corresponding to one user request amount sample.
Here, the initial learning rate of the prediction model is 0.01, the decay period is 20 epochs by adopting the learning rate decay method of cosine annealing, and the lowest learning rate is 0.0005. The training period was 90 epochs, the batch size was 32, the weight decay was 0.0005, and the dropout ratio was 0.5. And optimizing the trained prediction model by using the verification set.
The attention mechanism module is connected to the back of the neural network model, and can weight the initial user request quantity output by the neural network model to obtain a target user request quantity, so that the predicted target user request quantity is more accurate.
For example, as shown in fig. 2, the prediction model 200 includes a neural network model 201 and an attention mechanism module 202 connected in sequence, where input X represents a period to be predicted, and output Y represents a target user request amount.
In the related scheme, due to the characteristics of large daytime access quantity, small nighttime access quantity and periodic access peak value of the medical system, the common neural network model is insensitive to sudden user request quantity, so that the peak value cannot be accurately predicted. In order to solve the problem, the embodiment of the application introduces an attention mechanism module, and the attention mechanism module can carry out weighted recording on peak request amounts, so that the sensitivity of a prediction model to the peak request amounts is improved, and the accuracy and the robustness of the model are further improved.
Specifically, the attention mechanism module is configured to process an initial user request amount output by the neural network model to obtain a target user request amount by:
acquiring a first model weight of the neural network model and a second model weight of the prediction model with the attention mechanism module;
determining a first calculation result corresponding to each divided unit historical time period according to the initial user request quantity and the first model weight in each divided unit historical time period obtained by the neural network model;
normalizing the first calculation result corresponding to each divided unit historical time period to obtain a second calculation result corresponding to each divided unit historical time period;
and carrying out weighted summation on the second calculation result corresponding to each divided unit historical time period and the second model weight to obtain the target user request quantity.
Because the attention mechanism module is connected behind the neural network model, the attention mechanism module can weight the result (initial user request quantity) output by the neural network model, so that the predicted target user request quantity is more accurate.
In a related scheme, because the neural network model is more difficult to converge due to the introduction of the attention mechanism module, in order to solve the problem of network convergence, the embodiment of the application proposes to introduce a forgetting deviation module, and the deviation is helpful for the neural network model to save more information, and is helpful for better gradient flow during training.
Specifically, the neural network model includes a forgetting gate:
f t =σ(W f ·[h t-1 ,X t ]+f bias );
wherein f bias Indicating forgetting deviation, initializing to 1; sigma () is a sigmoid activation function; w (W) f A weight coefficient indicating the forgetting gate, h t-1 Representing the output of the hidden layer at the previous moment in the neural network model, X t Representing an input feature vector constructed from a plurality of divided unit history time periods, [ h ] t-1 ,X t ]Representing the dot product of the output of the hidden layer at the previous time and the input feature vector.
Here, f bias Is a trainable neural network parameter for forgetting deviation.
For example, as shown in FIG. 3, FIG. 3 is a schematic diagram of a forgetting gate in a neural network model, X t Representing an input feature vector constructed from a plurality of divided unit history time segments, h t-1 The output of the hidden layer at the previous moment in the neural network model is represented and processed according to the flow sequence shown in figure 3 to obtain f t ,f t Representing a forgetting gate for controlling the loss rate of memory storage.
In addition, in the embodiment of the application, the training neural network model adopts an Adam optimization algorithm to update the network weight and deviation and the sampling time interval according to the gradient of the loss function.
By the method, after the attention mechanism module is introduced, the forgetting deviation module is introduced, so that the problem that the neural network model is difficult to converge can be avoided, the lstm network is helped to store more information, the gradient is helped to flow better during training, and the accuracy of the prediction model is further improved.
In the related scheme, since the original LSTM network result cannot be directly used as a time sequence prediction result, in order to perform time sequence prediction, two full-connection layers are connected behind the LSTM, so that time sequence prediction can be performed, meanwhile, in order to improve the operation efficiency and reduce the prediction time, the final output vector is changed into 1 dimension.
Specifically, the neural network model further comprises two full-connection layers, and the two full-connection layers are used for outputting one-dimensional target user request quantity. Wherein the two fully connected layers are connected in a matrix multiplication manner.
In step S103, the number of containers of the medical system in the period to be predicted may be determined by a smoothing function according to the obtained target user request amount.
Specifically, the obtained user request quantity is smoothed by using a smoothing function, and the number of containers of the medical system in the period to be predicted is obtained.
Wherein the smoothing function comprises:
min(max_container,max(min_container,smooth_factor*request));
min () represents a minimum function, max () represents a maximum function, max_container represents a maximum number of containers, min_container represents a minimum number of containers, smooth_factor represents a smoothing factor, and request represents a user request amount obtained by a prediction model.
Here, the smoothing factor is empirically obtained, typically 0.025, and can be adjusted according to the system scale.
Specifically, since the LSTM network prediction result has jump, if the result is directly used, the expansion and contraction capacity is too frequent, which causes unstable system and wastes resources, so that a smoothing function is added to make the expansion and contraction as smooth as possible.
According to the embodiment of the application, the future flow of the visiting medical system is predicted by using the prediction model with the attention mechanism module, the number of containers is calculated in advance to automatically expand the capacity, the data can be utilized as much as possible, the data scale is improved, and the model robustness is improved.
In the embodiment of the application, the containers are expanded by kubernetes, and the number of the containers is made to enter a small stable period, and the containers are not stretched in the stable period. This stabilization period ensures that the container expands, and the amount of expansion changes again during the period from when the container actually begins to operate, resulting in instability of the system.
After the container expands, the whole expansion service enters a stable period, so that the stability of the system during the expansion period is improved.
The container expansion method provided by the embodiment of the application can be optimized according to the characteristics of a medical system, and a attention mechanism module is introduced, so that the problem that the traditional lstm is not sensitive enough to peak data can be effectively solved, a deep learning network is built, and the deep learning network is trained to obtain a deep learning model. The model can predict the user request quantity in a future period, the algorithm calculates the number of containers in a future period according to the predicted value, the number of the containers is smoothed, and capacity expansion is completed by using kubernetes, so that the overall usability of the system is improved.
Based on the same inventive concept, the embodiment of the present application further provides a container expansion device corresponding to the container expansion method, and since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the container expansion method in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and the repetition is omitted.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a container expansion device according to an embodiment of the present disclosure. As shown in fig. 4, the apparatus 400 includes:
a time period obtaining module 401, configured to obtain a time period to be predicted;
the request quantity prediction module 402 is configured to input a time period to be predicted into a prediction model with an attention mechanism module, so as to obtain a target user request quantity of the medical system in the time period to be predicted;
a quantity determining module 403, configured to determine, according to the obtained target user request quantity, a quantity of containers of the medical system in a time period to be predicted;
and the system capacity expansion module 404 is configured to perform capacity expansion according to the determined number of containers.
In an alternative embodiment of the present application, the prediction model includes a neural network model and an attention mechanism module connected in sequence, and the request amount prediction module 402 is configured to train the prediction model with the attention mechanism module by:
acquiring user request quantity samples of the medical system in a plurality of divided unit historical time periods;
inputting a user request amount sample in each divided unit historical time period into a neural network model and an attention mechanism module which are connected in sequence for training to obtain a trained prediction model with the attention mechanism module; the attention mechanism module is used for processing the initial user request quantity output by the neural network model to obtain a target user request quantity.
In an alternative embodiment of the present application, the attention mechanism module is configured to process the initial user request amount output by the neural network model to obtain the target user request amount by:
acquiring a first model weight of the neural network model and a second model weight of the prediction model with the attention mechanism module;
determining a first calculation result corresponding to each divided unit historical time period according to the initial user request quantity and the first model weight in each divided unit historical time period obtained by the neural network model;
normalizing the first calculation result corresponding to each divided unit historical time period to obtain a second calculation result corresponding to each divided unit historical time period;
and carrying out weighted summation on the second calculation result corresponding to each divided unit historical time period and the second model weight to obtain the target user request quantity.
In an alternative embodiment of the present application, the neural network model includes a forgetting gate:
f t =σ(W f ·[h t-1 ,X t ]+f bias );
wherein f bias Indicating forgetting deviation, initializing to 1; sigma () is a sigmoid activation function; w (W) f A weight coefficient indicating the forgetting gate, h t-1 Representing the output of the hidden layer at the previous moment in the neural network model, X t Representing an input feature vector constructed from a plurality of divided unit history time periods, [ h ] t-1 ,X t ]Representing the dot product of the output of the hidden layer at the previous time and the input feature vector.
In an alternative embodiment of the present application, the neural network model further includes two fully connected layers, and the two fully connected layers are used for outputting the one-dimensional target user request quantity.
In an alternative embodiment of the present application, the number determination module 403 is specifically configured to: and smoothing the obtained user request quantity by using a smoothing function to obtain the number of containers of the medical system in the period to be predicted.
In an alternative embodiment of the present application, the smoothing function comprises:
min(max_container,max(min_container,smooth_factor*request));
wherein, min () represents taking a minimum function, max () represents taking a maximum function, max_container represents the maximum container number, min_container represents the minimum container number, smooth_factor represents a smoothing factor, and request represents a user request amount obtained through a prediction model.
The container capacity expansion device provided by the embodiment of the application can acquire the time period to be predicted; inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted; determining the number of containers of the medical system in a period to be predicted according to the obtained target user request quantity; and expanding the capacity according to the determined number of the containers. According to the method and the device, the attention mechanism module can be introduced into the prediction model, the user request quantity changing along with the time period in the medical system can be accurately processed, the number of containers with the required expansion of the medical system can be further effectively predicted, and the high availability of the medical system is ensured.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
The memory 520 stores machine-readable instructions executable by the processor 510, and when the electronic device 500 is running, the processor 510 communicates with the memory 520 through the bus 530, and when the machine-readable instructions are executed by the processor 510, the steps of the container expansion method in the method embodiment shown in fig. 1 can be executed, and the specific implementation can be referred to the method embodiment and will not be described herein.
The embodiment of the present application further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the container expansion method in the embodiment of the method shown in fig. 1 may be executed, and a specific implementation manner may refer to the method embodiment and will not be described herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present application, and are not intended to limit the scope of the present application, but the present application is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, the present application is not limited thereto. Any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or make equivalent substitutions for some of the technical features within the technical scope of the disclosure of the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A container expansion method for use in a medical system, the method comprising:
acquiring a time period to be predicted;
inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted;
determining the number of containers of the medical system in the period to be predicted according to the obtained target user request quantity;
and expanding the capacity according to the determined number of the containers.
2. The method of claim 1, wherein the predictive model comprises a neural network model and an attention mechanism module connected in sequence, the predictive model with the attention mechanism module being trained by:
acquiring user request quantity samples of the medical system in a plurality of divided unit historical time periods;
inputting a user request amount sample in each divided unit historical time period into a neural network model and an attention mechanism module which are connected in sequence for training to obtain a trained prediction model with the attention mechanism module; the attention mechanism module is used for processing the initial user request quantity output by the neural network model to obtain a target user request quantity.
3. The method according to claim 2, wherein the attention mechanism module is configured to process the initial user request amount output by the neural network model to obtain the target user request amount by:
acquiring a first model weight of the neural network model and a second model weight of a prediction model with an attention mechanism module;
determining a first calculation result corresponding to each divided unit historical time period according to the initial user request quantity and the first model weight in each divided unit historical time period obtained by the neural network model;
normalizing the first calculation result corresponding to each divided unit historical time period to obtain a second calculation result corresponding to each divided unit historical time period;
and carrying out weighted summation on the second calculation result corresponding to each divided unit historical time period and the second model weight to obtain the target user request quantity.
4. The method of claim 2, wherein the neural network model comprises a forgetting gate:
f t =σ(W f ·[h t-1 ,X t ]+f bias );
wherein f bias Indicating forgetting deviation, initializing to 1; sigma () is a sigmoid activation function; w (W) f A weight coefficient indicating the forgetting gate, h t-1 Representing the output of the hidden layer at the previous moment in the neural network model, X t Representing an input feature vector constructed from a plurality of divided unit history time periods, [ h ] t-1 ,X t ]Representing the dot product of the output of the hidden layer at the previous time and the input feature vector.
5. The method of claim 2, wherein the neural network model further comprises two fully connected layers for outputting one-dimensional target user request amounts.
6. The method of claim 1, wherein the step of determining the number of containers of the medical system during the period of time to be predicted based on the resulting user request comprises:
and smoothing the obtained user request quantity by using a smoothing function to obtain the number of containers of the medical system in the time period to be predicted.
7. The method of claim 6, wherein the smoothing function comprises:
min(max_container,max(min_container,smooth_factor*request));
wherein, min () represents taking a minimum function, max () represents taking a maximum function, max_container represents the maximum container number, min_container represents the minimum container number, smooth_factor represents a smoothing factor, and request represents a user request amount obtained through a prediction model.
8. A container expansion device for use in a medical system, the device comprising:
the time period acquisition module is used for acquiring a time period to be predicted;
the request quantity prediction module is used for inputting the time period to be predicted into a prediction model with an attention mechanism module to obtain a target user request quantity of the medical system in the time period to be predicted;
the quantity determining module is used for determining the quantity of the containers of the medical system in the time period to be predicted according to the obtained target user request quantity;
and the system capacity expansion module is used for carrying out capacity expansion according to the determined number of the containers.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, performs the steps of the method according to any of claims 1 to 7.
CN202310127740.0A 2023-02-01 2023-02-01 Container expansion method and device, electronic equipment and storage medium Pending CN116185568A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310127740.0A CN116185568A (en) 2023-02-01 2023-02-01 Container expansion method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310127740.0A CN116185568A (en) 2023-02-01 2023-02-01 Container expansion method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116185568A true CN116185568A (en) 2023-05-30

Family

ID=86445808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310127740.0A Pending CN116185568A (en) 2023-02-01 2023-02-01 Container expansion method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116185568A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117170821A (en) * 2023-11-01 2023-12-05 建信金融科技有限责任公司 Service processing method, device, electronic equipment and computer readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117170821A (en) * 2023-11-01 2023-12-05 建信金融科技有限责任公司 Service processing method, device, electronic equipment and computer readable medium
CN117170821B (en) * 2023-11-01 2024-02-09 建信金融科技有限责任公司 Service processing method, device, electronic equipment and computer readable medium

Similar Documents

Publication Publication Date Title
CN110651280B (en) Projection neural network
KR102170105B1 (en) Method and apparatus for generating neural network structure, electronic device, storage medium
EP3446260B1 (en) Memory-efficient backpropagation through time
US11200511B1 (en) Adaptive sampling of training data for machine learning models based on PAC-bayes analysis of risk bounds
US20180150783A1 (en) Method and system for predicting task completion of a time period based on task completion rates and data trend of prior time periods in view of attributes of tasks using machine learning models
US10922611B2 (en) Neural network optimizer search
CN108399564B (en) Credit scoring method and device
US11348572B2 (en) Speech recognition method and apparatus
US7058550B2 (en) Selectively resampling particle filter
EP3474274A1 (en) Speech recognition method and apparatus
US11494699B2 (en) Automatic machine learning feature backward stripping
CN110764714B (en) Data processing method, device and equipment and readable storage medium
US11763151B2 (en) System and method for increasing efficiency of gradient descent while training machine-learning models
CN116185568A (en) Container expansion method and device, electronic equipment and storage medium
CN112990958A (en) Data processing method, data processing device, storage medium and computer equipment
CN111832693B (en) Neural network layer operation and model training method, device and equipment
US20230128579A1 (en) Generative-discriminative ensemble method for predicting lifetime value
CN115545168A (en) Dynamic QoS prediction method and system based on attention mechanism and recurrent neural network
CN115761429A (en) Vehicle track prediction method and device, and track prediction model training method and device
Santner et al. Some criterion-based experimental designs
IL294712A (en) Learning with moment estimation using different time constants
Khan et al. Cloud storage tier optimization through storage object classification
He et al. A method to cloud computing resources requirement prediction on SaaS application
CN117808040B (en) Method and device for predicting low forgetting hot events based on brain map
US12050995B2 (en) System and method for increasing efficiency of gradient descent while training machine-learning models

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