Disclosure of Invention
The present disclosure is directed to solving at least one of the problems of the prior art and provides an isomer generating method, a server, and a computer readable medium.
To achieve the above object, an embodiment of the present disclosure provides an isomer generating method, including:
acquiring application configuration parameters, performing risk assessment, and generating first risk assessment information, wherein the application configuration parameters comprise: configuration parameters of at least one application component;
generating isomer transformation information according to the first risk assessment information, system environment information and a preset isomer initial transformation frequency, wherein the system environment information is used for indicating a deployable system environment;
and generating an isomer configuration file according to the isomer transformation information and the application configuration parameters.
In some embodiments, at least one of the application components comprises: application body, middleware, and database.
In some embodiments, the first risk assessment information comprises: a first risk assessment parameter corresponding to each application component;
the step of generating isomer transformation information according to the first risk assessment information, the system environment information, and the preset number of isomer initial transformations specifically includes:
calculating to obtain the total component transformation times corresponding to the application components according to the first risk assessment parameters, the system environment information and the isomer initial transformation times;
generating the isomer transformation information according to the total times of transformation of each assembly, wherein the isomer transformation information comprises: a first environment transformation frequency corresponding to each of the system environments.
In some embodiments, the step of generating the isomer transformation information according to the total number of times of transformation of each of the components specifically includes:
aiming at each component transformation total frequency, scattering the component transformation total frequency into a plurality of component transformation frequencies, and distributing the plurality of component transformation frequencies to each system environment in a one-to-one correspondence manner;
and for each system environment, adding the conversion times of the components distributed in the system environment to obtain the conversion times of the first environment so as to generate isomer conversion information.
In some embodiments, the system environment information includes: a total number of system environments and at least one deployable system environment type.
In some embodiments, after the step of generating the first risk assessment information, further comprising:
performing risk assessment aiming at each system environment type to generate second risk assessment information;
determining the system environment number corresponding to each system environment type according to the second risk assessment information and the total number of the system environments;
and configuring the system environment according to the system environment number, and updating the system environment information.
In some embodiments, the step of generating isomer transformation information according to the first risk assessment information, the system environment information, and a preset number of times of isomer initial transformation specifically includes:
generating isomer transformation information according to the first risk assessment information, the updated system environment information and the isomer initial transformation times, wherein the isomer transformation information comprises: and the second environment conversion times corresponding to the configured system environments.
To achieve the above object, an embodiment of the present disclosure provides a server, including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement an isoform generation method as described in any of the previous embodiments.
To achieve the above object, the embodiments of the present disclosure provide a computer readable medium, on which a computer program is stored, the program, when executed by a processor, implementing the steps in the isomer generating method as described in any of the above embodiments.
The present disclosure has the following beneficial effects:
the embodiment of the disclosure provides an isomer generation method, a server and a computer readable medium, which can dynamically generate isomers according to the self condition of an application and the specific condition of a deployable system environment and by combining corresponding risk assessment results, perform corresponding isomer configuration, and improve efficiency and applicability while ensuring the isomerism.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present disclosure, the isomer generating method, the server and the computer readable medium provided by the present disclosure are described in detail below with reference to the accompanying drawings.
Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but which may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It will be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. Thus, a first element, component, or module discussed below could be termed a second element, component, or module without departing from the teachings of the present disclosure.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The isoform generation methods, servers, and computer readable media provided by the present disclosure may be used to configure the corresponding isoform in conjunction with risk assessment based on application configuration parameters and system environment.
Fig. 1 is a flow chart of an isomer generation method provided by an embodiment of the present disclosure. As shown in fig. 1, the method is applicable to generating a profile of a Web application, the method comprising:
and step S1, acquiring the application configuration parameters, performing risk assessment, and generating first risk assessment information.
Wherein, the application configuration parameters comprise: configuration parameters of at least one application component. The process of obtaining the application configuration parameters may be performed by an environment analysis module or other query means.
In some embodiments, for a general architecture of a Web application, at least one application component includes: application body, middleware, and database.
The configuration parameters of the application main body comprise: the file configuration parameters of the front-end file, the back-end executable file, the interface executable file and the main body configuration file also comprise configuration parameters of connection information such as a slight application mapping address, a port number and the like from the aspect of heterogeneity; the configuration parameters of the middleware comprise: configuration parameters of an application agent, application deployment, an application log and a middleware configuration file, and configuration parameters of connection information such as a rough authentication address and an attachment directory; the configuration parameters of the database include: the configuration parameters of the business database, the cache, the file service and the database configuration file also comprise the configuration parameters of the connection information such as the address, the port number, the user name, the password and the like of the database.
In some embodiments, the risk assessment is performed, and the process of generating the first risk assessment information may be performed by a corresponding risk assessment module, or by querying a summarized risk assessment report.
And step S2, isomer transformation information is generated according to the first risk assessment information, the system environment information and the preset isomer initial transformation times.
Wherein the system environment information is used to indicate a deployable system environment; the number of initial isomer transformations is generally set to 3, i.e., the initial coefficient at which the number of isomer transformations is calculated.
In some embodiments, the system environment information includes: the total number of system environments, the types of the system environments (e.g., Windows, Linux, Docker, etc.) where applications can be deployed, and the number of system environments corresponding to each system environment type. The total number of the system environment is determined according to software and hardware conditions of the server or other equipment, and can be configured in advance.
In some embodiments, the isomer transformation information may be generated by multiplying the total number of system environments, the risk assessment parameter in the first risk assessment information, and the number of isomer initial transformations by rounding up to obtain a calculation result.
And step S3, generating isomer configuration files according to the isomer transformation information and the application configuration parameters.
And carrying out heterogeneous transformation on the configuration parameters of each application component according to the isomer transformation information to generate an isomer configuration file.
Fig. 2 is a flow chart of another isomer generation method provided by embodiments of the present disclosure. As shown in fig. 2, the method is an embodiment alternative based on the method shown in fig. 1. Specifically, the first risk assessment information includes: first risk assessment parameters corresponding to the application components; step S2, generating isomer transformation information according to the first risk assessment information, the system environment information and the preset initial isomer transformation times, specifically including step S201 and step S202. Only step S201 and step S202 will be described in detail below.
Step S201, calculating to obtain the total component transformation times corresponding to each application component according to each first risk assessment parameter, system environment information and the initial isomer transformation times.
The total times of component transformation are the total times of heterogeneous transformation of the application component in all system environments.
In some embodiments, the risk assessment parameters are obtained according to the risk requirements of each application component, and the risk assessment parameters may be expressed in numerical form.
And step S202, isomer transformation information is generated according to the total times of transformation of each component.
Wherein the isomer transformation information includes: the number of times of first environment conversion corresponding to each system environment. The first environment transformation times are times of heterogeneous transformation of the system environment.
Fig. 3 is a flowchart illustrating a specific implementation manner of step S202 in the embodiment of the present disclosure. As shown in fig. 3, specifically, step S202 includes: step S2021 and step S2022.
Step S2021, for each total component transformation frequency, scattering the total component transformation frequency into a plurality of component transformation frequencies, and allocating the plurality of component transformation frequencies to each system environment in a one-to-one correspondence.
And when the total times of the scattering component are changed, the heterogeneity can be enhanced by adopting a random scattering mode. The total times of component transformation and the times of component transformation are integers, the times of single component transformation can be zero, and the times of component transformation is the times of heterogeneous transformation of the application component in a system environment. And after the one-to-one corresponding distribution is finished, the number of the component conversion times distributed in a single system environment is the number of the application components.
Step S2022, adding the component transformation times allocated in each system environment to obtain a first environment transformation time, so as to generate isomer transformation information.
Adding the times of heterogeneous transformation of each application component in the system environment to obtain the times of heterogeneous transformation of the system environment.
Embodiments of the present disclosure provide an isoform generation method that may be used to dynamically configure isoforms based on actual risk assessment of individual components or application layers of an application.
Fig. 4 is a flow chart of yet another isomer generation method provided by embodiments of the present disclosure. As shown in fig. 4, the method is an embodied alternative embodiment based on the method shown in fig. 1. Specifically, the system environment information includes: a total number of system environments and at least one deployable system environment type; the method includes not only step S1 and step S3, but also steps S101 to S103 after step S1. Only step S101 to step S103 will be described in detail below.
And S101, performing risk assessment aiming at each system environment type to generate second risk assessment information.
In some embodiments, the risk assessment is performed for each system environment type, and the process of generating the second risk assessment information may be performed by a corresponding risk assessment module, or by querying a summarized risk assessment report, similar to the process of generating the first risk assessment information.
In some embodiments, the second risk assessment information includes risk assessment parameters corresponding to each system environment type.
And S102, determining the system environment number corresponding to each system environment type according to the second risk assessment information and the total number of the system environments.
In some embodiments, the risk assessment parameter corresponding to each system environment type is multiplied by the total number of system environments and rounded to obtain the number of system environments corresponding to each system environment type.
And step S103, configuring the system environment according to the number of the system environments and updating the system environment information.
In some embodiments, in step S2, the step of generating isomer transformation information according to the first risk assessment information, the system environment information, and the preset number of isomer initial transformations specifically includes:
and S2a, generating isomer transformation information according to the first risk assessment information, the updated system environment information and the preset initial isomer transformation times.
Wherein the isomer transformation information includes: and the second environment conversion times corresponding to the configured system environments. The second environment transformation times are times of heterogeneous transformation of the current system environment.
The embodiment of the disclosure provides an isomer generation method, which can be used for risk assessment of each system environment while risk assessment is performed on application configuration, so that the safety is improved, and the isomers are diversified.
The step flow of the isomer generation method in the present disclosure is described in detail below in conjunction with practical applications, specifically, for Web applications, the total deployable system environment is 10; the deployable system environment types are a Windows system, a Linux system and a Docker system; the number of initial isomer transformations is 3; the basic application configuration parameters are as follows:
web application body: and (3) developing a language: java; front-end file: …/demo; back-end runnable files: …/demo/classes; configuration files: …/demo/WEB-INF; b. a middleware: name: tomcat; application deployment: (ii) opt/tomcat/webapps; application of the log: t opt/tomcat/logs; and (3) middleware configuration: t opt/tomcat/conf; c. a database: name: MySQL; a service database: /opt/mysql/data/demo; and (3) database configuration: cnf/opt/mysql/etc/my.
First, risk assessment is carried out according to application configuration parameters, and first risk assessment information is generated. The first risk assessment information includes first risk assessment parameters corresponding to the application components. Wherein the risk requirement of the application subject is higher safety requirement, and the risk evaluation parameter is 7/20; the risk requirement of the middleware is to avoid directly hanging the middleware after being broken, and the risk evaluation parameter is 5/20; the risk requirement of the database is that the data sensitivity requirement is high, and the risk assessment parameter is 8/20.
And then, performing risk assessment aiming at each system environment type to generate second risk assessment information. The second risk assessment information includes second risk assessment parameters corresponding to the system environment types. Wherein the risk assessment parameter of the Windows system is 5/15; the risk assessment parameter of the Linux system is 7/15; the risk assessment parameter for the Docker system is 3/15.
And determining the system environment number corresponding to each system environment type according to the second risk assessment information and the total number of the system environments. Wherein, the system environment number of the Windows system is 5/15 × 10, and the whole is 3 sets; the number of the system environment of the Linux system is 7/15 × 10, and 5 sets of the Linux system are rounded; the number of system environments of the Docker system is 3/15 × 10 — 2 sets. Thereby, the system environment is configured, and the system environment information is updated.
And then, calculating to obtain the total component transformation times corresponding to each application component according to each first risk assessment parameter, the system environment information and the isomer initial transformation times. Wherein, the total times of applying the subject transformation is 3 × 7/20 × 10 ═ 10.5, and the round up is 11 times; the total number of transitions of the intermediate piece was 3 × 5/20 × 10 ═ 7.5 rounded up to 8; the total number of database transformations was 3 × 8/20 × 10 ═ 12.
And aiming at the total times of the transformation of each component, scattering the total times of the transformation of the component into a plurality of times of the transformation of the component, and distributing the times of the transformation of the component to each system environment in a one-to-one correspondence manner. And for each system environment, adding the conversion times of the components distributed in the system environment to obtain a first environment conversion time so as to generate isomer conversion information.
The system environment conditions, the scatter results, and the first environment transformation times are as follows:
the values in the table are the conversion times, the other values except the value in the last row are the component conversion times, and the value in the last row is the first environment conversion times.
And finally, generating an isomer configuration file according to the isomer transformation information and the application configuration parameters. Taking one isomer in the isomer profile as an example, the rest can be analogized. The isomer is subjected to 3 times of isomeric transformation, and the configuration parameters are as follows:
web application body: front-end file: …/demo 123; back-end runnable files: …/demo/classes 123; configuration files: …/demo/WEB-INF 123; b. a middleware: application deployment: /opt/tomcat/webapps 123; application of the log: /opt/tomcat/logs 123; and (3) middleware configuration: /opt/tomcat/conf 123; c. a database: a service database: /opt/mysql/data/demo 123; and (3) database configuration: /opt/mysql/etc/my123. cnf.
To this end, the isoform generation for this Web application is completed.
An embodiment of the present disclosure further provides a server, including: one or more processors;
storage means for storing one or more programs; when executed by the one or more processors, cause the one or more processors to implement any of the isoform generating methods as in the previous embodiments.
The embodiments of the present disclosure also provide a computer readable medium, on which a computer program is stored, which when executed by a processor implements the steps in any one of the isomer generating methods in the above embodiments.
It is to be understood that the above embodiments are merely exemplary embodiments that are employed to illustrate the principles of the present disclosure, and that the present disclosure is not limited thereto. It will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the disclosure, and these are to be considered as the scope of the disclosure.