WO2019057192A1 - 知识图谱的展示方法及装置、移动终端及可读存储介质 - Google Patents

知识图谱的展示方法及装置、移动终端及可读存储介质 Download PDF

Info

Publication number
WO2019057192A1
WO2019057192A1 PCT/CN2018/107274 CN2018107274W WO2019057192A1 WO 2019057192 A1 WO2019057192 A1 WO 2019057192A1 CN 2018107274 W CN2018107274 W CN 2018107274W WO 2019057192 A1 WO2019057192 A1 WO 2019057192A1
Authority
WO
WIPO (PCT)
Prior art keywords
entity
entities
display
level sub
sub
Prior art date
Application number
PCT/CN2018/107274
Other languages
English (en)
French (fr)
Inventor
吴正山
何枫
吴雷
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2019057192A1 publication Critical patent/WO2019057192A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Definitions

  • the present application relates to the field of information processing technologies, and in particular, to a method and apparatus for displaying a knowledge map, a mobile terminal, and a readable storage medium.
  • the knowledge map also known as the scientific knowledge map, is called the knowledge domain visualization or the knowledge domain mapping map in the library and information industry. It is a series of different graphs showing the relationship between knowledge development process and structure. It uses visual technology to describe knowledge resources and Its carrier explores, analyzes, builds, maps, and displays the interrelationships between knowledge and knowledge.
  • knowledge maps can be used in many fields, for example, using knowledge maps to show a person's achievements, using knowledge maps to show relationships between multiple characters, using knowledge maps to display things attributes, and so on.
  • the application example provides a method for displaying a knowledge map, including:
  • the application example provides a display device for a knowledge map, including:
  • a response module configured to determine, in response to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • a first location determining module configured to determine, according to a preset layout rule, a first display of the multiple entities in the display area by using a tree structure relationship between multiple entities and a size of a display area of the mobile terminal location information
  • a first display module configured to display a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • the present application provides a mobile terminal, including: a memory, a processor, and a computer program stored on the memory and running on the processor, when the processor executes the computer program, implementing the present application
  • a mobile terminal including: a memory, a processor, and a computer program stored on the memory and running on the processor, when the processor executes the computer program, implementing the present application
  • the present application example provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements various steps in a method of presenting a knowledge map as provided herein.
  • FIG. 1A is a schematic structural diagram of a system involved in an example of the present application.
  • 1B is a schematic structural diagram of a system involved in an example of the present application.
  • 1C is a schematic flowchart of a method for displaying a knowledge map in an example of the present application
  • FIG. 2 is a schematic diagram showing a tree structure relationship between multiple entities in a display interface of a mobile terminal according to an example of the present application
  • Figure 3 is a schematic diagram showing the addition of a specific relationship on the basis of Figure 2;
  • FIG. 4 is a schematic flowchart of a refinement step of step 102 in the example shown in FIG. 1C of the present application;
  • FIG. 5 is a schematic flowchart diagram of a method for displaying a knowledge map in an example of the present application
  • FIG. 6 is a schematic diagram showing display after layering of a primary sub-entity in an example of the present application.
  • FIG. 7 is a schematic diagram of a traversal sequence in an example of the present application.
  • FIG. 8 is a schematic diagram showing an extended display area based on FIG. 2 in the example of the present application.
  • FIG. 9 is a schematic flow chart of an additional step of the example shown in FIG. 1C or FIG. 5 of the present application.
  • Figure 10 is a schematic view showing the sliding direction in the example of the present application.
  • 11a and 11b are schematic diagrams of an example based on a main vector layout in an example of the present application.
  • FIG. 12 is another schematic diagram of a traversal sequence in an example of the present application.
  • FIG. 13 is a schematic view of a display area before a sliding operation in an example of the present application.
  • Figure 14 is a schematic view of the display area after the sliding operation is performed in Figure 13;
  • 15 is a schematic structural diagram of a program module of a device for displaying a knowledge map in an example of the present application
  • 16 is a schematic structural diagram of a program module of a device for displaying a knowledge map in an example of the present application
  • 17 is a schematic structural diagram of a program module of a device for displaying a knowledge map in an example of the present application.
  • FIG. 18 is a schematic structural diagram of an additional program module of the example shown in FIG. 15 and FIG. 17;
  • FIG. 19 is a schematic structural diagram of a mobile terminal according to an example of the present application.
  • the knowledge map is used to describe various entities existing in the real world, and the intrinsic characteristics of the entities are characterized by attribute-value pairs. Connect two or more entities to characterize the association between two or more entities.
  • a knowledge map can also be thought of as a huge mesh diagram, with nodes in the mesh diagram representing entities and edges in the mesh diagram being composed of attributes or relationships.
  • the knowledge map includes at least a central entity and a first-level sub-entity of the central entity. Further, the knowledge map may include at least a central entity, a primary sub-entity of the central entity, and a secondary sub-entity of the central entity, the knowledge map.
  • the relationship between entities in can also be seen as a tree structure relationship.
  • each entity has its parent entity, except for the central entity.
  • the technical solution in the example of the present application is to display the entity to be displayed in the knowledge map when the knowledge map is displayed on the display area of the mobile terminal, so that the display area can be fully utilized.
  • the method for displaying the knowledge map proposed by the example of the present application can be applied to scenarios such as semantic search, machine question and answer, information retrieval, electronic reading, online learning, etc.
  • the method can be applied to the scene as shown in FIG. 1A. .
  • the system architecture includes a terminal device, such as a mobile terminal 101A, and an application 102A in the terminal device.
  • a terminal device such as a mobile terminal 101A
  • an application 102A in the terminal device When the user views the knowledge map of the specified content using the application 102A, the application 102A in the terminal device will respond to the user at the terminal device. Triggering operations on the interface, and generating a knowledge map in response to the triggering operation, displaying the knowledge map on the interface.
  • terminal devices such as mobile terminal 101B, application 102B, and server 103B are included.
  • the application 102B can be a browser
  • the server 103B provides network services (eg, generating a knowledge map) to the user through one or more networks 104B, wherein the user operates his terminal device (eg, the mobile terminal 101B).
  • the browser When the user searches the knowledge map of the participant of a drama using the browser, the browser responds to the operation, generates a search request, and sends the search request to the server 103B, and the server 103B generates a knowledge map in response to the search request, and The knowledge map is sent to the browser to cause the browser to display the knowledge map.
  • the terminal device may be a mobile phone, a tablet computer, or a personal digital assistant or a wearable device.
  • the server can be implemented on one or more separate data processing devices or distributed computer networks. In some instances, the server may also use services of various virtual devices and/or third party service providers (eg, third party cloud service providers) to provide underlying computing resources and/or base resources.
  • third party service providers eg, third party cloud service providers
  • FIG. 1C is a schematic flowchart of a method for displaying a knowledge map in an example of the present application, where the method includes:
  • Step 101C Determine, according to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • the method for displaying the knowledge map is implemented by a display device of a knowledge map (hereinafter referred to as a display device), and the display device is specifically a program module, which can be implemented by a processor calling a program module stored in a storage medium. .
  • the mobile terminal responds to the triggering operation of the user on the interface of the mobile terminal, and determines, between the plurality of entities to be displayed and the plurality of entities included in the specified knowledge map, in response to the knowledge map display instruction generated by the triggering operation. Tree structure relationship.
  • the triggering operation may be a search operation, and the specified knowledge map may be generated by a server.
  • the multiple entities to be displayed may include a central entity and a plurality of first-level sub-entities of the central entity, and the number of the first-level sub-entities is less than or equal to a preset mobile terminal.
  • the display area shows the maximum number of entities. For example, if in the above specified knowledge map, the central entity has one hundred primary sub-entities, in this case, if the one hundred primary sub-entities are displayed in the display area of the mobile terminal, The sub-entity shows that the area is too small, the sub-entity collision, etc., the display effect is not good.
  • the N first-level sub-entities with the entity weights ranked in the top N are selected from the one hundred primary sub-entities.
  • the tree structure relationship refers to a connection relationship between the plurality of entities.
  • the tree structure relationship between the plurality of entities is actually displayed, that is, the knowledge map formed by the plurality of entities .
  • Step 102C Determine, according to a preset layout rule, first display location information of the multiple entities in the display area by using a tree structure relationship between the multiple entities and a size of a display area of the mobile terminal;
  • the above layout rules may be a circular layout rule, an elliptical layout rule, a mesh layout rule, and the like.
  • elliptical layout rules may be employed, it being understood that the plane is relative to the mesh type.
  • the layout and the circular layout, the layout implemented based on the elliptical layout rule is more suitable for the characteristics of the display area of the mobile terminal, can fully utilize the display area, and can lay out more entities than other layout methods.
  • the elliptical layout rule refers to an elliptical shape after multiple physical layouts, and an elliptical layout algorithm is used when laying out based on the elliptical layout rules.
  • the display device determines the first display location information of the plurality of entities in the display area by using a tree structure relationship between the multiple entities and a size of the display area of the mobile terminal based on the preset layout rule.
  • the size of the display area of the mobile terminal is preset or known, and the display location information is used to indicate the location and area of the entity when the display area is displayed.
  • Step 103C Display a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • each entity has its corresponding first placement location information, and the tree structure relationship between the multiple entities is displayed in the display area according to the first placement location information of the entity.
  • the tree structure relationship between the plurality of entities that is, the knowledge map formed by the plurality of entities.
  • the ellipse layout rule is used as an example.
  • FIG. 2 a schematic diagram of a tree structure relationship between multiple entities is displayed on a display interface of a mobile terminal in the example of the present application.
  • entity A is a central entity
  • entities B to Q are first-level sub-entities of entity A, and when displayed in the display area, an elliptical shape is presented.
  • the entity A is connected with the entities B to Q respectively, and the connection line indicates that the entities are related, and the relationship between the entities can be displayed on the connection line, as shown in FIG. 2, or not The relationship between the entities is displayed on the connection line.
  • FIG. 3 FIG.
  • FIG. 3 is a schematic diagram showing the addition of a specific relationship on the basis of FIG. 2, where a1 to a16 are the relationships between the entities A and the entities B to Q, respectively.
  • a1 to a16 are the relationships between the entities A and the entities B to Q, respectively.
  • the foregoing display device may be a mobile terminal, that is, the technical solution in the example of the present application is implemented by the mobile terminal, as shown in FIG. 1A; or the display device may also be a mobile terminal and a server.
  • the system is configured, as shown in FIG. 1B, the knowledge map display instruction is sent to the server by the mobile terminal in the system, and the server implements step 101C and step 102C in the example of the present application, and obtains the first display position of the plurality of entities. After the information, the first display location information of the multiple entities is fed back to the mobile terminal, and the mobile terminal performs step 103C to implement the technical solution in the example of the present application through the interaction between the server and the mobile terminal.
  • the display device determines, according to the knowledge map display instruction, a tree structure relationship between multiple entities to be displayed and multiple entities included in the specified knowledge map, and uses multiple entities based on preset layout rules. Determining, between the tree structure relationship and the size of the display area of the mobile terminal, the first display location information of the multiple entities in the display area, and displaying the plurality of entities in the display area according to the first display location information The tree structure relationship to achieve the presentation of the knowledge map composed of the plurality of entities.
  • the plurality of entities to be displayed in the specified knowledge map are laid out in the display area of the mobile terminal based on the preset layout rule, and the size of the display area can be fully utilized to effectively implement the knowledge map in the display area of the mobile terminal. Demonstrate to meet the needs of mobile terminal users.
  • FIG. 4 is a schematic flowchart of the refinement step of step 102C in the example shown in FIG. 1C of the present application.
  • the step 102C includes:
  • Step 401 Determine a length of a long side of the display area and a length of the short side;
  • Step 402 Calculate, according to a preset ellipse layout algorithm, a length of the long side, and a length of the short side, starting from a central entity in the tree structure relationship, and sequentially calculating first display location information of the multiple entities.
  • the length of the long side of the display area and the length of the short side it is necessary to first determine the length of the long side of the display area and the length of the short side, and use a preset ellipse layout algorithm, the length of the long side, and the short side.
  • the length starting from the central entity in the tree structure relationship, sequentially calculates the first placement information of the plurality of entities.
  • the ellipse layout algorithm described above is as follows:
  • startAngle i represents the initial direction angle of the i-th entity
  • index i represents the index of the i-th entity in the tree structure relationship
  • weight i represents the pre-set i-th entity Weight size
  • s i represents a scaling factor of the i-th entity set in advance
  • a represents half of the length of the short side of the display area
  • b represents half of the long side of the display area
  • x i and y i are respectively represented based on In the two-dimensional space coordinates constructed by the display area, the abscissa value and the ordinate value of the i-th entity
  • scale i represents the area occupied by the i-th entity when displayed in the display area;
  • the first display location information of multiple entities can be effectively obtained by the above manner.
  • the primary sub-entity data to be displayed is too much, the first and second sub-items are inevitable after the layout is implemented according to the technical solution shown in FIG. 1C or FIG. 4.
  • the flow diagram of the method for displaying the knowledge map in the example of the present application includes:
  • Step 501 Determine, according to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • Step 502 Determine, according to a preset layout rule, the first display location information of the multiple entities in the display area by using a tree structure relationship between the multiple entities and a size of the display area of the mobile terminal;
  • Step 503 If the number of the first-level sub-entities of the central entity is greater than a preset threshold, obtain second display location information of the first-level sub-entity based on the preset hierarchical layout rule.
  • Step 504 Display a tree structure relationship between the plurality of entities in the display area according to the first display location information of the central entity and the second display location information of the primary sub-entity.
  • the steps 501 and 502 are similar to those described in step 101C and step 102C of FIG. 1C, respectively, and the step 502 is similar to the content described in the refinement step shown in FIG. 4, for details, refer to the above figure.
  • the contents described in 1C and FIG. 4 are not described herein.
  • the first placement location information of the first-level sub-entity is optimized based on the preset hierarchical layout rule, and the second placement location information of the primary entity is obtained.
  • the preset threshold is a preset constant, for example, may be 6, 8, or the like.
  • the layered layout rule is specifically as follows: the first level sub-entity of the central entity is divided into multiple layers, and the number of each layer entity does not exceed the preset maximum number of layout entities, and the entity and the entity
  • the uniform layout between the layers and between the layers makes the picture effect regular and symmetrical when displaying the entities after the layout.
  • the hierarchical layout of the first-level sub-entities can be achieved by using the hierarchical layout rule.
  • the foregoing step 503 may specifically include:
  • Step A1 determining the number of layers of the first-level sub-entity and the actual number of entities in each layer, based on the number of primary sub-entities of the central entity and the number of preset entities of each layer;
  • Step A2 based on the principle of uniform distribution, determining the number of layers to which each entity in the first-level sub-entity belongs by using the number of layers and the actual number of entities in each layer;
  • Step A3 Perform hierarchical processing on the first placement location information of the primary sub-entity based on the number of layers to which each entity belongs in the primary sub-entity, and obtain second presentation location information of the primary sub-entity.
  • the number of entities in each layer is preset, for example, the number of primary sub-entities of the first layer is up to eight, and the number of primary entities of the second layer is up to eight. .
  • the number of primary sub-entities of the first layer is equal to the foregoing preset threshold.
  • the number of primary sub-entities of the first layer is equal to 6, that is, the number of primary sub-entities in the central entity is less than or
  • it indicates that the layout of the primary sub-entity can be completed only by one layer
  • the number of primary sub-entities of the central entity is greater than the preset threshold, it indicates that at least two layers are required.
  • the primary entity of the central entity needs to be layered according to the hierarchical layout rules described above.
  • the number of layers of the primary sub-entity and the actual number of physical entities of each layer are determined, for example, in the first layer.
  • the maximum number of primary sub-entities is eight, and the maximum number of primary sub-entities in the second-level sub-entities is eight. If the number of primary sub-entities of the central entity is 12, it can be determined that it is divided into two layers. And the first layer is 8 first-level sub-entities, the second layer is 4 first-level sub-entities, or, if the central entity has 14 first-level sub-entities, it can be determined to be divided into two layers, and Both the first and second layers are 7 primary sub-entities.
  • the first-level sub-entities of the central entity belong to the first layer Belongs to the second floor. For example, if the number of primary sub-entities in the central entity is 14, and the first layer and the second layer are all seven primary sub-entities, then the first-level sub-entity and the second tier of the first tier can be determined.
  • the first-level sub-entities can be arranged at intervals.
  • FIG. 6 is a schematic diagram showing the layered sub-entities in the example of the present application, where A is the central entity, and b1 to b6 are the first-level first-level sub-entities, c1 To c6 is the second level first level sub-entity.
  • the first placement information of the first-level sub-entity is hierarchically configured to obtain the second display location information of the primary sub-entity, specifically, first Processing the first display location information of the primary sub-entity belonging to the first layer, wherein the size of the area occupied by the entity is unchanged, and the horizontal and vertical coordinates of the first-level sub-entity of the first layer are all approached to the central entity. To shorten the distance of the first-level sub-entity of the first layer from the central entity.
  • the first placement information of the first-level sub-entity of the second layer may be selected to be continued. Processing, for example, shortening the distance of the first-level sub-entity of the second layer relative to the central entity to approach the central entity, or increasing the distance of the first-level sub-entity of the second layer relative to the central entity to be away from the central entity;
  • the first placement information of the first-level sub-entity of the second layer is not processed, and the initial first placement information is retained.
  • the Euclidean distance between a primary sub-entity in a layer and an adjacent primary sub-entity in an adjacent layer is greater than the radius of the two entities.
  • the Euclidean distance refers to the true distance between two points in the m-dimensional space, or the natural length of the vector (ie, the distance from the point to the origin).
  • the Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points.
  • the hierarchical first-level sub-entities collide, and the collision means that two or more first-level sub-entities overlap in the display area of the display area.
  • collision detection is performed based on the second placement location information of the primary sub-entity, and the third placement location information of the primary sub-entity is obtained, so as to avoid collision of the primary primary entity after the layering.
  • the collision detection includes:
  • Step B1 Determine a traversal order of the first-level sub-entities based on a preset traversal rule, and perform traversal according to the traversal order;
  • Step B2 calculating an Euclidean distance between the first level sub-entity traversed and the next second level sub-entity to be traversed;
  • Step B3 If the Euclidean distance does not satisfy the preset condition, the second display position of the second level sub-entity is changed based on the preset coordinate change constant, and returns to the first execution of the calculation traversal a step of the Euclidean distance between the first-level sub-entity and the next second-level sub-entity to be traversed; wherein the preset condition is that the Euclidean distance is greater than or equal to the collision distance of the first-level sub-entity, The collision distance is a sum of a radius of the first level sub-entity, a radius of the second level sub-entity, and a preset constant;
  • Step B4 If the Euclidean distance satisfies the preset condition, traverse to the next level sub-entity, and return to perform execution calculation between the first-level sub-entity traversed and the next second-level sub-entity to be traversed The step of the Euclidean distance until the first-level sub-entities satisfy the preset condition, and the display position information when the preset condition is satisfied is used as the third display position information.
  • the traversal rule for the first-level sub-entity of the central entity will be preset, for example, the traversal rule may be traversed from the inside to the outside and counterclockwise, specifically, for the level that has been divided into N layers.
  • the sub-entities will sequentially determine the traversal sub-order of each layer. Taking the determination of the traversal sub-sequence of the first layer as an example, a first-level sub-entity can be randomly selected from the first-level sub-entities of the first layer as the initial traversal.
  • the order of the first-level sub-entities of the first layer is used as the traversal sub-sequence, wherein the traversal sub-order is a closed loop, as shown in FIG. 6 , if traversing from the entity b1 is selected, traversing The sub-order is b1-b2-b3-b4-b5-b6, and after traversing b6, it will continue to traverse b1 and continue the loop traversal.
  • the traversal order of the entire first-level sub-entity will be determined, which may be traversing from the first layer, such as after completing the traversal of the first layer, continuing to traverse the second layer, for example Taking FIG.
  • the traversal process will begin, and for each traversed first-level sub-entity, it will be processed as follows:
  • the next-level sub-entity of the first-level sub-entity b1 to be traversed is b2, and the Euclidean distance between the first-level sub-entity b1 and the first-level sub-entity b2 is calculated.
  • the Euclidean distance can be calculated using the Euclidean distance formula.
  • the preset condition may be a collision distance greater than or equal to the E-class distance b1 of the first-level sub-entity b1
  • the collision distance of the sub-entity b1 is equal to the sum of the radius of the primary sub-entity b1, the radius of the primary sub-entity b2, and the preset constant.
  • the Euclidean distance calculated above does not satisfy the preset condition, that is, the Euclidean distance is smaller than the collision distance of the primary sub-entity b1, indicating that a collision occurs between the primary sub-entity b1 and the primary sub-entity b2,
  • the second display position information of the first-level sub-entity b2 is changed based on the preset coordinate change constant, for example, a coordinate change constant is added to the second display position information of the first-level sub-entrate b2 to change
  • the abscissa and the ordinate and after the change, in order to further determine whether the first-level sub-entity b1 and the first-level sub-entry b2 still have a collision, the step B2 described above is returned, and the first-level sub-entity b1 and the placement information are continuously calculated.
  • the Euclidean distance calculated above satisfies a preset condition, that is, the Euclidean distance is greater than or equal to the collision distance of the primary sub-entity b1, indicating that there is no collision between the primary sub-entity b1 and the primary sub-entity b2.
  • the current placement information of the primary sub-entity b2 will be retained without modification.
  • collision detection of the first layer is completed, collision detection of the first-level sub-entities of the second layer is continued based on a similar manner until all the first-level sub-entities satisfy the preset condition, and at all After the first-level sub-entities meet the preset conditions, the placement information when the condition is met is used as the third placement information to further optimize the placement information of the primary sub-entities to avoid collision.
  • the step 504 may specifically be: performing the first display according to the central entity.
  • the location information and the third placement information of the primary sub-entity display a tree structure relationship between the plurality of entities in the display area.
  • the size of the display area can be further utilized more effectively, and the manner of exceeding the display area is caused by the manner of reducing the size of the entity and expanding the distance.
  • the display of the primary sub-entity can be completed, and the problem beyond the display area is not brought, and the user is better used.
  • the layout of the primary sub-entities can be optimized, and the user is better used.
  • the display area further includes an extended display area
  • the first level entity may be selected by a sliding operation, and the selected first level sub-entity will be displayed in the extended display area, and the first level is displayed based on the main vector layout rule.
  • the secondary sub-entity of the child entity Please refer to FIG. 8 , which is a schematic diagram of an extended display area based on FIG. 2 for an example of the present application.
  • the area indicated by 701 is an extended display area.
  • the extended display area is located at the center of the display area, and at this time, the central entity A is located in the extended display area. It can be understood that whether the primary sub-entity is a layer display or a two-layer or multi-layer display, the position of the extended display area is unchanged.
  • FIG. 9 is a schematic flowchart of an additional step of the method for displaying the knowledge map shown in FIG. 1C or FIG. 5 in the example of the present application, including:
  • Step 901 Determine, according to the extended presentation instruction, a target level one of the plurality of entities, in response to the extended presentation instruction;
  • the extended display instruction may be triggered in multiple manners, for example, a drag operation or a sliding operation. Specifically, if the user needs to expand the second-level sub-entity that displays the first-level sub-entity C, Then, the first-level sub-entity C can be touched, and dragged into the extended display area while maintaining the touch, and the touch state is released in the extended display area, and the mobile terminal is further triggered to generate an extended display instruction.
  • the sliding operation can be any sliding operation.
  • the presentation device will respond to the extended presentation instruction and determine a target primary sub-entity of the plurality of entities to be extended to be displayed based on the extended presentation instruction.
  • the target first-level sub-entity is the first-level sub-entity at the start position of the drag operation
  • the sliding can be determined based on the sliding operation The sliding direction of the operation, such as determining the starting position and ending position of the sliding operation, and the direction formed from the starting position toward the ending position as the sliding direction.
  • the direction formed by each primary sub-entity to the central entity may be determined based on the placement information of the central entity and each primary sub-entity, and the first-level sub-entity may be obtained.
  • the sliding direction is matched with the direction of each primary sub-entity, that is, the angle between the sliding direction and the direction of each primary sub-entity is determined, and the angle is
  • the direction of the first-level sub-entity used at the smallest time is the most matching direction
  • the first-level sub-entity corresponding to the most matching direction is the target-level sub-entity.
  • FIG. 10 is a schematic diagram of the sliding direction in the example of the present application.
  • the position of the finger movement of the user indicated by the broken line, and the position where the finger is currently located is the position at the end of the sliding operation, wherein the direction of the arrow is the sliding direction determined based on the sliding operation, and can be determined based on the above manner, in FIG.
  • the sliding direction most closely matches the direction in which entity B points to entity A. At this time, entity B is the target level child entity.
  • the sliding direction of the sliding operation can be accurately determined, and the target primary sub-entity corresponding to the sliding operation can be further determined.
  • Step 902 For the purpose of moving the display position of the target level sub-entity into the extended display area, move the plurality of entities as a whole to obtain fourth display location information of the multiple entities.
  • the function that can be implemented by the extended display area may also be referred to as a “magnifying glass”, that is, a secondary sub-entity of the primary sub-entity may be displayed.
  • the target-level sub-entity needs to be displayed in the extended display area.
  • the placement information of the first-level sub-entity and the central entity is adjusted first. Specifically, the destination information of the target level sub-entity is moved to the extended display area, and the first-level sub-entity and the central entity are moved as a whole, and the fourth display location information of the multiple entities is obtained. Since the first-level sub-entity and the central entity are moved as a whole, the fourth placement information of some entities will be beyond the range of the display area, and cannot be displayed.
  • Step 903 Determine, according to a primary vector layout rule, fourth display location information of the second-level sub-entity to be extended and displayed by the target-level sub-ent.
  • the layout of the second-level sub-entities of the target-level sub-entity adopts a main vector layout manner
  • the main vector layout is a main vector in which the central entity points to the target-level sub-entity, and the second to be laid out
  • the level sub-entities may be arranged on both sides centered on the main vector of the target-level sub-entity, and determine the fourth display position information of the second-level sub-entity to be extended and displayed by the target-level sub-entity.
  • the number of the second-level sub-entities to be extended and displayed by the target-level sub-entity has an upper limit value, for example, six, if the number of the second-level sub-entities of the target-level sub-entity is less than or equal to six, All the second-level sub-entities are used as the second-level sub-entities to be displayed. If the number of the second-level sub-entities of the target-level sub-entities is greater than 6, the weights are randomly selected or selected from the second-level sub-entities.
  • the first six 6 secondary sub-entities are the secondary sub-entities to be displayed.
  • FIG. 11a to FIG. 11b are schematic diagrams of an example based on a main vector layout.
  • B is the target primary entity
  • D is the central entity
  • the direction of the dotted arrow is the primary vector direction
  • the entities b1 to b6 are the secondary sub-entities of the target primary sub-entrant B
  • the target-level sub-entities are located in the extension Within the exhibition area.
  • FIG. 11a and FIG. 11b are mainly for explaining the layout manner of the secondary sub-entities. In the figure, other first-level sub-entities are not shown.
  • Step 904 Display, in the display area, according to the fourth display location information of the multiple entities and the second-level sub-entities.
  • the fourth location information of the central entity and the first-level sub-entity may be displayed in the display area according to the fourth display location information of the multiple entity and the second-level sub-entity.
  • the step 904 may specifically be: displaying the fifth display position information obtained after the collision detection of the plurality of entities and the second sub-entities in the display area.
  • collision detection is performed as follows:
  • Step C1 Determine, according to a preset traversal rule, a traversal order of an entity in a set of entities including a first-level sub-entry and a second-level sub-entity of the plurality of entities, and perform traversal according to the traversal order;
  • Step C2 Calculate the Euclidean distance between the traversed first entity and the next second entity to be traversed
  • Step C3 If the Euclidean distance does not satisfy the preset condition, the fourth display position information of the second entity is changed based on the preset coordinate change constant, and the first entity that performs the calculation traversal is returned.
  • a step of the Euclidean distance between the second entity to be traversed; the preset condition is that the Euclidean distance is greater than or equal to the collision distance of the first entity, and the collision distance is a radius of the first entity, a sum of a radius of the second entity and a preset constant;
  • Step C4 If the Euclidean distance satisfies the preset condition, traverse to the next entity, and return to perform the step of performing the Euclidean distance between the first entity to be traversed and the next entity to be traversed until the The entities in the set of entities satisfy the preset condition, and the placement information when the preset condition is met is used as the fifth display location information.
  • the preset traversal rule in step C1 is similar to the traversal rule mentioned in the example shown in FIG. 5.
  • the target primary sub-entity needs to be
  • the level child entity is added to the traversal subsequence of the layer in which the target level child entity is located.
  • FIG. 12 is a schematic diagram of the traversal sequence in the example of the present application.
  • the entity A is a central entity
  • the entities B, D, F, H, J, L, N, and P are all primary sub-entities
  • the entity F is a target-level sub-entity
  • the entities f1, f2, and f3 are target ones.
  • the second sub-entity of the sub-entity F constitutes the order of traversal.
  • the Euclidean distance between the traversed first entity F and the next second entity f1 to be traversed is calculated by traversing to the entity F as an example.
  • the preset condition may be a collision distance greater than or equal to the Euclidean distance, wherein the first entity
  • the collision distance of F is equal to the sum of the radius of the first entity F, the radius of the second entity f1, and the preset constant.
  • the Euclidean distance calculated above does not satisfy the preset condition, that is, the Euclidean distance is smaller than the collision distance of the F of the first entity, it indicates that a collision occurs between the first entity F and the second entity f1.
  • the fourth display position information of the second entity f1 is changed based on the preset coordinate change constant, for example, a coordinate change constant is added to the fourth display position information of the second entity f1 to change the abscissa and the vertical Coordinates, and after the change, in order to further determine whether the first entity F and the second entity f1 still have a collision, the step C2 described above is returned, and the second entity F and the second entity after the change of the placement information are continuously calculated.
  • the Euclidean distance calculated above satisfies the preset condition, that is, the Euclidean distance is greater than or equal to the collision distance of the first entity F, it indicates that there is no collision between the first entity F and the second entity f1.
  • the current placement information of the second entity f1 is retained and is not modified. And continue to traverse to the next entity, that is, the entity f1 will be the entity traversed, repeat the content of the above step C2, and loop until all the entities satisfy the preset condition.
  • FIG. 13 a schematic diagram of a display area before a sliding operation in the example of the present application, as shown in FIG. 14 , is a schematic view of a display area after performing a sliding operation in FIG. 13 .
  • the entity F in FIG. 14 is a target level entity, and the entity F is located in the extended display area in FIG.
  • the display area is switched from the FIG. 13 to the process of FIG. 14 to show the effect. Specifically, all entities in the interface (including the central entity A and the primary sub-entity B) are displayed first. , D, F, H, J, L, N, P) move the same distance in the same direction as a whole until the first sub-entity F moves to the extended display area, and after the first-level sub-entity F moves to the extended display area
  • the second-level sub-entities f1, f2, and f3 will be displayed by the first-level sub-entries F as a starting point, and after the end of the display, the second-level sub-entities f1, f2, and f3 are hidden by shrinking toward the center. stand up. It can be understood that, in practical applications, there are various display effects, which are not limited herein.
  • the target primary sub-entity in response to the extended presentation instruction, the target primary sub-entity is determined, and the placement information of the secondary sub-entity of the target primary sub-entity is determined, so that the secondary sub-entity can be further displayed and detected by collision The way to push the colliding entity away from collisions, making the display clearer and improving the user experience.
  • FIG. 15 is a schematic structural diagram of a program module of a device for displaying a knowledge map according to an example of the present application.
  • the device includes:
  • the response module 1501 is configured to determine, according to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • the plurality of entities to be displayed include a central entity and a plurality of first-level sub-entities of the central entity, and the number of the first-level sub-entities is less than or equal to a display area of the preset mobile terminal.
  • the maximum number of entities For example, if in the above specified knowledge map, the central entity has one hundred primary sub-entities, in this case, if the one hundred primary sub-entities are displayed in the display area of the mobile terminal, The sub-entity shows that the area is too small, the sub-entity collision, etc., the display effect is not good.
  • the N first-level sub-entities with the entity weights ranked in the top N are selected from the one hundred primary sub-entities.
  • the tree structure relationship refers to a connection relationship between the plurality of entities.
  • the tree structure relationship between the plurality of entities is actually displayed, that is, the knowledge map formed by the plurality of entities .
  • the first location determining module 1502 is configured to determine, by using a tree structure relationship between the multiple entities and a size of the display area of the mobile terminal, the first of the multiple entities in the display area based on the preset layout rule. Placement information;
  • the above layout rules may be a circular layout rule, an elliptical layout rule, a mesh layout rule, and the like.
  • elliptical layout rules may be employed, it being understood that, relative to the diffused planar layout
  • the layout of the mesh type and the layout of the area the layout implemented based on the elliptical layout rule is more suitable for the characteristics of the display area of the mobile terminal, and can fully utilize the display area, and can be laid out in comparison with the above various layout modes. More entities.
  • the elliptical layout rule refers to an elliptical shape after a plurality of physical layouts.
  • the first display module 1503 is configured to display a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • the display device determines, according to the knowledge map display instruction, a tree structure relationship between multiple entities to be displayed and multiple entities included in the specified knowledge map, and uses multiple entities based on preset layout rules. Determining, between the tree structure relationship and the size of the display area of the mobile terminal, the first display location information of the multiple entities in the display area, and displaying the plurality of entities in the display area according to the first display location information The tree structure relationship to achieve the presentation of the knowledge map composed of the plurality of entities.
  • the plurality of entities to be displayed in the specified knowledge map are laid out in the display area of the mobile terminal based on the preset layout rule, and the size of the display area can be fully utilized to effectively implement the knowledge map in the display area of the mobile terminal. Demonstrate to meet the needs of mobile terminal users.
  • FIG. 16 is a schematic structural diagram of a program module of a display device of a knowledge map in an example of the present application.
  • the device includes a response module 1601 , a first location determining module 1602 , and a first display module 1603 .
  • the response module 1601 is configured to determine, according to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • the plurality of entities to be displayed include a central entity and a plurality of first-level sub-entities of the central entity, and the number of the first-level sub-entities is less than or equal to a display area of the preset mobile terminal.
  • the maximum number of entities For example, if in the above specified knowledge map, the central entity has one hundred primary sub-entities, in this case, if the one hundred primary sub-entities are displayed in the display area of the mobile terminal, The sub-entity shows that the area is too small, the sub-entity collision, etc., the display effect is not good.
  • the N first-level sub-entities with the entity weights ranked in the top N are selected from the one hundred primary sub-entities.
  • the tree structure relationship refers to a connection relationship between the plurality of entities.
  • the tree structure relationship between the plurality of entities is actually displayed, that is, the knowledge map formed by the plurality of entities .
  • a first location determining module 1602 configured to determine, by using a tree structure relationship between multiple entities and a size of a display area of the mobile terminal, a first of the plurality of entities in the display area based on a preset layout rule Placement information;
  • the above layout rules may be a circular layout rule, an elliptical layout rule, a mesh layout rule, and the like.
  • elliptical layout rules may be employed, it being understood that, relative to the diffused planar layout
  • the layout of the mesh type and the layout of the area the layout implemented based on the elliptical layout rule is more suitable for the characteristics of the display area of the mobile terminal, and can fully utilize the display area, and can be laid out in comparison with the above various layout modes. More entities.
  • the elliptical layout rule refers to an elliptical shape after a plurality of physical layouts.
  • the first display module 1603 is configured to display a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • the first location determining module 1602 includes:
  • a length determining module 1604 configured to determine a length of the long side of the display area and a length of the short side;
  • the information determining module 1605 is configured to sequentially calculate, according to a preset ellipse layout algorithm, a length of the long side, and a length of a short side, a first display of the plurality of entities, starting from a central entity in the tree structure relationship. location information.
  • the preset elliptical layout algorithm is as follows:
  • startAngle i represents the initial direction angle of the i-th entity
  • index i represents the index of the i-th entity in the tree structure relationship
  • weight i represents the preset number
  • s i represents the scaling factor of the i-th entity set in advance
  • a represents half the length of the short side of the display area
  • b represents half of the long side of the display area
  • x i and y i respectively represent the abscissa value and the ordinate value of the i-th entity in the two-dimensional space coordinates constructed based on the display area shown
  • scale i represents the occupied position of the i-th entity when displayed in the display area area size
  • the first display location information of multiple entities can be effectively obtained by the above manner.
  • FIG. 17 is a schematic structural diagram of a program module of a device for displaying a knowledge map according to an example of the present application, including a response module 1701, a first location determining module 1702, and a first display module 1703.
  • the response module 1701 is configured to determine, according to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • the plurality of entities to be displayed include a central entity and a plurality of first-level sub-entities of the central entity, and the number of the first-level sub-entities is less than or equal to a display area of the preset mobile terminal.
  • the maximum number of entities For example, if in the above specified knowledge map, the central entity has one hundred primary sub-entities, in this case, if the one hundred primary sub-entities are displayed in the display area of the mobile terminal, The sub-entity shows that the area is too small, the sub-entity collision, etc., the display effect is not good.
  • the N first-level sub-entities with the entity weights ranked in the top N are selected from the one hundred primary sub-entities.
  • the tree structure relationship refers to a connection relationship between the plurality of entities.
  • the tree structure relationship between the plurality of entities is actually displayed, that is, the knowledge map formed by the plurality of entities .
  • a first location determining module 1702 configured to determine, by using a tree structure relationship between multiple entities and a size of a display area of the mobile terminal, a first of the plurality of entities in the display area based on a preset layout rule Placement information;
  • the above layout rules may be a circular layout rule, an elliptical layout rule, a mesh layout rule, and the like.
  • elliptical layout rules may be employed, it being understood that, relative to the diffused planar layout
  • the layout of the mesh type and the layout of the area the layout implemented based on the elliptical layout rule is more suitable for the characteristics of the display area of the mobile terminal, and can fully utilize the display area, and can be laid out in comparison with the above various layout modes. More entities.
  • the elliptical layout rule refers to an elliptical shape after a plurality of physical layouts.
  • the first display module 1703 is configured to display a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • the device also includes:
  • the optimization module 1704 is configured to: before the displaying module, if the number of the first-level sub-entities of the central entity is greater than a preset threshold, obtaining a second-level sub-entity based on the preset hierarchical layout rule Placement information;
  • the first display module 1703 is specifically configured to:
  • the optimization module 1704 specifically includes:
  • the first determining module 1705 is configured to determine, according to the number of the first level sub-entities and the number of preset each layer entity, the number of layers of the first level sub-entity and the actual number of entities of each layer;
  • a second determining module 1706 configured to determine, according to the uniform distribution principle, the number of layers to which each entity in the first-level sub-entity belongs by using the number of layers and the actual number of entities of the layers;
  • the layering processing module 1707 is configured to perform hierarchical setting processing on the first placement location information of the first-level sub-entity based on the number of layers to which each entity in the first-level sub-entity belongs, to obtain the first-level sub-entity Second display location information;
  • the first collision detection module 1708 is configured to perform collision detection based on the second placement location information of the first-level sub-entity to obtain second placement location information of the first-level sub-entity.
  • the first collision detection module 1708 includes:
  • the first sequence determining module 1709 is configured to determine a traversal order of the first level sub-entities based on a preset traversal rule, and perform traversal according to the traversal order;
  • the first calculating module 1710 is configured to calculate a Euclidean distance between the first level sub-entity traversed to the next first level sub-entity to be traversed;
  • the first change returning module 1711 is configured to: if the Euclidean distance does not satisfy the preset condition, change the second display position of the second level sub-entity based on the preset coordinate change constant, and return to perform the a first calculation module 1710; wherein the preset condition is that the Euclidean distance is greater than or equal to a collision distance of the first level sub-entity, and the collision distance is a radius of the first level sub-entity, the The sum of the radius of the second-level sub-entity and the preset constant;
  • the first traversal returning module 1712 is configured to: if the Euclidean distance meets the preset condition, traverse to the next level sub-entity, and return to execute the first calculating module 1710 until the first-level sub-entity meets the Presetting a condition, and using the placement information when the preset condition is satisfied as the third display position information.
  • the layered layout rule is specifically as follows: the first level sub-entity of the central entity is divided into multiple layers, and the number of each layer entity does not exceed the preset maximum number of layout entities, and the entity and the entity
  • the uniform layout between the layers and between the layers makes the picture effect regular and symmetrical when displaying the entities after the layout.
  • the hierarchical layout of the first-level sub-entities can be achieved by using the hierarchical layout rule.
  • the number of entities in each layer is set in advance.
  • the number of primary sub-entities in the first layer is up to eight
  • the number of primary entities in the second layer is up to eight.
  • the number of the first-level sub-entities of the first layer is equal to the preset threshold, that is, when the number of the first-level sub-entities of the central entity is less than or equal to the preset threshold, it indicates that only one layer can be completed.
  • the layout rules are layered.
  • the number of layers of the primary sub-entity and the actual number of physical entities of each layer are determined, for example, in the first layer.
  • the maximum number of primary sub-entities is eight, and the maximum number of primary sub-entities in the second-level sub-entities is eight. If the number of primary sub-entities of the central entity is 12, it can be determined that it is divided into two layers. And the first layer is 8 first-level sub-entities, the second layer is 4 first-level sub-entities, or, if the central entity has 14 first-level sub-entities, it can be determined to be divided into two layers, and Both the first and second layers are 7 primary sub-entities.
  • the first-level sub-entities of the central entity belong to the first layer Second floor. For example, if the number of primary sub-entities in the central entity is 14, and the first layer and the second layer are all seven primary sub-entities, then the first-level sub-entity and the second tier of the first tier can be determined.
  • the first-level sub-entities can be arranged at intervals.
  • one of the 14 first-level sub-entities is randomly selected as the first-level sub-entity, and then determined counterclockwise to determine that the second one belongs to the second layer, and the third It belongs to the first layer, and the fourth belongs to the second layer, and so on, which level of sub-entities belong to the first layer and which belong to the second layer.
  • FIG. 6 is a schematic diagram showing the layered sub-entities in the example of the present application.
  • the central entity in A, b1 to b6 are the first-level first-level sub-entities, c1 To c6 is the second level first level sub-entity.
  • the first placement information of the first-level sub-entity is hierarchically configured to obtain the second display location information of the primary sub-entity, specifically, first Processing the first display location information of the primary sub-entity belonging to the first layer, wherein the size of the area occupied by the entity is unchanged, and the horizontal and vertical coordinates of the first-level sub-entity of the first layer are all approached to the central entity. To shorten the distance of the first-level sub-entity of the first layer from the central entity.
  • the first placement information of the first-level sub-entity of the second layer may be selected to be continued. Processing, for example, shortening the distance of the first-level sub-entity of the second layer relative to the central entity to approach the central entity, or increasing the distance of the first-level sub-entity of the second layer relative to the central entity to be away from the central entity; Optionally, the first placement information of the first-level sub-entity of the second layer is not processed, and the initial first placement information is retained. It should be noted that, in order to prevent collision of entities between layers, the Euclidean distance between a primary sub-entity in a layer and an adjacent primary sub-entity in an adjacent layer is greater than the radius of the two entities. Sum.
  • the hierarchical first-level sub-entities collide, and the collision means that two or more first-level sub-entities overlap in the display area of the display area.
  • the traversal rule for the first-level sub-entity of the central entity will be preset, for example, the traversal rule may be traversed from the inside to the outside and counterclockwise, specifically, for the level that has been divided into N layers.
  • the sub-entities will sequentially determine the traversal sub-order of each layer. Taking the determination of the traversal sub-sequence of the first layer as an example, a first-level sub-entity can be randomly selected from the first-level sub-entities of the first layer as the initial traversal.
  • the order of the first-level sub-entities of the first layer is used as the traversal sub-sequence, wherein the traversal sub-order is a closed loop, as shown in FIG. 6 , if traversing from the entity b1 is selected, traversing The sub-order is b1-b2-b3-b4-b5-b6, and after traversing b6, it will continue to traverse b1 and continue the loop traversal.
  • the traversal order of the entire first-level sub-entity will be determined, which may be traversing from the first layer, such as after completing the traversal of the first layer, continuing to traverse the second layer, for example Taking FIG.
  • the traversal process will begin, and for each traversed first-level sub-entity, it will be processed as follows:
  • the next-level sub-entity of the first-level sub-entity b1 to be traversed is b2, and the Euclidean distance between the first-level sub-entity b1 and the first-level sub-entity b2 is calculated.
  • the Euclidean distance can be calculated using the Euclidean distance formula.
  • the preset condition may be a collision distance greater than or equal to the E-class distance b1 of the first-level sub-entity b1
  • the collision distance of the sub-entity b1 is equal to the sum of the radius of the primary sub-entity b1, the radius of the primary sub-entity b2, and the preset constant.
  • the Euclidean distance calculated above does not satisfy the preset condition, that is, the Euclidean distance is smaller than the collision distance of the primary sub-entity b1, indicating that a collision occurs between the primary sub-entity b1 and the primary sub-entity b2,
  • the second display position information of the first-level sub-entity b2 is changed based on the preset coordinate change constant, for example, a coordinate change constant is added to the second display position information of the first-level sub-entrate b2 to change
  • the abscissa and the ordinate and after the change, in order to further determine whether the first-level sub-entity b1 and the first-level sub-entry b2 still have a collision, the first calculation module is returned, and the first-level sub-entity b1 and the display are continuously calculated.
  • the Euclidean distance between the primary sub-entities b2 after the location information is changed, and the above process is repeated.
  • the Euclidean distance calculated above satisfies a preset condition, that is, the Euclidean distance is greater than or equal to the collision distance of the primary sub-entity b1, indicating that there is no collision between the primary sub-entity b1 and the primary sub-entity b2.
  • the current placement information of the primary sub-entity b2 will be retained without modification.
  • collision detection of the first layer is completed, collision detection of the first-level sub-entities of the second layer is continued based on a similar manner until all the first-level sub-entities satisfy the preset condition, and at all After the first-level sub-entities meet the preset conditions, the placement information when the condition is met is used as the third placement information to further optimize the placement information of the primary sub-entities to avoid collision.
  • the size of the display area can be further utilized more effectively, and the manner of exceeding the display area is caused by the manner of reducing the size of the entity and expanding the distance.
  • the layout of the primary sub-entities can be optimized to give the user a better experience.
  • FIG. 18 is a schematic structural diagram of a program module of a device for displaying a knowledge map according to an example of the present application.
  • the response module 1801 is configured to determine, according to the knowledge map display instruction, a plurality of entities to be displayed included in the specified knowledge map and a tree structure relationship between the plurality of entities;
  • the plurality of entities to be displayed include a central entity and a plurality of first-level sub-entities of the central entity, and the number of the first-level sub-entities is less than or equal to a display area of the preset mobile terminal.
  • the maximum number of entities For example, if in the above specified knowledge map, the central entity has one hundred primary sub-entities, in this case, if the one hundred primary sub-entities are displayed in the display area of the mobile terminal, The sub-entity shows that the area is too small, the sub-entity collision, etc., the display effect is not good.
  • the N first-level sub-entities with the entity weights ranked in the top N are selected from the one hundred primary sub-entities.
  • the tree structure relationship refers to a connection relationship between the plurality of entities.
  • the tree structure relationship between the plurality of entities is actually displayed, that is, the knowledge map formed by the plurality of entities .
  • a first location determining module 1802 configured to determine, by using a tree structure relationship between multiple entities and a size of a display area of the mobile terminal, a first of the plurality of entities in the display area based on a preset layout rule Placement information;
  • the above layout rules may be a circular layout rule, an elliptical layout rule, a mesh layout rule, and the like.
  • elliptical layout rules may be employed, it being understood that, relative to the diffused planar layout
  • the layout of the mesh type and the layout of the area the layout implemented based on the elliptical layout rule is more suitable for the characteristics of the display area of the mobile terminal, and can fully utilize the display area, and can be laid out in comparison with the above various layout modes. More entities.
  • the elliptical layout rule refers to an elliptical shape after a plurality of physical layouts.
  • the first display module 1803 is configured to display a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • the above display device further includes:
  • a target determining module 1804 configured to determine, according to the extended display instruction, a target level one of the plurality of entities in response to the extended presentation instruction;
  • the mobile module 1805 is configured to move the plurality of entities as a whole to obtain the fourth display location information of the multiple entities, for the purpose of moving the placement of the target first-level sub-entity into the extended display area;
  • a third determining module 1806, configured to determine fourth display location information of the second-level sub-entity to be extended and displayed by the target-level sub-entity based on the primary vector layout rule;
  • the second display module 1808 is configured to display in the display area according to the fourth display location information of the multiple entities and the second-level sub-entities.
  • the device further includes:
  • the second collision detection module 1807 is configured to perform collision detection based on the fourth display location information of the multiple entities and the second secondary entity before the second display module 1808, to obtain the multiple entities and the second Fifth placement location information of the level sub-entities;
  • the second display module 1808 is specifically configured to display in the display area according to the fifth display location information of the multiple entities and the second-level sub-entities.
  • the target determining module 1804 includes:
  • a direction determining module 1809 configured to determine a sliding direction of the sliding operation based on the sliding operation
  • the selecting module 1810 is configured to select, as the target level one sub-entity, a first-level sub-entity corresponding to a direction that the sliding direction is most matched, in a direction formed by the plurality of first-level sub-entities pointing to the central entity.
  • the second collision detection module 1807 includes:
  • a second sequence determining module 1811 configured to determine, according to a preset traversal rule, a traversal order of an entity in a set of entities including a first-level sub-entity and a second-level sub-entity of the plurality of entities, and follow the traversal order Traversing;
  • a second calculating module 1812 configured to calculate a Euclidean distance between the first entity traversed to the next entity to be traversed
  • the second change returning module 1813 is configured to: if the Euclidean distance does not satisfy the preset condition, change the fourth display position information of the second entity based on the preset coordinate change constant, and return to perform the second a calculation module 1812;
  • the preset condition is that the Euclidean distance is greater than or equal to a collision distance of the first entity, and the collision distance is a sum of a radius of the first entity, a radius of the second entity, and a preset constant ;
  • the second traversal returning module 1814 is configured to traverse to the next entity if the Euclidean distance meets the preset condition, and return to execute the second calculating module 1812 until the entities in the entity set satisfy the preset a condition, and the placement information when the preset condition is satisfied is used as the fifth display location information.
  • the extended display instruction may be triggered in multiple manners, for example, may be a drag operation or a sliding operation.
  • the second-level sub-entity can touch the first-level sub-entity C and drag it to the extended display area while keeping the touch, and release the touch state in the extended display area, which further triggers the mobile terminal to generate an extended display. instruction.
  • the sliding operation can be any sliding operation.
  • the presentation device will respond to the extended presentation instruction and determine a target primary sub-entity of the plurality of entities to be extended to be displayed based on the extended presentation instruction.
  • the target first-level sub-entity is the first-level sub-entity at the start position of the drag operation
  • the sliding can be determined based on the sliding operation The sliding direction of the operation, such as determining the starting position and ending position of the sliding operation, and the direction formed from the starting position toward the ending position as the sliding direction.
  • the target primary sub-entity in response to the extended presentation instruction, the target primary sub-entity is determined, and the placement information of the secondary sub-entity of the target primary sub-entity is determined, so that the secondary sub-entity can be further displayed and detected by collision The way to push the colliding entity away from collisions, making the display clearer and improving the user experience.
  • the method for displaying the above knowledge map can be implemented by a terminal device, such as a mobile terminal, or an interaction between the mobile terminal and the server.
  • the mobile terminal is implemented as an example in the above method, as shown in FIG. It is a schematic structural diagram of the mobile terminal 190 in the example of the present application.
  • the mobile terminal 190 includes a processor 1901, a memory 1902, and a transceiver 1903.
  • the memory 1902 can include read only memory and random access memory, and provides operational instructions and data to the processor 1901.
  • a portion of the memory 1902 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • memory 1902 stores elements of executable modules or data structures, or a subset thereof, or their extended set.
  • the following process is executed: determining, in response to the knowledge map presentation instruction, a plurality of to-be-displayed included in the specified knowledge map a tree structure relationship between the entity and the plurality of entities; determining, according to a preset layout rule, the tree structure relationship between the plurality of entities and the size of the display area of the mobile terminal a first display location information in the area; displaying a tree structure relationship between the plurality of entities in the display area according to the first display location information.
  • the mobile terminal provided by the example of the present application lays out multiple entities to be displayed in the specified knowledge map in the display area of the mobile terminal based on the preset layout rule, and can fully utilize the size of the display area to effectively realize the display of the knowledge map in the mobile terminal. Display in the area to meet the needs of mobile terminal users.
  • the processor 1901 controls the operation of the mobile terminal 190, and the processor 1901 may also be referred to as a CPU (Central Processing Unit).
  • Memory 1902 can include read only memory and random access memory and provides instructions and data to processor 1901. A portion of the memory 1902 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the specific components of the mobile terminal 190 are coupled together by a bus system 1904 in a specific application.
  • the bus system 1904 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 1904 in the figure.
  • the method disclosed in the above example of the present application may be applied to the processor 1901 or implemented by the processor 1901.
  • the processor 1901 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 1901 or an instruction in a form of software.
  • the processor 1901 described above may be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or discrete hardware. Component.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the examples of the present application can be implemented or executed.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in connection with the examples of the present application may be directly embodied by the execution of the hardware decoding processor or by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 1902, and the processor 1901 reads the information in the memory 1902 and completes the steps of the above method in combination with its hardware.
  • the application example also provides a mobile terminal, including a memory, a processor, and a computer program stored on the memory and running on the processor.
  • a mobile terminal including a memory, a processor, and a computer program stored on the memory and running on the processor.
  • the processor executes the computer program, the implementation is as shown in FIG. 1 or FIG. 5 or FIG.
  • the present application also provides a computer readable storage medium having stored thereon a computer program, which when executed by the processor, implements the display of the knowledge map in the example shown in FIG. 1 or FIG. 5 or FIG. The various steps of the method.
  • the disclosed apparatus and method can be implemented in other ways.
  • the device examples described above are merely illustrative.
  • the division of the modules is only a logical function division.
  • there may be another division manner for example, multiple modules or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or otherwise.
  • the modules described as separate components may or may not be physically separated.
  • the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present example.
  • each functional module in each instance of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the various examples of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请公开了一种知识图谱的展示方法及装置、移动终端及可读存储介质,该方法包括:响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及多个实体之间的树结构关系,基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定该多个实体在展示区域内的第一展示位置信息,按照该第一展示位置信息在展示区域内展示该多个实体之间的树结构关系,以实现该多个实体构成的知识图谱的展示。

Description

知识图谱的展示方法及装置、移动终端及可读存储介质
本申请要求于2017年09月25日提交中国专利局、申请号为201710876436.0、发明名称为“知识图谱的展示方法及装置、移动终端及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息处理技术领域,尤其涉及一种知识图谱的展示方法及装置、移动终端及可读存储介质。
背景
知识图谱,也被称为科学知识图谱,在图书情报界称为知识域可视化或知识领域映射地图,是显示知识发展进程与结构关系的一系列各种不同的图形,用可视化技术描述知识资源及其载体,挖掘、分析、构建、绘制和显示知识及知识之间的相互关系。时下,很多领域都可以用到知识图谱,例如,利用知识图谱展示一个人的成就、利用知识图谱展示多个人物之间的关系、利用知识图谱展示事物属性等等。
技术内容
本申请实例提供了一种知识图谱的展示方法,包括:
响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
本申请实例提供了一种知识图谱的展示装置,包括:
响应模块,用于响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
第一位置确定模块,用于基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
第一展示模块,用于按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
本申请实例提供了一种移动终端,包括:存储器、处理器及存储在所述存储器上且在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如本申请实例提供的知识图谱的展示方法中的各个步骤。
本申请实例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,实现如本申请提供的知识图谱的展示方法中的各个步骤。
附图简要说明
为了更清楚地说明本申请实例中的技术方案,下面将对实例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1A为本申请实例涉及的一种系统构架示意图;
图1B为本申请实例涉及的一种系统构架示意图;
图1C为本申请实例中知识图谱的展示方法的流程示意图;
图2为本申请实例中移动终端的显示界面展示多个实体之间的树结构关系的示意图;
图3是在图2基础上增加了具体关系的显示示意图;
图4为本申请图1C所示实例中步骤102的细化步骤的流程示意图;
图5为本申请实例中知识图谱的展示方法的流程示意图;
图6为本申请实例中一级子实体分层后的显示示意图;
图7为本申请实例中遍历顺序的示意图;
图8为本申请实例中基于图2增加了扩展显示区域的示意图;
图9为本申请图1C或图5所示实例的追加步骤的流程示意图;
图10为本申请实例中滑动方向的示意图;
图11a及图11b为本申请实例中基于主向量布局的示例的示意图;
图12为本申请实例中遍历顺序的另一示意图;
图13为本申请实例中滑动操作前的显示区域的示意图;
图14为在图13执行滑动操作后的显示区域的示意图;
图15为本申请实例中知识图谱的展示装置的程序模块的结构示意图;
图16为本申请实例中知识图谱的展示装置的程序模块的结构示意图;
图17为本申请实例中知识图谱的展示装置的程序模块的结构示意图;
图18为本申请图15及图17所示实例的追加程序模块的结构示意图;
图19为本申请实例移动终端的结构示意图。
实施方式
为使得本申请的发明目的、特征、优点能够更加的明显和易懂,下面将结合本申请实例中的附图,对本申请实例中的技术方案进行清楚、完整地描述,显然,所描述的实例仅仅是本申请一部分实例,而非全部实例。基于本申请中的实例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实例,都属于本申请保护的范围。
为了更好的理解本申请实例中的技术方案,先介绍知识图谱的概念,知识图谱用于描述真实世界中存在的各种实体,并通过属性-值对来刻画实体的内在特性,通过关系来连接两个或多个实体,刻画两个或多个实体之间的关联。知识图谱亦可看作是一张巨大的网状图,网状图中的节点表示实体,而网状图中的边则由属性或关系构成。在本申请实例中,知识图谱至少包含中心实体、中心实体的一级子实体,进一步的,知识图谱可以至少包含中心实体、中心实体的一级子实体及中心实体的二级子实体,知识图谱中的实体之间的关系也可以看成是树结构关系。在知识图谱中,除了中心实体以外,每一个实体都有其父实体。本申请实例中技术方案即是若在移动终端的显示区域上展示知识图谱时,布局知识图谱中的待展示的实体,以便能够充分利用显示区域。
本申请实例提出的知识图谱的展示方法可应用于语义搜索、机器问答、情报检索、电子阅读、在线学习等场景中,在一些实例中,所述方法可应用于如图1A所示的场景中。
在图1A中,系统构架包括终端设备,如移动终端101A,以及终端设备中的应用102A,当用户使用应用102A查看指定内容的知识图谱时,终端设备中的应用102A将响应用户在终端设备的界面上的触发操作,并响应于该触发操作生成知识图谱,在所述界面上展示该知识图谱。
在图1B中,包括终端设备,如移动终端101B,应用102B,及服 务器103B。其中,应用102B可以浏览器,服务器103B通过一个或多个网络104B,向用户提供网络服务(例如,生成知识图谱),其中所述用户操作其终端设备(例如,移动终端101B)。
当用户在使用浏览器搜索一电视剧的参与人员的知识图谱时,浏览器响应该操作,生成搜索请求,并将该搜索请求发送至服务器103B,服务器103B响应该搜索请求,生成知识图谱,并将该知识图谱发送至浏览器,以使浏览器展示该知识图谱。
其中,终端设备可以是手机、平板电脑或者个人数字助理或穿戴式设备等。服务器可以在一个或多个独立的数据处理装置或分布式计算机网络上实现。在一些实例中,服务器也可以使用各种虚拟设备和/或第三方服务提供商(例如,第三方云服务提供商)的服务,以提供底层的计算资源和/或基础资源。
请参阅图1C,为本申请实例中知识图谱的展示方法的流程示意图,该方法包括:
步骤101C、响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
在本申请实例中,上述的知识图谱的展示方法由知识图谱的展示装置(以下简称为:展示装置)实现,该展示装置具体为程序模块,可以由处理器调用存储介质中存储的程序模块实现。
其中,用户在使用移动终端的过程中,若需要查看指定内容的知识图谱,例如,能够反映人物的好友关系的知识图谱、能够反映文章内容结构的知识图谱、能够反映电视剧的参与人员的知识图谱等等,移动终端将响应用户在移动终端的界面上的触发操作,并响应于该触发操作生成的知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及多个实体之间的树结构关系。
其中,上述触发操作可以是搜索操作,且上述指定知识图谱可以由服务器生成。
在一些实例中,上述的待展示的多个实体可以包含一个中心实体及该中心实体的若干个一级子实体,且该若干个一级子实体的个数小于或等于预先设置的移动终端的显示区域可显示实体的最大个数。例如,若在上述指定知识图谱中,中心实体具有一百个一级子实体,在这种情况下,如果将该一百个一级子实体都显示在移动终端的显示区域内,则将造成子实体显示面积过小、子实体碰撞等等显示效果不佳的问题,为了避免该问题,将从该一百个一级子实体中选择实体权重排在前N的N个一级子实体作为待展示的一级子实体,其中,N为上述预先设置的最大个数。
其中,树结构关系是指该多个实体之间的连接关系,在展示该多个实体时,实际上是展示的该多个实体之间的树结构关系,即该多个实体构成的知识图谱。
步骤102C、基于预置的布局规则,利用所述多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
在本申请实例中,上述的布局规则可以为圆形布局规则,椭圆布局规则、网状式布局规则等等。
考虑到众多移动终端的显示区域的大小不一样,且移动终端的显示区域通常为矩形,因此在本申请的一些实例中,可以采用椭圆布局规则,可以理解的是,相对于网状式的平面布局及圆形布局,基于该椭圆布局规则实施的布局更加适合移动终端显示区域的特性,能够充分利用显示区域,且相对于其他布局方式,能够布局更多的实体。其中,椭圆布局规则是指多个实体布局之后呈现出椭圆形状,且在基于椭圆布局规则进 行布局时,使用的是椭圆布局算法。
其中,展示装置将基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定该多个实体在显示区域内的第一展示位置信息。
其中,移动终端的显示区域的大小是预先设置的或已知的,且展示位置信息用于表示实体在显示区域显示时的位置及面积。
步骤103C、按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
在本申请实例中,对于多个实体,每个实体都有其对应的第一展示位置信息,则将按照实体的第一展示位置信息在显示区域内展示该多个实体之间的树结构关系,其中,该多个实体之间的树结构关系,即为该多个实体构成的知识图谱。
以使用椭圆布局规则为例,请参阅图2,为本申请实例中移动终端的显示界面展示多个实体之间的树结构关系的示意图。如图2所示,实体A为中心实体,实体B至Q为实体A的一级子实体,且在显示区域内展示时,是呈现椭圆形状。可以理解的是,实体A分别与实体B至Q通过连线连接,该连线表示实体之间是有关系的,且可以将实体之间的关系显示在连线上,如图2,可以不将实体之间的关系显示在连线上,如图3,图3是在图2的基础上增加了具体关系的显示示意图,其中,a1至a16为实体A分别与实体B至Q的关系。在实际应用中可以选择显示关系,也可以选择不显示关系,此处不做限定。
可以理解的是,在本申请实例中,上述的展示装置可以是移动终端,即由移动终端实现本申请实例中的技术方案,如图1A所示;或者该展示装置也可以是移动终端与服务器构成的系统,如图1B所示,由该系统中的移动终端将知识图谱展示指令发送给服务器,服务器实现本申请 实例中的步骤101C及步骤102C,并在得到多个实体的第一展示位置信息之后,将该多个实体的第一展示位置信息反馈给移动终端,由移动终端执行步骤103C,即可通过服务器与移动终端之间的交互实现本申请实例中的技术方案。
在本申请实例中,展示装置响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及多个实体之间的树结构关系,基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在展示区域内的第一展示位置信息,按照该第一展示位置信息在展示区域内展示该多个实体之间的树结构关系,以实现该多个实体构成的知识图谱的展示。本申请实例中,基于预设的布局规则在移动终端的显示区域内布局指定知识图谱中待展示的多个实体,能够充分利用显示区域的大小,有效实现知识图谱在移动终端的显示区域内的展示,满足移动终端用户的使用需求。
请参阅图4,为本申请图1C所示实例中步骤102C的细化步骤的流程示意图,该步骤102C包括:
步骤401、确定所述显示区域的长边的长度及短边的长度;
步骤402、基于预置的椭圆布局算法、所述长边的长度及短边的长度,从所述树结构关系中的中心实体开始,依次计算所述多个实体的第一展示位置信息。
在本申请实例中,对于不同的移动终端的显示区域,需要先确定该显示区域的长边的长度及短边的长度,并利用预置的椭圆布局算法、该长边的长度及短边的长度,从树结构关系中的中心实体开始,依次计算多个实体的第一展示位置信息。具体的,上述的椭圆布局算法如下:
Figure PCTCN2018107274-appb-000001
其中,count表示多个实体的总个数,startAngle i表示第i个实体的初始方向角,index i表示第i个实体在树结构关系中的索引,weight i表示预先设置的第i个实体的权重大小,s i表示预先设置的第i个实体的缩放因子,a表示显示区域的短边的长度的一半,b表示显示区域的长边的一半,x i和y i分别表示在基于所示展示区域构建的二维空间坐标中,第i个实体的横坐标值和纵坐标值,scale i表示第i个实体在显示区域内展示时的所占的面积大小;
其中,x i、y i及scale i构成第i个实体的第一展示位置信息。
可以理解的是,实体的权重越大距离中心距离越近,实体的半径也越大。
在本申请实例中,通过上述方式,能够有效的得到多个实体的第一展示位置信息。
在本申请实例中,受显示区域的大小的限制,在待展示的一级子实体数据过多时,按照图1C或图4所表示的技术方案实现布局之后,必然会导致一级和二级子实体之间的拥挤及碰撞,为了能够使得一级子实体的布局更清晰且布局更合理,可以对上述布局进行变形,即通过分层的方式展示一级子实体,具体的,请参阅图5,为本申请实例中知识图谱的展示方法的流程示意图,包括:
步骤501、响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
步骤502、基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
步骤503、若所述中心实体的一级子实体的个数大于预设阈值,则基于预置的分层布局规则得到所述一级子实体的第二展示位置信息;
步骤504、按照所述中心实体的第一展示位置信息及所述一级子实体的第二展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
在本申请实例中,上述步骤501及步骤502分别与图1C所示步骤101C及步骤102C描述的内容相似,且步骤502具体和图4所示细化步骤描述的内容相似,具体请参阅上述图1C及图4描述的内容,此处不做赘述。
在本申请实例中,在确定多个实体在显示区域的第一展示位置信息之后,将进一步确定中心实体的一级子实体的个数是否大于或预设阈值,若大于该预设阈值,则基于预置的分层布局规则对该一级子实体的第一展示位置信息进行优化,得到一级实体的第二展示位置信息。
其中,该预设阈值为预先设置的常数,例如,可以为6、8等。
其中,上述的分层布局规则具体为:将中心实体的一级子实体分为多层,且每层实体的个数不超过预先设置的最多可布局的实体的个数,同时,实体与实体之间、层与层之间采用的是均匀布局方式,使得在展示布局之后的实体时画面效果规则且匀称。利用该分层布局规则可以实现对一级子实体的分层布局。
其中,上述步骤503具体可以包括:
步骤A1、基于中心实体的一级子实体的个数及预置的每层实体的个数,确定上述一级子实体的层数及各层的实际实体个数;
步骤A2、基于均匀分布原则,利用上述层数及各层的实际实体个数,确定上述一级子实体中各个实体所属的层数;
步骤A3、基于一级子实体中各个实体所属的层数对一级子实体的第一展示位置信息进行分层设置处理,得到一级子实体的第二展示位置信息。
在本申请实例中,预先设置了每层实体的个数,例如,设置第一层的一级子实体的个数最多为8个,设置第二层一级子实体的个数最多为8个。
通常,第一层的一级子实体的个数等于上述的预设阈值,例如,第一层的一级子实体的个数等于6,即在中心实体的一级子实体的个数小于或等于述预置阈值时,表明只需要通过一层即可完成一级子实体的布局,而在中心实体的一级子实体的个数大于上述预置阈值时,则表明需要至少两层布局,此时则需要将中心实体的一级子实体按照上述的分层布局规则进行分层。
进一步的,将基于中心实体的一级子实体的个数及预置的每层实体的个数,确定一级子实体的层数及各层的实际实体个数,例如,在第一层的一级子实体的个数最多为8个,第二层一级子实体的个数最多为8个时,若中心实体的一级子实体的个数为12个,则可以确定分为两层,且第一层为8个一级子实体,第二层为4个一级子实体,或者,若中心实体的一级子实体个数为14个,则可以确定分为两层,且第一层及第二层均为7个一级子实体。
其中,在确定层数及各层的实际实体个数之后,将基于均匀分布原则,利用该层数及各层的实际实体个数,确定中心实体的一级子实体中哪些属于第一层哪些属于第二层。例如,在中心实体的一级子实体的个数为14个,且第一层及第二层均为7个一级子实体,则可以确定将第 一层的一级子实体与第二层的一级子实体可间隔排列,则从上述14个一级子实体中,随机选择一个一级子实体为第一层,然后逆时针确定,确定第二个为属于第二层,第三个属于第一层,第四个属于第二层,并依次类推,则可得到哪些一级子实体属于第一层,哪些属于第二层。为了更好的理解分层的效果,请参阅图6,为本申请实例中一级子实体分层后的显示示意图,其中A为中心实体,b1至b6为第一层一级子实体,c1至c6为第二层一级子实体。
其中,在确定一级子实体中各实体所属的层数之后,将对一级子实体的第一展示位置信息分层设置处理,得到一级子实体的第二展示位置信息,具体的,先对属于第一层的一级子实体的第一展示位置信息进行处理,其中实体所占的面积大小不变,将第一层的一级子实体的横坐标及纵坐标均向中心实体靠近,以缩短第一层的一级子实体相对于中心实体的距离。可以理解的是,若层数为两层,在对第一层的一级子实体的第一展示位置信息进行处理之后,可以选择继续对第二层的一级子实体的第一展示位置信息进行处理,例如,缩短第二层的一级子实体相对于中心实体的距离,以向中心实体靠近,或者增长第二层的一级子实体相对于中心实体的距离,以远离中心实体;此外,还可以选择不对第二层的一级子实体的第一展示位置信息进行处理,保留初始的第一展示位置信息。需要说明的是,为了防止层与层之间的实体的碰撞,一层中的一个一级子实体与相邻层中相邻的一级子实体之间的欧式距离大于该两个实体的半径之和。其中,欧式距离是指在m维空间中两个点之间的真实距离,或者向量的自然长度(即该点到原点的距离)。在二维和三维空间中的欧氏距离就是两点之间的实际距离。
可以理解的是,在经过上述处理之后,将得到分层布局后一级子实体的第二展示位置信息。
考虑到对一级子实体进行分层是因为一级子实体的个数超过了单层分布的最大值,因此,在分层之后,仍然可能因为一级子实体的个数比较多的原因导致分层后的一级子实体会发生碰撞,碰撞是指:两个或多个一级子实体在显示区域的展示区域出现重合。
为了解决上述问题,本申请实例中将基于一级子实体的第二展示位置信息进行碰撞检测,得到一级子实体的第三展示位置信息,以避免分层之后的一级子实体出现碰撞。具体的,该碰撞检测包括:
步骤B1、基于预设的遍历规则确定所述一级子实体的遍历顺序,并按照所述遍历顺序进行遍历;
步骤B2、计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离;
步骤B3、若所述欧式距离不满足预设条件,则基于预设的坐标变化常数对所述第二一级子实体的第二展示位置进行更改,并返回执行所述计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离的步骤;其中,所述预设条件为欧式距离大于或等于所述第一一级子实体的碰撞距离,所述碰撞距离为所述第一一级子实体的半径、所述第二一级子实体的半径及预设常数的和;
步骤B4、若所述欧式距离满足预设条件,则遍历至下一个一级子实体,返回执行计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离的步骤,直至所述一级子实体均满足所述预设条件,且将满足所述预设条件时的展示位置信息作为所述第三展示位置信息。
在本申请实例中,将预先设置对中心实体的一级子实体的遍历规则,例如,该遍历规则可以是从里至外及逆时针方向遍历,具体的,对于已分为N层的一级子实体,将依次确定每一层的遍历子顺序,以第一 层的遍历子顺序的确定为例,可以从第一层的一级子实体中随机选择一个一级子实体作为起始遍历的实体,并按照逆时针方向将第一层的一级子实体的排列顺序作为遍历子顺序,其中,该遍历子顺序是一个闭环,以图6为例,若选择从实体b1开始遍历,则遍历子顺序为b1-b2-b3-b4-b5-b6,且在遍历完b6之后,将继续遍历b1,且继续循环遍历。其中,在确定每一层的遍历子顺序之后,将确定整个一级子实体的遍历顺序,可以是从第一层往外遍历,如在完成第一层的遍历之后,继续遍历第二层,例如,以图7为例,即为在有多层的情况下的遍历顺序,先从b1开始,遍历第一层中b1-b2-b3-b4-b5-b6-b1构成的闭环圈,且在完成第一层的遍历之后,将从c1开始开始,遍历第二层中c1-c2-c3-c4-c5-c6-c1构成的闭环圈。其中,各层的遍历子顺序构成一级子实体的遍历顺序。
其中,在确定遍历顺序之后,将开始遍历过程,且对于每一个遍历到的一级子实体,都将按照如下的方式进行处理:
以遍历到的一级子实体为b1为例,该一级子实体b1的下一个待遍历的一级子实体为b2,计算一级子实体b1与一级子实体b2之间的欧式距离,其中,欧式距离可以使用欧式距离公式进行计算。
进一步判断该一级子实体b1与一级子实体b2之间的欧式距离是否满足预设条件,其中,该预设条件具体可以为欧式距离大于或等于一级子实体b1的碰撞距离,一级子实体b1的碰撞距离等于一级子实体b1的半径、一级子实体b2的半径及预设常数的和。
其中,若上述计算得到的欧式距离不满足预设条件,即该欧式距离小于一级子实体b1的碰撞距离,此时表明一级子实体b1与一级子实体b2之间发生了碰撞,此时,将基于预设的坐标变化常数对一级子实体b2的第二展示位置信息进行更改,例如,在一级子实体b2的第二展示 位置信息的基础上增加一个坐标变化常数,以改变横坐标和纵坐标,且在改变之后,为了进一步确定一级子实体b1与一级子实体b2是否仍然存在碰撞,则将返回上述的步骤B2,继续计算该一级子实体b1与展示位置信息改变后的一级子实体b2之间的欧式距离,并重复上述步骤。
其中,若上述计算得到的欧式距离满足预设条件,即该欧式距离大于或等于一级子实体b1的碰撞距离,此时表明一级子实体b1与一级子实体b2之间并没有碰撞,此时,将保留一级子实体b2当前的展示位置信息,并不做修改。且继续遍历至下一个一级子实体b2,检测一级子实体b2是否与一级子实体b3发生碰撞,并以此循环,直至第一层的所有一级子实体与下一个一级子实体的欧式距离均大于或等于相应的一级子实体的碰撞距离,满足预设条件。
可以理解的是,在完成第一层的碰撞检测之后,将基于相似的方式继续对第二层的一级子实体进行碰撞检测,直至所有的一级子实体均满足预设条件,且在所有的一级子实体均满足预设条件之后,将满足条件时的展示位置信息作为第三展示位置信息,以完成对一级子实体的展示位置信息的进一步优化,避免存在碰撞的情况。
可以理解的是,若基于一级子实体的第二展示位置信息进行了碰撞检测,则将得到碰撞检测后的第三展示位置信息,则上述步骤504具体可以为:按照中心实体的第一展示位置信息及一级子实体的第三展示位置信息在显示区域内展示多个实体之间的树结构关系。
在本申请实例中,通过对中心实体的一级子实体采用分层布局的方式,使得能够进一步更有效的利用显示区域的大小,相对于缩小实体大小的方式及扩大距离导致超过显示区域的方式,存在明显的优点,不仅不需要缩小实体的大小就可以完成一级子实体的展示,且不会带来超出显示区域的问题,给用户更好的使用体验。且进一步的,为了避免 实体之间的碰撞,通过对一级子实体进行碰撞检测,能够更优化一级子实体的布局,给用户更好的使用体验。
在本申请实例中,显示区域还包含扩展展示区域,可以通过滑动操作选择一级实体,且被选中的一级子实体将在该扩展展示区域内显示,同时基于主向量布局规则展示该一级子实体的二级子实体。请参阅图8,为本申请实例基于图2增加了扩展展示区域的示意图。其中701所指示的区域即为扩展展示区域,在一些实例中,扩展展示区域位于显示区域的中心,且此时,中心实体A位于扩展展示区域内。可以理解的是,无论一级子实体是一层展示还是分为2层或多层展示,扩展展示区域的位置不变。
请参阅图9,为本申请实例中图1C或图5所示知识图谱的展示方法的追加步骤的流程示意图,包括:
步骤901、响应于扩展展示指令,基于所述扩展展示指令确定所述多个实体中的目标一级子实体;
在本申请实例中,上述的扩展展示指令可以通过多种方式触发,例如可以是拖动操作,也可以是滑动操作,具体的,用户若需要扩展展示一级子实体C的二级子实体,则可以触摸该一级子实体C,并在保持触摸的状态下拖动至扩展展示区域内,并在扩展展示区域内释放触摸状态,将进一步的触发移动终端生成扩展展示指令。其中,滑动操作可以是任意的滑动操作。
在本申请实例中,展示装置将响应于扩展展示指令,并基于该扩展展示指令确定多个实体中待扩展展示的目标一级子实体。
其中,若是由拖动操作触发的扩展展示指令,则目标一级子实体为拖动操作起始位置处的一级子实体,若是由滑动操作触发的扩展展示指 令,则可以基于滑动操作确定滑动操作的滑动方向,如确定滑动操作的起始位置及结束位置,并将从起始位置指向结束位置形成的方向作为滑动方向。
其中,对于已展示的中心实体及一级子实体,可基于中心实体与各个一级子实体的展示位置信息,分别确定从各个一级子实体指向中心实体所形成的方向,即可得到一级子实体与方向之间的对应关系,进一步的,将利用上述的滑动方向与各个一级子实体的方向进行匹配,即确定该滑动方向分别与各个一级子实体的方向的夹角,夹角最小的时使用的一级子实体的方向为最匹配的方向,且最匹配的方向对应的一级子实体作为目标一级子实体。
请参阅图10,为本申请实例中滑动方向的示意图。其中,虚线表示的用户的手指移动的轨迹,且手指当前所在的位置为滑动操作结束时的位置,其中,箭头方向即为基于滑动操作确定的滑动方向,且基于上述方式可以确定,图10中的滑动方向最匹配的是实体B指向实体A构成的方向,此时,实体B为目标一级子实体。
通过上述方式,可以准确确定滑动操作的滑动方向,并进一步确定滑动操作对应的目标一级子实体。
步骤902、以所述目标一级子实体的展示位置移动至所述扩展展示区域内为目的,整体移动所述多个实体,得到所述多个实体的第四展示位置信息;
在本申请实例中,扩展展示区域所能够实现的功能也可称为“放大镜”,即可以展示一级子实体的二级子实体。
其中,在确定目标一级子实体之后,在展示时,需要将该目标一级子实体展示在扩展展示区域内,此时,将先对一级子实体及中心实体的展示位置信息进行调整,具体可以是以目标一级子实体的展示位置信息 移动至扩展展示区域内为目的,整体移动上述的一级子实体及中心实体,得到该多个实体的第四展示位置信息,可以理解的是,由于整体移动了一级子实体及中心实体,则将会存在部分实体的第四展示位置信息超出显示区域的范围,而无法显示。
步骤903、基于主向量布局规则,确定所述目标一级子实体待扩展展示的二级子实体的第四展示位置信息;
在本申请实例中,目标一级子实体的二级子实体的布局则采用主向量布局的方式,主向量布局是以中心实体指向目标一级子实体的方向为主向量,且待布局的二级子实体可以布局在以目标一级子实体的主向量为中心的两边,确定该目标一级子实体待扩展展示的二级子实体的第四展示位置信息。
其中,目标一级子实体待扩展展示的二级子实体的个数具有上限值,例如为6个,则若目标一级子实体的二级子实体的个数小于或等于6个,则将该所有的二级子实体作为待展示的二级子实体,若目标一级子实体的二级子实体的个数大于6个,则从该二级子实体中随机选择或者选择权重排在前6的6个二级子实体作为待展示的二级子实体。
为了更好的理解,请参阅图11a至图11b,为基于主向量布局的示例的示意图。其中,B表示目标一级子实体,D表示中心实体,虚线箭头方向即表示主向量方向,实体b1至b6均为目标一级子实体B的二级子实体,且目标一级子实体位于扩展展示区域内。可以理解的是,图11a及图11b主要是为了介绍二级子实体的布局方式,在图中,其他的一级子实体并未示出。
步骤904、按照所述多个实体及所述二级子实体的第四展示位置信息在所述显示区域内进行展示。
在本申请实例中,在得到中心实体及一级子实体的第四位置信息, 可以按照该多个实体及上述二级子实体的第四展示位置信息在显示区域内进行展示。
进一步的,考虑到在得到目标一级子实体的二级子实体的第四展示位置信息之后,由于可能会存在碰撞的情况,此时,为了避免碰撞的发生,需要对上述实体均进行碰撞检测,得到多个实体及二级子实体的第五展示位置信息。且在进行了碰撞检测的情况下,上述步骤904具体可以为:按照多个实体及二级子实体碰撞检测后得到的第五展示位置信息在显示区域内进行展示。
在本申请实例中,按照如下方式进行碰撞检测:
步骤C1、基于预设的遍历规则确定包括多个实体中的一级子实体及所述二级子实体的实体集合中实体的遍历顺序,并按照所述遍历顺序进行遍历;
步骤C2、计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离;
步骤C3、若所述欧式距离不满足预设条件,则基于预设的坐标变化常数对所述第二实体的第四展示位置信息进行更改,并返回执行所述计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离的步骤;所述预设条件为欧式距离大于或等于所述第一实体的碰撞距离,所述碰撞距离为所述第一实体的半径、所述第二实体的半径及预设常数的和;
步骤C4、若所述欧式距离满足预设条件,则遍历至下一个实体,返回执行所述计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离的步骤,直至所述实体集合中的实体均满足所述预设条件,且将满足所述预设条件时的展示位置信息作为所述第五展示位置信息。
在本申请实例中,步骤C1中的预设的遍历规则与图5所示实例中 提到的遍历规则相似,在图5所示的遍历规则的基础上,需要将目标一级子实体的二级子实体添加至该目标一级子实体所在的层的遍历子顺序中。为了更好的理解,请参阅图12,为本申请实例中,遍历顺序的示意图。其中,实体A为中心实体,实体B、D、F、H、J、L、N、P均为一级子实体,实体F为目标一级子实体,且实体f1、f2及f3为目标一级子实体F的二级子实体。其中,虚线箭头方向构成遍历的顺序。
对于图12中的所有待遍历的实体,以遍历到实体F为例,计算遍历到的第一实体F与下一个待遍历的第二实体f1之间的欧式距离。
进一步判断该第一实体F与第二实体f1之间的欧式距离是否满足预设条件,其中,该预设条件具体可以为欧式距离大于或等于第一实体F的碰撞距离,其中,第一实体F的碰撞距离等于第一实体F的半径、第二实体f1的半径及预设的常数的和。
其中,若上述计算得到的欧式距离不满足预设条件,即该欧式距离小于第一实体的F的碰撞距离,此时表明第一实体F与第二实体f1之间发生了碰撞,此时,将基于预设的坐标变化常数对第二实体f1的第四展示位置信息进行更改,例如,在第二实体f1的第四展示位置信息的基础上增加一个坐标变化常数,以改变横坐标和纵坐标,且在改变之后,为了进一步确定该第一实体F与第二实体f1是否仍然存在碰撞,则将返回上述的步骤C2,继续计算该第一实体F与展示位置信息改变后的第二实体f1之间的欧式距离,并重复上述步骤。
其中,若上述计算得到的欧式距离满足预设条件,即该欧式距离大于或等于第一实体F的碰撞距离,此时表明第一实体F与第二实体f1之间并没有碰撞,此时,保留第二实体f1当前的展示位置信息,并不做修改。且继续遍历至下一个实体,即实体f1将作为遍历到的实体,重复上述步骤C2的内容,以此循环,直至所有的实体均满足预设条件。
如图13所示,为本申请实例中,滑动操作前的显示区域的示意图,如图14所示,为在图13执行滑动操作后的显示区域的示意图。对比图13及图14可知,图14中实体F为目标一级实体,且实体F在图14中位于扩展展示区域内。
可以理解的是,在本申请实例中,显示区域从图13切换至图14的过程中是由展示效果的,具体可以是先显示界面中的所有实体(包括中心实体A,一级子实体B、D、F、H、J、L、N、P)整体向同一个方向移动相同的距离,直至一级子实体F移动到扩展展示区域,且在一级子实体F移动到扩展展示区域之后,将通过由一级子实体F为起点向周围展开的方式展示二级子实体f1、f2、f3,且在展示结束之后,二级子实体f1、f2及f3则通过向中心收缩的方式隐藏起来。可以理解的是,在实际应用中,展示效果有多种,此处不做限定。
在本申请实例中,响应于扩展展示指令,确定目标一级子实体,并确定目标一级子实体的二级子实体的展示位置信息,使得能够进一步的展示二级子实体,且通过碰撞检测的方式,将发生碰撞的实体推开,避免碰撞,使得展示更加清晰,且改善用户的使用体验。
请参阅图15,为本申请实例中知识图谱的展示装置的程序模块的结构示意图,该装置包括:
响应模块1501,用于响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
其中,上述的待展示的多个实体包含一个中心实体及该中心实体的若干个一级子实体,且该若干个一级子实体的个数小于或等于预先设置的移动终端的显示区域可显示实体的最大个数。例如,若在上述指定知识图谱中,中心实体具有一百个一级子实体,在这种情况下,如果将该 一百个一级子实体都显示在移动终端的显示区域内,则将造成子实体显示面积过小、子实体碰撞等等显示效果不佳的问题,为了避免该问题,将从该一百个一级子实体中选择实体权重排在前N的N个一级子实体作为待展示的一级子实体,其中,N为上述预先设置的最大个数。
其中,树结构关系是指该多个实体之间的连接关系,在展示该多个实体时,实际上是展示的该多个实体之间的树结构关系,即该多个实体构成的知识图谱。
第一位置确定模块1502,用于基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
在本申请实例中,上述的布局规则可以为圆形布局规则,椭圆布局规则、网状式布局规则等等。
考虑到众多移动终端的显示区域的大小不一样,且移动终端的显示区域通常为矩形,因此在本申请的一些实例中,可以采用椭圆布局规则,可以理解的是,相对于扩散式的平面布局、网状式的平面布局及区域式的平面布局,基于该椭圆布局规则实施的布局更加适合移动终端显示区域的特性,能够实现显示区域的充分利用,且相对于上述多种布局方式,能够布局更多的实体。其中,椭圆布局规则是指多个实体布局之后呈现出椭圆形状。
第一展示模块1503,用于按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
在本申请实例中,展示装置响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及多个实体之间的树结构关系,基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在展示区域内的第一展示位置信息,按照 该第一展示位置信息在展示区域内展示该多个实体之间的树结构关系,以实现该多个实体构成的知识图谱的展示。本申请实例中,基于预设的布局规则在移动终端的显示区域内布局指定知识图谱中待展示的多个实体,能够充分利用显示区域的大小,有效实现知识图谱在移动终端的显示区域内的展示,满足移动终端用户的使用需求。
请参阅图16,为本申请实例中知识图谱的展示装置的程序模块的结构示意图,该装置包括响应模块1601、第一位置确定模块1602、第一展示模块1603。
响应模块1601,用于响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
其中,上述的待展示的多个实体包含一个中心实体及该中心实体的若干个一级子实体,且该若干个一级子实体的个数小于或等于预先设置的移动终端的显示区域可显示实体的最大个数。例如,若在上述指定知识图谱中,中心实体具有一百个一级子实体,在这种情况下,如果将该一百个一级子实体都显示在移动终端的显示区域内,则将造成子实体显示面积过小、子实体碰撞等等显示效果不佳的问题,为了避免该问题,将从该一百个一级子实体中选择实体权重排在前N的N个一级子实体作为待展示的一级子实体,其中,N为上述预先设置的最大个数。
其中,树结构关系是指该多个实体之间的连接关系,在展示该多个实体时,实际上是展示的该多个实体之间的树结构关系,即该多个实体构成的知识图谱。
第一位置确定模块1602,用于基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
在本申请实例中,上述的布局规则可以为圆形布局规则,椭圆布局规则、网状式布局规则等等。
考虑到众多移动终端的显示区域的大小不一样,且移动终端的显示区域通常为矩形,因此在本申请的一些实例中,可以采用椭圆布局规则,可以理解的是,相对于扩散式的平面布局、网状式的平面布局及区域式的平面布局,基于该椭圆布局规则实施的布局更加适合移动终端显示区域的特性,能够实现显示区域的充分利用,且相对于上述多种布局方式,能够布局更多的实体。其中,椭圆布局规则是指多个实体布局之后呈现出椭圆形状。
第一展示模块1603,用于按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
其中,第一位置确定模块1602包括:
长度确定模块1604,用于确定所述显示区域的长边的长度及短边的长度;
信息确定模块1605,用于基于预置的椭圆布局算法、所述长边的长度及短边的长度,从所述树结构关系中的中心实体开始,依次计算所述多个实体的第一展示位置信息。
其中,预置的椭圆布局算法如下:
Figure PCTCN2018107274-appb-000002
其中,count表示所述多个实体的总个数,startAngle i表示第i个实体的初始方向角,index i表示第i个实体在所述树结构关系中的索引,weight i表示预先设置的第i个实体的权重大小,s i表示预先设置的第i个实体的 缩放因子,a表示所述显示区域的短边的长度的一半,b表示所述显示区域的长边的一半,x i和y i分别表示在基于所示展示区域构建的二维空间坐标中,第i个实体的横坐标值和纵坐标值,scale i表示第i个实体在所述显示区域内展示时的所占的面积大小;
其中,x i、y i及scale i构成第i个实体的第一展示位置信息。
在本申请实例中,通过上述方式,能够有效的得到多个实体的第一展示位置信息。
请参阅图17,为本申请实例中知识图谱的展示装置的程序模块的结构示意图,包括响应模块1701、第一位置确定模块1702、第一展示模块1703。
响应模块1701,用于响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
其中,上述的待展示的多个实体包含一个中心实体及该中心实体的若干个一级子实体,且该若干个一级子实体的个数小于或等于预先设置的移动终端的显示区域可显示实体的最大个数。例如,若在上述指定知识图谱中,中心实体具有一百个一级子实体,在这种情况下,如果将该一百个一级子实体都显示在移动终端的显示区域内,则将造成子实体显示面积过小、子实体碰撞等等显示效果不佳的问题,为了避免该问题,将从该一百个一级子实体中选择实体权重排在前N的N个一级子实体作为待展示的一级子实体,其中,N为上述预先设置的最大个数。
其中,树结构关系是指该多个实体之间的连接关系,在展示该多个实体时,实际上是展示的该多个实体之间的树结构关系,即该多个实体构成的知识图谱。
第一位置确定模块1702,用于基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
在本申请实例中,上述的布局规则可以为圆形布局规则,椭圆布局规则、网状式布局规则等等。
考虑到众多移动终端的显示区域的大小不一样,且移动终端的显示区域通常为矩形,因此在本申请的一些实例中,可以采用椭圆布局规则,可以理解的是,相对于扩散式的平面布局、网状式的平面布局及区域式的平面布局,基于该椭圆布局规则实施的布局更加适合移动终端显示区域的特性,能够实现显示区域的充分利用,且相对于上述多种布局方式,能够布局更多的实体。其中,椭圆布局规则是指多个实体布局之后呈现出椭圆形状。
第一展示模块1703,用于按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
装置还包括:
优化模块1704,用于在所述展示模块之前,若所述中心实体的一级子实体的个数大于预设阈值,则基于预置的分层布局规则得到所述一级子实体的第二展示位置信息;
则所述第一展示模块1703具体用于:
按照所述中心实体的第一展示位置信息及所述一级子实体的第二展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
其中,优化模块1704具体包括:
第一确定模块1705,用于基于所述一级子实体的个数及预置的每层实体的个数,确定所述一级子实体的层数及各层的实际实体个数;
第二确定模块1706,用于基于均匀分布原则,利用所述层数及所述 各层的实际实体个数,确定所述一级子实体中各个实体所属的层数;
分层处理模块1707,用于基于所述一级子实体中各个实体所属的层数对所述一级子实体的第一展示位置信息进行分层设置处理,得到所述一级子实体的第二展示位置信息;
第一碰撞检测模块1708,用于基于所述一级子实体的第二展示位置信息进行碰撞检测,得到所述一级子实体的第二展示位置信息。
其中,第一碰撞检测模块1708包括:
第一顺序确定模块1709,用于基于预设的遍历规则确定所述一级子实体的遍历顺序,并按照所述遍历顺序进行遍历;
第一计算模块1710,用于计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离;
第一更改返回模块1711,用于若所述欧式距离不满足预设条件,则基于预设的坐标变化常数对所述第二一级子实体的第二展示位置进行更改,并返回执行所述第一计算模块1710;其中,所述预设条件为欧式距离大于或等于所述第一一级子实体的碰撞距离,所述碰撞距离为所述第一一级子实体的半径、所述第二一级子实体的半径及预设常数的和;
第一遍历返回模块1712,用于若所述欧式距离满足预设条件,则遍历至下一个一级子实体,返回执行所述第一计算模块1710,直至所述一级子实体均满足所述预设条件,且将满足所述预设条件时的展示位置信息作为所述第三展示位置信息。
其中,上述的分层布局规则具体为:将中心实体的一级子实体分为多层,且每层实体的个数不超过预先设置的最多可布局的实体的个数,同时,实体与实体之间、层与层之间采用的是均匀布局方式,使得在展示布局之后的实体时画面效果规则且匀称。利用该分层布局规则可以实现对一级子实体的分层布局。
其中,预先设置了每层实体的个数,例如,设置第一层的一级子实体的个数最多为8个,设置第二层一级子实体的个数最多为8个。
通常第一层的一级子实体的个数等于上述的预设阈值,即在中心实体的一级子实体的个数小于或等于述预置阈值时,表明只需要通过一层即可完成一级子实体的布局,而在中心实体的一级子实体的个数大于上述预置阈值时,则表明需要至少一层布局,此时则需要将中心实体的一级子实体按照上述的分层布局规则进行分层。
进一步的,将基于中心实体的一级子实体的个数及预置的每层实体的个数,确定一级子实体的层数及各层的实际实体个数,例如,在第一层的一级子实体的个数最多为8个,第二层一级子实体的个数最多为8个时,若中心实体的一级子实体的个数为12个,则可以确定分为两层,且第一层为8个一级子实体,第二层为4个一级子实体,或者,若中心实体的一级子实体个数为14个,则可以确定分为两层,且第一层及第二层均为7个一级子实体。
其中,在确定层数及各层的实际实体个数之后,将基于均匀分布原则,利用该层数及各层的实际个数,确定中心实体的一级子实体中哪些属于第一层哪些属于第二层。例如,在中心实体的一级子实体的个数为14个,且第一层及第二层均为7个一级子实体,则可以确定将第一层的一级子实体与第二层的一级子实体可间隔排列,则从上述14个一级子实体中,随机选择一个一级子实体为第一层,然后逆时针确定,确定第二个为属于第二层,第三个属于第一层,第四个属于第二层,并依次类推,则可得到哪些一级子实体属于第一层,哪些属于第二层。为了更好的理解分层的效果,请参阅图6,为本申请实例中一级子实体分层后的显示示意图,其中A中中心实体,b1至b6为第一层一级子实体,c1至c6为第二层一级子实体。
其中,在确定一级子实体中各实体所属的层数之后,将对一级子实体的第一展示位置信息分层设置处理,得到一级子实体的第二展示位置信息,具体的,先对属于第一层的一级子实体的第一展示位置信息进行处理,其中实体所占的面积大小不变,将第一层的一级子实体的横坐标及纵坐标均向中心实体靠近,以缩短第一层的一级子实体相对于中心实体的距离。可以理解的是,若层数为两层,在对第一层的一级子实体的第一展示位置信息进行处理之后,可以选择继续对第二层的一级子实体的第一展示位置信息进行处理,例如,缩短第二层的一级子实体相对于中心实体的距离,以向中心实体靠近,或者增长第二层的一级子实体相对于中心实体的距离,以远离中心实体;此外,还可以选择不对第二层的一级子实体的第一展示位置信息进行处理,保留初始的第一展示位置信息。需要说明的是,为了防止层与层之间的实体的碰撞,一层中的一个一级子实体与相邻层中相邻的一级子实体之间的欧式距离大于该两个实体的半径之和。
可以理解的是,在经过上述处理之后,将得到分层布局后一级子实体的第二展示位置信息。
考虑到对一级子实体进行分层是因为一级子实体的个数超过了单层分布的最大值,因此,在分层之后,仍然可能因为一级子实体的个数比较多的原因导致分层后的一级子实体会发生碰撞,碰撞是指:两个或多个一级子实体在显示区域的展示区域出现重合。
在本申请实例中,将预先设置对中心实体的一级子实体的遍历规则,例如,该遍历规则可以是从里至外及逆时针方向遍历,具体的,对于已分为N层的一级子实体,将依次确定每一层的遍历子顺序,以第一层的遍历子顺序的确定为例,可以从第一层的一级子实体中随机选择一个一级子实体作为起始遍历的实体,并按照逆时针方向将第一层的一级 子实体的排列顺序作为遍历子顺序,其中,该遍历子顺序是一个闭环,以图6为例,若选择从实体b1开始遍历,则遍历子顺序为b1-b2-b3-b4-b5-b6,且在遍历完b6之后,将继续遍历b1,且继续循环遍历。其中,在确定每一层的遍历子顺序之后,将确定整个一级子实体的遍历顺序,可以是从第一层往外遍历,如在完成第一层的遍历之后,继续遍历第二层,例如,以图7为例,即为在有多层的情况下的遍历顺序,先从b1开始,遍历第一层中b1-b2-b3-b4-b5-b6-b1构成的闭环圈,且在完成第一层的遍历之后,将从c1开始开始,遍历第二层中c1-c2-c3-c4-c5-c6-c1构成的闭环圈。其中,各层的遍历子顺序构成一级子实体的遍历顺序。
其中,在确定遍历顺序之后,将开始遍历过程,且对于每一个遍历到的一级子实体,都将按照如下的方式进行处理:
以遍历到的一级子实体为b1为例,该一级子实体b1的下一个待遍历的一级子实体为b2,计算一级子实体b1与一级子实体b2之间的欧式距离,其中,欧式距离可以使用欧式距离公式进行计算。
进一步判断该一级子实体b1与一级子实体b2之间的欧式距离是否满足预设条件,其中,该预设条件具体可以为欧式距离大于或等于一级子实体b1的碰撞距离,一级子实体b1的碰撞距离等于一级子实体b1的半径、一级子实体b2的半径及预设常数的和。
其中,若上述计算得到的欧式距离不满足预设条件,即该欧式距离小于一级子实体b1的碰撞距离,此时表明一级子实体b1与一级子实体b2之间发生了碰撞,此时,将基于预设的坐标变化常数对一级子实体b2的第二展示位置信息进行更改,例如,在一级子实体b2的第二展示位置信息的基础上增加一个坐标变化常数,以改变横坐标和纵坐标,且在改变之后,为了进一步确定一级子实体b1与一级子实体b2是否仍然 存在碰撞,则将返回上述的第一计算模块,继续计算该一级子实体b1与展示位置信息改变后的一级子实体b2之间的欧式距离,并重复上述过程。
其中,若上述计算得到的欧式距离满足预设条件,即该欧式距离大于或等于一级子实体b1的碰撞距离,此时表明一级子实体b1与一级子实体b2之间并没有碰撞,此时,将保留一级子实体b2当前的展示位置信息,并不做修改。且继续遍历至下一个一级子实体b2,检测一级子实体b2是否与一级子实体b3发生碰撞,并以此循环,直至第一层的所有一级子实体与下一个一级子实体的欧式距离均大于或等于相应的一级子实体的碰撞距离,满足预设条件。
可以理解的是,在完成第一层的碰撞检测之后,将基于相似的方式继续对第二层的一级子实体进行碰撞检测,直至所有的一级子实体均满足预设条件,且在所有的一级子实体均满足预设条件之后,将满足条件时的展示位置信息作为第三展示位置信息,以完成对一级子实体的展示位置信息的进一步优化,避免存在碰撞的情况。
在本申请实例中,通过对中心实体的一级子实体采用分层布局的方式,使得能够进一步更有效的利用显示区域的大小,相对于缩小实体大小的方式及扩大距离导致超过显示区域的方式,存在明显的优点,不仅不需要缩小实体的大小就可以完成一级子实体的展示,且不会带来超出显示区域的问题,给用户更好的使用体验。且进一步的,为了避免实体之间的碰撞,通过对一级子实体进行碰撞检测,能够更优化一级子实体的布局,给用户更好的使用体验。
请参阅图18,为本申请实例中知识图谱的展示装置的程序模块的结构示意图,具体的:
响应模块1801,用于响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
其中,上述的待展示的多个实体包含一个中心实体及该中心实体的若干个一级子实体,且该若干个一级子实体的个数小于或等于预先设置的移动终端的显示区域可显示实体的最大个数。例如,若在上述指定知识图谱中,中心实体具有一百个一级子实体,在这种情况下,如果将该一百个一级子实体都显示在移动终端的显示区域内,则将造成子实体显示面积过小、子实体碰撞等等显示效果不佳的问题,为了避免该问题,将从该一百个一级子实体中选择实体权重排在前N的N个一级子实体作为待展示的一级子实体,其中,N为上述预先设置的最大个数。
其中,树结构关系是指该多个实体之间的连接关系,在展示该多个实体时,实际上是展示的该多个实体之间的树结构关系,即该多个实体构成的知识图谱。
第一位置确定模块1802,用于基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
在本申请实例中,上述的布局规则可以为圆形布局规则,椭圆布局规则、网状式布局规则等等。
考虑到众多移动终端的显示区域的大小不一样,且移动终端的显示区域通常为矩形,因此在本申请的一些实例中,可以采用椭圆布局规则,可以理解的是,相对于扩散式的平面布局、网状式的平面布局及区域式的平面布局,基于该椭圆布局规则实施的布局更加适合移动终端显示区域的特性,能够实现显示区域的充分利用,且相对于上述多种布局方式,能够布局更多的实体。其中,椭圆布局规则是指多个实体布局之后呈现出椭圆形状。
第一展示模块1803,用于按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
上述展示装置还包括:
目标确定模块1804,用于响应于扩展展示指令,基于所述扩展展示指令确定所述多个实体中的目标一级子实体;
移动模块1805,用于以所述目标一级子实体的展示位置移动至所述扩展展示区域内为目的,整体移动所述多个实体,得到所述多个实体的第四展示位置信息;
第三确定模块1806,用于基于主向量布局规则,确定所述目标一级子实体待扩展展示的二级子实体的第四展示位置信息;
第二展示模块1808,用于按照所述多个实体及所述二级子实体的第四展示位置信息在所述显示区域内进行展示。
进一步的,该装置还包括:
第二碰撞检测模块1807,用于在第二展示模块1808之前,基于所述多个实体及所述二级子实体的第四展示位置信息进行碰撞检测,得到所述多个实体及所述二级子实体的第五展示位置信息;
则第二展示模块1808具体用于按照所述多个实体及所述二级子实体的第五展示位置信息在所述显示区域内进行展示。
其中,目标确定模块1804包括:
方向确定模块1809,用于基于所述滑动操作确定所述滑动操作的滑动方向;
选择模块1810,用于在所述多个一级子实体指向中心实体所形成的方向中,选择与所述滑动方向最匹配的方向对应的一级子实体作为所述目标一级子实体。
其中,第二碰撞检测模块1807包括:
第二顺序确定模块1811,用于基于预设的遍历规则确定包括所述多个实体中的一级子实体及所述二级子实体的实体集合中实体的遍历顺序,并按照所述遍历顺序进行遍历;
第二计算模块1812,用于计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离;
第二更改返回模块1813,用于若所述欧式距离不满足预设条件,则基于预设的坐标变化常数对所述第二实体的第四展示位置信息进行更改,并返回执行所述第二计算模块1812;所述预设条件为欧式距离大于或等于所述第一实体的碰撞距离,所述碰撞距离为所述第一实体的半径、所述第二实体的半径及预设常数的和;
第二遍历返回模块1814,用于若所述欧式距离满足预设条件,则遍历至下一个实体,返回执行所述第二计算模块1812,直至所述实体集合中的实体均满足所述预设条件,且将满足所述预设条件时的展示位置信息作为所述第五展示位置信息。
在本申请实例中,在本申请实例中,上述的扩展展示指令可以通过多种方式触发,例如可以是拖动操作,也可以是滑动操作,具体的,用户若需要扩展展示一级子实体C的二级子实体,则可以触摸该一级子实体C,并在保持触摸的状态下拖动至扩展展示区域内,并在扩展展示区域内释放触摸状态,将进一步的触发移动终端生成扩展展示指令。其中,滑动操作可以是任意的滑动操作。
在本申请实例中,展示装置将响应于扩展展示指令,并基于该扩展展示指令确定多个实体中待扩展展示的目标一级子实体。
其中,若是由拖动操作触发的扩展展示指令,则目标一级子实体为拖动操作起始位置处的一级子实体,若是由滑动操作触发的扩展展示指令,则可以基于滑动操作确定滑动操作的滑动方向,如确定滑动操作的 起始位置及结束位置,并将从起始位置指向结束位置形成的方向作为滑动方向。
在本申请实例中,响应于扩展展示指令,确定目标一级子实体,并确定目标一级子实体的二级子实体的展示位置信息,使得能够进一步的展示二级子实体,且通过碰撞检测的方式,将发生碰撞的实体推开,避免碰撞,使得展示更加清晰,且改善用户的使用体验。
可以理解的是,上述知识图谱的展示方法可以由终端设备,如移动终端,或者移动终端与服务器的交互实现,为了更好的理解,以上述方法由移动终端实现为例,请参阅图19,为本申请实例中移动终端190的结构示意图。该移动终端190包括处理器1901、存储器1902和收发器1903,存储器1902可以包括只读存储器和随机存取存储器,并向处理器1901提供操作指令和数据。存储器1902的一部分还可以包括非易失性随机存取存储器(NVRAM)。
在一些实施方式中,存储器1902存储了如下的元素:可执行模块或者数据结构,或者他们的子集,或者他们的扩展集。
在本申请实例中,通过调用存储器1902存储的操作指令(该操作指令可存储在操作系统中),执行以下的过程:响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;基于预置的布局规则,利用多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
本申请实例提供的移动终端,基于预设的布局规则在移动终端的显示区域内布局指定知识图谱中待展示的多个实体,能够充分利用显示区域的大小,有效实现知识图谱在移动终端的显示区域内的展示,满足移 动终端用户的使用需求。
其中,处理器1901控制移动终端190的操作,处理器1901还可以称为CPU(Central Processing Unit,中央处理单元)。存储器1902可以包括只读存储器和随机存取存储器,并向处理器1901提供指令和数据。存储器1902的一部分还可以包括非易失性随机存取存储器(NVRAM)。具体的应用中移动终端190的各个组件通过总线系统1904耦合在一起,其中总线系统1904除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统1904。
上述本申请实例揭示的方法可以应用于处理器1901中,或者由处理器1901实现。处理器1901可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1901中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1901可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1902,处理器1901读取存储器1902中的信息,结合其硬件完成上述方法的步骤。
本申请实例中还提供一种移动终端,包括存储器、处理器及存储在存储器上且在处理器上运行的计算机程序,处理器执行计算机程序时, 实现如图1或图5或图9所示实例中的知识图谱的展示方法中的各个步骤。
本申请实例中还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,实现如图1或图5或图9所示实例中的知识图谱的展示方法的各个步骤。
在本申请所提供的几个实例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实例方案的目的。
另外,在本申请各个实例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设 备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,对于前述的各方法实例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实例均属于优选实例,所涉及的动作和模块并不一定都是本申请所必须的。
在上述实例中,对各个实例的描述都各有侧重,某个实例中没有详述的部分,可以参见其它实例的相关描述。
以上为对本申请所提供的一种知识图谱的展示方法及装置、移动终端及可读存储介质的描述,对于本领域的技术人员,依据本申请实例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。

Claims (15)

  1. 一种知识图谱的展示方法,由终端设备执行,所述方法包括:
    响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
    基于预置的布局规则,利用所述多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
    按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
  2. 根据权利要求1所述的展示方法,其中,所述布局规则为椭圆布局规则;
    则所述基于预置的布局规则,利用所述多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息包括:
    确定所述显示区域的长边的长度及短边的长度;
    基于预置的椭圆布局算法、所述长边的长度及短边的长度,从所述树结构关系中的中心实体开始,依次计算所述多个实体的第一展示位置信息。
  3. 根据权利要求1所述的展示方法,其中,所述多个实体包含一个中心实体及所述中心实体的一级子实体;
    则所述按照所述第一展示位置信息在所述显示区域内展示所述多个实体的步骤之前还包括:
    若所述中心实体的一级子实体的个数大于预设阈值,则基于预置的分层布局规则得到所述一级子实体的第二展示位置信息;
    则所述按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系,具体包括:
    按照所述中心实体的第一展示位置信息及所述一级子实体的第二展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
  4. 根据权利要求3所述的展示方法,其中,所述基于预置的分层布局规则得到所述一级子实体的第二展示位置信息,包括:
    基于所述一级子实体的个数及预置的每层实体的个数,确定所述一级子实体的层数及各层的实际实体个数;
    基于均匀分布原则,利用所述层数及所述各层的实际实体个数,确定所述一级子实体中各个实体所属的层数;
    基于所述一级子实体中各个实体所属的层数对所述一级子实体的第一展示位置信息进行分层设置处理,得到所述一级子实体的第二展示位置信息。
  5. 根据权利要求4所述的展示方法,其中,所述基于所述一级子实体中各个实体所属的层数对所述一级子实体的第一展示位置信息进行分层设置处理,得到所述一级子实体的第二展示位置信息,之后还包括:
    基于所述一级子实体的第二展示位置信息进行碰撞检测,得到所述一级子实体的第三展示位置信息;
    则所述按照所述中心实体的第一展示位置信息及所述一级子实体的第二展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系,具体包括:
    按照所述中心实体的第一展示位置信息及所述一级子实体的第三展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
  6. 根据权利要求5所述的展示方法,其中,所述基于所述一级子 实体的第二展示位置信息进行碰撞检测,得到所述一级子实体的第三展示位置信息,包括:
    基于预设的遍历规则确定所述一级子实体的遍历顺序,并按照所述遍历顺序进行遍历;
    计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离;
    若所述欧式距离不满足预设条件,则基于预设的坐标变化常数对所述第二一级子实体的第二展示位置进行更改,并返回执行所述计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离的步骤;其中,所述预设条件为欧式距离大于或等于所述第一一级子实体的碰撞距离,所述碰撞距离为所述第一一级子实体的半径、所述第二一级子实体的半径及预设常数的和;
    若所述欧式距离满足预设条件,则遍历至下一个一级子实体,返回执行计算遍历到的第一一级子实体与下一个待遍历的第二一级子实体之间的欧式距离的步骤,直至所述一级子实体均满足所述预设条件,且将满足所述预设条件时的展示位置信息作为所述第三展示位置信息。
  7. 根据权利要求1至6任意一项所述的展示方法,其中,所述显示区域包含扩展展示区域;
    则所述方法还包括:
    响应于扩展展示指令,基于所述扩展展示指令确定所述多个实体中的目标一级子实体;
    以所述目标一级子实体的展示位置移动至所述扩展展示区域内为目的,整体移动所述多个实体,得到所述多个实体的第四展示位置信息;
    基于主向量布局规则,确定所述目标一级子实体待扩展展示的二级子实体的第四展示位置信息;
    按照所述多个实体及所述二级子实体的第四展示位置信息在所述显示区域内进行展示。
  8. 根据权利要求7所述的展示方法,其中,所述按照所述多个实体及所述二级子实体的第四展示位置信息在所述显示区域内进行展示之前还包括:
    基于所述多个实体及所述二级子实体的第四展示位置信息进行碰撞检测,得到所述多个实体及所述二级子实体的第五展示位置信息;
    则所述按照所述多个实体及所述二级子实体的第四展示位置信息在所述显示区域内进行展示,具体包括:
    按照所述多个实体及所述二级子实体的第五展示位置信息在所述显示区域内进行展示。
  9. 根据权利要求7所述的展示方法,其中,所述基于所述扩展展示指令确定所述多个实体中的目标一级子实体,包括:
    若所述扩展展示指令由滑动操作触发,则基于所述滑动操作确定所述滑动操作的滑动方向;
    在所述多个一级子实体指向中心实体所形成的方向中,选择与所述滑动方向最匹配的方向对应的一级子实体作为所述目标一级子实体。
  10. 根据权利要求8所述的扩展方法,其中,所述基于所述多个实体及所述二级子实体的第四展示位置信息进行碰撞检测,得到所述多个实体及所述二级子实体的第五展示位置信息,包括:
    基于预设的遍历规则确定包括所述多个实体中的一级子实体及所述二级子实体的实体集合中实体的遍历顺序,并按照所述遍历顺序进行遍历;
    计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离;
    若所述欧式距离不满足预设条件,则基于预设的坐标变化常数对所述第二实体的第四展示位置信息进行更改,并返回执行所述计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离的步骤;所述预设条件为欧式距离大于或等于所述第一实体的碰撞距离,所述碰撞距离为所述第一实体的半径、所述第二实体的半径及预设常数的和;
    若所述欧式距离满足预设条件,则遍历至下一个实体,返回执行所述计算遍历到的第一实体与下一个待遍历的第二实体之间的欧式距离的步骤,直至所述实体集合中的实体均满足所述预设条件,且将满足所述预设条件时的展示位置信息作为所述第五展示位置信息。
  11. 一种知识图谱的展示装置,所述装置包括:
    响应模块,用于响应于知识图谱展示指令,确定指定知识图谱中包含的待展示的多个实体及所述多个实体之间的树结构关系;
    第一位置确定模块,用于基于预置的布局规则,利用所述多个实体之间的树结构关系及移动终端的显示区域的大小,确定所述多个实体在所述显示区域内的第一展示位置信息;
    第一展示模块,用于按照所述第一展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
  12. 根据权利要求11所述的展示装置,其中,所述多个实体包含一个中心实体及所述中心实体的一级子实体;
    则所述装置还包括:
    优化模块,用于在所述展示模块之前,若所述中心实体的一级子实体的个数大于预设阈值,则基于预置的分层布局规则得到所述一级子实体的第二展示位置信息;
    则所述第一展示模块具体用于:
    按照所述中心实体的第一展示位置信息及所述一级子实体的第二 展示位置信息在所述显示区域内展示所述多个实体之间的树结构关系。
  13. 根据权利要求11或12所述的展示装置,其中,所述显示区域包含扩展展示区域;
    则所述装置还包括:
    目标确定模块,用于响应于扩展展示指令,基于所述扩展展示指令确定所述多个实体中的目标一级子实体;
    移动模块,用于以所述目标一级子实体的展示位置移动至所述扩展展示区域内为目的,整体移动所述多个实体,得到所述多个实体的第四展示位置信息;
    第三确定模块,用于基于主向量布局规则,确定所述目标一级子实体待扩展展示的二级子实体的第四展示位置信息;
    第二展示模块,用于按照所述多个实体及所述二级子实体的第四展示位置信息在所述显示区域内进行展示。
  14. 一种终端设备,包括存储器、处理器及存储在所述存储器上且在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1至10任意一项所述的知识图谱的展示方法中的各个步骤。
  15. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,实现如权利要求1至10任意一项所述的知识图谱的展示方法的各个步骤。
PCT/CN2018/107274 2017-09-25 2018-09-25 知识图谱的展示方法及装置、移动终端及可读存储介质 WO2019057192A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710876436.0 2017-09-25
CN201710876436.0A CN110019765B (zh) 2017-09-25 2017-09-25 知识图谱的展示方法及装置、移动终端及可读存储介质

Publications (1)

Publication Number Publication Date
WO2019057192A1 true WO2019057192A1 (zh) 2019-03-28

Family

ID=65809532

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/107274 WO2019057192A1 (zh) 2017-09-25 2018-09-25 知识图谱的展示方法及装置、移动终端及可读存储介质

Country Status (2)

Country Link
CN (1) CN110019765B (zh)
WO (1) WO2019057192A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688251A (zh) * 2021-07-27 2021-11-23 广东师大维智信息科技有限公司 一种室内体育赛事安保领域的知识图谱构建方法与系统

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020172861A1 (zh) * 2019-02-28 2020-09-03 深圳晶泰科技有限公司 晶体结构碰撞快速检测方法
CN110543528A (zh) * 2019-07-30 2019-12-06 深圳众赢维融科技有限公司 信息展示方法、装置、电子设备及存储介质
CN110955737A (zh) * 2019-11-27 2020-04-03 北京明略软件系统有限公司 关系图谱展示策略确定方法、装置、电子设备及存储介质
CN111143547B (zh) * 2019-12-30 2020-09-01 山东大学 一种基于知识图谱的大数据显示方法
CN111258471B (zh) * 2020-01-13 2021-05-25 维沃移动通信有限公司 一种对象的显示方法及电子设备
CN111708847A (zh) * 2020-05-20 2020-09-25 北京明略软件系统有限公司 一种关系图的展示方法及装置
CN111966683A (zh) * 2020-08-14 2020-11-20 北京致远互联软件股份有限公司 可视化表单图谱建立方法、装置、电子设备及存储介质
CN117076682A (zh) * 2023-07-24 2023-11-17 企查查科技股份有限公司 知识图谱生成方法及生成设备

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095858A (zh) * 2016-06-02 2016-11-09 海信集团有限公司 一种音视频搜索方法、装置和终端
CN107122444A (zh) * 2017-04-24 2017-09-01 北京科技大学 一种法律知识图谱自动构建方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9329756B2 (en) * 2013-09-09 2016-05-03 Adobe Systems Incorporated Navigation in a hierarchical node structure
US10261659B2 (en) * 2014-06-25 2019-04-16 Oracle International Corporation Orbit visualization for displaying hierarchical data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095858A (zh) * 2016-06-02 2016-11-09 海信集团有限公司 一种音视频搜索方法、装置和终端
CN107122444A (zh) * 2017-04-24 2017-09-01 北京科技大学 一种法律知识图谱自动构建方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688251A (zh) * 2021-07-27 2021-11-23 广东师大维智信息科技有限公司 一种室内体育赛事安保领域的知识图谱构建方法与系统
CN113688251B (zh) * 2021-07-27 2024-02-13 广东师大维智信息科技有限公司 一种室内体育赛事安保领域的知识图谱构建方法与系统

Also Published As

Publication number Publication date
CN110019765A (zh) 2019-07-16
CN110019765B (zh) 2023-03-24

Similar Documents

Publication Publication Date Title
WO2019057192A1 (zh) 知识图谱的展示方法及装置、移动终端及可读存储介质
US10664510B1 (en) Displaying clusters of media items on a map using representative media items
JP6480607B2 (ja) リアルタイム仮想シーンにおけるコライダ間の衝突を検出するための方法、端末および記憶媒体
US8237716B2 (en) Algorithm for drawing directed acyclic graphs
TWI579734B (zh) 3d視覺化技術
WO2016091087A1 (zh) 信息展示方法及装置、电子设备
US20180164978A1 (en) Causing display of a three dimensional graphical user interface
CN110264326A (zh) 识别异常账户集合和风险账户集合的方法、装置及设备
WO2017092251A1 (zh) 实时虚拟场景中圆柱碰撞体与凸体碰撞探测的方法、终端和存储介质
WO2021103945A1 (zh) 地图融合方法及装置、设备、存储介质
CN111045754A (zh) 由基于改变的试探法驱动的自动和交互式动画
US11704559B2 (en) Learning to search user experience designs based on structural similarity
KR102317013B1 (ko) 컴퓨팅 장치를 이용한 객체 관리 및 시각화
CN108733371A (zh) 一种界面生成方法、装置及设备
TW201546636A (zh) 註解顯示器輔助裝置及輔助方法
US20150088799A1 (en) Input assistance device, input assisting method, and recording medium storing input assistance program
CN107437367A (zh) 一种标注选择方法及装置
US10198412B2 (en) Simulated annealing to place annotations in a drawing
US20150309681A1 (en) Depth-based mode switching for touchless gestural interfaces
CN116992058A (zh) 跨元宇宙的数据显示方法和装置
WO2023155348A1 (zh) 游戏数据处理方法、装置、计算机设备及存储介质
CN107038176B (zh) 网络图页面渲染方法、装置及设备
WO2021036190A1 (zh) 节点布局确定方法以及装置
US20210141502A1 (en) Smart augmented reality selector
CN110647574B (zh) 一种社交网络数据展示方法、终端设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18858768

Country of ref document: EP

Kind code of ref document: A1