Summary of the invention
In view of this, the embodiment of the present invention provides the method, apparatus and electronics of a kind of decision paths and packet name corresponding relationshipEquipment can relatively accurately determine installation kit corresponding to path.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that
On the one hand, the embodiment of the present invention provides the method for a kind of decision paths and packet name corresponding relationship, comprising:
From the first tables of data comprising path to be determined and packet name corresponding relationship, it is corresponding with packet name to read first pathRelationship;
It determines in first path and packet name corresponding relationship, the similarity in path and packet name;
If in first path and packet name corresponding relationship, the similarity of path and packet name is greater than the first predetermined threshold, then determineFirst path and packet name corresponding relationship are set up.
Optionally, described from the first tables of data comprising path to be determined and packet name corresponding relationship, read the first viaDiameter and packet name corresponding relationship, comprising:
Read the first tables of data comprising path to be determined and packet name corresponding relationship, in the first tables of data path withPacket name corresponding relationship is filtered;
From the path and packet name corresponding relationship retained after filtering, first path and packet name corresponding relationship are read;
Wherein, in the first tables of data path and packet name corresponding relationship be filtered include: will be comprising following any feelingsThe path of shape is filtered out with packet name corresponding relationship: path and common path exact matching;Path is the self-built path of user.
Optionally, in the determining first path and packet name corresponding relationship, the similarity in path and packet name, comprising: judgementIn first path and packet name corresponding relationship, whether path and packet name include common character string;If the path and packet name packetContaining common character string, then the first weighted value is assigned to first path and packet name corresponding relationship;
By in path in the first tables of data and packet name corresponding relationship path and packet name carry out cutting respectively, establish first pairAnswer set of relations;The first corresponding relationship of each of the first corresponding relationship concentration, is the cutting vocabulary in path in the first tables of dataCorresponding relationship between the cutting vocabulary of packet name corresponding with the path;First corresponding relationship concentrates the first corresponding passPath is identical as the quantity of packet name corresponding relationship in the quantity of system, and the first tables of data;
The frequency for carrying out the first corresponding relationship established after cutting with packet name corresponding relationship to first path calculates, andJudge whether the frequency of first corresponding relationship is greater than the second predetermined threshold;If it is pre- that the frequency of first corresponding relationship is greater than secondDetermine threshold value, then judges that first corresponding relationship whether there is in the second corresponding relationship frequency table;Wherein, the described second corresponding passThe frequency of to be in frequency table include the second corresponding relationship and the second corresponding relationship, second corresponding relationship is will in advance reallyThe path and packet name being set in correct path and packet name corresponding relationship carry out the corresponding relationship established after cutting respectively;
If first corresponding relationship exists in the second corresponding relationship frequency table, first corresponding relationship is read secondCorresponding frequency in corresponding relationship frequency table;Corresponding to judging first corresponding relationship in the second corresponding relationship frequency tableWhether frequency is greater than third predetermined threshold;
If first corresponding relationship frequency corresponding in the second corresponding relationship frequency table is greater than third predetermined threshold,The second weighted value is assigned to first path and packet name corresponding relationship;
First weighted value and the second weighted value are added, obtained in first path and packet name corresponding relationship, roadThe similarity of diameter and packet name.
Optionally, in the judgement first path and packet name corresponding relationship, whether path and packet name include common wordSymbol string, comprising: judge in first path and packet name corresponding relationship, whether subpath and packet name in path include common wordSymbol string.
Optionally, the frequency that the first corresponding relationship established after cutting is carried out to first path and packet name corresponding relationshipIt is calculated, comprising: first established after carrying out cutting with packet name corresponding relationship to first path according to following formula is corresponding to closeThe frequency of system is calculated:
F1=n/m;
Wherein, F1 is the frequency that the first corresponding relationship established after cutting is carried out to first path and packet name corresponding relationship;
N is to concentrate in the first corresponding relationship, carries out establish after cutting first with to first path and packet name corresponding relationshipThe sum of the quantity of identical all first corresponding relationships of corresponding relationship;
M is to concentrate in the first corresponding relationship, includes the path cutting vocabulary or packet in first path and packet name corresponding relationshipThe sum of the quantity of all first corresponding relationships of name cutting vocabulary.
Optionally, from the first tables of data comprising path to be determined and packet name corresponding relationship, first path is readBefore packet name corresponding relationship, the method for the decision paths and packet name corresponding relationship, further includes:
Under the user EXEC of mobile terminal, by client application to the creation in path in mobile terminal orChange is monitored;
When monitoring currently has new path to create or have path change in the mobile terminal, newly created road is readDiameter or the path to change obtain the packet name of the application program of the mobile terminal foreground and backstage current active, establish and readCorresponding relationship between the path taken and the packet name of acquisition;
The tables of data for establishing the corresponding relationship between the packet name comprising the path and acquisition read, as describedThe first tables of data comprising path to be determined and packet name corresponding relationship.
Optionally, from the first tables of data comprising path to be determined and packet name corresponding relationship, first path is readBefore packet name corresponding relationship, the method for the decision paths and packet name corresponding relationship, further includes:
Foundation includes to have been determined as second tables of data in correct path Yu packet name corresponding relationship in advance;
Path in second tables of data and the path in packet name corresponding relationship and packet name are subjected to cutting respectively, establish secondSet of correspondences;The second corresponding relationship of each of the second corresponding relationship concentration, is the segmenting word in path in the second tables of dataThe corresponding relationship converged between the cutting vocabulary of packet name corresponding with the path;Second corresponding relationship concentrates second to correspond toPath is identical as the quantity of packet name corresponding relationship in the quantity of relationship, and the second tables of data;
The frequency of the second corresponding relationship each of is concentrated to calculate the second corresponding relationship according to following formula:
F2=j/k;
Wherein, F2 is the frequency that the second corresponding relationship concentrates one of them the second corresponding relationship;
J is to concentrate in the second corresponding relationship, all second corresponding passes identical with one of them described second corresponding relationshipThe sum of quantity of system;
K be the second corresponding relationship concentrate, comprising in one of them described second corresponding relationship path cutting vocabulary orThe sum of the quantity of all second corresponding relationships of packet name cutting vocabulary.
According to the frequency of the second corresponding relationship of each of the second corresponding relationship concentration being calculated, described second pair is establishedIt should be related to frequency table.
Optionally, described establish includes the second data for having been determined as correct path Yu packet name corresponding relationship in advanceTable, comprising: under the root user mode of mobile terminal, to the creation in path in mobile terminal or changed by client applicationChange is monitored;
When monitoring currently has new path to create or have path change in the mobile terminal, newly created road is readDiameter or the path to change obtain the packet name of the application program of the mobile terminal foreground and backstage current active, establish and readCorresponding relationship between the path taken and the packet name of acquisition;
The tables of data for establishing the corresponding relationship between the packet name comprising the path and acquisition read, as describedIt include the second tables of data for having been determined as correct path Yu packet name corresponding relationship in advance.
On the other hand, the embodiment of the present invention provides the device of a kind of decision paths and packet name corresponding relationship, comprising: source dataRead module, for reading first path and packet from the first tables of data comprising path to be determined and packet name corresponding relationshipName corresponding relationship;Similarity determining module, for determining in first path and packet name corresponding relationship, path is similar to packet nameDegree;Judgment module, if the similarity of path and packet name is greater than the first predetermined threshold in first path and packet name corresponding relationshipValue then determines that first path and packet name corresponding relationship are set up.
Optionally, the source data read module, comprising: the first reading submodule includes road to be determined for readingFirst tables of data of diameter and packet name corresponding relationship;Filter submodule, for being closed to the path in the first tables of data is corresponding with packet nameSystem is filtered;Second reading submodule, for reading first path from the path and packet name corresponding relationship retained after filteringWith packet name corresponding relationship;Wherein, the path in the first tables of data is filtered with packet name corresponding relationship include: will be comprising as followsThe path of any case is filtered out with packet name corresponding relationship: path and common path exact matching;Path is the self-built road of userDiameter.
Optionally, the similarity determining module, including the first determining submodule, the second determining submodule and cumulative mouldBlock;Wherein, described first submodule is determined, for judging in first path and packet name corresponding relationship, whether path and packet name are wrappedContain common character string;It is corresponding with packet name to first path to close if the path and packet name include common character stringSystem assigns the first weighted value;
Described second determines submodule, is used for:
By in path in the first tables of data and packet name corresponding relationship path and packet name carry out cutting respectively, establish first pairAnswer set of relations;The first corresponding relationship of each of the first corresponding relationship concentration, is the cutting vocabulary in path in the first tables of dataCorresponding relationship between the cutting vocabulary of packet name corresponding with the path;First corresponding relationship concentrates the first corresponding passPath is identical as the quantity of packet name corresponding relationship in the quantity of system, and the first tables of data;
The frequency for carrying out the first corresponding relationship established after cutting with packet name corresponding relationship to first path calculates, andJudge whether the frequency of first corresponding relationship is greater than the second predetermined threshold;If it is pre- that the frequency of first corresponding relationship is greater than secondDetermine threshold value, then judges that first corresponding relationship whether there is in the second corresponding relationship frequency table;Wherein, the described second corresponding passThe frequency of to be in frequency table include the second corresponding relationship and the second corresponding relationship, second corresponding relationship is will in advance reallyThe path and packet name being set in correct path and packet name corresponding relationship carry out the corresponding relationship established after cutting respectively;
If first corresponding relationship exists in the second corresponding relationship frequency table, first corresponding relationship is read secondCorresponding frequency in corresponding relationship frequency table;Corresponding to judging first corresponding relationship in the second corresponding relationship frequency tableWhether frequency is greater than third predetermined threshold;
If first corresponding relationship frequency corresponding in the second corresponding relationship frequency table is greater than third predetermined threshold,The second weighted value is assigned to first path and packet name corresponding relationship;
The accumulator module, for being added to first weighted value and the second weighted value, obtain first path withIn packet name corresponding relationship, the similarity in path and packet name.
Optionally, described first submodule is determined, the son for judging in first path and packet name corresponding relationship, in pathWhether path and packet name include common character string;If the subpath and packet name in the path include common characterString then assigns the first weighted value to first path and packet name corresponding relationship.
Optionally, described second submodule is determined, comprising: the first computational submodule is used for according to following formula to firstThe frequency that path carries out the first corresponding relationship established after cutting with packet name corresponding relationship is calculated:
F1=n/m;
Wherein, F1 is the frequency that the first corresponding relationship established after cutting is carried out to first path and packet name corresponding relationship;
N is to concentrate in the first corresponding relationship, carries out establish after cutting first with to first path and packet name corresponding relationshipThe sum of the quantity of identical all first corresponding relationships of corresponding relationship;
M is to concentrate in the first corresponding relationship, includes the path cutting vocabulary or packet in first path and packet name corresponding relationshipThe sum of the quantity of all first corresponding relationships of name cutting vocabulary.
Optionally, the device of the decision paths and packet name corresponding relationship, further includes: the first monitoring module is used forUnder the user EXEC of mobile terminal, the creation or change in path in mobile terminal are supervised by client applicationDepending on;First building module, for reading when monitoring currently has new path to create or have path change in the mobile terminalThe path for taking newly created path or changing obtains the application program of the mobile terminal foreground and backstage current activePacket name establishes the corresponding relationship between the path of reading and the packet name of acquisition;Establish the path comprising readingThe tables of data of corresponding relationship between the packet name of acquisition includes path to be determined and packet name corresponding relationship as describedThe first tables of data.
Optionally, the device of the decision paths and packet name corresponding relationship further includes the second building module, computing moduleModule is constructed with third;Wherein
Second building module, includes have been determined as correct path and packet name corresponding relationship in advance second for establishingTables of data;
Computing module, with by the second tables of data path in packet name corresponding relationship path and packet name cut respectivelyPoint, establish the second set of correspondences;The second corresponding relationship of each of the second corresponding relationship concentration, is the second tables of data RoadCorresponding relationship between the cutting vocabulary of diameter and the cutting vocabulary of packet name corresponding with the path;Second set of correspondencesIn the second corresponding relationship quantity, and path is identical as the quantity of packet name corresponding relationship in the second tables of data;
The frequency of the second corresponding relationship each of is concentrated to calculate the second corresponding relationship according to following formula:
F2=j/k;
Wherein, F2 is the frequency that the second corresponding relationship concentrates one of them the second corresponding relationship;
J is to concentrate in the second corresponding relationship, all second corresponding passes identical with one of them described second corresponding relationshipThe sum of quantity of system;
K be the second corresponding relationship concentrate, comprising in one of them described second corresponding relationship path cutting vocabulary orThe sum of the quantity of all second corresponding relationships of packet name cutting vocabulary;
Third constructs module, for the frequency according to the second corresponding relationship of each of the second corresponding relationship concentration being calculatedNumber, establishes the second corresponding relationship frequency table.
Optionally, the second building module, comprising: the second monitoring submodule, for the root user mould in mobile terminalUnder formula, the creation or change in path in mobile terminal are monitored by client application;4th building submodule, is usedIn when monitoring currently has new path to create or have path change in the mobile terminal, newly created path or hair are readThe raw path changed, obtains the packet name of the application program of the mobile terminal foreground and backstage current active, establishes the institute of readingState the corresponding relationship between path and the packet name of acquisition;Establish comprising read the path and acquisition the packet name itBetween corresponding relationship tables of data, as it is described include have been determined as correct path and packet name corresponding relationship in advance secondTables of data.
In another aspect, the embodiment of the present invention also provides a kind of electronic equipment, the electronic equipment include: shell, processor,Memory, circuit board and power circuit, wherein circuit board is placed in the space interior that shell surrounds, and processor and memory are setIt sets on circuit boards;Power circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory can for storingExecute program code;Processor is run by reading the executable program code stored in memory and executable program codeCorresponding program, the method for executing decision paths described in aforementioned any embodiment Yu packet name corresponding relationship.
The method, apparatus and electronic equipment of decision paths provided in an embodiment of the present invention and packet name corresponding relationship, by trueThe similarity in fixed path and packet name corresponding relationship to be determined, and judge whether the similarity is greater than the predetermined threshold value first set,If more than preset threshold value, then determine that first path and packet name corresponding relationship are set up, thus, it is possible to relatively accurately determineInstallation kit corresponding to path.
Specific embodiment
With reference to the accompanying drawing to the method, apparatus and electronics of a kind of decision paths of the embodiment of the present invention and packet name corresponding relationshipEquipment is described in detail.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.BaseEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all itsIts embodiment, shall fall within the protection scope of the present invention.
Fig. 1 is the flow diagram present invention determine that one embodiment of method of path and packet name corresponding relationship.Referring to Fig. 1,Present invention determine that one embodiment of method in path and packet name corresponding relationship, includes the following steps:
S11, from the first tables of data comprising path to be determined and packet name corresponding relationship, read first path and packet nameCorresponding relationship;
Fig. 2 is the first tables of data in the present embodiment comprising path to be determined and packet name corresponding relationship.Referring to Fig. 2,One tables of data can be a two-dimensional data table, wherein including the corresponding relationship in path Yu packet name.
The data in path and packet name corresponding relationship, can first pass through client application in advance in first tables of data, from userThe mobile terminals such as mobile phone, tablet computer in collect path and packet name corresponding relationship to be determined, then establish comprising to be determinedPath and packet name corresponding relationship tables of data.
In the embodiment of the present invention, the first path and packet name corresponding relationship are any one roads referred in the first tables of dataDiameter and packet name corresponding relationship.
S12, it determines in first path and packet name corresponding relationship, the similarity in path and packet name;
It, can be according to the similarity in path and the character string of packet name, to determine path as an alternative embodiment in this stepWith the similarity of packet name.
If in S13, first path and packet name corresponding relationship, the similarity of path and packet name is greater than the first predetermined threshold, thenDetermine that first path and packet name corresponding relationship are set up.
The method of decision paths provided in an embodiment of the present invention and packet name corresponding relationship, by determination path to be determined withThe similarity of packet name corresponding relationship, and judge whether the similarity is greater than the predetermined threshold value first set, if more than presetThreshold value then determines that first path and packet name corresponding relationship are set up, and thus, it is possible to relatively accurately determine installation corresponding to pathPacket.
It, can be to including path to be determined and packet name corresponding relationship in order to improve the accuracy for determining efficiency and judgementPath in tables of data is filtered with packet name corresponding relationship, filters out undesirable path and packet name corresponding relationship.GinsengSee Fig. 3, it is described from the first tables of data comprising path to be determined and packet name corresponding relationship, it reads first path and packet name is rightIt should be related to (S11), may include:
S111, read the tables of data comprising path to be determined and packet name corresponding relationship, in the tables of data path withPacket name corresponding relationship is filtered.
Wherein, in the tables of data path and packet name corresponding relationship be filtered include: will be comprising the following two kinds situationThe path of middle any case is filtered out with packet name corresponding relationship:
(1) path and common path exact matching;
(2) path is the self-built path of user.
S112, from the path and packet name corresponding relationship retained after filtering, read a paths and packet name corresponding relationship.
Fig. 3 is the flow diagram present invention determine that another embodiment of method of path and packet name corresponding relationship.Referring to figure3, present invention determine that the determining first path is corresponding with packet name in another embodiment of method of path and packet name corresponding relationshipIn relationship, the similarity (12) in path and packet name be may include steps of:
S121, judge in first path and packet name corresponding relationship, whether path and packet name include common character string.
Under normal conditions, a paths generally include the subpath under common path and common path, such as pathIn " Tencent QQMusic QzoneMusic ", " Tencent " can be described as common path, " QQMusic QzoneMusic "It can be described as subpath.In order to improve judgement efficiency, the son in the path in the path and packet name corresponding relationship can be only judgedIn path, if there is the character string common with the packet name.
If S122, the path and packet name include common character string, first path and packet name corresponding relationship are assignedGive the first weighted value.
S123, by path in the first tables of data and packet name corresponding relationship path and packet name carry out cutting respectively, establishFirst set of correspondences.
First corresponding relationship each of concentrates the first corresponding relationship, be in the first tables of data the cutting vocabulary in path andCorresponding relationship between the cutting vocabulary of packet name corresponding with the path;First corresponding relationship concentrates the first corresponding relationshipQuantity, and path is identical as the quantity of packet name corresponding relationship in the first tables of data.
S124, the frequency for carrying out the first corresponding relationship established after cutting with packet name corresponding relationship to first path are countedIt calculates.
Frequency is the number that some data occurs in one group of data.It, can be according to such as in this step as an alternative embodimentThe frequency that lower formula carries out the first corresponding relationship established after cutting with packet name corresponding relationship to first path calculates:
F1=n/m;
Wherein, F1 is the frequency that the first corresponding relationship established after cutting is carried out to first path and packet name corresponding relationship;
N is to concentrate in the first corresponding relationship, carries out establish after cutting first with to first path and packet name corresponding relationshipThe sum of the quantity of identical all first corresponding relationships of corresponding relationship;
M is to concentrate in the first corresponding relationship, includes the path cutting vocabulary or packet in first path and packet name corresponding relationshipThe sum of the quantity of all first corresponding relationships of name cutting vocabulary.
S125, judge whether the frequency of first corresponding relationship is greater than the second predetermined threshold.
If the frequency of S126, first corresponding relationship is greater than the second predetermined threshold, judge first corresponding relationship theIt whether there is in two corresponding relationship frequency tables.
It wherein, include the frequency of the second corresponding relationship and the second corresponding relationship in the second corresponding relationship frequency table,Second corresponding relationship be will have been determined as in advance path in correct path and packet name corresponding relationship and packet name respectively intoThe corresponding relationship established after row cutting.
If S127, first corresponding relationship exist in the second corresponding relationship frequency table, first corresponding relationship is readThe corresponding frequency in the second corresponding relationship frequency table.
S128, judge whether first corresponding relationship frequency corresponding in the second corresponding relationship frequency table is greater than thirdPredetermined threshold.
If S129, first corresponding relationship frequency corresponding in the second corresponding relationship frequency table are greater than the predetermined threshold of thirdValue then assigns the second weighted value to first path and packet name corresponding relationship.
S130, first weighted value and the second weighted value are added, obtain first path and packet name corresponding relationshipIn, the similarity in path and packet name.
In the embodiment of the method for aforementioned decision paths and packet name corresponding relationship, optionally, from including road to be determinedIn first tables of data of diameter and packet name corresponding relationship, before reading first path and packet name corresponding relationship (S11), the judgement roadThe method of diameter and packet name corresponding relationship can also establish first tables of data as follows:
A1, under the user EXEC of mobile terminal, by client application to the wound in path in mobile terminalIt builds or changes and monitored.
Wherein, the user EXEC of the mobile terminal is root user's mould for root user modeFormula can be described as root user mode again;Under normal conditions, after mobile terminal-opening automatically into be user EXEC;It can be by generalGeneral family pattern switching can also be switched to user EXEC by root user mode to root user mode.
A2, when monitoring currently has new path creation or has path change in the mobile terminal, read new creationPath or the path that changes, obtain the packet name of the application program of the mobile terminal foreground and backstage current active, buildCorresponding relationship between the vertical path read and the packet name of acquisition.
The tables of data of corresponding relationship between the packet name of A3, foundation comprising the path and acquisition read, asFirst tables of data comprising path to be determined and packet name corresponding relationship.
In current newly created path or there are the path of change, a packet name with current foreground and the application program of background activityBetween establish corresponding relationship, so as to reduce the quantity of the corresponding relationship between the path of foundation and packet name, improve subsequentDetermine efficiency.The corresponding relationship can be one-to-many relationship, be also possible to many-to-one relationship, it can be by a pathIt is corresponding with multiple packet names, it is also possible to multiple paths are corresponding with the same packet name.
In the embodiment of the method for aforementioned decision paths and packet name corresponding relationship, optionally, from including road to be determinedIn first tables of data of diameter and packet name corresponding relationship, before reading first path and packet name corresponding relationship (S11), the judgement roadThe method of diameter and packet name corresponding relationship can also establish the second corresponding relationship frequency table as follows:
B1, foundation include the second tables of data for having been determined as correct path Yu packet name corresponding relationship in advance.
In this step, as an alternative embodiment, can be established by artificial mode includes to have been determined as in advance correctlyPath and packet name corresponding relationship the second tables of data, can also by bury point mode obtain the second tables of data in path and packet name it is rightThe data that should be related to.
B2, the path in the second tables of data and the path in packet name corresponding relationship and packet name are subjected to cutting respectively, establishedSecond set of correspondences.
Second corresponding relationship each of concentrates the second corresponding relationship, be in the second tables of data the cutting vocabulary in path andCorresponding relationship between the cutting vocabulary of packet name corresponding with the path;Second corresponding relationship concentrates the second corresponding relationshipQuantity, and path is identical as the quantity of packet name corresponding relationship in the second tables of data;
B3, the frequency of the second corresponding relationship each of is concentrated to calculate the second corresponding relationship according to following formula:
F2=j/k;
Wherein, F2 is the frequency that the second corresponding relationship concentrates one of them the second corresponding relationship;
J is to concentrate in the second corresponding relationship, all second corresponding passes identical with one of them described second corresponding relationshipThe sum of quantity of system;
K be the second corresponding relationship concentrate, comprising in one of them described second corresponding relationship path cutting vocabulary orThe sum of the quantity of all second corresponding relationships of packet name cutting vocabulary.
B4, the frequency that the second corresponding relationship each of is concentrated according to the second corresponding relationship for being calculated establish described theTwo corresponding relationship frequency tables.
In aforementioned decision paths and the embodiment of the method for packet name corresponding relationship, optionally, the foundation includes preparatoryHave been determined as second tables of data (B1) in correct path Yu packet name corresponding relationship, comprising:
B11, the creation under the root user mode of mobile terminal, by client application to path in mobile terminalOr changes and monitored;
B12, when monitoring currently has new path creation or has path change in the mobile terminal, read new creationPath or the path that changes, obtain the packet name of the application program of the mobile terminal foreground and backstage current active, buildCorresponding relationship between the vertical path read and the packet name of acquisition;
The tables of data of corresponding relationship between the packet name of B13, foundation comprising the path and acquisition read, asDescribed includes the second tables of data for having been determined as correct path Yu packet name corresponding relationship in advance.
Corresponding relationship in second tables of data can be one-to-many relationship, be also possible to many-to-one relationship, it canIt is that a path is corresponding with multiple packet names, it is corresponding with the same packet name is also possible to multiple paths.
Below in tables of data shown in Fig. 2 path and packet name corresponding relationship " qqmusic/cache- >Com.tencent.qqmusic " is illustrated for being determined.
Present embodiment determine that the method in path and packet name corresponding relationship, includes the following steps:
S21, under the root user mode of mobile terminal, by client application to the wound in path in mobile terminalIt builds or changes and monitored.
In this step, can creation to the path in multiple mobile terminals or change monitor, it is more to collectData.
S22, when monitoring currently has new path creation or has path change in the mobile terminal, read new creationPath or the path that changes, obtain the packet name of the application program of the mobile terminal foreground and backstage current active, buildCorresponding relationship between the vertical path read and the packet name of acquisition.
Second tables of data of the corresponding relationship between the packet name of S23, foundation comprising the path and acquisition read.
The second tables of data comprising the corresponding relationship that Fig. 4 is established for the corresponding relationship established according to step S22;?10 paths and packet name corresponding relationship are shared in second tables of data, that is, share 10 datas.
S24, the path in the second tables of data and the path in packet name corresponding relationship and packet name are subjected to cutting respectively, establishedSecond set of correspondences, as shown in Figure 5.
In this step, as unit of vocabulary, remove the "/" in path, " " gone in switch name is accorded at equal intervals, to pathCutting is carried out respectively with packet name.
S25, based on path, the frequency of the second corresponding relationship each of is concentrated to the second corresponding relationship according to following formulaNumber is calculated:
F2=j/k;
Wherein, F2 is the frequency that the second corresponding relationship concentrates one of them the second corresponding relationship;
J is to concentrate in the second corresponding relationship, all second corresponding passes identical with one of them described second corresponding relationshipThe sum of quantity of system;
K be the second corresponding relationship concentrate, comprising in one of them described second corresponding relationship path cutting vocabulary orThe sum of the quantity of all second corresponding relationships of packet name cutting vocabulary.
S26, the frequency that the second corresponding relationship each of is concentrated according to the second corresponding relationship for being calculated establish described theTwo corresponding relationship frequency tables, as shown in Figure 6.
S27, under the user EXEC of mobile terminal device, by client application in mobile terminal deviceThe creation or change in path are monitored.
S28, when monitoring currently has new path creation or has path change in the mobile terminal device, read newThe path of creation or the path to change obtain the application program of the mobile terminal device foreground and backstage current activePacket name establishes the corresponding relationship between the path of reading and the packet name of acquisition.
The tables of data of corresponding relationship between the packet name of S29, foundation comprising the path and acquisition read, asFirst tables of data comprising path to be determined and packet name corresponding relationship.Fig. 2 be establish comprising path to be determined withFirst tables of data of packet name corresponding relationship.
S30, from the first tables of data, read first path and packet name corresponding relationship " qqmusic/cache- >Com.tencent.qqmusic ", as path to be determined and packet name corresponding relationship.Wherein, " qqmusic/cache " is roadDiameter, " com.tencent.qqmusic " are packet name.
S31, judge the path and packet name corresponding relationship " qqmusic/cache- > com.tencent.qqmusic ",In, whether path and packet name include common character string;By judgement, the path and packet name include common character string" qqmusic " assigns the to the path and packet name corresponding relationship " qqmusic/cache- > com.tencent.qqmusic "One weighted value 1.0.
S32, by path in the first tables of data and packet name corresponding relationship path and packet name carry out cutting respectively, establish theOne set of correspondences, as shown in Figure 7.
S33, the first corresponding pass established after cutting is carried out to " qqmusic/cache- > com.tencent.qqmusic "The frequency of system is calculated according to following formula, and the frequency for obtaining first corresponding relationship is 2/4=0.5.
Calculation formula are as follows: F1=n/m;
Wherein, F1 is first pair established after carrying out cutting to " qqmusic/cache- > com.tencent.qqmusic "The frequency that should be related to;
N is to concentrate in the first corresponding relationship, is cut with to " qqmusic/cache- > com.tencent.qqmusic "The sum of the quantity for identical all first corresponding relationships of the first corresponding relationship established after point, n=2 in the present embodiment;
M is to concentrate in the first corresponding relationship, includes the road in " qqmusic/cache- > com.tencent.qqmusic "The sum of the quantity of all first corresponding relationships of diameter segmenting word remittance " qqmusic cache ", in the present embodiment, m=4.
S34, judge whether the frequency of first corresponding relationship is greater than the second predetermined threshold 0.4.
S35, by judgement, the frequency of first corresponding relationship is 0.5, is greater than the second predetermined threshold 0.4, judge this firstCorresponding relationship whether there is in the second corresponding relationship frequency table.
By judgement, first corresponding relationship " qqmusic cache- > com tencent qqmusic " is corresponding secondExist in relationship frequency table.
S36, first corresponding relationship frequency 1.0 corresponding in the second corresponding relationship frequency table is read.
S37, judge whether first corresponding relationship frequency 1.0 corresponding in the second corresponding relationship frequency table is greater than theThree predetermined thresholds 0.2.
S38, by judgement, first corresponding relationship frequency 1.0 corresponding in the second corresponding relationship frequency table is greater thanThird predetermined threshold 0.2 then assigns the second weighted value 0.8 to first path and packet name corresponding relationship.
S39, first weighted value 1.0 is added with the second weighted value 0.8, it is corresponding with packet name obtains first pathIn relationship, the similarity of path and packet name is 1.8.
S40, by judgement, in first path and packet name corresponding relationship, it is pre- that the similarity 1.8 of path and packet name is greater than firstDetermine threshold value 1.0, determines that first path and packet name corresponding relationship " qqmusic/cache- > com.tencent.qqmusic " are set up.
Fig. 8 is the structural schematic diagram present invention determine that one embodiment of device of path and packet name corresponding relationship.Referring to Fig. 8,Present invention determine that one embodiment of device in path and packet name corresponding relationship, including source data read module 51, similarity determine mouldBlock 52 and judgment module 53;Wherein
Source data read module 51, for from the first tables of data comprising path to be determined and packet name corresponding relationship,Read first path and packet name corresponding relationship.
Fig. 2 is the first tables of data in the present embodiment comprising path to be determined and packet name corresponding relationship.Referring to Fig. 2,One tables of data can be a two-dimensional data table, wherein including the corresponding relationship in path Yu packet name.
The data in path and packet name corresponding relationship, can first pass through client application in advance in first tables of data, from userThe mobile terminals such as mobile phone, tablet computer in collect path and packet name corresponding relationship to be determined, then establish comprising to be determinedPath and packet name corresponding relationship tables of data.
Similarity determining module 52, for determining in first path and packet name corresponding relationship, the similarity in path and packet name.
It, can be according to the similarity in path and the character string of packet name, to determine path and packet name as an alternative embodimentSimilarity.
Judgment module 53, if the similarity of path and packet name is greater than first in first path and packet name corresponding relationshipPredetermined threshold then determines that first path and packet name corresponding relationship are set up.
The device of decision paths provided in an embodiment of the present invention and packet name corresponding relationship, by determination path to be determined withThe similarity of packet name corresponding relationship, and judge whether the similarity is greater than the predetermined threshold value first set, if more than presetThreshold value then determines that first path and packet name corresponding relationship are set up, and thus, it is possible to relatively accurately determine installation corresponding to pathPacket.
Fig. 9 is the structural schematic diagram present invention determine that another embodiment of device of path and packet name corresponding relationship.In order to mentionHeight determines the accuracy of efficiency and judgement, can be to the path in the tables of data comprising path to be determined and packet name corresponding relationshipIt is filtered with packet name corresponding relationship, filters out undesirable path and packet name corresponding relationship.Referring to Fig. 9, sentence aforementionedIn the Installation practice for determining path and packet name corresponding relationship, the source data read module 51, comprising:
First reading submodule 511 includes path and the first tables of data of packet name corresponding relationship to be determined for reading;
Filter submodule 512, for being filtered to the path in the first tables of data with packet name corresponding relationship;Wherein, rightIt includes: that the path comprising following any case and packet name is right that path in first tables of data is filtered with packet name corresponding relationshipIt should be related to and filter out:
(1) path and common path exact matching;
(2) path is the self-built path of user.
Second reading submodule 513, for reading first path from the path and packet name corresponding relationship retained after filteringWith packet name corresponding relationship.
In the Installation practice of aforementioned decision paths and packet name corresponding relationship, the similarity determining module 52 can be withDetermine that submodule 521, second determines submodule 522 and accumulator module 523 including first;Wherein
Described first determines submodule 521, and for judging in first path and packet name corresponding relationship, whether path and packet nameIt include common character string;If the path and packet name include common character string, corresponding with packet name to first pathRelationship assigns the first weighted value.
Under normal conditions, a paths generally include the subpath under common path and common path, such as pathIn " Tencent QQMusic QzoneMusic ", " Tencent " can be described as common path, " QQMusic QzoneMusic "It can be described as subpath.In order to improve judgement efficiency, the son in the path in the path and packet name corresponding relationship can be only judgedIn path, if there is the character string common with the packet name.
Described second determines submodule 522, is used for:
By in path in the first tables of data and packet name corresponding relationship path and packet name carry out cutting respectively, establish first pairAnswer set of relations;The first corresponding relationship of each of the first corresponding relationship concentration, is the cutting vocabulary in path in the first tables of dataCorresponding relationship between the cutting vocabulary of packet name corresponding with the path;First corresponding relationship concentrates the first corresponding passPath is identical as the quantity of packet name corresponding relationship in the quantity of system, and the first tables of data;
The frequency for carrying out the first corresponding relationship established after cutting with packet name corresponding relationship to first path calculates, andJudge whether the frequency of first corresponding relationship is greater than the second predetermined threshold;If it is pre- that the frequency of first corresponding relationship is greater than secondDetermine threshold value, then judges that first corresponding relationship whether there is in the second corresponding relationship frequency table;Wherein, the described second corresponding passThe frequency of to be in frequency table include the second corresponding relationship and the second corresponding relationship, second corresponding relationship is will in advance reallyThe path and packet name being set in correct path and packet name corresponding relationship carry out the corresponding relationship established after cutting respectively;
If first corresponding relationship exists in the second corresponding relationship frequency table, first corresponding relationship is read secondCorresponding frequency in corresponding relationship frequency table;Corresponding to judging first corresponding relationship in the second corresponding relationship frequency tableWhether frequency is greater than third predetermined threshold;
If first corresponding relationship frequency corresponding in the second corresponding relationship frequency table is greater than third predetermined threshold,The second weighted value is assigned to first path and packet name corresponding relationship;
The accumulator module 523 obtains first path for being added to first weighted value and the second weighted valueIn packet name corresponding relationship, the similarity in path and packet name.
In aforementioned decision paths and the Installation practice of packet name corresponding relationship, optionally, described second determines submodule522, comprising: the first computational submodule, for being built after carrying out cutting with packet name corresponding relationship to first path according to following formulaThe frequency of the first vertical corresponding relationship is calculated:
F1=n/m;
Wherein, F1 is the frequency that the first corresponding relationship established after cutting is carried out to first path and packet name corresponding relationship;
N is to concentrate in the first corresponding relationship, carries out establish after cutting first with to first path and packet name corresponding relationshipThe sum of the quantity of identical all first corresponding relationships of corresponding relationship;
M is to concentrate in the first corresponding relationship, includes the path cutting vocabulary or packet in first path and packet name corresponding relationshipThe sum of the quantity of all first corresponding relationships of name cutting vocabulary.
In aforementioned decision paths and the Installation practice of packet name corresponding relationship, optionally, the decision paths and packetThe device of name corresponding relationship further includes the first monitoring module 54 and the first building module 55;Wherein
First monitoring module 54, under the user EXEC of mobile terminal, by client application to shiftingThe creation or change in path are monitored in dynamic terminal.
Wherein, the user EXEC of the mobile terminal is root user's mould for root user modeFormula can be described as root user mode again;Under normal conditions, after mobile terminal-opening automatically into be user EXEC;It can be by generalGeneral family pattern switching can also be switched to user EXEC by root user mode to root user mode.
First building module 55, for currently having new path creation in the mobile terminal or thering is path to change when monitoringWhen change, the path reading newly created path or changing obtains answering for the mobile terminal foreground and backstage current activeWith the packet name of program, the corresponding relationship between the path of reading and the packet name of acquisition is established;It establishes comprising readingThe tables of data of corresponding relationship between the path and the packet name of acquisition includes path to be determined and packet name as describedFirst tables of data of corresponding relationship.
In current newly created path or there are the path of change, a packet name with current foreground and the application program of background activityBetween establish corresponding relationship, so as to reduce the quantity of the corresponding relationship between the path of foundation and packet name, improve subsequentDetermine efficiency.The corresponding relationship can be one-to-many relationship, be also possible to many-to-one relationship, it can be by a pathIt is corresponding with multiple packet names, it is also possible to multiple paths are corresponding with the same packet name.
In aforementioned decision paths and the Installation practice of packet name corresponding relationship, optionally, the decision paths and packetThe device of name corresponding relationship further includes the second building module 56, computing module 57 and third building module 58;Wherein
Second building module 56 includes have been determined as correct path and packet name corresponding relationship in advance for establishingTwo tables of data.As an alternative embodiment, can be established by artificial mode include have been determined as in advance correct path withSecond tables of data of packet name corresponding relationship can also obtain path and packet name corresponding relationship in the second tables of data by burying point modeData.
Computing module 57, for by the second tables of data path and packet name corresponding relationship in path and packet name respectively intoThe second set of correspondences is established in row cutting;The second corresponding relationship of each of the second corresponding relationship concentration, is the second tables of dataCorresponding relationship between the cutting vocabulary in middle path and the cutting vocabulary of packet name corresponding with the path;Described second corresponding passPath is identical as the quantity of packet name corresponding relationship in the quantity of the second corresponding relationship, and the second tables of data in assembly;
The frequency of the second corresponding relationship each of is concentrated to calculate the second corresponding relationship according to following formula:
F2=j/k;
Wherein, F2 is the frequency that the second corresponding relationship concentrates one of them the second corresponding relationship;
J is to concentrate in the second corresponding relationship, all second corresponding passes identical with one of them described second corresponding relationshipThe sum of quantity of system;
K be the second corresponding relationship concentrate, comprising in one of them described second corresponding relationship path cutting vocabulary orThe sum of the quantity of all second corresponding relationships of packet name cutting vocabulary;
Third constructs module 58, for according to the second corresponding relationship of each of the second corresponding relationship concentration being calculatedFrequency establishes the second corresponding relationship frequency table.
In aforementioned decision paths and the Installation practice of packet name corresponding relationship, optionally, the second building module 56,Include:
Second monitoring submodule 561, under the root user mode of mobile terminal, by client application to shiftingThe creation or change in path are monitored in dynamic terminal;
4th building submodule 562 currently has new path to create or have road for working as to monitor in the mobile terminalWhen diameter changes, the path reading newly created path or changing obtains the mobile terminal foreground and backstage current activeApplication program packet name, establish the corresponding relationship between the path of reading and the packet name of acquisition;It establishes comprising readingThe tables of data of corresponding relationship between the path taken and the packet name of acquisition, as it is described include to have been determined as in advanceSecond tables of data in correct path and packet name corresponding relationship.
Corresponding relationship in second tables of data can be one-to-many relationship, be also possible to many-to-one relationship, it canIt is that a path is corresponding with multiple packet names, it is corresponding with the same packet name is also possible to multiple paths.
Figure 10 is the structural schematic diagram of one embodiment of electronic equipment of the present invention.Referring to Figure 10, electronic equipment of the present invention is implementedExample includes: shell 81, processor 82, memory 83, circuit board 84 and power circuit 85, wherein circuit board 84 is placed in shell81 space interiors surrounded, processor 82 and memory 83 are arranged on circuit board 84;Power circuit 85, for being above-mentioned electronicsThe each circuit or device of equipment are powered;Memory 83 is for storing executable program code;Processor 82 is by reading storageThe executable program code stored in device runs program corresponding with executable program code, for executing aforementioned decision pathsStep described in method any embodiment with packet name corresponding relationship.
Electronic equipment provided in an embodiment of the present invention, it is similar to packet name corresponding relationship by determination path to be determinedDegree, and judge whether the similarity is greater than the predetermined threshold value first set and then determines first path if more than preset threshold valueIt is set up with packet name corresponding relationship, thus, it is possible to relatively accurately determine installation kit corresponding to path.
The electronic equipment exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, dataCommunication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and lowHold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing functionCan, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are totalLine etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energyPower, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic devices with data interaction function.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be withRelevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage mediumIn, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magneticDish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (RandomAccessMemory, RAM) etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyIn the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answersIt is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.