CN113268290A - Software container optimization method, device, equipment and computer program product - Google Patents
Software container optimization method, device, equipment and computer program product Download PDFInfo
- Publication number
- CN113268290A CN113268290A CN202110669181.7A CN202110669181A CN113268290A CN 113268290 A CN113268290 A CN 113268290A CN 202110669181 A CN202110669181 A CN 202110669181A CN 113268290 A CN113268290 A CN 113268290A
- Authority
- CN
- China
- Prior art keywords
- condition
- software container
- checking unit
- abnormal
- condition checking
- 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.)
- Granted
Links
- 238000005457 optimization Methods 0.000 title claims abstract description 75
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000004590 computer program Methods 0.000 title claims abstract description 11
- 230000002159 abnormal effect Effects 0.000 claims abstract description 210
- 238000012795 verification Methods 0.000 claims description 27
- 239000002699 waste material Substances 0.000 abstract description 10
- 230000008569 process Effects 0.000 description 13
- 238000004891 communication Methods 0.000 description 6
- 238000003860 storage Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 3
- 238000012827 research and development Methods 0.000 description 3
- 239000002131 composite material Substances 0.000 description 2
- 235000010627 Phaseolus vulgaris Nutrition 0.000 description 1
- 244000046052 Phaseolus vulgaris Species 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
- G06F9/4491—Optimising based on receiver type
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a software container optimization method, which comprises the following steps: respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container; if a first target abnormal frequency greater than a first preset frequency exists in each first abnormal frequency, determining a target abnormal condition checking unit corresponding to the first target abnormal frequency; adjusting the order of the target abnormal condition checking unit in the condition relation chain of the software container so that the target abnormal condition checking unit is in the front of the condition relation chain. The invention also discloses a software container optimization device, equipment and a computer program product. The invention can avoid the condition checking unit before the condition checking unit in the condition relation chain from being executed inefficiently, thereby reducing the invalid execution of the condition checking unit in the software container, avoiding the waste of the running resources of the server and improving the resource utilization rate of the server.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer program product for optimizing a software container.
Background
In the current internet technology, a "software container" contains an abstract concept of a complete software runtime environment, and the technology containerizes software applications, dependencies and the like, encapsulates all relevant details necessary for running application programs, breaks away from direct relevance of environmental factors such as systems, versions and the like, and has great convenience and good performance for software development, production deployment, online running and the like. Since birth to now, the application range of software containers is very wide, such as RPC interfaces, WEB platforms and other types of applications, and the current mainstream research and development framework basically uses software container concepts and technologies for architecture design and research and development. In the software container, the software container object bean provides service functions in the form of unit individuals in the software container, and is an entity which only exists in a physical memory of the server and provides the service functions in the software container.
Generally, the software container object is created and assembled by the software container following the creation of the software container, and exists in the physical memory for a long time and continuously provides business services to the outside. In a normal business process, the software container object can be optimized to a certain extent through the writing of codes in the research and development stage of a project. However, for the software container object with the condition checking function, when any condition checking unit in the software container object is abnormal continuously, the service function cannot provide normal service continuously, and all the condition checking units before the condition unit in the software container object running process lose running significance even if running normally, and become 'invalid running', which results in waste of server running resources.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a software container optimization method, a software container optimization device, software container optimization equipment and a computer program product, and aims to solve the technical problem that server operation resources are wasted due to a condition checking unit in the existing software container.
In order to achieve the above object, the present invention provides a software container optimization method, including the following steps:
respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container;
if a first target abnormal frequency greater than a first preset frequency exists in each first abnormal frequency, determining a target abnormal condition checking unit corresponding to the first target abnormal frequency;
adjusting the order of the target abnormal condition checking unit in the condition relation chain of the software container so that the target abnormal condition checking unit is in the front of the condition relation chain.
Further, the step of adjusting the order of the target abnormal condition checking unit in the condition relation chain of the software container so that the target abnormal condition checking unit is at the front of the condition relation chain includes
Determining whether the condition relation chain has a relevant condition checking unit corresponding to the target abnormal condition checking unit;
if the target abnormal condition is not existed, adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be positioned at the front of the condition relation chain;
and if the relevant condition checking unit exists, taking the relevant condition checking unit and the target abnormal condition checking unit as a unit to be adjusted as a whole, and adjusting the sequence of the unit to be adjusted as a whole in the condition relation chain so that the target abnormal condition checking unit is positioned in the front of the condition relation chain.
Further, the software container optimization method further includes:
regularly determining whether the first abnormal times have abnormal times larger than the first preset times at intervals of a first preset time length;
if not, resetting each first abnormal frequency.
Further, the software container optimization method further includes:
when the verification of each condition checking unit in the software container is completed, determining whether an interface calling exception exists in a downstream external interface;
if the interface calling is abnormal, updating a second abnormal frequency corresponding to the downstream external interface;
and if the second abnormal frequency is greater than a second preset frequency, adding an unexecutable marking unit in the front row of the condition relation chain.
Further, the software container optimization method further includes:
regularly determining whether the second abnormal times are greater than a second preset times at intervals of a second preset time length;
and if the second abnormal times are less than or equal to second preset times, resetting each second abnormal time.
Further, before the step of updating the first abnormal times corresponding to each condition checking unit in the software container object respectively based on the current checking information of each condition checking unit in the software container, the software container optimization method further includes:
when the software container is created, setting a plurality of condition checking units in the software container object based on the configuration information of the software container, and determining the condition relation chain based on each condition checking unit;
and when the call request is received, verifying each condition checking unit in the software container object to obtain the current verification information of each condition checking unit.
Further, the software container optimization method further includes:
regularly resetting the first abnormal times and second abnormal times corresponding to a downstream external interface at intervals of a third preset time length;
determining whether an abnormal condition checking unit and/or a marking unit exists in the front row of the condition relation chain;
and if the condition verification units exist, restoring the condition relation chain according to the initial sequence of the condition verification units in the condition relation chain, and/or deleting the marking units in the condition relation chain.
In addition, to achieve the above object, the present invention further provides a software container optimization apparatus, including:
the updating module is used for respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container;
the determining module is used for determining a target abnormal condition checking unit corresponding to the first target abnormal times if the first target abnormal times which are greater than a first preset times exist in the first abnormal times;
and the adjusting module is used for adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be positioned at the front of the condition relation chain.
In addition, to achieve the above object, the present invention also provides a software container optimization apparatus, including: a memory, a processor and a software container optimization program stored on the memory and executable on the processor, the software container optimization program when executed by the processor implementing the steps of the aforementioned software container optimization method.
Furthermore, to achieve the above object, the present invention also provides a computer program product comprising a computer program, which when executed by a processor, implements the steps of the aforementioned software container optimization method.
Respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container; then, if a first target abnormal frequency which is greater than a first preset frequency exists in each first abnormal frequency, determining a target abnormal condition checking unit corresponding to the first target abnormal frequency; and then adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be in the front row of the condition relation chain, adjusting the continuously abnormal condition checking unit to the front row of the condition relation chain through a quantitative triggering mechanism, enabling a subsequent application party to execute the target abnormal condition checking unit at the first time, and avoiding invalid execution of the condition checking unit in the condition relation chain before the condition checking unit when the target abnormal condition checking unit is abnormal again, thereby reducing invalid execution of the condition checking unit in the software container, avoiding waste of running resources of a server and improving the resource utilization rate of the server.
Drawings
FIG. 1 is a schematic diagram of a software container optimization device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a software container optimization method according to the present invention;
FIG. 3 is a diagram illustrating a conditional relationship chain according to an embodiment of the software container optimization method of the present invention;
fig. 4 is a functional block diagram of an embodiment of the software container optimization apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a software container optimization device in a hardware operating environment according to an embodiment of the present invention.
The software container optimization device of the embodiment of the invention can be a PC. As shown in fig. 1, the software container optimization apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the software container optimization device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Of course, the software container optimization device may also be configured with other sensors such as barometer, hygrometer, thermometer, infrared sensor, etc., which are not described herein again.
Those skilled in the art will appreciate that the terminal architecture shown in fig. 1 does not constitute a limitation of the software container optimization apparatus and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a software container optimization program therein.
In the software container optimization device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and processor 1001 may be used to invoke a software container optimizer stored in memory 1005.
In this embodiment, the software container optimization apparatus includes: the system comprises a memory 1005, a processor 1001 and a software container optimization program stored on the memory 1005 and capable of running on the processor 1001, wherein when the processor 1001 calls the software container optimization program stored in the memory 1005, the steps of the software container optimization method in each embodiment are executed.
The invention also provides a software container optimization method, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the software container optimization method of the invention.
In this embodiment, the software container optimization method includes the following steps:
step S101, respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container;
in this embodiment, after the condition checking units are created, a condition relation chain is obtained according to the execution sequence of each condition checking unit, the sequence of the condition checking units without the execution sequence can be set arbitrarily in the condition relation chain, and a plurality of condition checking units with business relation are set in the condition relation chain according to the sequence of business relation.
In this embodiment, when an application side calls a software container, condition checking units in each object of the software container are sequentially checked to obtain checking information, where the checking information includes checking results of each condition checking unit, such as checking abnormal information, and then, based on current checking information of each condition checking unit in the software container, first abnormal times corresponding to each condition checking unit in the software container object are respectively updated, specifically, it is determined whether checking abnormal information exists in the checking information, if so, an abnormal condition checking unit corresponding to the checking abnormal information is obtained, the first abnormal times corresponding to each abnormal condition checking unit are updated, that is, the first abnormal times corresponding to each abnormal condition checking unit is added by 1 to obtain updated first abnormal times, and for the condition checking unit that is checked this time to be normal, keeping its current first number of anomalies.
In another embodiment, if the check information does not include the check abnormality information, the step S101 is not executed.
Step S102, if a first target abnormal frequency which is greater than a first preset frequency exists in each first abnormal frequency, determining a target abnormal condition checking unit corresponding to the first target abnormal frequency;
in this embodiment, after the first abnormal times are updated, whether a first target abnormal time greater than a first preset time exists in each first abnormal time is determined, and if yes, a target abnormal condition checking unit corresponding to the first target abnormal time is obtained.
The first preset number of times may be set reasonably, for example, the first preset number of times may be set to 5, 8, 10, and so on.
Step S103, adjusting the order of the target abnormal condition checking unit in the condition relation chain of the software container so that the target abnormal condition checking unit is in the front of the condition relation chain.
In the present embodiment, after the target abnormal condition verifying unit is obtained, the order of the target abnormal condition verifying unit is adjusted in the condition relation chain of the software container so that the target abnormal condition verifying unit is in the front of the condition relation chain, specifically, the target abnormal condition verifying unit is adjusted to the head of the condition relation chain, and if a plurality of target abnormal condition verifying units are present, any one of the target abnormal condition verifying units may be adjusted to the head of the condition relation chain, or all of the target abnormal condition verifying units may be adjusted to the head of the condition relation chain, and the order of the target abnormal condition verifying units is not limited.
It is easy to understand that through a quantitative triggering mechanism, the container object can realize performance optimization under an abnormal state for a specific application party and even a global application party, so that the application party can immediately know the failure reason of the service at the first time, judge that the specific application party and even the global application party are 'unavailable' within a certain time, reduce invalid execution of a condition checking unit in a software container, and reduce waste of physical server resources.
In the embodiment, an application side calls container objects, and starts to check in sequence according to condition checking units in the container objects, and if checking exception occurs in the checking process, the corresponding condition checking units send information to a feedback module; the feedback module sends the abnormal verification information in the container object to the statistical module, and the statistical module updates the first abnormal times corresponding to each condition checking unit in the software container object according to the abnormal verification information. The triggering module acquires a first abnormal frequency in the statistical data, the dynamic loading module is triggered when a first target abnormal frequency which is greater than a first preset frequency exists in the first abnormal frequency, and after the dynamic loading module acquires the information data of the condition verification unit, the corresponding condition verification unit is adjusted to be in the front of the condition relationship chain in the condition relationship chain, so that the condition verification unit in the condition relationship chain before the condition verification unit is executed inefficiently.
In the software container optimization method provided by this embodiment, the first abnormal times corresponding to each condition checking unit in the software container object are respectively updated based on the current checking information of each condition checking unit in the software container; then, if a first target abnormal frequency which is greater than a first preset frequency exists in each first abnormal frequency, determining a target abnormal condition checking unit corresponding to the first target abnormal frequency; and then adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be in the front row of the condition relation chain, adjusting the continuously abnormal condition checking unit to the front row of the condition relation chain through a quantitative triggering mechanism, enabling a subsequent application party to execute the target abnormal condition checking unit at the first time, and avoiding invalid execution of the condition checking unit in the condition relation chain before the condition checking unit when the target abnormal condition checking unit is abnormal again, thereby reducing invalid execution of the condition checking unit in the software container, avoiding waste of running resources of a server and improving the resource utilization rate of the server.
Based on the first embodiment, a second embodiment of the software container optimization method of the present invention is provided, in this embodiment, step S103 includes:
step S201, determining whether the condition relation chain has a relation condition checking unit corresponding to the target abnormal condition checking unit;
step S202, if the condition relation chain does not exist, adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so that the target abnormal condition checking unit is in the front of the condition relation chain;
step S203, if the correlation condition checking unit exists, taking the correlation condition checking unit and the target abnormal condition checking unit as a unit to be adjusted as a whole, and adjusting the order of the unit to be adjusted as a whole in the condition relation chain so that the target abnormal condition checking unit is in the front of the condition relation chain.
In general, a plurality of conditional checking units exist in a container object, and a conditional relationship chain is a relationship definition of the plurality of conditional checking units in a front-back order. The condition checking unit has two types of basic relations: the two units have business association relation, the order of the two units is determined by the business to belong to strong business relation, and the execution order can not be changed; the front unit and the rear unit have no service association relation, the two units actually belong to weak service relation in parallel relation, the change of the sequence does not influence the service logic result, and the execution sequence of the two units can be changed.
In this embodiment, after obtaining the target abnormal condition checking unit, it is determined whether there is a correlation condition checking unit corresponding to the target abnormal condition checking unit in the condition correlation chain, that is, whether there is a business correlation condition checking unit with the target abnormal condition checking unit, if there is a correlation condition checking unit, the correlation condition checking unit and the target abnormal condition checking unit are taken as a unit to be adjusted as a whole, and the order of the unit to be adjusted as a whole is adjusted in the condition correlation chain, so that the target abnormal condition checking unit is in the front of the condition correlation chain. Namely, the related condition verifying unit and the target abnormal condition verifying unit are integrally adjusted to the front row of the condition related chain.
Referring to fig. 3, a1, B1, C1, D1, a2, B2, C2 and D2 are all conditional checking units, where a1-B1 and C1-D1 are respectively two composite relations, that is, there is a business association relation between a1-B1 and C1-D1, if D1 is abnormal, the sequence of C1-D1 is adjusted to D1-C1 first, when a1-B1-D1-C1 is put in the front of the conditional relation, if the conditional relation only includes a1, B1, C1 and D1, the adjusted conditional relation is a1-B1-D1-C1, and further, execution of C1 can be avoided. The composite relation of A2-B2 and C2-D2 is weak relation, a business association relation exists between A2-B2, a business association relation exists between C2-D2, if D2 is abnormal, C2-D2 is simultaneously arranged at the front row of the conditional association chain, if the conditional association chain only comprises A2, B2, C2 and D2, the adjusted conditional association chain is C2-D2-A2-B2, and further execution of A2 and B2 can be avoided in subsequent execution.
In the software container optimization method provided in this embodiment, whether the associated condition checking unit corresponding to the target abnormal condition checking unit exists in the condition-relationship chain is determined;
if the target abnormal condition is not existed, adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be positioned at the front of the condition relation chain; if the correlation condition checking unit exists, the correlation condition checking unit and the target abnormal condition checking unit are taken as a unit to be adjusted as a whole, the sequence of the unit to be adjusted as a whole is adjusted in the condition relation chain, so that the target abnormal condition checking unit is positioned at the front of the condition relation chain, a subsequent application party can execute the target abnormal condition checking unit at the first time, the invalid execution of the condition checking unit in the software container is further reduced, the waste of running resources of the server is avoided, and the resource utilization rate of the server is improved.
Based on the first embodiment, a third embodiment of the software container optimization method of the present invention is provided, and in this embodiment, the software container optimization method further includes:
step S301, regularly determining whether the first abnormal times have abnormal times larger than the first preset times at intervals of a first preset time length;
in step S302, if not, each of the first abnormal times is reset.
In this embodiment, it is determined at regular intervals of a first preset duration whether the first abnormal times are greater than the first preset times, that is, whether the abnormal condition checking unit in the current condition relation chain is in the front row is determined, and if not, each of the first abnormal times is reset, that is, each of the first abnormal times is cleared. Specifically, the triggering module triggers resetting of the first abnormal times every first preset time length so as to prevent the condition checking unit with non-continuous abnormality from being positioned at the front of the condition relation chain.
The first preset time period may be set reasonably, for example, the first preset time period is 10 minutes, 30 minutes, 1 hour, and the like.
In the software container optimization method provided by this embodiment, whether the first abnormal times have abnormal times greater than the first preset times is determined at regular intervals for a first preset time; and if the condition verification unit does not exist, resetting each first abnormal frequency, so that the condition verification unit with non-continuous abnormality can be prevented from being positioned at the front of the condition relation chain, and the normal operation of the software container is ensured.
Based on the first embodiment, a fourth embodiment of the software container optimization method of the present invention is provided, and in this embodiment, the software container optimization method further includes:
step S401, when the verification of each condition checking unit in the software container is completed, determining whether an interface calling exception exists in a downstream external interface;
step S402, if the interface calling is abnormal, updating a second abnormal frequency corresponding to the downstream external interface;
in step S403, if the second abnormal frequency is greater than the second preset frequency, add an unexecutable flag unit in the front row of the conditional relationship chain.
In this embodiment, when the verification of each condition checking unit in the software container is completed, it is determined whether an interface call exception exists in the downstream external interface, and specifically, the software container transfers intermediate data verified by each condition checking unit to the downstream external interface, and determines whether an interface call exception exists in the downstream external interface.
If the interface calling is abnormal, updating a second abnormal frequency corresponding to the downstream external interface, judging whether the second abnormal frequency is greater than a second preset frequency, if the second abnormal frequency is greater than the second preset frequency, adding an unexecutable marking unit at the front row of the condition relation chain, and avoiding invalid execution of the condition checking unit under the condition that the downstream external interface is unexecutable through the unexecutable marking unit.
Specifically, if the application side calls data to complete the verification of each condition verification unit in the object, the container object transmits the intermediate data to a downstream external interface, and if the downstream external interface generates abnormal calling, the container receives the intermediate data and then sends feedback information to a feedback module; the feedback module sends the downstream external interface abnormal feedback information to the statistic module; the counting module counts to obtain statistical data, namely the second abnormal times, and sends the statistical data to the triggering module; if the second abnormal times is larger than the second preset times, the triggering module sends information to the dynamic loading module, after the dynamic loading module acquires feedback information data of other interfaces or third parties, an unexecutable marking unit is added in the front of the original condition relation chain, an unexecutable object is created accordingly, invalid execution of the condition checking object is avoided under the condition that a downstream external interface is unexecutable, resource waste of the software container to the application party is greatly reduced, saved resources can be delivered by the system to the software container to process other application party services or other service objects in the container, and further the overall performance of the container object and even the software container is improved.
According to the software container optimization method provided by the embodiment, when the verification of each condition checking unit in the software container is completed, whether interface calling abnormity exists in a downstream external interface is determined; if the interface calling is abnormal, updating a second abnormal frequency corresponding to the downstream external interface; if the second abnormal times is larger than the second preset times, adding unexecutable marking units in the front row of the condition relation chain; through the unexecutable marking unit, when the subsequent application side calls the software container, invalid execution of normal units in the condition relation chain when the calling of the downstream interface fails is avoided, waste of running resources of the server is avoided, and the resource utilization rate of the server is further improved.
Based on the fourth embodiment, a fifth embodiment of the software container optimization method of the present invention is provided, in this embodiment, the software container optimization method further includes:
step S501, regularly determining whether the second abnormal times are greater than second preset times at intervals of second preset duration;
in step S502, if the second abnormal times are less than or equal to a second preset times, each of the second abnormal times is reset.
In this embodiment, it is determined whether the second abnormal times are greater than the second preset times at intervals of a second preset duration, and if the second abnormal times are less than or equal to the second preset times, each of the second abnormal times is reset, that is, each of the second abnormal times is cleared. Specifically, the triggering module triggers resetting of the second abnormal times every second preset duration to avoid triggering the marking unit by the downstream external interface which is not continuously abnormal.
The second preset time period can be set reasonably, for example, the second preset time period is 10 minutes, 30 minutes, 1 hour, and the like.
In the software container optimization method provided by this embodiment, whether the second abnormal times are greater than a second preset times is determined at regular time intervals by a second preset duration; and then, if the second abnormal times are less than or equal to second preset times, resetting each second abnormal time to avoid triggering a marking unit by a downstream external interface which is not continuously abnormal, and ensuring the normal operation of the software container.
Based on the first embodiment, a sixth embodiment of the software container optimization method of the present invention is provided, in this embodiment, before step S101, the software container optimization method further includes:
step S601, when the creation of the software container is completed, setting a plurality of condition checking units in the software container object based on the configuration information of the software container, and determining the condition relation chain based on each condition checking unit;
step S602, when receiving the call request, verifying each condition checking unit in the software container object to obtain current verification information of each condition checking unit.
In the embodiment, the software container is created along with the project deployment process, corresponding data is obtained according to configuration in the creation process, and the object creation parameters are initialized; meanwhile, a plurality of condition checking units are arranged in the software container object based on the configuration information of the software container, and a condition relation chain is obtained according to the execution sequence of each condition checking unit.
And then, when the application side calls the software container, namely when a call request is received, verifying each condition checking unit in the software container object to obtain the current verification information of each condition checking unit.
In the software container optimization method provided by this embodiment, when the creation of the software container is completed, a plurality of condition checking units are set in the software container object based on the configuration information of the software container, and the condition relation chain is determined based on each condition checking unit; and then when a call request is received, checking each condition checking unit in the software container object to obtain the current checking information of each condition checking unit, and setting a condition relation chain in the software container to facilitate the subsequent operation of the condition relation chain.
Based on the foregoing embodiments, a seventh embodiment of the software container optimization method of the present invention is provided, in this embodiment, the software container optimization method further includes:
step S701, regularly resetting the first abnormal times and second abnormal times corresponding to a downstream external interface at intervals of a third preset time length;
step S702, determining whether an abnormal condition checking unit and/or a marking unit exists in the front row of the condition relation chain;
and step S703, if the condition verification unit exists, restoring the condition relation chain according to the initial sequence of the condition verification unit in the condition relation chain, and/or deleting the marking unit in the condition relation chain.
It should be noted that the third preset time period is longer than the first preset time period and longer than the second preset time period, for example, the third preset time period may be set to 12 hours, 24 hours, and the like.
In this embodiment, the first abnormal times and the second abnormal times corresponding to the downstream external interface are periodically reset at intervals of a third preset duration, and whether an abnormal condition checking unit and/or a marking unit exists in the front row of the condition relation chain is determined; and if the condition relation chain exists, restoring the condition relation chain according to the initial sequence of the condition checking units in the condition relation chain, and/or deleting the marking units in the condition relation chain to restore the condition relation chain to a default state, so that the software container is ensured to restore to a normal state to process normal data requests after resource waste is reduced within a certain time.
Specifically, the triggering module triggers the dynamic loading module to reset the object condition relation chain to a default configuration every third preset duration, and restores the software container to an initialized state, so that the software container can provide services with a normal verification process to the outside again, and further, through the timing triggering mechanism, the software container can ensure that an application party is not permanently unavailable, provide a chance of secondary trial use, and ensure that a service macro level provides normal services.
In the software container optimization method provided by this embodiment, the first abnormal times and the second abnormal times corresponding to the downstream external interface are periodically reset at intervals of a third preset duration; then determining whether an abnormal condition checking unit and/or a marking unit exists in the front row of the condition relation chain; and if the condition relation chain exists, restoring the condition relation chain according to the initial sequence of the condition checking units in the condition relation chain, and/or deleting the marking units in the condition relation chain, and restoring the software container to a normal state to process the normal data request after resource waste is reduced within a certain time by restoring the condition relation chain to a default state.
The present invention also provides a software container optimization apparatus, and referring to fig. 4, the software container optimization apparatus includes:
an updating module 10, configured to update, based on current verification information of each condition checking unit in a software container, the first abnormal times corresponding to each condition checking unit in the software container object respectively;
the determining module 20 is configured to determine a target abnormal condition checking unit corresponding to a first target abnormal frequency if the first target abnormal frequency is greater than a first preset frequency;
an adjusting module 30, configured to adjust the order of the target abnormal condition checking unit in the condition relation chain of the software container, so that the target abnormal condition checking unit is at the front of the condition relation chain.
The method executed by each program unit can refer to each embodiment of the software container optimization method of the present invention, and is not described herein again.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention has stored thereon a software container optimization program, which when executed by a processor implements the steps of the software container optimization method as described above.
The method implemented when the software container optimization program running on the processor is executed may refer to each embodiment of the software container optimization method of the present invention, and details are not described here.
Furthermore, an embodiment of the present invention further provides a computer program product, which includes a software container optimization program, and when the software container optimization program is executed by a processor, the software container optimization program implements the steps of the software container optimization method described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A software container optimization method is characterized by comprising the following steps:
respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container;
if a first target abnormal frequency greater than a first preset frequency exists in each first abnormal frequency, determining a target abnormal condition checking unit corresponding to the first target abnormal frequency;
adjusting the order of the target abnormal condition checking unit in the condition relation chain of the software container so that the target abnormal condition checking unit is in the front of the condition relation chain.
2. The software container optimization method of claim 1, wherein the step of adjusting the order of the target abnormal condition checking unit in the conditional relationship chain of the software container so that the target abnormal condition checking unit is in the front of the conditional relationship chain comprises
Determining whether the condition relation chain has a relevant condition checking unit corresponding to the target abnormal condition checking unit;
if the target abnormal condition is not existed, adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be positioned at the front of the condition relation chain;
and if the relevant condition checking unit exists, taking the relevant condition checking unit and the target abnormal condition checking unit as a unit to be adjusted as a whole, and adjusting the sequence of the unit to be adjusted as a whole in the condition relation chain so that the target abnormal condition checking unit is positioned in the front of the condition relation chain.
3. The software container optimization method of claim 1, wherein the software container optimization method further comprises:
regularly determining whether the first abnormal times have abnormal times larger than the first preset times at intervals of a first preset time length;
if not, resetting each first abnormal frequency.
4. The software container optimization method of claim 1, wherein the software container optimization method further comprises:
when the verification of each condition checking unit in the software container is completed, determining whether an interface calling exception exists in a downstream external interface;
if the interface calling is abnormal, updating a second abnormal frequency corresponding to the downstream external interface;
and if the second abnormal frequency is greater than a second preset frequency, adding an unexecutable marking unit in the front row of the condition relation chain.
5. The software container optimization method of claim 4, wherein the software container optimization method further comprises:
regularly determining whether the second abnormal times are greater than a second preset times at intervals of a second preset time length;
and if the second abnormal times are less than or equal to second preset times, resetting each second abnormal time.
6. The software container optimization method according to claim 1, wherein before the step of updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container, the software container optimization method further comprises:
when the software container is created, setting a plurality of condition checking units in the software container object based on the configuration information of the software container, and determining the condition relation chain based on each condition checking unit;
and when the call request is received, verifying each condition checking unit in the software container object to obtain the current verification information of each condition checking unit.
7. The software container optimization method of any one of claims 1 to 6, further comprising:
regularly resetting the first abnormal times and second abnormal times corresponding to a downstream external interface at intervals of a third preset time length;
determining whether an abnormal condition checking unit and/or a marking unit exists in the front row of the condition relation chain;
and if the condition verification units exist, restoring the condition relation chain according to the initial sequence of the condition verification units in the condition relation chain, and/or deleting the marking units in the condition relation chain.
8. A software container optimization apparatus, characterized in that the software container optimization apparatus comprises:
the updating module is used for respectively updating the first abnormal times corresponding to each condition checking unit in the software container object based on the current checking information of each condition checking unit in the software container;
the determining module is used for determining a target abnormal condition checking unit corresponding to the first target abnormal times if the first target abnormal times which are greater than a first preset times exist in the first abnormal times;
and the adjusting module is used for adjusting the sequence of the target abnormal condition checking unit in the condition relation chain of the software container so as to enable the target abnormal condition checking unit to be positioned at the front of the condition relation chain.
9. A software container optimization apparatus, characterized in that the software container optimization apparatus comprises: memory, a processor and a software container optimization program stored on the memory and executable on the processor, the software container optimization program when executed by the processor implementing the steps of the software container optimization method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps of the software container optimization method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110669181.7A CN113268290B (en) | 2021-06-16 | 2021-06-16 | Software container optimization method, device, equipment and computer program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110669181.7A CN113268290B (en) | 2021-06-16 | 2021-06-16 | Software container optimization method, device, equipment and computer program product |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113268290A true CN113268290A (en) | 2021-08-17 |
CN113268290B CN113268290B (en) | 2024-07-26 |
Family
ID=77235361
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110669181.7A Active CN113268290B (en) | 2021-06-16 | 2021-06-16 | Software container optimization method, device, equipment and computer program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113268290B (en) |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110154096A1 (en) * | 2009-12-23 | 2011-06-23 | Sap Ag | Business Methods Retry Optimization |
CN103888254A (en) * | 2012-12-21 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Network information verification method and apparatus |
CN104346243A (en) * | 2013-07-30 | 2015-02-11 | 旭达电脑(昆山)有限公司 | System for automatic adjustment of main board testing process and implement method thereof |
CN105225125A (en) * | 2014-06-23 | 2016-01-06 | 阿里巴巴集团控股有限公司 | Information calibration method and equipment |
WO2017156676A1 (en) * | 2016-03-14 | 2017-09-21 | 华为技术有限公司 | Processing method and device for application, and smart terminal |
CN108062256A (en) * | 2017-11-10 | 2018-05-22 | 中国民生银行股份有限公司 | The access method and device of a kind of application program |
CN108287771A (en) * | 2017-12-27 | 2018-07-17 | 沈阳东软医疗系统有限公司 | A kind of data verification method, device and equipment |
CN108627195A (en) * | 2018-08-17 | 2018-10-09 | 深圳市金邦科技发展有限公司 | A kind of intelligent detecting method and intelligent checking system that memory body module is detected |
TWM575174U (en) * | 2018-11-12 | 2019-03-01 | 友懋國際科技股份有限公司 | Inspection system |
CN109450691A (en) * | 2018-11-20 | 2019-03-08 | 深圳前海微众银行股份有限公司 | Gateway monitoring method, equipment and computer readable storage medium |
CN109728969A (en) * | 2018-05-18 | 2019-05-07 | 平安普惠企业管理有限公司 | Abnormal user method for detecting, monitoring service end and the storage medium of application software |
CN111159153A (en) * | 2019-12-30 | 2020-05-15 | 北京三快在线科技有限公司 | Service data checking method and device, computer equipment and storage medium |
US20200387442A1 (en) * | 2019-06-06 | 2020-12-10 | International Business Machines Corporation | Bypassing execution of a module in real-time |
WO2020259147A1 (en) * | 2019-06-28 | 2020-12-30 | 深圳前海微众银行股份有限公司 | Field information checking method and apparatus |
CN112416308A (en) * | 2020-11-30 | 2021-02-26 | 上海汽车集团股份有限公司 | Software optimization method and device and software architecture |
CN112783677A (en) * | 2019-11-04 | 2021-05-11 | 北京京东尚科信息技术有限公司 | Method and device for monitoring service abnormity |
-
2021
- 2021-06-16 CN CN202110669181.7A patent/CN113268290B/en active Active
Patent Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110154096A1 (en) * | 2009-12-23 | 2011-06-23 | Sap Ag | Business Methods Retry Optimization |
CN103888254A (en) * | 2012-12-21 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Network information verification method and apparatus |
CN104346243A (en) * | 2013-07-30 | 2015-02-11 | 旭达电脑(昆山)有限公司 | System for automatic adjustment of main board testing process and implement method thereof |
CN105225125A (en) * | 2014-06-23 | 2016-01-06 | 阿里巴巴集团控股有限公司 | Information calibration method and equipment |
WO2017156676A1 (en) * | 2016-03-14 | 2017-09-21 | 华为技术有限公司 | Processing method and device for application, and smart terminal |
CN108062256A (en) * | 2017-11-10 | 2018-05-22 | 中国民生银行股份有限公司 | The access method and device of a kind of application program |
CN108287771A (en) * | 2017-12-27 | 2018-07-17 | 沈阳东软医疗系统有限公司 | A kind of data verification method, device and equipment |
CN109728969A (en) * | 2018-05-18 | 2019-05-07 | 平安普惠企业管理有限公司 | Abnormal user method for detecting, monitoring service end and the storage medium of application software |
CN108627195A (en) * | 2018-08-17 | 2018-10-09 | 深圳市金邦科技发展有限公司 | A kind of intelligent detecting method and intelligent checking system that memory body module is detected |
TWM575174U (en) * | 2018-11-12 | 2019-03-01 | 友懋國際科技股份有限公司 | Inspection system |
CN109450691A (en) * | 2018-11-20 | 2019-03-08 | 深圳前海微众银行股份有限公司 | Gateway monitoring method, equipment and computer readable storage medium |
US20200387442A1 (en) * | 2019-06-06 | 2020-12-10 | International Business Machines Corporation | Bypassing execution of a module in real-time |
WO2020259147A1 (en) * | 2019-06-28 | 2020-12-30 | 深圳前海微众银行股份有限公司 | Field information checking method and apparatus |
CN112783677A (en) * | 2019-11-04 | 2021-05-11 | 北京京东尚科信息技术有限公司 | Method and device for monitoring service abnormity |
CN111159153A (en) * | 2019-12-30 | 2020-05-15 | 北京三快在线科技有限公司 | Service data checking method and device, computer equipment and storage medium |
CN112416308A (en) * | 2020-11-30 | 2021-02-26 | 上海汽车集团股份有限公司 | Software optimization method and device and software architecture |
Non-Patent Citations (2)
Title |
---|
码农梦醒: "MethodValidationInterceptor执行优先级问题", pages 526 - 530, Retrieved from the Internet <URL:https://www.jianshu.com/p/d84e76ea01e0> * |
陈学明: "Spring+Spring MVC+MyBatis整合开发实战", 机械工业出版社, pages: 526 - 530 * |
Also Published As
Publication number | Publication date |
---|---|
CN113268290B (en) | 2024-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107729041B (en) | Application program hot updating method, device, terminal and storage medium | |
CN111314141B (en) | Route updating method and device | |
CN107783795B (en) | Application program starting method and device, computer equipment and storage medium | |
EP3007408B1 (en) | Service method for managing transactions using application properties and system therefor | |
CN112867988A (en) | Implementing compliance settings by a mobile device to follow a configuration scenario | |
CN107291481B (en) | Component updating method, device and system | |
CN112714158B (en) | Transaction processing method, relay network, cross-link gateway, system, medium and equipment | |
CN111221550B (en) | Rule updating method and device for streaming computing and streaming computing system | |
CN109450691B (en) | Service gateway monitoring method, device and computer readable storage medium | |
US10776081B2 (en) | Systems and methods for utilizing webhooks integrated in platform-as-a-service supported application development and deployment | |
CN110471884A (en) | Data managing method, device, equipment, system and computer readable storage medium | |
CN111258723A (en) | Transaction processing method, device, system, medium and equipment of distributed system | |
CN113434230A (en) | Jump control method and device for H5 page, storage medium and electronic device | |
CN114401187B (en) | Gray scale issuing method, device, computer equipment and storage medium | |
CN111311014A (en) | Service data processing method and device, computer equipment and storage medium | |
CN110737548A (en) | Data request method and server | |
CN110574006B (en) | System and method for automatically synchronizing responses and conditions on a device | |
CN111414181B (en) | Service upgrading method and device for network product, server and storage medium | |
CN113114734A (en) | Information processing method, device, equipment and storage medium | |
CN111273939B (en) | Information processing method, information processing device and terminal equipment | |
CN112506590A (en) | Interface calling method and device and electronic equipment | |
CN113268290B (en) | Software container optimization method, device, equipment and computer program product | |
WO2013161522A1 (en) | Log collection server, log collection system, log collection method | |
CN107798250B (en) | Sensitive information shielding rule issuing method, application server and computer readable storage medium | |
CN114553786B (en) | Network request fusing method and device, computer equipment and storage medium |
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 |