CN117234701B - Policy iteration method, device, computer equipment and storage medium - Google Patents

Policy iteration method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117234701B
CN117234701B CN202310950359.4A CN202310950359A CN117234701B CN 117234701 B CN117234701 B CN 117234701B CN 202310950359 A CN202310950359 A CN 202310950359A CN 117234701 B CN117234701 B CN 117234701B
Authority
CN
China
Prior art keywords
strategy
policy
version
current version
loaded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310950359.4A
Other languages
Chinese (zh)
Other versions
CN117234701A (en
Inventor
俞亮亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Shuhe Information Technology Co Ltd
Original Assignee
Shanghai Shuhe 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 Shanghai Shuhe Information Technology Co Ltd filed Critical Shanghai Shuhe Information Technology Co Ltd
Priority to CN202310950359.4A priority Critical patent/CN117234701B/en
Publication of CN117234701A publication Critical patent/CN117234701A/en
Application granted granted Critical
Publication of CN117234701B publication Critical patent/CN117234701B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application relates to a strategy iteration method, a strategy iteration device, computer equipment and a storage medium. The method comprises the following steps: responding to a strategy iteration instruction, and acquiring calling condition information of a calculation thread of a current version strategy; judging whether the computing thread is in a call-free state according to the call condition information; judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a call-free state; the current version policy is offloaded from the memory of the current execution server in response to the absence of an external object that depends on the instance of the current version policy. By adopting the method, the stability of the execution server can be improved during strategy iteration.

Description

Policy iteration method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a policy iteration method, apparatus, computer device, and storage medium.
Background
With the development of computer technology, different policies can be loaded through a computer cluster to perform different business logic processes, and the efficiency of policy iteration is related to enterprise competitiveness. The traditional strategy iteration method is that an old version strategy is downloaded, a version strategy to be loaded is deployed, a gap exists between the old version strategy and the version strategy to be loaded, the old version strategy is a service vacuum period, and large service data loss can be generated under the condition of large service volume.
In the prior art, in order to solve the problem that the new version strategy iteration generates the service vacuum period, the policies of the new version strategy and the old version strategy are loaded into the memory in full quantity, however, the memory of the server is limited, and the memory overload of the server is easily caused, so that the memory is also required to be released manually and periodically, and the executing end server is required to be restarted after the memory is released, so that the service processing of the executing end server is unstable due to the policy iteration.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a policy iteration method, apparatus, computer device, and storage medium that can improve stability of an execution server at the time of policy iteration.
A policy iteration method, the method comprising:
Responding to a strategy iteration instruction, and acquiring calling condition information of a calculation thread of a current version strategy;
judging whether the computing thread is in a call-free state according to the call condition information;
Judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a call-free state;
the current version policy is offloaded from the memory of the current execution server in response to the absence of an external object that depends on the instance of the current version policy.
In some embodiments, the current version policy is set to correspond to an associated unique policy loader for dynamically monitoring loading and scheduling of the current version policy, and in response to the absence of an external object that depends on an instance of the current version policy, the method further comprises:
Acquiring state information of a strategy loader;
And unloading the strategy loader when the state information characterizes the strategy loader to be in a recoverable state, and executing the step of unloading the current version strategy from the memory of the current execution server.
In some embodiments, the method further comprises:
acquiring a loading monitoring record and a scheduling monitoring record corresponding to a strategy loader;
judging whether data does not exist in the loading monitoring record and the scheduling monitoring record in preset time;
Responding to no data in the loading monitoring record and the scheduling monitoring record in preset time, and judging whether an external object depending on an instance of the strategy loader exists or not;
In response to there being no external object that depends on the instance of the policy loader, the state information of the policy loader is changed to a recoverable state.
In some embodiments, the method further comprises:
receiving a policy loading event sent by a policy configuration terminal; the policy loading event comprises binding relation information between a version policy to be loaded and a designated execution server;
and when the current execution server is determined to be the appointed execution server according to the binding relation information, loading the version strategy to be loaded and the data corresponding to the version strategy to be loaded into the memory of the current execution server.
In some embodiments, a method for binding a version policy to be loaded with a specified execution server includes:
acquiring configured strategy data;
compiling the strategy data to generate a version strategy to be loaded;
Extracting a policy portrait of the version policy to be loaded, screening the execution servers according to the policy portrait, taking the screened execution servers as specified execution servers, and binding the version policy to be loaded with the specified execution servers.
In some embodiments, the image filtering execution server according to the policy includes:
Obtaining a trained matching model; the trained matching model is an algorithm model obtained by training the performance parameters of the execution server according to the historical portrait of the historical strategy;
and obtaining a specified execution server matched with the current version strategy according to the strategy image and the trained matching model.
In some embodiments, the method further comprises:
in response to an instruction for executing the version policy to be loaded, judging whether the version policy to be loaded is successfully loaded in the memory;
If not, pulling the data of the version strategy to be loaded from the strategy memory and loading the version strategy to be loaded into the memory.
A policy iteration apparatus, the apparatus comprising:
the first acquisition module is used for responding to the strategy iteration instruction and acquiring calling condition information of a calculation thread of the current version strategy;
the first judging module is used for judging whether the computing thread is in a call-free state according to the call condition information;
The second acquisition module is used for judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a non-calling state;
and the second judging module is used for unloading the current version strategy from the memory of the current execution server in response to the fact that the external object depending on the instance of the current version strategy does not exist.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a policy iteration method of any of the above when executing the computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the policy iteration method of any of the above.
According to the policy iteration method, the device, the computer equipment and the storage medium, after the execution server receives the policy iteration instruction, the memory of the execution server can be stably and accurately released without manual intervention and cleaning or restarting of the execution server by judging the calling condition of the computing thread under the current version policy and the dependence condition of the external object of the instance of the current version policy when the state of the current version policy is calculated to be in line with the condition, so that the memory automatic management is realized, and the stability of the execution server can be improved during policy iteration.
Drawings
FIG. 1 is an application environment diagram of a policy iteration method in one embodiment;
FIG. 2 is a flow diagram of a strategy iteration method in one embodiment;
FIG. 3 is a flow chart of a strategy iteration method in an application example;
FIG. 4 is a flow diagram of a policy-loaded Push mode in one example;
FIG. 5 is a flow diagram of a policy loading Pull mode in one example;
FIG. 6 is a block diagram of a strategy iteration device in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The strategy iteration method provided by the application can be applied to an application environment shown in figure 1. The server 102 at the policy execution end, the server 104 at the policy configuration end and the server 106 of the policy management platform communicate with each other through a network. The server may be implemented as a stand-alone server or as a server cluster formed by a plurality of servers.
In some embodiments, the server 102 of the policy execution end responds to the policy iteration instruction to obtain calling condition information of a computing thread of the current version policy; judging whether the computing thread is in a call-free state according to the call condition information; judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a call-free state; and in response to the external object which does not exist the instance depending on the current version strategy, unloading the current version strategy and the data corresponding to the current version strategy from the memory of the current execution server. The policy iteration instruction may be generated by the server 104 of the policy configuration end and pushed to the server 102 of the policy execution end, or may also be generated by the server 106 of the policy management platform and pushed to the server 102 of the policy execution end via the server 104 of the policy configuration end, or the like.
In one embodiment, as shown in fig. 2, a policy iteration method is provided, which is illustrated by taking a server of the policy execution end in fig. 1 as an example, and includes the following steps:
Step S202: and responding to the strategy iteration instruction, and acquiring calling condition information of a calculation thread of the current version strategy.
The policy iteration instruction comprises an instruction for indicating to unload the policy, and the instruction can be generated by a server of the policy management platform and pushed to a server corresponding to the current version policy by a policy execution end through a server of the policy configuration end. The current version policy refers to a policy of a certain version loaded in a current execution server of an execution end at a current time period or point in time. The current execution server refers to a server of an execution end loaded with the current version policy.
Specifically, the current execution server responds to the policy iteration instruction, detects the calling condition of the computing thread constructed based on the current version policy loaded by the current execution server, and judges whether the computing thread of the current version policy is called in the current time period or the preset time period according to the calling condition information of the computing thread.
Step S204: and judging whether the computing thread is in a call-free state according to the call condition information.
Specifically, the current execution server determines whether the computing thread is in a non-calling state by detecting calling condition information of the computing thread created under the current version policy, where the non-calling state refers to a static state where the thread is currently not called and executed, and may include a non-calling state where the thread is not executed or is executed to complete both cases.
Step S206: and in response to the computing thread being in a no-call state, determining whether an external object depending on the instance of the current version policy exists.
Wherein, the instance of the current version policy refers to one or more instance objects created based on the current version policy after instantiation. An external object that depends on an instance of the current version policy refers to an object that has a dependency relationship of calling, being called, etc. with the instance of the current version policy.
Specifically, when the current execution server determines that the computing thread created under the current version policy is in a no-call state, it may further detect whether one or more instance objects instantiated based on the current version policy are dependent on other external objects. Because, when the computing thread of the current version strategy is monitored to be in the non-calling state, although the computing thread at the current stage can be ensured to be static, if a non-static external object still exists, the instance of the current version strategy can still be called at the next stage, so that the accuracy of judgment can be improved by further monitoring whether the external object depending on the instance of the current version strategy exists or not, and further, the accuracy of strategy unloading and iteration is improved.
Illustratively, the step of determining whether there is an external object that depends on the instance of the current version policy may further comprise: judging whether the external object of the instance depending on the current version strategy is in a non-calling state or not, judging whether the external object of the instance depending on the current version strategy is in a recoverable state or not, and if the external object of the instance depending on the current version strategy is in the non-calling and recoverable state, judging that the external object of the instance depending on the current version strategy does not exist.
Step S208: the current version policy is offloaded from the memory of the current execution server in response to the absence of an external object that depends on the instance of the current version policy.
In this step, the current execution server may automatically uninstall the current version policy from its own memory and purge relevant data of the current version policy from its own memory in response to the absence of an external object depending on the instance of the current version policy for a preset period of time.
According to the policy iteration method, after the execution server receives the policy iteration instruction, the memory of the execution server can be stably and accurately released when the state of the current version policy is calculated to be in line with the condition through judging the calling condition of the computing thread under the current version policy and the dependence condition of the external object of the instance of the current version policy, manual intervention and cleaning are not needed, the execution server is not needed to be restarted, automatic management of the memory is achieved, and therefore stability of the execution server can be improved during policy iteration.
In some embodiments, the current version policy is set to correspond to an associated unique policy loader for dynamically monitoring loading and scheduling of the current version policy, and in response to the absence of an external object that depends on an instance of the current version policy, the method further comprises: acquiring state information of a strategy loader; and unloading the strategy loader when the state information characterizes the strategy loader to be in a recoverable state, and executing the step of unloading the current version strategy from the memory of the current execution server.
In this embodiment, a unique policy loader may be configured for each version of policy correspondence, where each policy corresponding to each version of policy may be used to register, load, schedule, etc. information on the policies of the respective responsible version, and may monitor the loading condition and the scheduling condition of the policies of the respective responsible version.
Illustratively, the policy loader may include two states, an unrecoverable state and a recoverable state, respectively. When the policy loader is in the unrecoverable state, the operation condition of the version of the policy which is still responsible for monitoring the policy is described, namely, the policy of the version is still in the life cycle and still is called, loaded or is in the called and loaded state, otherwise, when the policy loader is in the recoverable state, the policy of the version is described that the need of monitoring does not exist, and all monitoring data are in a static state.
In some embodiments, the method further comprises: acquiring a loading monitoring record and a scheduling monitoring record corresponding to a strategy loader; judging whether data does not exist in the loading monitoring record and the scheduling monitoring record in preset time; responding to no data in the loading monitoring record and the scheduling monitoring record in preset time, and judging whether an external object depending on an instance of the strategy loader exists or not; in response to there being no external object that depends on the instance of the policy loader, the state information of the policy loader is changed to a recoverable state.
In the above embodiment, when the condition calculation before the memory release is performed, the judgment is performed not only from the perspective of the current version policy itself, but also in combination with the state of the policy loader uniquely corresponding to the current version policy, and by performing data acquisition and logic calculation from two angles, the accuracy of the memory release can be further improved.
Referring now to fig. 3 in conjunction with an application example, fig. 3 shows a schematic flow chart of a policy iteration method in an application example. More specifically:
The server of the policy configuration terminal can be integrated with a policy management module, and the policy management module is used for generating a push event which is used for designating an execution server of the execution terminal corresponding to the current version policy to carry out policy unloading;
the execution server of the policy execution end receives the push event, responds to the policy unloading instruction, and enters logic calculation:
1. Judging whether the calculation thread of the current version strategy has no call, if so, entering 2, if not, ending or entering the loop judgment;
2. the object of the instance depending on the current version strategy is not called and can be recycled, if yes, the method enters 3, if not, the method can be ended, or enters 1 to carry out cyclic judgment;
3. and if not, entering 1 to carry out cycle judgment.
And after the current version strategy is unloaded from the memory of the execution server, the strategy management module is also used for updating and maintaining the mapping relation between the strategy version and the execution server.
In some embodiments, the method further comprises: receiving a policy loading event sent by a policy configuration terminal; the policy loading event comprises binding relation information between a version policy to be loaded and a designated execution server; and when the current execution server is determined to be the appointed execution server according to the binding relation information, loading the version strategy to be loaded and the data corresponding to the version strategy to be loaded into the memory of the current execution server.
In this embodiment, policies of different versions may be bound with different execution servers in advance, after the memory of the execution server is released, or in an initialization stage, when the execution server receives a policy loading instruction, the policy loading instruction may include information of a designated server, so that the execution server may load policies of corresponding versions as required according to binding relation information, and all servers of the execution end do not need to load policies in full, thereby making full use of memory resources of each execution server and improving utilization rate of memory.
In one embodiment, a method for binding a version policy to be loaded with a specified execution server includes: acquiring configured strategy data; compiling the strategy data to generate a version strategy to be loaded; extracting a policy portrait of the version policy to be loaded, screening the execution servers according to the policy portrait, taking the screened execution servers as specified execution servers, and binding the version policy to be loaded with the specified execution servers.
Illustratively, policy loading may include two modes: push mode and Pull mode.
Reference may be made to fig. 4, where fig. 4 shows a schematic flow diagram of policy-loaded Push mode in one example. Specifically, the following contents can be included:
On one hand, the server of the policy configuration terminal compiles policy data and pushes the compiled policies to the policy configuration cloud storage (external memory), and on the other hand, the association relationship between the execution server and policies of different versions and different types can be maintained in real time or periodically. In the implementation process, the server of the policy configuration end actively pushes the policy to be loaded into the memory of the appointed execution server of the policy execution server end from the external memory, and the policy data is loaded into the memory for preheating.
In some embodiments, the image filtering execution server according to the policy includes: obtaining a trained matching model; the trained matching model is an algorithm model obtained by training the performance parameters of the execution server according to the historical portrait of the historical strategy; and obtaining a specified execution server matched with the current version strategy according to the strategy image and the trained matching model.
In this embodiment, data can be achieved based on a policy SLO (SERVICE LEVEL Object, service level objective), a matching model for matching between a policy and an execution server is continuously perfected, a matching algorithm is optimized, and a matching relationship between the policy portrait and the execution server performance can be continuously trained by completing the policy portrait, so that accuracy of the matching algorithm is improved.
By way of example, at least one of policy core information, policy priority information, system resource condition information, policy version information, policy submission time information, etc. may be acquired, a policy portrait may be generated according to the above information, and the policy portrait is used as an input of a matching model to obtain a matching result calculated by the matching model, so as to determine a designated execution server corresponding to the policy.
For example, if a lot of running batch strategies are executed every day at a certain time point, if a new strategy needing running batch is newly submitted today, the core degree of the old strategy and the new strategy is judged first, the core strategy is preferentially guaranteed to be executed, the non-core strategy is limited in current and is executed in a delayed mode if system resources are tense, and if the two strategies are core strategies, priority execution is carried out according to the submitting time, so that a proper execution server can be correspondingly matched according to different conditions.
In some embodiments, the method further comprises: in response to an instruction for executing the version policy to be loaded, judging whether the version policy to be loaded is successfully loaded in the memory; if not, pulling the data of the version strategy to be loaded from the strategy memory and loading the version strategy to be loaded into the memory.
Referring to FIG. 5, FIG. 5 illustrates a flow diagram of policy loading Pull mode in one example. The Pull mode can be used as a spam mode of policy loading, can be used as a loading omission for supplementing the Push mode, and some execution servers possibly need a certain policy, but the policy is not preloaded through the Push mode due to matching or calculation errors, so that pulling of policy data can be actively carried out and loading of policy files can be carried out when the policy is monitored to be needed in the execution process, and therefore, through the mutual coordination of the two loading modes, the full-quantity policy loading can be optimized to be loaded as required, management of useless policies in the current execution server is reduced, and memory resources can be fully utilized.
Based on the combination of the embodiments, when the strategy iterates, on one hand, the association relation between the strategy and the execution server is maintained, the strategy is loaded according to the need, the memory resource of the execution server is fully utilized, and the loading efficiency is improved; on the other hand, the automatic release of the memory is realized in real time or periodically, the policy version meeting the unloading algorithm is subjected to garbage collection, and the occupied resources in the memory are released in real time without manual intervention or restarting; therefore, the strategy iteration method related to the embodiment of the application can effectively manage and utilize the memory resources, and improve the stability and efficiency of strategy iteration.
It should be understood that, although the steps in the flowcharts of fig. 2-5 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in fig. 6, a policy iteration apparatus is provided, including: the device comprises a first acquisition module, a first judgment module, a second acquisition module and a second judgment module, wherein:
a first obtaining module 610, configured to obtain call condition information of a computing thread of a current version policy in response to a policy iteration instruction;
a first judging module 620, configured to judge whether the computing thread is in a call-free state according to the call condition information;
a second obtaining module 630, configured to determine, in response to the computing thread being in a no-call state, whether an external object that depends on an instance of the current version policy exists;
a second determining module 640, configured to offload the current version policy from the memory of the current execution server in response to the external object not having an instance that depends on the current version policy.
In some embodiments, the current version policy is set to be a corresponding associated unique policy loader, the policy loader is configured to dynamically monitor a loading condition and a scheduling condition of the current version policy, and the second determining module 640 is further configured to obtain status information of the policy loader after no external object depending on an instance of the current version policy exists; and unloading the strategy loader when the state information characterizes the strategy loader to be in a recoverable state, and executing the step of unloading the current version strategy from the memory of the current execution server.
In some embodiments, the second determining module 640 is further configured to obtain a loading monitoring record and a scheduling monitoring record corresponding to the policy loader; judging whether data does not exist in the loading monitoring record and the scheduling monitoring record in preset time; responding to no data in the loading monitoring record and the scheduling monitoring record in preset time, and judging whether an external object depending on an instance of the strategy loader exists or not; in response to there being no external object that depends on the instance of the policy loader, the state information of the policy loader is changed to a recoverable state.
In some embodiments, the second judging module 640 is further configured to receive a policy loading event sent by the policy configuration end; the policy loading event comprises binding relation information between a version policy to be loaded and a designated execution server; and when the current execution server is determined to be the appointed execution server according to the binding relation information, loading the version strategy to be loaded and the data corresponding to the version strategy to be loaded into the memory of the current execution server.
In some embodiments, the second determining module 640 is further configured to obtain configured policy data; compiling the strategy data to generate a version strategy to be loaded; extracting a policy portrait of the version policy to be loaded, screening the execution servers according to the policy portrait, taking the screened execution servers as specified execution servers, and binding the version policy to be loaded with the specified execution servers.
In some embodiments, the second determining module 640 is further configured to obtain a trained matching model; the trained matching model is an algorithm model obtained by training the performance parameters of the execution server according to the historical portrait of the historical strategy; and obtaining a specified execution server matched with the current version strategy according to the strategy image and the trained matching model.
In some embodiments, the second determining module 640 is further configured to determine, in response to an instruction to execute the version policy to be loaded, whether the version policy to be loaded has been successfully loaded in the memory; if not, pulling the data of the version strategy to be loaded from the strategy memory and loading the version strategy to be loaded into the memory.
For specific limitations of the policy iteration device, reference may be made to the above limitation of the policy iteration method, and no further description is given here. The modules in the above strategy iteration device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a strategy iteration method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program: responding to a strategy iteration instruction, and acquiring calling condition information of a calculation thread of a current version strategy; judging whether the computing thread is in a call-free state according to the call condition information; judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a call-free state; the current version policy is offloaded from the memory of the current execution server in response to the absence of an external object that depends on the instance of the current version policy.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring state information of a strategy loader; and unloading the strategy loader when the state information characterizes the strategy loader to be in a recoverable state, and executing the step of unloading the current version strategy from the memory of the current execution server.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a loading monitoring record and a scheduling monitoring record corresponding to a strategy loader; judging whether data does not exist in the loading monitoring record and the scheduling monitoring record in preset time; responding to no data in the loading monitoring record and the scheduling monitoring record in preset time, and judging whether an external object depending on an instance of the strategy loader exists or not; in response to there being no external object that depends on the instance of the policy loader, the state information of the policy loader is changed to a recoverable state.
In one embodiment, the processor when executing the computer program further performs the steps of: receiving a policy loading event sent by a policy configuration terminal; the policy loading event comprises binding relation information between a version policy to be loaded and a designated execution server; and when the current execution server is determined to be the appointed execution server according to the binding relation information, loading the version strategy to be loaded and the data corresponding to the version strategy to be loaded into the memory of the current execution server.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring configured strategy data; compiling the strategy data to generate a version strategy to be loaded; extracting a policy portrait of the version policy to be loaded, screening the execution servers according to the policy portrait, taking the screened execution servers as specified execution servers, and binding the version policy to be loaded with the specified execution servers.
In one embodiment, the processor when executing the computer program further performs the steps of: obtaining a trained matching model; the trained matching model is an algorithm model obtained by training the performance parameters of the execution server according to the historical portrait of the historical strategy; and obtaining a specified execution server matched with the current version strategy according to the strategy image and the trained matching model.
In one embodiment, the processor when executing the computer program further performs the steps of: in response to an instruction for executing the version policy to be loaded, judging whether the version policy to be loaded is successfully loaded in the memory; if not, pulling the data of the version strategy to be loaded from the strategy memory and loading the version strategy to be loaded into the memory.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: responding to a strategy iteration instruction, and acquiring calling condition information of a calculation thread of a current version strategy; judging whether the computing thread is in a call-free state according to the call condition information; judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a call-free state; the current version policy is offloaded from the memory of the current execution server in response to the absence of an external object that depends on the instance of the current version policy.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring state information of a strategy loader; and unloading the strategy loader when the state information characterizes the strategy loader to be in a recoverable state, and executing the step of unloading the current version strategy from the memory of the current execution server.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a loading monitoring record and a scheduling monitoring record corresponding to a strategy loader; judging whether data does not exist in the loading monitoring record and the scheduling monitoring record in preset time; responding to no data in the loading monitoring record and the scheduling monitoring record in preset time, and judging whether an external object depending on an instance of the strategy loader exists or not; in response to there being no external object that depends on the instance of the policy loader, the state information of the policy loader is changed to a recoverable state.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving a policy loading event sent by a policy configuration terminal; the policy loading event comprises binding relation information between a version policy to be loaded and a designated execution server; and when the current execution server is determined to be the appointed execution server according to the binding relation information, loading the version strategy to be loaded and the data corresponding to the version strategy to be loaded into the memory of the current execution server.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring configured strategy data; compiling the strategy data to generate a version strategy to be loaded; extracting a policy portrait of the version policy to be loaded, screening the execution servers according to the policy portrait, taking the screened execution servers as specified execution servers, and binding the version policy to be loaded with the specified execution servers.
In one embodiment, the computer program when executed by the processor further performs the steps of: obtaining a trained matching model; the trained matching model is an algorithm model obtained by training the performance parameters of the execution server according to the historical portrait of the historical strategy; and obtaining a specified execution server matched with the current version strategy according to the strategy image and the trained matching model.
In one embodiment, the computer program when executed by the processor further performs the steps of: in response to an instruction for executing the version policy to be loaded, judging whether the version policy to be loaded is successfully loaded in the memory; if not, pulling the data of the version strategy to be loaded from the strategy memory and loading the version strategy to be loaded into the memory.
Those skilled in the art will appreciate that all or part of the processes implementing the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the computer program may be stored on a non-volatile computer readable storage medium, and the computer program may include processes of the embodiments of the above methods when executed. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A method of policy iteration, the method comprising:
Responding to a strategy iteration instruction, and acquiring calling condition information of a calculation thread of a current version strategy;
Judging whether the computing thread is in a call-free state according to the call condition information; the thread is in a static state which is not called and executed at present, and the non-calling state comprises a non-calling state under the two conditions that the thread is not executed or is executed to complete;
Judging whether an external object depending on the instance of the current version policy exists or not in response to the computing thread being in a call-free state; wherein, the instance of the current version policy refers to one or more instance objects created based on the current version policy after instantiation; the external object of the instance depending on the current version policy refers to an object having a calling or called dependency relationship with the instance of the current version policy;
And unloading the current version strategy from the memory of the current execution server in response to the external object which does not exist and depends on the instance of the current version strategy.
2. The method of claim 1, wherein the current version policy is set to correspond to an associated unique policy loader for dynamically monitoring loading and scheduling of the current version policy, the method further comprising, after the response to the absence of an external object that depends on an instance of the current version policy:
acquiring state information of the strategy loader;
And unloading the strategy loader when the state information characterizes the strategy loader to be in a recoverable state, and executing the step of unloading the current version strategy from the memory of the current execution server.
3. The method according to claim 2, wherein the method further comprises:
acquiring a loading monitoring record and a scheduling monitoring record corresponding to the strategy loader;
Judging whether the loading monitoring record and the scheduling monitoring record have no data in preset time;
Responding to no data in the loading monitoring record and the scheduling monitoring record within the preset time, and judging whether an external object depending on the instance of the strategy loader exists or not;
The state information of the policy loader is changed to a recoverable state in response to the absence of an external object that depends on the instance of the policy loader.
4. The method according to claim 1, wherein the method further comprises:
receiving a policy loading event sent by a policy configuration terminal; the policy loading event comprises binding relation information between a version policy to be loaded and a designated execution server;
and when the current execution server is determined to be the appointed execution server according to the binding relation information, loading the version strategy to be loaded and the data corresponding to the version strategy to be loaded into a memory of the current execution server.
5. The method of claim 4, wherein the method of binding the version policy to be loaded with a designated execution server comprises:
acquiring configured strategy data;
compiling the strategy data to generate the version strategy to be loaded;
And extracting a strategy image of the strategy of the version to be loaded, screening an execution server according to the strategy image, taking the screened execution server as the appointed execution server, and binding the strategy of the version to be loaded with the appointed execution server.
6. The method of claim 5, wherein the filtering the execution server according to the policy representation comprises:
obtaining a trained matching model; the trained matching model is an algorithm model obtained by training the performance parameters of the execution server according to the historical portrait of the historical strategy;
and obtaining a specified execution server matched with the current version strategy according to the strategy portrait and the trained matching model.
7. The method according to claim 4, further comprising
Responding to an instruction for executing the version strategy to be loaded, and judging whether the version strategy to be loaded is successfully loaded in a memory;
if not, the data of the version strategy to be loaded is pulled from the strategy memory, and the version strategy to be loaded is loaded to the memory.
8. A policy iteration apparatus, the apparatus comprising:
the first acquisition module is used for responding to the strategy iteration instruction and acquiring calling condition information of a calculation thread of the current version strategy;
The first judging module is used for judging whether the computing thread is in a call-free state according to the call condition information; the thread is in a static state which is not called and executed at present, and the non-calling state comprises a non-calling state under the two conditions that the thread is not executed or is executed to complete;
the second acquisition module is used for judging whether an external object depending on the instance of the current version strategy exists or not in response to the fact that the computing thread is in a non-calling state; wherein, the instance of the current version policy refers to one or more instance objects created based on the current version policy after instantiation; the external object of the instance depending on the current version policy refers to an object having a calling or called dependency relationship with the instance of the current version policy;
and the second judging module is used for unloading the current version strategy from the memory of the current execution server in response to the fact that the external object depending on the instance of the current version strategy does not exist.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310950359.4A 2023-07-31 2023-07-31 Policy iteration method, device, computer equipment and storage medium Active CN117234701B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310950359.4A CN117234701B (en) 2023-07-31 2023-07-31 Policy iteration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310950359.4A CN117234701B (en) 2023-07-31 2023-07-31 Policy iteration method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117234701A CN117234701A (en) 2023-12-15
CN117234701B true CN117234701B (en) 2024-06-07

Family

ID=89090020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310950359.4A Active CN117234701B (en) 2023-07-31 2023-07-31 Policy iteration method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117234701B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894923A (en) * 2017-11-11 2018-04-10 北京信息科技大学 A kind of general computer game problem decision search engine class libraries
CN108287791A (en) * 2018-01-17 2018-07-17 福建天晴数码有限公司 The detection method and storage medium of the texture resource configuration of virtual reality software
CN111258926A (en) * 2020-02-26 2020-06-09 腾讯科技(深圳)有限公司 Memory recovery method and device, storage medium and computer equipment
CN111538519A (en) * 2020-04-30 2020-08-14 深圳前海微众银行股份有限公司 Version upgrading method and device
CN114205134A (en) * 2021-12-07 2022-03-18 北京神州新桥科技有限公司 Network policy detection method, electronic device, and storage medium
CN114862176A (en) * 2022-04-28 2022-08-05 上海数禾信息科技有限公司 Decision management platform and method
CN114997930A (en) * 2022-06-28 2022-09-02 上海数禾信息科技有限公司 Policy configuration method and device
CN115134238A (en) * 2022-08-30 2022-09-30 太平金融科技服务(上海)有限公司深圳分公司 Business system publishing method, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120030651A1 (en) * 2010-07-30 2012-02-02 Sap Ag System and method for test strategy optimization

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894923A (en) * 2017-11-11 2018-04-10 北京信息科技大学 A kind of general computer game problem decision search engine class libraries
CN108287791A (en) * 2018-01-17 2018-07-17 福建天晴数码有限公司 The detection method and storage medium of the texture resource configuration of virtual reality software
CN111258926A (en) * 2020-02-26 2020-06-09 腾讯科技(深圳)有限公司 Memory recovery method and device, storage medium and computer equipment
CN111538519A (en) * 2020-04-30 2020-08-14 深圳前海微众银行股份有限公司 Version upgrading method and device
CN114205134A (en) * 2021-12-07 2022-03-18 北京神州新桥科技有限公司 Network policy detection method, electronic device, and storage medium
CN114862176A (en) * 2022-04-28 2022-08-05 上海数禾信息科技有限公司 Decision management platform and method
CN114997930A (en) * 2022-06-28 2022-09-02 上海数禾信息科技有限公司 Policy configuration method and device
CN115134238A (en) * 2022-08-30 2022-09-30 太平金融科技服务(上海)有限公司深圳分公司 Business system publishing method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Iteration Strategy and its Effect Towards the Performance of Population Based Metaheuristics;Nor Azlina Ab. Aziz 等;《2020 IEEE 8th Conference on Systems, Process and Control (ICSPC)》;20210107;第58-63页 *
设计迭代管理策略的分析;何家勇 等;《重庆大学学报(自然科学版)》;20040108;第13-15页 *

Also Published As

Publication number Publication date
CN117234701A (en) 2023-12-15

Similar Documents

Publication Publication Date Title
CN110928653B (en) Cross-cluster task execution method and device, computer equipment and storage medium
CN114528085A (en) Resource scheduling method, device, computer equipment, storage medium and program product
WO2019148657A1 (en) Method for testing associated environments, electronic device and computer readable storage medium
CN113835713A (en) Source code package downloading method and device, computer equipment and storage medium
CN113377668A (en) Automatic testing method and device for service interface and computer equipment
CN113434180B (en) Data processing method and device for application, server and storage medium
CN111427943A (en) Task management method and device in ET L system
US20110078657A1 (en) Operation management server, rollback execution method, and rollback execution program
CN115543429A (en) Project environment building method, electronic equipment and computer readable storage medium
CN117234701B (en) Policy iteration method, device, computer equipment and storage medium
CN111399862A (en) Batch installation method and device of Windows missing driver and computer equipment
CN110162477B (en) Automatic abnormal debugging system and method for third-party library version upgrading
US20150089486A1 (en) Method of Firmware Upgrade
WO2023185137A1 (en) Task management method and apparatus, and device and storage medium
US20200225923A1 (en) Abort installation of firmware bundles
CN116009984A (en) Security arrangement and automatic response processing method and device and electronic equipment
CN115080076A (en) Cloud mobile phone software management method
CN114564385A (en) Software testing method and device, computer equipment and storage medium
CN109672573B (en) Configuration file deployment method, configuration file determination method, server and storage medium
US20120102505A1 (en) Dynamic process virtualization
CN109901998B (en) Resource recovery method, device, system, computer equipment and storage medium
CN113703804A (en) System upgrading method, system, device and storage medium
CN107643959A (en) Image file treating method and apparatus
CN111427720A (en) Database repair method and device, computer equipment and storage medium
EP3070610B1 (en) Information processing device, control method thereof, and recording 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