Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment one
See Fig. 1, present embodiments provide a kind of method showing character relation, the method flow process is specific as follows:
101: determine relation between multiple personage to be shown and put in order, the plurality of personage to be shown comprises a central person and a predetermined number related person;
102: according to the relation between the plurality of personage to be shown and put in order, draw the character relation of central person;
103: the distance between each any two personage's nodes playing up calculating and plotting in the cycle, and according to the distance of calculating and the relation of predeterminable range, make this any two personage's nodes relative movement, until keep stabilizing distance between all personage's nodes.
Wherein, the cycle of playing up refers to the time interval between every playing up for twice, and the present embodiment does not limit the concrete cycle of playing up, and in actual application, can set according to frame rate, namely sets according to the frame number of the picture refreshed p.s..
The method that the present embodiment provides, by after drafting character relation, calculate the distance between any two personage's nodes, and according to the distance of calculating and the relation of predeterminable range, make the relative movement of any two personage's nodes, until keep stabilizing distance between all personage's nodes, thus reach the effect of animation, play the effect optimizing character relation layout, make character relation more clear, accurate, and then improve Consumer's Experience.
Embodiment two
Present embodiments provide a kind of method showing character relation, the method effectively can not only reduce the intersection of character relation, and the display of character relation can also be made to reach the effect of animation, plays the effect optimizing character relation layout simultaneously.See Fig. 2, the method flow process is specific as follows:
201: determine relation between multiple personage to be shown and put in order, the plurality of personage to be shown comprises a central person and a predetermined number related person;
For this step, first need to obtain the relation data between multiple personage to be shown, the plurality of personage to be shown comprises a central person and a predetermined number related person.In actual application, central person is the personage of user search, the personage of namely user's concern, the related person relevant to central person can have multiple, but because display interface is limited, when the character relation of display centre personage, the quantity of the related person to display is needed to limit.For this reason, the present embodiment takes selects a predetermined number related person to carry out the mode shown in multiple related person, as for how to choose a predetermined number related person in multiple related person, and the concrete quantity of predetermined number, the present embodiment is all not specifically limited, and can set according to actual conditions.For the ease of choosing, the present embodiment takes the mode of by the density between related person and central person, each related person being carried out classification, such as, the personage directly related with central person is classified as one-level related person, the personage with central person's indirect correlation is classified as secondary related person.Choose a predetermined number related person according to the different stage of related person again, such as, in one-level related person, choose 7 related person, then in secondary related person random selecting 3 related person.
After obtaining the relation data between multiple personage to be shown, data by getting set up the relation list between multiple personage to be shown, take central person as A, predetermined number is 5, it is example that 5 related person are respectively B, C, D, E and F, then the relation list between them can as shown in table 1 below:
Table 1
The relation between each personage is can clearly be seen that by table 1, then after determining the relation between multiple personage to be shown, central person and a predetermined number related person are sorted according to the relation determined, ranking results can show equally in the form of a list again.Concrete sortord can have multiple, and the present embodiment is not specifically limited this, includes but not limited to following implementation:
First, traversal relation data, therefrom extracts the people information with individual layer relation, and after being sequentially arranged in central person;
If the pass shown in table 1 is example, then as can be seen from Table 1, related person D only has relation with central person A, there is not relation with other related person, therefore, can think that this related person D only has individual layer relation, is then arranged in after related person A.
Secondly, a related person is chosen in the related person that all the other are not sorted, because this related person has multilayer relation, then after being arranged in ordering personage, the relational tree of this related person be selected of recursion again, and by recursion to personage be sequentially arranged in this related person be selected after; By that analogy, until obtain putting in order between the plurality of personage to be shown.
It should be noted that, when choosing a related person in the related person that all the other are not sorted, can have and multiplely choose mode, the present embodiment is not specifically limited this.Such as, when the related person chosen is B, then after related person B is arranged in ordering related person D, the relational tree of this related person B of recursion, as can be seen from Table 1, related person B and related person C has relation, and related person C and related person F have relation, related person F and related person E has relation, and related person E and central person A has relation, because central person A sorts, then recursion terminates.According to recursion order, by recursion to related person C, F and E be sequentially arranged in related person B after, arrive this, the sequencer procedure of all personages terminates, and final ranking results can as shown in table 2 below:
Table 2
Sequence number |
Personage |
1 |
A |
2 |
D |
3 |
B |
4 |
C |
5 |
F |
6 |
E |
202: according to the relation between the plurality of personage to be shown and put in order, draw the character relation of this central person;
Particularly, because the mode sorted to multiple personage to be shown can have multiple, when then drawing the character relation of central person according to putting in order, correspondingly also can have the drawing result of multiple drafting mode and correspondence, the present embodiment does not limit concrete drafting mode and drawing result.Drafting mode includes but not limited to according to putting in order according to angle at equal intervals by the position of each related person node placement in the periphery any distance of central person's node, and connects according to the relation between multiple personage to be shown.
Wherein, the present embodiment does not limit the size of any distance.Such as, be still A with central person, related person is respectively B, C, D, E and F is example, relation between them is as shown in table 1, put in order as shown in table 2, then according to put in order according to angle at equal intervals by each related person node placement when the position of the periphery any distance of central person's node, after central person A can being placed on the center of display interface, according to putting in order in table 2, according to angle at equal intervals by related person D, B, C, F and E is placed on the position of the periphery any distance of central person A successively, according to the relation between each personage shown in table 1, each personage's node is connected again, example is illustrated in figure 3 with drawn character relation.
As can be seen from the drawing result of Fig. 3, because putting in order between personage carries out recursion according to character relation, therefore, this step, according to putting in order according to when each related person is placed on the periphery of central person's node by angle at equal intervals, can play the effect reducing the relation between personage's node and intersect.But in order to avoid further because character relation is complicated and cause user not see physical relationship problem between each personage of Chu, reach a kind of animation effect, and then promote Consumer's Experience, the present embodiment takes follow-up processing procedure, refers to following steps simultaneously.
203: play up in the cycle each the distance calculated between any two personage's nodes;
Wherein, the cycle of playing up refers to the time interval between every playing up for twice, and the present embodiment does not limit the concrete cycle of playing up, and in actual application, can set according to frame rate, namely sets according to the frame number of the picture refreshed p.s..For the distance how calculated between any two personage's nodes, have many algorithms in prior art, the present embodiment is not specifically limited this.
204: according to the distance of calculating and the relation of predeterminable range, make this any two personage's nodes relative movement, until keep stabilizing distance between all personage's nodes.
For this step, in order to keep the position distribution between each personage's node even, it is the mode of every two personage's Node configurations ideal distance in advance that the present embodiment takes, and this distance is predeterminable range.Predeterminable range needs are according to the width of display interface and height, and personage's number of display obtains.Be still A with central person, related person is B, C, D, E and F is example, central person's node to be shown and related person node are added up and one are had 6, then according to width and the height of display interface, for each personage's peer distribution one can make the uniform ideal position of position distribution between each personage's node; Calculate the distance between any two nodes again, this distance is predeterminable range.The present embodiment does not limit the obtain manner of predeterminable range, does not limit equally to the size of predeterminable range.
If shown according to predeterminable range between each personage's node, then the character relation shown will be a desirable state.But in actual applications, according to put in order according to angle at equal intervals by each related person node placement behind the position of the periphery any distance of central person's node, the character relation of display is difficult to reach perfect condition, therefore, after the character relation drawing central person, need to adjust the distance between any two personage's nodes, to make the distance between any two personage's nodes close to predeterminable range, thus make the character relation of display be tending towards perfect condition.
Particularly, when the distance between two personage's nodes reaches predeterminable range, it is equilibrium state; When distance between two personage's nodes is greater than predeterminable range, binding between two personage's nodes, force the distance of two personage's nodes to reduce; When distance between two personage's nodes is less than predeterminable range, between two personage's nodes, there is repulsive force, force the distance between two personage's nodes to increase.No matter be constraining force, or repulsive force, all will force the relative movement of two personage's nodes.
In the relation according to the distance calculated and predeterminable range, when making any two personage's node relative movements, need first to judge whether the distance calculated is greater than predeterminable range;
If so, then make these any two personage's nodes to the relative movement of the other side position;
Such as, according to the distance of calculating and the difference of predeterminable range, for any two personage's node sets positive acceleration to the movement of the other side position, and the forward direction speed of any two personage's nodes is calculated according to positive acceleration, these any two personage's nodes are moved to the other side position by forward direction speed;
If not, then make these any two personage's nodes to the relative movement of the other side's reverse position.
Such as, according to the distance of calculating and the difference of predeterminable range, for any two personage's node sets backward acceleration to the movement of the other side's reverse position, and the inverted speed of any two personage's nodes is calculated according to backward acceleration, these any two personage's nodes are moved to position, the other side direction by inverted speed.
Alternatively, when making any two personage's node relative movements, except all calculating a translational speed for these any two personage's nodes, make outside the movement simultaneously of these any two personage's nodes, the mode of the personage's node motion only made among any two personage's nodes can also be taked, thus reaching the object making this any two personage's nodes relative movement, the present embodiment is to making the mode of any two personage's nodes relative movement specifically limit.
Further, in the relation according to the distance calculated and predeterminable range, after making the relative movement of any two personage's nodes, if personage's node motion is to display page border arbitrarily, then oppositely move this any personage's node; If the translational speed of personage's node is less than threshold value arbitrarily, then stops this any personage's node mobile, think that the distance between this any personage's node and other personage's nodes reaches balance.After the distance treating between all personage's nodes all reaches balance, namely after keeping stabilizing distance between all personage's nodes, relation between each personage's node will clearly layout on display page, user is facilitated to check, still for the initial character relation layout of central person as shown in Figure 3, then after optimizing, the layout of display character relation can be as shown in Figure 4.
It should be noted that, when showing the physical relationship descriptor between personage, the method that the present embodiment provides can support display mode of the prior art equally, namely when user clicks the line between two personage's nodes, at this line place by display description relation information therebetween, such as, opponent, friend, middle man etc.Alternatively, the method that the present embodiment provides, also be supported in the keyword (the line place of two personage's nodes in Fig. 3 and Fig. 4 eliminates concrete descriptor) of one of them the personage's node of line place display description between two personage's nodes, and the descriptors such as this keyword can when each refreshing character relation, or refresh according to the refresh cycle of presetting, thus provide the character relation descriptor of real-time update for user.Wherein, the refresh cycle can according to user's request, or practical application sets, and the present embodiment is not specifically limited this.Specifically show which kind of descriptor for the line place between personage's node, the present embodiment is not specifically limited equally to this.
In sum, the method that the present embodiment provides, by according to the relation between central person and a predetermined number related person and put in order, draws the character relation of central person, effectively can reduce the intersection of character relation; And by after drafting character relation, according to the distance between any two the personage's nodes calculated and the relation of predeterminable range, make the relative movement of any two personage's nodes, until keep stabilizing distance between all personage's nodes, thus reach the display effect of animation, the effect optimizing character relation layout can not only be played, make character relation more clear, accurate, can also Consumer's Experience be promoted; In addition, because the descriptor of the relation between each personage is also refreshable, thus can be the descriptor that user provides up-to-date character relation, meet the search need of user further, improve Consumer's Experience.
Embodiment three
See Fig. 5, present embodiments provide a kind of device showing character relation, this device comprises:
Determination module 501, for determining relation between multiple personage to be shown and putting in order, the plurality of personage to be shown comprises a central person and a predetermined number related person;
Drafting module 502, for the relation between the personage multiple to be shown that determines according to determination module 501 and put in order, draws the character relation of central person;
Computing module 503, for the distance between each any two personage's nodes playing up calculating and plotting module 502 drafting in the cycle;
Optimize module 504, for the relation of the distance that calculates according to computing module 503 and predeterminable range, make this any two personage's nodes relative movement, until keep stabilizing distance between all personage's nodes.
Wherein, the cycle of playing up refers to the time interval between every playing up for twice, and the present embodiment does not limit the concrete cycle of playing up, and in actual application, can set according to frame rate, namely sets according to the frame number of the picture refreshed p.s..
See Fig. 6, determination module 501, specifically comprises:
Acquiring unit 501a, for obtaining the relation data between multiple personage to be shown, the plurality of personage to be shown comprises a central person and a predetermined number related person;
First sequencing unit 501b, for traveling through the relation data that acquiring unit 501a gets, therefrom extracts the people information with individual layer relation, and after being sequentially arranged in central person;
Second sequencing unit 501c, for choosing a related person in all the other are not by the related person of the first sequencing unit 501b sequence, and after being arranged in the personage arranged, the relational tree of this related person be selected of recursion again, by recursion to personage be sequentially arranged in this related person be selected after, by that analogy, until by complete for all related person arrangements, obtain putting in order between the plurality of personage to be shown.
Particularly, drafting module 502, specifically for putting in order between the personage multiple to be shown that determines according to determination module 501, according to angle at equal intervals by the position of each related person node placement in the periphery any distance of central person's node, and the relation between the personage multiple to be shown determined according to determination module 501 connects.
See Fig. 7, optimize module 504 and specifically comprise:
Judging unit 504a, for judging whether the distance that computing module 503 calculates is greater than predeterminable range;
Processing unit 504b, for when judging unit 504a judges that the distance calculated is greater than predeterminable range, makes these any two personage's nodes to the relative movement of the other side position; When judging unit 504a judges that the distance calculated is less than predeterminable range, then make these any two personage's nodes to the relative movement of the other side's reverse position.
Further, see Fig. 8, the device of this display character relation also comprises:
Post-processing module 505, for when any personage's node motion is to display page border, then oppositely moves this any personage's node; When the translational speed of any personage's node is less than threshold value, then stop this any personage's node mobile.
To sum up, the device that the present embodiment provides, by according to the relation between central person and a predetermined number related person and put in order, draws the character relation of central person, effectively can reduce the intersection of character relation; And by after drafting character relation, according to the distance between any two the personage's nodes calculated and the relation of predeterminable range, make the relative movement of any two personage's nodes, thus reach the effect of animation, play the effect optimizing character relation layout, make character relation more clear, accurate, and then improve Consumer's Experience.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
All or part of step in the embodiment of the present invention, can utilize software simulating, and corresponding software program can be stored in the storage medium that can read, as CD or hard disk etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.