Disclosure of Invention
In view of the foregoing, it is desirable to provide a server development method, apparatus, computer device, and storage medium that can improve server compatibility and shorten development cycle.
According to a first aspect of the present application, there is provided a server development method, the method comprising:
classifying all developed servers according to development templates used by server development, wherein servers belonging to the same class correspond to the same development template;
acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
determining the similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
and determining a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
In some embodiments, the method further comprises:
and screening the first configuration information sets of all the servers included in each development template based on the number of the servers to obtain the feature configuration information set corresponding to each development simulation.
In some embodiments, the step of filtering the first configuration information set of all developed servers included in each development template based on the number to obtain the feature configuration information set corresponding to each development simulation includes:
acquiring a first number of developed servers containing certain configuration information in all the developed servers;
respectively acquiring a second number of developed servers containing certain configuration information in each development template;
taking the ratio of the second quantity to the first quantity as the preference of certain configuration information in each development template;
sequencing the preference degree of all the configuration information by taking each development template as a unit;
and selecting a preset number of configuration information from the side with highest preference as a feature configuration information set corresponding to each development template.
In some embodiments, the step of determining the similarity of the server to be developed to each development template based on the first set of configuration information and the second set of configuration information comprises:
judging whether certain configuration information in the second configuration information set belongs to a characteristic configuration information set corresponding to each development template, and if so, acquiring the preference of certain configuration information under each development template;
and calculating the sum of the preference of all the acquired configuration information by taking each development template as a unit, and taking the sum as the similarity between the server to be developed and each development template.
In some embodiments, the step of determining the target development template of the server to be developed according to the similarity between the server to be developed and each development template includes:
sequencing the similarity between the server to be developed and each development template to obtain the highest similarity;
and taking the development template corresponding to the highest similarity as the target development template.
In some embodiments, the method further comprises:
adding the server to be developed into a server class corresponding to the target development template;
and returning to execute the step of screening the first configuration information sets of all the servers included in each development template based on the number of the servers to obtain the feature configuration information set corresponding to each development simulation so as to update the feature information set corresponding to each development template.
In some embodiments, the first configuration information and the second configuration information include at least one of: server model, central processor model, number of central processors, central processor manufacturer, whether graphics processor is included, graphics processor model, number of graphics processors, graphics processor manufacturer, memory capacity.
According to a second aspect of the present application, there is provided a server development apparatus, the apparatus comprising:
the classification module is configured to classify all developed servers according to development templates used for server development, wherein servers belonging to the same class correspond to the same development template;
the acquisition module is configured to acquire a first configuration information set of each developed server and a second configuration information set of a server to be developed;
a similarity determining module configured to determine a similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
and the development template determining module is configured to determine a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
According to a third aspect of the present application, there is also provided a computer device comprising:
at least one processor; and
a memory storing a computer program executable on a processor, the processor executing the server development method described above when executing the program, the method comprising:
classifying all developed servers according to development templates used by server development, wherein servers belonging to the same class correspond to the same development template;
acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
determining the similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
and determining a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
According to a fourth aspect of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, performs the aforementioned server development method, the method comprising:
classifying all developed servers according to development templates used by server development, wherein servers belonging to the same class correspond to the same development template;
acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
determining the similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
and determining a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
According to the server development method, all developed servers are classified according to the development templates used for server development, then the first configuration information set of each developed server and the second configuration information set of the server to be developed are obtained, the similarity between the server to be developed and each development template is determined based on the obtained first configuration information set and the second configuration information set, and finally the target development template is selected from the existing development templates for the server to be developed according to the similarity, so that the workload of compatibility test and development is remarkably reduced, the server compatibility efficiency is improved, the development period is shortened, and the development cost of the server is reduced.
In addition, the application also provides a server development device, a computer device and a computer readable storage medium, which can also achieve the technical effects described above, and are not repeated here.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the following embodiments of the present application will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present application, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present application, and the following embodiments are not described one by one.
In one embodiment, please refer to fig. 1, fig. 1 shows a flowchart of a server development method 100 according to one embodiment of the present application, specifically, the method includes the following steps:
step 101, classifying all developed servers according to development templates used for server development, wherein servers belonging to the same class correspond to the same development template;
in this embodiment, the developed server refers to a server in which a script program has been written to implement management and interface call to the server, and implement corresponding functions. The development template is a script program for realizing the corresponding function of the server. The same development template can comprise a plurality of servers, for example, ten existing developed servers are provided, four development templates are provided, one server is provided under each of three development templates, and seven servers with different configurations are provided under the rest one development template. It should be noted that the above-listed classification results of servers, the number of servers corresponding to each development template, and the number of development templates are only used for illustration, and the method of the present application does not limit the number of development templates and the data of the servers included in each development template.
Step 102, acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
in the present embodiment, the configuration information value refers to a hardware configuration of the server, for example, whether or not a device such as a central processing unit, a graphics card, a memory, or the like is included, and the number of models of each device, or the like. Preferably, the first configuration information and the second configuration information include at least one of: server model, central processor model, number of central processors, central processor manufacturer, whether graphics processor is included, graphics processor model, number of graphics processors, graphics processor manufacturer, memory capacity.
Step 103, determining the similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
the similarity is the similarity between the second server and the first configuration information included by each development template, and the similarity represents the similarity between the configuration of the server to be developed and the configuration of each development template.
And 104, determining a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
According to the server development method, all developed servers are classified according to the development templates used for server development, then the first configuration information set of each developed server and the second configuration information set of the server to be developed are obtained, the similarity between the server to be developed and each development template is determined based on the obtained first configuration information set and the second configuration information set, and finally the target development template is selected from the existing development templates for the server to be developed according to the similarity, so that the workload of compatibility test and development is remarkably reduced, the server compatibility efficiency is improved, the development period is shortened, and the development cost of the server is reduced.
In yet another embodiment, please refer to fig. 2, fig. 2 shows a flowchart of another server development method 200 according to another embodiment of the present application, the method includes:
step 201, classifying all developed servers according to development templates used for server development, wherein servers belonging to the same class correspond to the same development template;
step 202, acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
in this embodiment, the specific operations of steps 201 to 202 are described in detail in steps 101 to 102 in the embodiment shown in fig. 1, and are not described herein.
And 203, screening the first configuration information sets of all the servers included in each development template based on the number of the servers to obtain a feature configuration information set corresponding to each development simulation.
In this embodiment, since a plurality of servers may be included under each development template, each server has its own hardware configuration, and these configuration information have different importance levels, it is necessary to reduce the feature information included in each development template, specifically, the filtering may be performed according to the degree of re-compression of each configuration information, the priority of each configuration, and so on.
In some alternative embodiments, the specific implementation of step 203 is as follows:
step 2031, obtaining a first number of developed servers including certain configuration information in all developed servers;
step 2032, obtaining a second number of developed servers containing a certain configuration information in each development template;
step 2033, taking the ratio of the second number to the first number as the preference of the certain configuration information in each development template;
step 2034, sorting the preference of all the configuration information by taking each development template as a unit;
step 2035, selecting a preset number of configuration information from the side with the highest preference as the feature configuration information set corresponding to each development template.
For example, it is assumed that two development templates are denoted as a development template M1 and a development template M2, where the servers in the development template M1 have two denoted as servers A1 and A2, and if the configuration information of the server A1 is a cpu model, a cpu number, and a graphics card model, and if the configuration information of the server A2 includes the cpu model, the graphics card model, and a memory capacity, by calculating the preference of the cpu model, the graphics card central processing number, the graphics card model, and the memory capacity, where the preference of the cpu model and the graphics card model processor is higher, the cpu model and the graphics card model are taken as a feature configuration information set of the development template M1, and the corresponding development template M2 may perform simplification of the configuration information in the same manner. It should be noted that, the configuration information of the above server may be obtained according to the configuration of the server itself, the number of the feature configuration information screened may be set according to the requirement of the user, and the feature configuration information set formed by each configuration information may be able to distinguish different development templates.
Step 204, judging whether certain configuration information in the second configuration information set belongs to the feature configuration information set corresponding to each development template, and if so, acquiring the preference of certain configuration information under each development template;
step 205, calculating the sum of the preference of all the acquired configuration information by taking each development template as a unit, and taking the sum as the similarity between the server to be developed and each development template;
step 206, sorting the similarity between the server to be developed and each development template to obtain the highest similarity;
step 207, taking the development template corresponding to the highest similarity as the target development template;
step 208, adding the server to be developed into a server class corresponding to the target development template;
step 209, go back to step 203 to update the feature information set corresponding to each development template.
According to the server development method, the configuration information included in the development template is simplified, the configuration information set with higher preference is selected as the characteristic configuration information set, the data operation amount is reduced, the development template matching efficiency is improved, and in addition, the characteristic configuration information set of the existing development template is automatically updated based on the development template determined by the server to be developed, so that the proper development template can be accurately matched when a new server to be developed is available later, the labor amount of manual development is saved, and the development efficiency of the server is improved.
In yet another embodiment, for easy understanding of the technical solution of the present application, please refer to fig. 3, in which the following description uses configuration information as related information of a central processing unit as an example, specifically, the method of the present application includes the following steps:
step 301, classifying the developed servers according to the development templates, and the specific implementation modes are as follows:
(1) All developed servers (i.e., compatible) are classified according to whether the script program implementing the function is the same, and each type of server is commonly used with a set of development templates (e.g., development script programs). For example, the server A, B, C, D uses the development template M1, and the server E, F, G uses the development template M2.
(2) A server basic information set I is maintained, various basic information of the server, such as a central processing model, is arranged in the set, and whether the server is similar to each development template or not can be judged through the attribute.
Step 302, extracting feature configuration information according to a development template, wherein the specific implementation mode is as follows:
(1) The preference (denoted as α) of each element in the collection I is computed in turn, i.e., the attribute can better distinguish the servers under the development template from other servers. The calculation formula of the preference alpha is as follows:
taking the CPU model as an example, the model set of the servers in the development template M1 is { a1, a2}, and for all servers, if the number of servers with the model a1 is n1, the number of servers with the model a2 is n2, the number of servers corresponding to the development template M1 is M, and the preference of the CPU signal is M/(n1+n2).
For example, the preference degree of each element in the set I under the development template M1 is calculated, the first N elements are selected according to the preference degree sequence, N can be selected according to actual conditions, and a preferred attribute set I corresponding to the development template M1 is obtained M1 The method comprises the steps of carrying out a first treatment on the surface of the The feature configuration information set of each development template is calculated in the same manner.
Step 303, obtaining hardware configuration information of the server to be developed.
Step 304, calculating the similarity between the server to be developed and each development template, wherein the specific implementation manner is as follows:
(1) Assuming that the server to be developed is denoted as a server X, assuming that the feature configuration information set of the development template M1 is I M1 Wherein the attribute is { a, b, c, d, e };
(2) For a certain server A in M1, obtain I M1 The information corresponding to the attributes in the table (a) is an attribute vector { aA, bA, cA, dA, eA }, for example, a is the number of CPUs, and X is 2 CPUs, aa=2.
(3) For the server X to be developed, obtain I M1 The information corresponding to the feature configuration information in the model (a) forms attribute vectors { aX, bX, cX, dX, eX };
(4) The similarity between the server X and each development template is calculated, and the similarity calculation formula is as follows:
wherein alpha is i Preference for the ith configuration information of server A, r i And taking the similarity value of the configuration information and the configuration information as a similarity value, wherein the similarity value takes the value mode that if the configuration information is the same as 1, otherwise, the value is 0.
For example, taking the number of CPUs as an example, the number of preference degrees of 2 is expressed as:
similarly, the preference of 4 CPUs is expressed as:
step 305, sorting each development template according to the similarity;
step 306, applying the development template with highest similarity to the server to be developed.
According to the server development method, the most similar development templates are selected for compatibility according to the basic configuration information of the server, the server with high similarity is more likely to multiplex more codes, development workload of research personnel is greatly reduced, development efficiency of the server is improved, and compatibility speed is increased.
In yet another embodiment, as shown in fig. 4, the present application further provides a server development device 400, specifically, the retrofitting device includes:
the classification module 401 is configured to classify all developed servers according to development templates used for server development, wherein servers belonging to the same class correspond to the same development template;
an acquisition module 402 configured to acquire a first set of configuration information for each developed server and a second set of configuration information for a server to be developed;
a similarity determining module 403 configured to determine a similarity between the server to be developed and each development template based on the first set of configuration information and the second set of configuration information;
the development template determining module 404 is configured to determine a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
According to the server development device, all developed servers are classified according to the development templates used for server development, then the first configuration information set of each developed server and the second configuration information set of the server to be developed are obtained, the similarity between the server to be developed and each development template is determined based on the obtained first configuration information set and the second configuration information set, and finally the target development template is selected from the existing development templates for the server to be developed according to the similarity, so that the workload of compatibility test and development is remarkably reduced, the server compatibility efficiency is improved, the development period is shortened, and the development cost of the server is reduced.
It should be noted that, the specific limitation of the server development device may be referred to the limitation of the server development method hereinabove, and will not be described herein. The respective modules in the server development apparatus described above may be implemented in whole or in part by software, hardware, and a combination 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.
According to another aspect of the present application, there is provided a computer device, which may be a server, and an internal structure thereof is shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database 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 database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the server development method described above, in particular the method comprising the steps of:
classifying all developed servers according to development templates used by server development, wherein servers belonging to the same class correspond to the same development template;
acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
determining the similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
and determining a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
According to still another aspect of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the server development method described above, and in particular, includes performing the steps of:
classifying all developed servers according to development templates used by server development, wherein servers belonging to the same class correspond to the same development template;
acquiring a first configuration information set of each developed server and a second configuration information set of a server to be developed;
determining the similarity between the server to be developed and each development template based on the first configuration information set and the second configuration information set;
and determining a target development template of the server to be developed according to the similarity between the server to be developed and each development template.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. 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 DRAM (SLDRAM), memory bus 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.