CN114003305A - Device similarity calculation method, computer device, and storage medium - Google Patents

Device similarity calculation method, computer device, and storage medium Download PDF

Info

Publication number
CN114003305A
CN114003305A CN202111231252.1A CN202111231252A CN114003305A CN 114003305 A CN114003305 A CN 114003305A CN 202111231252 A CN202111231252 A CN 202111231252A CN 114003305 A CN114003305 A CN 114003305A
Authority
CN
China
Prior art keywords
similarity
vector
implementation method
function
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111231252.1A
Other languages
Chinese (zh)
Other versions
CN114003305B (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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202111231252.1A priority Critical patent/CN114003305B/en
Publication of CN114003305A publication Critical patent/CN114003305A/en
Application granted granted Critical
Publication of CN114003305B publication Critical patent/CN114003305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Stored Programmes (AREA)

Abstract

The present application relates to a device similarity calculation method, a computer device, and a storage medium. The method comprises the following steps: acquiring a first equipment model and a second equipment model; respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model; and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method. By adopting the method, an upper software developer can intuitively know the difference between the server to be compatible and the compatible server, and develop the server by selecting the template with small difference, so that the code redundancy can be reduced, the code efficiency can be improved, the compatibility efficiency can be improved, and the manpower can be saved.

Description

Device similarity calculation method, computer device, and storage medium
Technical Field
The present application relates to the field of device management technologies, and in particular, to a device similarity calculation method, apparatus, computer device, and storage medium.
Background
Currently, server management system software configures and manages a server by calling a server interface. As the business grows, more types of servers need to be managed, the implementation of server interfaces changes, and the server management software also needs to update the interface calling method.
The interfaces for acquiring the same function may be different for different models, if the software directly calls the server interface, two sets of processing logics need to be developed, but if the server is compatible by the underlying system, the input and output of the interfaces are the same for the software, and the development can be performed according to one set of logic, so that the development amount is reduced. The higher the similarity of the two servers is, the higher the similarity of the input and the output of the two servers is, so that how to judge the similarity of the two servers is very important.
Disclosure of Invention
In view of the above, it is necessary to provide a device similarity calculation method, apparatus, computer device and storage medium for solving the above technical problems.
In one aspect, a device similarity calculation method is provided, the method including:
acquiring a first equipment model and a second equipment model;
respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method.
In one embodiment, the method further comprises:
acquiring a function list used by the software, wherein the function list comprises at least one function;
acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first realization method and the second realization method of each function;
and calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
In one embodiment, calculating the device sub-similarity between the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function includes:
acquiring a first parameter of the first implementation method;
acquiring a second parameter of the second implementation method;
respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule;
and calculating the device sub-similarity of the first device and the second device according to the first vector and the second vector.
In one embodiment, the preset rules include:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
In one embodiment, the first parameters comprise a first input parameter and a first output parameter, and the second parameters comprise a second input parameter and a second output parameter;
the respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
calculating a device sub-similarity of a first device and a second device according to the first vector and the second vector, comprising:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
In one embodiment, two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure BDA0003316039810000031
In one embodiment, calculating the device sub-similarity f between the first device and the second device according to the input vector similarity and the output vector similarity by the following formula includes:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
In one embodiment, calculating the device similarity between the first device and the second device according to the device sub-similarities between the first device and the second device corresponding to all the functions in the function list includes:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnIn which p is1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure BDA0003316039810000032
in another aspect, 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 following steps when executing the computer program:
acquiring a first equipment model and a second equipment model;
respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method.
In one embodiment, the processor, when executing the computer program, implements:
acquiring a function list used by the software, wherein the function list comprises at least one function;
acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first realization method and the second realization method of each function;
and calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
In one embodiment, the processor, when executing the computer program, implements:
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function, wherein the method comprises the following steps:
acquiring a first parameter of the first implementation method;
acquiring a second parameter of the second implementation method;
respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule;
and calculating the device sub-similarity of the first device and the second device according to the first vector and the second vector.
In one embodiment, the processor, when executing the computer program, implements:
the preset rules include:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
In one embodiment, the processor, when executing the computer program, implements:
the first parameters comprise first input parameters and first output parameters, and the second parameters comprise second input parameters and second output parameters;
the respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
calculating a device sub-similarity of a first device and a second device according to the first vector and the second vector, comprising:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
In one embodiment, the processor, when executing the computer program, performs the steps of:
two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure BDA0003316039810000051
In one embodiment, the processor, when executing the computer program, performs the steps of:
calculating a device sub-similarity f of the first device and the second device according to the input vector similarity and the output vector similarity by the following formula, including:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
In one embodiment, the processor, when executing the computer program, performs the steps of:
calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all functions in the function list, wherein the method comprises the following steps:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnIn which p is1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure BDA0003316039810000061
in yet another aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring a first equipment model and a second equipment model;
respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method.
In one embodiment, the computer program when executed by a processor implements:
acquiring a function list used by the software, wherein the function list comprises at least one function;
acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first realization method and the second realization method of each function;
and calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
In one embodiment, the computer program when executed by a processor implements the steps of:
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function, wherein the method comprises the following steps:
acquiring a first parameter of the first implementation method;
acquiring a second parameter of the second implementation method;
respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule;
and calculating the device sub-similarity of the first device and the second device according to the first vector and the second vector.
In one embodiment, the computer program when executed by a processor implements:
the preset rules include:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
In one embodiment, the computer program when executed by a processor implements the steps of:
the first parameters comprise first input parameters and first output parameters, and the second parameters comprise second input parameters and second output parameters;
the respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
calculating a device sub-similarity of a first device and a second device according to the first vector and the second vector, comprising:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
In one embodiment, the computer program when executed by a processor implements the steps of:
two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure BDA0003316039810000081
In one embodiment, the computer program when executed by a processor implements the steps of:
calculating a device sub-similarity f of the first device and the second device according to the input vector similarity and the output vector similarity by the following formula, including:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
In one embodiment, the computer program when executed by a processor implements the steps of:
calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all functions in the function list, wherein the method comprises the following steps:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnIn which p is1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure BDA0003316039810000082
by the aid of the equipment similarity calculation method and device, the computer equipment and the storage medium, developers can visually know the difference between the server to be compatible and the compatible server, develop the server by selecting the template with small difference, code redundancy can be reduced, code efficiency is improved, compatibility efficiency is improved, and manpower is saved.
Drawings
FIG. 1 is a diagram illustrating an exemplary implementation of a method for calculating device similarity;
FIG. 2 is a schematic flow chart diagram illustrating a method for device similarity calculation according to an embodiment;
FIG. 3 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The device similarity calculation method provided by the application can be applied to the application scene shown in fig. 1. The specific implementation of the present application is described by taking a device as a server, and the server may be implemented by an independent server or a server cluster formed by a plurality of servers. The upper software running on the server provides a model of the server to be compatible, a compatible server list, a related function list, a function weight vector and the like to a calculation module in a bottom module of the server, and the calculation module acquires parameters participating in calculation from a data storage module and calculates the similarity S of the server.
In one embodiment, as shown in fig. 2, there is provided a device similarity calculation method including the steps of:
step S201, acquiring a first equipment model and a second equipment model;
specifically, the first device is a compatible server, the second device is a server to be compatible, and the bottom-layer server compatibility module firstly performs compatibility development on the server, records the model of the compatible server, and an input/output parameter list of each function. And calling the bottom compatible module interface and carrying out secondary development when the upper layer software needs a compatible server. When the upper software needs to be compatible with a new server, the upper software provides a list of servers which are compatible with the upper software and the models of the servers to be compatible with the upper software to the similarity calculation module.
Step S202, respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
specifically, the data storage module stores an implementation method corresponding to each server model, and the calculation module acquires the implementation method for implementing the upper-layer software of each server from the data storage module according to the server model.
Step S203, calculating the device similarity between the first device and the second device according to the first implementation method and the second implementation method.
Specifically, the calculation module calculates the similarity between the compatible server and the server to be compatible according to the obtained implementation method of the upper layer software implemented by the compatible server and the implementation method of the upper layer software implemented by the server to be compatible.
In one embodiment, the method further comprises:
step 302, acquiring a function list used by the software, wherein the function list comprises at least one function;
specifically, a plurality of functions, such as a password function, are involved in general upper layer software, the similarity calculation needs to be performed according to each function of the upper layer software, and during the calculation, the upper layer software provides a function list used by the upper layer software to the similarity calculation module.
Based on step 302, step S202 is adjusted to step S303: acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
based on step 303, step S203 above is adjusted to:
s304, calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function;
in an embodiment, step S304, calculating the device sub-similarity between the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function, specifically including:
s3041, acquiring a first parameter of the first implementation method;
s3042, obtaining a second parameter of the second implementation method;
in one embodiment, the first parameters include a first input parameter and a first output parameter, and the second parameters include a second input parameter and a second output parameter;
specifically, taking the calculation of the sub-similarity of the cryptographic function F as an example, the input parameters of the implementation method 1 for implementing the cryptographic function F are { a, b, c }1D, output parameters x, y, z1, and input parameters for implementing method 2 are { a, b, c }2The output parameters are { x, y, z }2}
S3043, respectively constructing a first vector corresponding to the first implementation method and a second vector corresponding to the second implementation method according to the first parameter, the second parameter and a preset rule;
specifically, the respectively constructing a first vector corresponding to the first implementation method and a second vector corresponding to the second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
in one embodiment, the preset rules include:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
Specifically, in the foregoing example, the parameters of the two methods with the same input parameter are a and b, the parameter with different value ranges is c, and the parameter with different value ranges is d (only 1). Similarly, the output parameters are classified into (xy) which is the same as the output parameters and (z) which is different in range.
Obtained according to an algorithm, the input parameter vector for realizing the method 1 is I1={1,1,pC11, and the output parameter vector is O1={1,1,pz1The input parameter vector for realizing the method 2 is I2={1,1,pC20, and the output parameter vector is O2={1,1,pz2}。
Taking the input parameter c as the password length as an example, the password length for realizing the method 1 is 6-12 bits, the password length for realizing the method 2 is 8-12 bits, the total range of the parameter password length is 6-12, and p is calculated according to the ruleC1A value of 1, pC2Value 5/7, then I1={1,1,1,1},I2={1,1,5/7,0};
The output parameter z is the number of user right items as an example, the number of the user right items for realizing the method 1 is 1-6, the number of the user right items for realizing the method 2 is 1-8, the total range of the number of the user right items for the parameter is 1-8, and p isz1Value 3/4, pz2The value is 1. Then O is1={1,1,3/4},O2={1,1,1}。
S3044, calculating a device sub-similarity between the first device and the second device according to the first vector and the second vector.
Specifically, calculating the device sub-similarity between the first device and the second device according to the first vector and the second vector includes:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
In one embodiment, two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure BDA0003316039810000121
Specifically, following the foregoing example, to calculate rIFor example, rI=1/4*(1*1+1*1+1*5/7+1*0)
19/36. To calculate rO=1/3*(1*1+1*1+3/4*1)=11/12。
In one embodiment, calculating the device sub-similarity f between the first device and the second device according to the input vector similarity and the output vector similarity by the following formula includes:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
Following the previous example, the sub-similarity F of the cryptographic function F is (19/36) × (11/12) ═ 209/432.
S305, calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
In one embodiment, step S305 specifically includes:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnIn which p is1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure BDA0003316039810000131
specifically, in the above case, the functions used by the upper layer software only include the cryptographic function F and the user registration function W, and the sub-similarity F of the cryptographic function F is taken as an example1To 209/432, the sub-similarity f of the user registration function W21/3, the weight p of the cryptographic function F10.4, weight p of user registration function W2The similarity S of the first server and the second server is 0.6, 209/432 × 0.4+1/3 × 0.6 ═ 85/216.
If the similarity between the servers is 1, it indicates that the two servers are completely the same, and the functions are completely the same, and the codes can be directly and completely multiplexed.
If the servers are not completely the same, the server models are sequenced according to the similarity, the more the server with higher similarity reuses the more codes, the less the codes need to be modified, and the upper-layer software is developed by taking the most similar server model as a template according to the similarity, so that the development amount is reduced, and the compatibility efficiency is improved.
The upper layer software can provide the weight of each function according to the service, the function with larger weight is higher, and the similarity is higher, so that the similarity of the server is higher.
The upper software developer can visually know the difference between the server to be compatible and the compatible server, and selects the template with small difference for development, so that the code redundancy can be reduced, the code efficiency is improved, the compatibility efficiency is improved, and the manpower is saved.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, a display screen, and an input device 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 comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. 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 device similarity calculation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain 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 following steps when executing the computer program:
acquiring a first equipment model and a second equipment model;
respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method.
In one embodiment, the processor, when executing the computer program, implements:
acquiring a function list used by the software, wherein the function list comprises at least one function;
acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first realization method and the second realization method of each function;
and calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
In one embodiment, the processor, when executing the computer program, implements:
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function, wherein the method comprises the following steps:
acquiring a first parameter of the first implementation method;
acquiring a second parameter of the second implementation method;
respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule;
and calculating the device sub-similarity of the first device and the second device according to the first vector and the second vector.
In one embodiment, the processor, when executing the computer program, implements:
the preset rules include:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
In one embodiment, the processor, when executing the computer program, implements:
the first parameters comprise first input parameters and first output parameters, and the second parameters comprise second input parameters and second output parameters;
the respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
calculating a device sub-similarity of a first device and a second device according to the first vector and the second vector, comprising:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
In one embodiment, the processor, when executing the computer program, performs the steps of:
two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure BDA0003316039810000161
In one embodiment, the processor, when executing the computer program, performs the steps of:
calculating a device sub-similarity f of the first device and the second device according to the input vector similarity and the output vector similarity by the following formula, including:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
In one embodiment, the processor, when executing the computer program, performs the steps of:
calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all functions in the function list, wherein the method comprises the following steps:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnTherein ofp1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure BDA0003316039810000171
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:
acquiring a first equipment model and a second equipment model;
respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method.
In one embodiment, the computer program when executed by a processor implements:
acquiring a function list used by the software, wherein the function list comprises at least one function;
acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first realization method and the second realization method of each function;
and calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
In one embodiment, the computer program when executed by a processor implements the steps of:
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function, wherein the method comprises the following steps:
acquiring a first parameter of the first implementation method;
acquiring a second parameter of the second implementation method;
respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule;
and calculating the device sub-similarity of the first device and the second device according to the first vector and the second vector.
In one embodiment, the computer program when executed by a processor implements:
the preset rules include:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
In one embodiment, the computer program when executed by a processor implements the steps of:
the first parameters comprise first input parameters and first output parameters, and the second parameters comprise second input parameters and second output parameters;
the respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
calculating a device sub-similarity of a first device and a second device according to the first vector and the second vector, comprising:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
In one embodiment, the computer program when executed by a processor implements the steps of:
two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure BDA0003316039810000191
In one embodiment, the computer program when executed by a processor implements the steps of:
calculating a device sub-similarity f of the first device and the second device according to the input vector similarity and the output vector similarity by the following formula, including:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
In one embodiment, the computer program when executed by a processor implements the steps of:
calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all functions in the function list, wherein the method comprises the following steps:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnIn which p is1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure BDA0003316039810000192
it will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A device similarity calculation method, characterized by comprising:
acquiring a first equipment model and a second equipment model;
respectively acquiring a first implementation method of software on first equipment and a second implementation method of software on second equipment according to the first equipment model and the second equipment model;
and calculating the device similarity of the first device and the second device according to the first implementation method and the second implementation method.
2. The device similarity calculation method according to claim 1, characterized by further comprising:
acquiring a function list used by the software, wherein the function list comprises at least one function;
acquiring a first implementation method of each function in the function list on the first device and a second implementation method on the second device;
calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first realization method and the second realization method of each function;
and calculating the device similarity of the first device and the second device according to the device sub-similarity of the first device and the second device corresponding to all the functions in the function list.
3. The device similarity calculation method according to claim 2, wherein calculating the device sub-similarity of the first device and the second device corresponding to each function according to the first implementation method and the second implementation method of each function includes:
acquiring a first parameter of the first implementation method;
acquiring a second parameter of the second implementation method;
respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule;
and calculating the device sub-similarity of the first device and the second device according to the first vector and the second vector.
4. The device similarity calculation method according to claim 3, wherein the preset rule includes:
the parameters are the same, and the vector elements are 1;
no parameters, vector elements are 0;
the parameter ranges are different, and the vector element is the ratio of the parameter range to the total range.
5. The apparatus similarity calculation method according to claim 3, wherein the first parameters include a first input parameter and a first output parameter, and the second parameters include a second input parameter and a second output parameter;
the respectively constructing a first vector corresponding to a first implementation method and a second vector corresponding to a second implementation method according to the first parameter, the second parameter and a preset rule includes:
respectively constructing a first input vector corresponding to a first implementation method and a second input vector corresponding to a second implementation method according to the first input parameter, the second input parameter and the preset rule;
respectively constructing a first output vector corresponding to a first implementation method and a second output vector corresponding to a second implementation method according to the first output parameter, the second output parameter and the preset rule;
calculating a device sub-similarity of a first device and a second device according to the first vector and the second vector, comprising:
calculating input vector similarity according to the first input vector and the second input vector;
calculating output vector similarity according to the first output vector and the second output vector;
and calculating the device sub-similarity of the first device and the second device according to the input vector similarity and the output vector similarity.
6. The apparatus similarity calculation method according to claim 5, wherein two vector similarities r are calculated by:
first vector I1={a1,a2,a3,…an},I2={b1,b2,b3,…bn}
Figure FDA0003316039800000021
7. The device similarity calculation method according to claim 6, wherein calculating the device sub-similarity f of the first device and the second device from the input vector similarity and the output vector similarity by the following formula comprises:
f=rI*rO
wherein r isIFor input vector similarity, rOIs the output vector similarity.
8. The device similarity calculation method according to claim 7, wherein calculating the device similarity of the first device and the second device according to the device sub-similarities of the first device and the second device corresponding to all the functions in the function list comprises:
constructing a sub-similarity vector F ═ { F) for all functions1,f2,…,fnN is the number of function items used by upper-layer software, f1 is the equipment sub-similarity of the first function, and so on;
acquiring a function weight vector P ═ { P } constructed by function weights corresponding to all functions1,p2,…,pnIn which p is1The function weight of the first function is obtained in the same way, and the sum of all weights is 1;
the device similarity S between the first device and the second device is:
Figure FDA0003316039800000031
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 steps of the method of any of claims 1 to 8 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202111231252.1A 2021-10-22 2021-10-22 Device similarity calculation method, computer device, and storage medium Active CN114003305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111231252.1A CN114003305B (en) 2021-10-22 2021-10-22 Device similarity calculation method, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111231252.1A CN114003305B (en) 2021-10-22 2021-10-22 Device similarity calculation method, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN114003305A true CN114003305A (en) 2022-02-01
CN114003305B CN114003305B (en) 2024-03-15

Family

ID=79923625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111231252.1A Active CN114003305B (en) 2021-10-22 2021-10-22 Device similarity calculation method, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN114003305B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020258506A1 (en) * 2019-06-27 2020-12-30 平安科技(深圳)有限公司 Text information matching degree detection method and apparatus, computer device and storage medium
CN112559365A (en) * 2020-12-23 2021-03-26 上海品顺信息科技有限公司 Test case screening method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020258506A1 (en) * 2019-06-27 2020-12-30 平安科技(深圳)有限公司 Text information matching degree detection method and apparatus, computer device and storage medium
CN112559365A (en) * 2020-12-23 2021-03-26 上海品顺信息科技有限公司 Test case screening method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHIN-LIANG CHANG: "Fuzzy similarity for function computation model", IEEE, 1 October 2015 (2015-10-01) *
王爱菊;丁颖;马文越;黄继海;: "云计算网络下的服务器兼容性估计模型软件设计", 现代电子技术, no. 12, 15 June 2017 (2017-06-15) *

Also Published As

Publication number Publication date
CN114003305B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN109345324B (en) Application function recommendation method and device, computer equipment and storage medium
CN112565272B (en) Method and device for blocking minimum Steiner tree of double-layer network and computer equipment
CN111126668A (en) Spark operation time prediction method and device based on graph convolution network
CN110764913B (en) Data calculation method based on rule calling, client and readable storage medium
CN111399833A (en) Service data processing method and device, computer equipment and storage medium
CN111324471A (en) Service adjusting method, device, equipment and storage medium
CN114816711A (en) Batch task processing method and device, computer equipment and storage medium
CN112540749A (en) Micro-service dividing method and device, computer equipment and readable storage medium
CN112765833B (en) Reliability modeling and evaluation method for dynamic tasks of redundant multi-stage task system
CN109542962B (en) Data processing method, data processing device, computer equipment and storage medium
CN111934937B (en) Dependent network node importance degree evaluation method and device based on importance iteration
CN113158435A (en) Complex system simulation running time prediction method and device based on ensemble learning
CN113568612A (en) Service configuration method, device, computer equipment and storage medium
CN112163929A (en) Service recommendation method and device, computer equipment and storage medium
CN114003305A (en) Device similarity calculation method, computer device, and storage medium
CN111291085A (en) Hierarchical interest matching method and device, computer equipment and storage medium
CN115221852A (en) Vxe-table based dynamic calculation table implementation method, device and computer equipment
JP2022007311A (en) System for evaluating risk of information leakage from learning model
CN113610558A (en) Resource distribution method and device, electronic equipment and storage medium
CN112395148A (en) Quantification method and device for micro-service evaluation, computer equipment and storage medium
CN111124932A (en) Scheme verification method, system, device, computer equipment and storage medium
CN111598390A (en) Server high availability evaluation method, device, equipment and readable storage medium
CN114118388B (en) Heterogeneous network graph link prediction method facing user privacy protection and related equipment
CN117934049B (en) Multi-level cost calculation optimization method and device, electronic equipment and storage medium
CN111985185A (en) Circuit board code generation method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant