Disclosure of Invention
Aiming at the problems existing in the prior art, the embodiment of the invention provides a method and equipment for generating a dynamic identifier of terminal equipment, which can solve the problems of unique identifier of the equipment and shared identifier among products on the premise of not collecting sensitive information of the terminal equipment.
In a first aspect, an embodiment of the present invention provides a method for generating a dynamic identifier of a terminal device, including:
respectively obtaining the latest modification time of N application programs on target terminal equipment, wherein N is a positive integer;
And generating the dynamic identification of the target terminal equipment based on the identifications of the N application programs and the latest modification time of the N application programs.
Further, the obtaining the latest modification time of the N application programs on the target terminal device respectively specifically includes:
acquiring top N application programs with discrete contribution from high to low based on the latest modification time of a plurality of alternative application programs on a plurality of terminal devices; wherein the plurality of terminal devices includes the target terminal device; the discrete contribution degree refers to the discrete degree of the latest modification time of the application program on different terminal equipment;
And respectively acquiring the latest modification time of the N application programs on the target terminal equipment.
Further, based on the latest modification time of the plurality of alternative application programs on the plurality of terminal devices, acquiring the first N application programs with discrete contribution from high to low specifically includes:
based on the latest modification time and duplication removal of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with one-to-one discrete contribution from high to low;
the one-to-one discrete contribution degree refers to the proportion of first discrete data to the total latest modification time, and the first discrete data refers to the number of terminal equipment corresponding to one latest modification time of an application program.
Further, based on the latest modification time of the plurality of alternative application programs on the plurality of terminal devices, acquiring the first N application programs with discrete contribution from high to low specifically includes:
Based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring a pair of top N application programs with N discrete contribution degrees from high to low;
The pair of n discrete contribution degrees refers to the proportion of second discrete data to the total latest modification time, the second discrete data refers to the number of terminal devices corresponding to n and less than one latest modification time of an application program, and n is a positive integer greater than 1.
Further, after the last modification time and duplication removal of the plurality of candidate applications on the plurality of terminal devices, obtaining first N applications with one-to-one duty cycle discrete contribution from high to low, further includes:
based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with first contribution values from high to low;
The first contribution value refers to a value obtained by carrying out weighted summation on one-to-one discrete contribution degree of the application program and the latest modified time abnormal data duty ratio.
Further, after the last modification time and duplication removal of the plurality of alternative applications on the plurality of terminal devices, a pair of top N applications with N discrete contribution degrees from high to low is obtained, and the method further includes:
based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with second contribution values from high to low;
The second contribution value is a value obtained by weighted summation of a pair of n discrete contribution degrees of the application program and the latest modified time anomaly data duty ratio.
Further, based on the latest modification time of the plurality of alternative application programs on the plurality of terminal devices, acquiring the first N application programs with discrete contribution from high to low specifically includes:
Based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with third contribution values from high to low;
the third contribution value is a value obtained by weighted summation of a one-to-one discrete contribution degree and a pair of n discrete contribution degrees of the application program.
The one-to-one discrete contribution degree refers to the proportion of first discrete data to the number of all latest modification times, and the first discrete data refers to the number of terminal equipment corresponding to one latest modification time of an application program; the pair of n discrete contribution degrees refers to the proportion of second discrete data to the total latest modification time, the second discrete data refers to the number of terminal devices corresponding to n and less than one latest modification time of an application program, and n is a positive integer greater than 1.
Further, the acquiring the first N applications with discrete contribution from high to low based on the latest modification time of the plurality of candidate applications on the plurality of terminal devices further includes:
based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with fourth contribution values from high to low;
The fourth contribution value is a value obtained by weighted summation of one-to-one discrete contribution degree, one-to-n discrete contribution degree and the latest modified time abnormal data duty ratio of the application program.
In a second aspect, an embodiment of the present invention provides an electronic device, including:
At least one processor; and
At least one memory communicatively coupled to the processor, wherein:
The memory stores program instructions executable by the processor, and the processor invokes the program instructions to perform the method for generating the dynamic identifier of the terminal device and the method according to any optional embodiment of the method according to the first aspect of the embodiment of the present invention.
In a third aspect, an embodiment of the present invention provides a non-transitory computer readable storage medium, where the non-transitory computer readable storage medium stores computer instructions for executing the method for generating the dynamic identifier of the terminal device according to the first aspect of the embodiment of the present invention and the method according to any optional embodiment of the present invention.
The method for generating the dynamic identification of the terminal equipment provided by the embodiment of the invention can generate the unique dynamic identification of the target terminal equipment according to the identification of one or more application programs on the target terminal equipment and the latest modification time thereof on the premise of not collecting the sensitive information of the terminal equipment, has extremely low collision rate, and solves the problems of the unique identification of the equipment and the shared identification among products.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The descriptions of the "first" and "second" in the embodiments of the present invention are used to distinguish different data, messages, devices, modules, and the like, and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
Fig. 1 is a flow chart of a method for generating a dynamic identifier of a terminal device according to an embodiment of the present invention. The method for generating the dynamic identifier of the terminal equipment shown in fig. 1 comprises the following steps:
100, respectively obtaining the latest modification time of N application programs on target terminal equipment, wherein N is a positive integer;
For a target terminal device, embodiments of the present invention generate a dynamic identification of the mobile device by collecting the most recent modification time of one or more specific system applications or hot three-party applications in the terminal. Preferably, the selection standard of the specific system application or the hot three-party application is that the application with larger coverage and moderate update frequency, and the application with high dispersion and low collision rate is selected as a factor for generating the dynamic identification according to the standard, so that the generated dynamic identification has extremely low collision rate, and the requirement of sharing the identification by the terminal equipment can be met.
101, Generating a dynamic identifier of the target terminal device based on the identifiers of the N application programs and the latest modification time of the N application programs.
Based on big data analysis, the time of updating the same application by different users is discrete, namely the latest modification time of the same application program on different terminals is discrete, and a basis is provided for the uniqueness of dynamic identification generated by taking the latest modification time as a factor.
In embodiments of the present invention, the identification of the application (also referred to as the application identification or application identification) and the last modification time may be combined to generate a unique dynamic identification. For example, N application identifications are denoted as a 1、a2、......、aN, respectively, and the corresponding last modification times are denoted as t 1、t2、......、tN, respectively. In an alternative embodiment, the application program identifier and the corresponding latest modification time thereof can be spliced into a 1t1a2t2......aNtN in sequence, and the spliced value can be directly used as the dynamic identifier of the terminal equipment; the application identification and the last modification time may also be processed into a consistent length format using a hash algorithm. It should be noted that, the application program identifier and the latest modification time are taken as factors for generating the dynamic identifier of the terminal device, the splicing sequence is not limited to the mode described in this embodiment, and can be any mode under the condition that the factors are unchanged, and any separator or no separator can be used during splicing; specific algorithms for generating dynamic identifications include, but are not limited to, MD5, SHA1, SHA256, and the like.
Taking an intelligent terminal of an Android system as an example, the selected application program can be a system application, a preset application or a three-party application with larger user quantity on the terminal, and the application program interface API provided by the Android system is used for acquiring the latest modification time of the designated application program. Taking an application program of an application store as an example, acquiring application information of the application store by a getPackageInfo method of a packageManager, and reading a lastUpdateTime field in PackageInfo to obtain the last modification time of the application. Because the package name exists only on the intelligent terminal of the same Android system, the package name of the application is selected as the application identifier. Further, for example, when N is 3, 3 application programs, such as an application store, a file manager and a video player, are selected, and the last modification time of the application store is 1599490600000, the last modification time of the file manager is 1599372540000, the last modification time of the video player is 1600212240000, and the time stamp represents the number of milliseconds elapsed from 1 month 1 in 1970 (midnight of UTC/GMT), namely 1599490600000 represents 2020/9/7/22:56:40. The application identifier of the application store is acquired as com.android.mark, the application identifier of the file manager is acquired as com.android.fileexplorer, the application identifier of the video player is acquired as com.android.video, and the finally generated dynamic identifier is com.android.market:1599490600000,com.android.fileexplorer:1599372540000,com.android.video:1600212240000; or the hash value of the dynamic identifier and the dynamic identifier is calculated, such as 9291C14562491E9F5B0550DEF404FFAF calculated by MD5 algorithm.
The method for generating the dynamic identification of the terminal equipment provided by the embodiment of the invention can generate the unique dynamic identification of the target terminal equipment according to the identification of one or more application programs on the target terminal equipment and the latest modification time thereof on the premise of not collecting the sensitive information of the terminal equipment, namely, the dynamic identification of the terminal equipment is completed on the premise of not collecting the privacy information of the mobile terminal user, and the method has extremely low collision rate, thereby solving the problems of the unique identification of the equipment and the sharing of the identification among products.
The embodiment of the invention provides a plurality of methods for selecting N application programs on the terminal equipment, and the method is specifically described below.
Based on the above embodiment, step 100, the obtaining the latest modification time of N application programs on the target terminal device respectively specifically includes:
100.1, acquiring top N application programs with discrete contribution from high to low based on the latest modification time of a plurality of alternative application programs on a plurality of terminal devices; wherein the plurality of terminal devices includes the target terminal device; the discrete contribution degree refers to the discrete degree of the latest modification time of the application program on different terminal equipment;
100.2, respectively obtaining the latest modification time of the N application programs on the target terminal equipment.
The number of applications currently available to run on the terminal device is very large, and as described above, the standard of the application selected in the embodiment of the present invention is a specific system application or a hot three-party application with a large coverage amount and a moderate update frequency. First, a plurality of alternative application programs are selected from a large number of application programs, and then the latest modification time of the alternative application programs on a plurality of terminal devices is collected.
The embodiment of the invention collects the latest modification time of the application program on different terminal equipment, and aims to ensure the low collision rate of dynamic identification generation by acquiring the latest modification time with high discrete degree of the high coverage application program. In general, an application may be installed on multiple terminal devices, even though the application developer issues updates of the application at a fixed time, the timing of the updates of the same application on the respective terminal will typically be different due to different usage habits of each terminal user, which determines that the dynamic identification factored by the latest modification time of a particular high coverage application is of a high degree of discretion. Since the usage habit of the end user is unpredictable, the optimal factor combination cannot be obtained through theoretical derivation, and the optimal factor combination must be determined through actual verification and matching with an evaluation model.
According to the embodiment of the invention, the top N application programs with high discrete contribution degree from high to low are selected according to the standard with high discrete degree of coverage.
In an alternative embodiment, the alternative application identifier may be issued to the intelligent terminal for verification, and the collected dynamic identifier is returned to the back-end server for analysis by means of log recovery or the like, where the dynamic identifier is a combination of the application identifier and the latest modification time. Wherein, a UUID needs to be generated for each terminal device at the same time, so as to distinguish whether the returned dynamic identifier is repeatedly sent out by the same terminal device. Examples of terminal devices corresponding to the acquired application identifier and the latest modification time are shown in table 1.
TABLE 1
Application identification recent modification time (16 system) |
Corresponding UUID number |
com.miui.newhome:1752C42B678 |
10 |
com.miui.newhome:174EA7F7A28 |
9 |
com.miui.newhome:17577389BC0 |
2 |
com.miui.newhome:174EA8087B0 |
7 |
com.miui.newhome:174EA7F7258 |
1 |
com.miui.newhome:1746292A9C8 |
6 |
Referring to table 1, the application is com.miui.newhome, and the latest modification time 1752C42B678 corresponds to 10 UUIDs, which indicates that 10 terminal devices have run the application at that time, and the application is updated; the latest modification time 174EA7F7258 corresponds to 1 UUID, which indicates that 1 terminal device has run the application at that time, and the application is updated.
Table 1 only lists one application program, and for a plurality of alternative application programs, the modification time of each application program on each terminal device can be collected, and the number of UUIDs corresponding to each latest modification time, namely, the number of terminal devices, is counted. According to the discrete degree of the latest modification time of each application program on the target terminal equipment, the first N application program identifiers a 1、a2、......、aN with the discrete contribution degree from high to low are obtained, the latest modification time t 1、t2、......、tN of the N application programs on the target terminal equipment is obtained, and the unique dynamic identifier of the target terminal equipment can be generated by performing combination splicing or using a hash algorithm according to the application program identifiers and the corresponding latest modification time.
The discrete contribution degree in the embodiment of the invention refers to the discrete degree of the latest modification time of the application program on different terminal devices, and specifically, the discrete contribution degree can be divided into a one-to-one discrete contribution degree and a pair of n discrete contribution degrees.
The one-to-one discrete contribution degree refers to the proportion of first discrete data to the total latest modification time, and the first discrete data refers to the number of terminal equipment corresponding to one latest modification time of an application program; a higher one-to-one discrete contribution means a higher discrete level, and a higher contribution to the reduction of collision rate for dynamic identification.
The pair of n discrete contribution degrees refers to the proportion of second discrete data to the total latest modification time, the second discrete data refers to the number of terminal devices which are n and less than one latest modification time of an application program, and n is a positive integer greater than 1; a higher pair of N discrete contributions indicates a higher degree of dispersion, and a higher contribution to dynamic identification of reduction of collision rate in the case of apportioning the collision rate by N applications.
The following illustrates an intelligent terminal of the Android system and some application program Xxxx, and the UUID corresponding to the acquired part of the latest modification time is shown in table 2.
TABLE 2
(Some application) recently modified time (16 system) |
Corresponding UUID number |
(Null value, acquisition failure) |
14381 |
Xxxx:17425B7C290 |
6 |
... |
|
Xxxx:17588B527D8 |
3 |
... |
|
Xxxx:1758967B6C8 |
2 |
... |
|
Xxxx:175706581F0 |
1 |
... |
|
Referring to table 2, assume that after the UUID corresponding to the latest modification time of the application Xxxx is de-duplicated, the corresponding 266677 different UUIDs are collected in total; one of the most recent modification times corresponds to a UUID (e.g., 175706581F 0) number of 215467; one last modification time corresponds to 3 UUIDs and within, i.e., one last modification time corresponds to 1 UUID, one last modification time corresponds to 2 UUIDs, and one last modification time corresponds to 3 UUIDs (e.g., 17588B527D8, 1758967B6C8, and 175706581F 0) in number 251190, and abnormal data (e.g., acquisition failure) in number 14381. Calculating the duty ratio of one UUID corresponding to one latest modification time to 215467/266677= 80.80%, namely the one-to-one discrete contribution degree to 80.80%; the duty ratio of UUIDs within 3 corresponding to the latest modification time is 251190/266677= 94.19%, namely a pair of n discrete contributions is 94.19%; the anomaly data duty ratio was 14381/266677=5.39%.
It should be noted that, the latest modification time abnormal data refers to a default value obtained when the system application or the pre-installed application in the terminal is never updated, for example, the latest modification time is 1230768000000 (2009/1/1:8:0:0), and such data has no discreteness. The contribution to dynamically identifying reduced collision rate is higher when the latest modified time anomaly data duty cycle is lower.
Based on the analysis, the embodiment of the invention can respectively obtain the top N application programs with the discrete contribution degree from high to low according to the following optional indexes:
(1) According to the one-to-one discrete contribution;
(2) According to the one-to-one discrete contribution and the abnormal data duty ratio;
(3) According to a pair of n discrete contributions;
(4) According to a pair of n discrete contribution degrees and an abnormal data duty ratio;
(5) According to the one-to-one discrete contribution and the one-to-n discrete contribution;
(6) According to the one-to-one discrete contribution, the one-to-n discrete contribution and the abnormal data duty ratio.
The manner of acquiring the first N applications with discrete contributions from high to low described above will be described separately below. It should be noted that, based on the ideas expressed in the embodiments of the present invention, a pair of two discrete contribution degrees, a pair of three discrete contribution degrees, a pair of four discrete contribution degrees, and the like are separately provided, and are respectively combined according to various discrete contribution degrees, or further combined with an abnormal data duty ratio, or the like, one or more application programs meeting the discrete degree requirements on the target terminal device are obtained, and all the application programs fall into the protection scope of the embodiments of the present invention as factors for generating dynamic identifiers.
Based on any of the above optional embodiments, step 100.1, the obtaining the first N applications with discrete contribution from high to low based on the latest modification time of the several alternative applications on the several terminal devices specifically includes:
based on the latest modification time and duplication removal of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with one-to-one discrete contribution from high to low;
In this embodiment, the top N applications from high to low are selected according to the one-to-one discrete contribution, and as in the example of table 2, the ratio of the number of 1 UUIDs to the total number of UUIDs is calculated for one latest modification time of the application. Counting the one-to-one discrete contribution degree of the alternative application programs, and then sequencing from high to low according to the one-to-one discrete contribution degree to obtain the first N (one or more) application programs as factors for generating dynamic identifications; after determining N application programs, acquiring the latest modification time t 1、t2、......、tN of the N application programs on the target terminal device, and performing combination splicing or using a hash algorithm according to the N application program identifiers a 1、a2、......、aN and the latest modification time corresponding to the N application program identifiers.
Based on any of the above optional embodiments, after the last modification time and deduplication of the plurality of candidate applications on the plurality of terminal devices, obtaining the first N applications with one-to-one duty cycle discrete contribution from high to low, further includes:
based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with first contribution values from high to low;
The first contribution value refers to a value obtained by carrying out weighted summation on one-to-one discrete contribution degree of the application program and the latest modified time abnormal data duty ratio.
In this embodiment, the top N applications from high to low are selected according to the one-to-one discrete contribution degree and the abnormal data duty ratio, as in the example of table 2, the duty ratio of the number of UUIDs corresponding to 1 to the total UUID number is calculated for one latest modification time of the application. The one-to-one discrete contribution and the latest modified time anomaly data duty cycle of the alternative application are counted and then weighted and summed to calculate the contribution value.
The first contribution value is calculated, for example, as follows:
D=A*100*W1 - C*100*W3; (1)
Wherein D is a contribution value, A is a one-to-one discrete contribution degree, and C is an abnormal data duty ratio; w 1 is one-to-one discrete contribution degree weight, and the value range is [0,1]; w 3 is the weight of the abnormal data, and the value range is 0, 1.
After calculating a contribution value according to the formula (1), acquiring top N application programs with contribution values from high to low as factors for generating dynamic identifications; after determining N application programs, acquiring the latest modification time t 1、t2、......、tN of the N application programs on the target terminal device, and performing combination splicing or using a hash algorithm according to the N application program identifiers a 1、a2、......、aN and the latest modification time corresponding to the N application program identifiers.
Based on any of the above optional embodiments, step 100.1, the obtaining the first N applications with discrete contribution from high to low based on the latest modification time of the several alternative applications on the several terminal devices specifically includes:
Based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring a pair of top N application programs with N discrete contribution degrees from high to low;
The present embodiment selects the top N applications from high to low according to a pair of N discrete contributions, as in the example of table 2, and calculates the duty ratio of the number of UUIDs within N and (e.g., within 3) relative to the total number of UUIDs for one most recent modification time of the application. Counting a pair of N discrete contribution degrees of alternative application programs, and then sequencing from high to low according to the pair of N discrete contribution degrees to obtain the first N (one or more) application programs as factors for generating dynamic identifications; after determining N application programs, acquiring the latest modification time t 1、t2、......、tN of the N application programs on the target terminal device, and performing combination splicing or using a hash algorithm according to the N application program identifiers a 1、a2、......、aN and the latest modification time corresponding to the N application program identifiers.
Based on any of the above optional embodiments, the obtaining a pair of top N applications with N discrete contributions from high to low based on the latest modification time and deduplication of the plurality of candidate applications on the plurality of terminal devices further includes:
based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with second contribution values from high to low;
The second contribution value is a value obtained by weighted summation of a pair of n discrete contribution degrees of the application program and the latest modified time anomaly data duty ratio.
In this embodiment, the first N applications from high to low are selected according to a pair of N discrete contributions and abnormal data duty ratios, and as in the example of table 2, the duty ratio of the number of UUIDs corresponding to N and within one latest modification time of the application to the total number of UUIDs is calculated. A pair of n discrete contributions and the latest modified time anomaly data duty cycle of the alternative application are counted, and then the pair of n discrete contributions and the anomaly data duty cycle are weighted and summed, so that a contribution value is calculated.
The second contribution value is calculated, for example, as follows:
D=B*100*W2-C*100*W3; (2)
Wherein D is a contribution value, B is a pair of n discrete contribution degrees, and C is an abnormal data duty ratio; w 2 is a pair of n discrete contribution degree weights, and the value range is [0,1]; w 3 is the weight of the abnormal data, and the value range is 0, 1.
After calculating a contribution value according to the formula (2), acquiring top N application programs with contribution values from high to low as factors for generating dynamic identifications; after determining N application programs, acquiring the latest modification time t 1、t2、......、tN of the N application programs on the target terminal device, and performing combination splicing or using a hash algorithm according to the N application program identifiers a 1、a2、......、aN and the latest modification time corresponding to the N application program identifiers.
Based on any of the above optional embodiments, step 100.1, the obtaining the first N applications with discrete contribution from high to low based on the latest modification time of the several alternative applications on the several terminal devices specifically includes:
Based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with third contribution values from high to low;
the third contribution value is a value obtained by weighted summation of a one-to-one discrete contribution degree and a pair of n discrete contribution degrees of the application program.
In this embodiment, the top N applications from high to low are selected according to the one-to-one discrete contribution and the pair of N discrete contributions, and as in the example of table 2, the ratio of the number of UUIDs corresponding to one last modification time of the application to the total number of UUIDs and the ratio of the number of UUIDs corresponding to N and within one last modification time of the application to the total number of UUIDs are calculated respectively. The one-to-one discrete contribution and the pair of n discrete contributions of the alternative application are counted and then the one-to-one discrete contribution and the pair of n discrete contributions are weighted and summed to calculate the contribution value.
The third contribution value is calculated, for example, as follows:
D=A*100*W1+B*100*W2; (3)
Wherein D is a contribution value, A is a one-to-one discrete contribution degree, and B is a pair of n discrete contribution degrees; w 1 is one-to-one discrete contribution degree weight, and the value range is [0,1]; w 2 is a pair of n discrete contribution weights, and the value range is [0,1].
After calculating a contribution value according to the formula (3), acquiring top N application programs with contribution values from high to low as factors for generating dynamic identifications; after determining N application programs, acquiring the latest modification time t 1、t2、......、tN of the N application programs on the target terminal device, and performing combination splicing or using a hash algorithm according to the N application program identifiers a 1、a2、......、aN and the latest modification time corresponding to the N application program identifiers.
Based on any of the above optional embodiments, the acquiring the first N applications with discrete contribution from high to low based on the latest modification time of the several alternative applications on the several terminal devices further includes:
based on the latest modification time and de-duplication of a plurality of alternative application programs on a plurality of terminal devices, acquiring first N application programs with fourth contribution values from high to low;
The fourth contribution value is a value obtained by weighted summation of one-to-one discrete contribution degree of the application program, a pair of n discrete contribution degrees and an abnormal data duty ratio of the latest modification time.
In this embodiment, the first N applications from high to low are selected according to the one-to-one discrete contribution, the pair of N discrete contributions and the abnormal data duty ratio, for example, in the example of table 2, the duty ratio of the number of UUIDs corresponding to one last modification time of the application to the total number of UUIDs is calculated, and the duty ratio of the number of UUIDs corresponding to N and within the last modification time of the application to the total number of UUIDs is calculated. The one-to-one discrete contribution, the pair of n discrete contributions and the abnormal data duty ratio of the alternative application program are counted, and then the one-to-one discrete contribution, the pair of n discrete contributions and the abnormal data duty ratio are weighted and summed, so that the contribution value is calculated.
The fourth contribution value is calculated, for example, as follows:
D=A*100*W1+B*100*W2-C*100*W3; (4)
Wherein D is a contribution value, A is a one-to-one discrete contribution degree, B is a pair of n discrete contribution degrees, and C is an abnormal data duty ratio; w 1 is one-to-one discrete contribution degree weight, and the value range is [0,1]; w 2 is a pair of n discrete contribution degree weights, and the value range is [0,1]; w 3 is the weight of the abnormal data, and the value range is 0, 1.
After calculating a contribution value according to the formula (4), acquiring top N application programs with contribution values from high to low as factors for generating dynamic identifications; after determining N application programs, acquiring the latest modification time t 1、t2、......、tN of the N application programs on the target terminal device, and performing combination splicing or using a hash algorithm according to the N application program identifiers a 1、a2、......、aN and the latest modification time corresponding to the N application program identifiers.
For example, taking an intelligent terminal of an Android system as an example, the latest modification time of an application program and the corresponding UUID number are obtained according to the format of the foregoing table 2, when N is 3, the weight w 1 is selected to be 0.6, the weight w 2 is selected to be 0.3, the weight w 3 is selected to be 0.1, the selection of each weight is only taken as an example, and each weight value can be adjusted according to the requirement.
The top 3 applications of the contribution rank calculate the contribution as follows according to equation (4) and rank in descending order according to the contribution score as shown in table 3:
80.80%*100*0.6+94.19%*100*0.3-5.39%*100*0.1=76.198;
78.66%*100*0.6+94.57%*100*0.3-3.86%*100*0.1=75.181;
78.77%*100*0.6+93.73%*100*0.3-5.02%*100*0.1=74.879;
TABLE 3 Table 3
Here, a pair of n discrete contributions is the ratio of the number of UUIDs to the total number of UUIDs within 3 corresponding to a latest modification time of the application.
The three application programs are selected as factors for producing dynamic identifications, and then the unique dynamic identifications of the target terminal equipment can be generated by combination and splicing or using a hash algorithm according to the latest modification time of com.misi.virtual im, om.xiaomi.pass and com.misi.pass on the target terminal equipment.
In this example, the one-to-one discrete contribution of the first application is denoted as a 1, and the one-to-n discrete contribution is denoted as B 1; the second applied one-to-one discrete contribution is denoted as a 2 and the n discrete contribution is denoted as B 2; the one-to-one discrete contribution of the third application is denoted as a 3, the one-to-n discrete contribution is denoted as B 3, and by the unique identifier composed of the three factors, the unique dynamic identifier produced by the three application programs as factors has a collision rate of 1-MAX (a 1,A2,A3) =1-MAX (80.80%, 78.66%, 78.77%) =19.2%, and a minimum of 0.00%, where the three factors cover the probability of all UUIDs when a latest modification time corresponds to one UUID. When the ratio of UUIDs within 3 of a latest modification time is higher, and the unique identifier is composed by 3 factors, the probability of apportioning the collision rate among the factors is higher, the expected value of the collision rate is about (1-B 1)*(1-B2)*(1-B3) =0.02%, so that the collision rate of the unique identifier is theoretically deduced to be in the range of [0.00%,0.02% ].
In summary, the method for generating the dynamic identifier of the terminal device provided by the embodiment of the invention can generate the unique dynamic identifier of the target terminal device according to the identifier of one or more application programs on the target terminal device and the latest modification time thereof on the premise of not collecting the sensitive information of the terminal device and not acquiring the privacy information of the user, has extremely low collision rate, solves the problems of the unique identifier of the device and the shared identifier among products, realizes the purpose of sharing the identifier among multiple products on the same terminal, protects the privacy of the user, is convenient to realize, and has good beneficial effects.
Fig. 2 is a schematic diagram of a device for generating a dynamic identifier of a terminal device according to an embodiment of the present invention, and as shown in fig. 2, the embodiment of the present invention further provides a device for generating a dynamic identifier of a terminal device, which includes a data acquisition module 200 and an identifier generation module 201;
The data obtaining module 200 is configured to obtain the latest modification times of N application programs on the target terminal device, where N is a positive integer;
the identifier generating module 201 is configured to generate a dynamic identifier of the target terminal device based on the identifiers of the N applications and the latest modification time of the N applications.
The device for generating the dynamic identifier of the terminal device in the embodiment of the present invention is configured to execute the technical scheme of the embodiment of the method for generating the dynamic identifier of the terminal device shown in fig. 1, and its implementation principle and technical effects are similar, and are not described herein again.
Fig. 3 is a schematic diagram of an electronic device frame according to an embodiment of the invention. Referring to fig. 3, an embodiment of the present invention provides an electronic device, including: processor 310, communication interface (Communications Interface) 320, memory 330, and bus 340, wherein processor 310, communication interface 320, memory 330 complete communication with each other via bus 340. The processor 310 may invoke logic instructions in the memory 330 to perform a method comprising: respectively obtaining the latest modification time of N application programs on target terminal equipment, wherein N is a positive integer; and generating the dynamic identification of the target terminal equipment based on the identifications of the N application programs and the latest modification time of the N application programs.
Embodiments of the present invention disclose a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the method embodiments described above, for example comprising: respectively obtaining the latest modification time of N application programs on target terminal equipment, wherein N is a positive integer; and generating the dynamic identification of the target terminal equipment based on the identifications of the N application programs and the latest modification time of the N application programs.
Embodiments of the present invention provide a non-transitory computer readable storage medium storing computer instructions that cause a computer to perform the methods provided by the above-described method embodiments, for example, including: respectively obtaining the latest modification time of N application programs on target terminal equipment, wherein N is a positive integer; and generating the dynamic identification of the target terminal equipment based on the identifications of the N application programs and the latest modification time of the N application programs.
Those of ordinary skill in the art will appreciate that: the implementation of the above described apparatus embodiments or method embodiments is merely illustrative, wherein the processor and the memory may be physically separate components or may not be physically separate, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a usb disk, a mobile hard disk, a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.