Personal data model generation method and query method based on graph database

By using a graph database-based method for generating personal data models, the problem of performance degradation in cross-dimensional queries of relational databases is solved, achieving efficient management and querying of complex personal data.

CN119003604APending Publication Date: 2024-11-22YICI NETCOM (HANGZHOU) TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410955690.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Existing technologies suffer from severe performance degradation in cross-dimensional queries when managing multi-dimensional personal data based on relational databases, making it difficult to effectively manage and query complex personal data in a short period of time.

Method used

A graph database-based personal data model generation method is adopted. By acquiring personal data, determining attribute information and related data, a graph database model is generated. The graph database directly stores the relationships between entities rather than the foreign key relationships between tables, thereby improving query efficiency.

Benefits of technology

It improves the efficiency of cross-dimensional data querying, simplifies data management and querying processes, enhances data analysis and visualization capabilities, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003604A_ABST
    Figure CN119003604A_ABST
Patent Text Reader

Abstract

The invention discloses a personal data model generation method and query method based on a graph database, and relates to the field of big data, and the method comprises the following steps: obtaining personal data; according to personal data, determining multiple pieces of attribute information and multiple pieces of attribute values in one-to-one correspondence with the attribute information; determining a plurality of different types of objects according to the feature similarity of the attribute information; determining first associated data between every two of the plurality of objects and second associated data between the plurality of objects and the plurality of corresponding attribute values according to a corresponding relationship between the plurality of pieces of attribute information and the plurality of attribute values; and inputting the plurality of objects, the plurality of first associated data and the plurality of second associated data into an initial graph database model to generate a personal data model. The method has the advantage that the user can conveniently manage and inquire personal data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a personal data model generation method and a query method based on a graph database. Background Art

[0002] Personal data stored on personal storage devices involves multiple dimensions, such as files (photos, videos, documents, etc.), personal behavior data (ordering takeout, booking tickets, etc.), asynchronous operation tasks on personal storage devices (batch deletion of files, batch setting of multiple copies, etc.), chat information of a certain group, etc. At the same time, some system data will be automatically generated inside personal storage devices, such as events, alarms, and operation logs.

[0003] Currently, a more common way to search for data stored on a personal storage device is based on a relational database.

[0004] In order to enable data to be queried, a table structure must be designed for data in each dimension and relationships between tables must be established. The query performance for data in any dimension meets the requirements, but the query performance for cross-dimensional data drops drastically.

[0005] When the complexity of personal data in the device reaches a certain level, how to effectively manage data in multiple dimensions and easily find valid data in the shortest time becomes an urgent issue that needs to be considered. Summary of the invention

[0006] The present invention aims to solve one of the technical problems in the related art to a certain extent. To this end, the present invention provides a method for generating a personal data model and a query method based on a graph database, which has the advantage of facilitating users to manage and query personal data.

[0007] In order to achieve the above object, the present invention adopts the following technical solution:

[0008] A method for generating a personal data model based on a graph database, comprising:

[0009] Access personal data;

[0010] Determine, based on the personal data, a plurality of attribute information and a plurality of attribute values ​​corresponding to the attribute information one by one;

[0011] determining a plurality of objects of different types according to feature similarities of the attribute information;

[0012] Determine, according to the correspondence between the plurality of attribute information and the plurality of attribute values, first association data between the plurality of objects, and second association data between the plurality of objects and the plurality of corresponding attribute values;

[0013] Input the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model.

[0014] Optionally, according to the correspondence between the plurality of attribute information and the plurality of attribute values, first association data between the plurality of objects and second association data between the plurality of objects and the plurality of attribute values ​​are determined, and then the method includes:

[0015] Determine a plurality of the first associated data and a plurality of the second associated data whose repetitions meet a preset value as a plurality of target associated data; the repetition is the ratio of the number of the first associated data and the second associated data to the sum of the number of the first associated data and the second associated data respectively;

[0016] The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes:

[0017] Input the plurality of objects and the plurality of target association data into the initial graph database model to generate a personal data model.

[0018] Optionally, the determining the first associated data and the second associated data whose repetitions satisfy a preset value as target associated data may then include:

[0019] Determining common associated data from the target associated data according to similarities between the plurality of target associated data;

[0020] The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes:

[0021] The object, the target-related data, and the public-related data are input into an initial graph database model to generate a personal data model.

[0022] Optionally, inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes:

[0023] Using the plurality of objects as a plurality of intermediate node data of an initial graph database model;

[0024] A personal data model is generated by using a plurality of the first related data and a plurality of the second related data as a plurality of edge data of the initial graph data model.

[0025] Optionally, the target association data and the public association data include pointing information between the objects and the objects, and between the objects and corresponding attribute values.

[0026] Optionally, the attribute information includes at least one of a file name, a file type, a file size, a creation date, a file owner, a file group, and a file source.

[0027] Optionally, the object includes at least one of a file, a person, an album, a playlist, an application, a style, a scene, a group, a user, an event, an alarm, a task, and an operation.

[0028] Since the graph database directly stores edges (i.e., relationships between entities) as data, rather than as foreign key relationships between tables like traditional relational databases, the graph database does not need to perform multiple connection operations when querying relationships, which greatly improves query efficiency. Therefore, personal data containing complex relationships is suitable for personal data models based on graph databases. In the modeling process, by explicitly representing the objects, first associated data, and second associated data in the personal data, a streamlined and efficient data model is ensured, which is conducive to subsequent data analysis, query, and visualization, and thus facilitates users to manage and query their own personal data.

[0029] In addition, the present invention also provides a query method, comprising:

[0030] Importing personal data into a personal data model; the personal data model is generated by inputting objects determined according to attribute information of the personal data, first association data between multiple objects determined according to corresponding relationships between multiple attribute information and multiple attribute values, and second association data between multiple objects and multiple attribute values ​​into an initial graph database model;

[0031] The target data is queried according to the structured query language and query conditions; the query conditions include the object to which the target data belongs and the attribute value of the target data.

[0032] The query method provided by the present invention is similar to the beneficial effect reasoning process of the aforementioned personal data model generation method, and will not be repeated here.

[0033] In addition, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the above-mentioned personal data model generation methods and query methods when executing the computer program.

[0034] At the same time, the present invention also provides a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, it implements any of the personal data model generation methods and query methods described above.

[0035] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and drawings. The best embodiments or means of the present invention will be described in detail in conjunction with the drawings, but they are not intended to limit the technical solutions of the present invention. In addition, there are multiple features, elements, and components that appear in each of the following texts and drawings, and different symbols or numbers are marked for convenience, but they all represent components with the same or similar structures or functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The present invention will be further described below in conjunction with the accompanying drawings:

[0037] Figure 1 A schematic diagram of a process of generating a personal data model according to an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of personal data relationships generated according to a personal data model in one embodiment of the present invention;

[0039] Figure 3 It is a schematic diagram of modules of the electronic device in the above embodiment of the present invention;

[0040] Figure 4 It is a schematic diagram of a computer-readable medium in the above embodiment of the present invention. DETAILED DESCRIPTION

[0041] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments in the implementation manner are intended to be used to explain the present invention and should not be construed as limiting the present invention.

[0042] References in this specification to "one embodiment" or "an example" or "an example" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment itself may be included in at least one embodiment of the present patent disclosure. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily refer to the same embodiment.

[0043] As a first aspect of the present invention, a method for generating a personal data model based on a graph database is provided. Figure 1 As shown, the method includes:

[0044] In step S110, personal data is obtained;

[0045] In step S120, a plurality of attribute information and a plurality of attribute values ​​corresponding to the attribute information are determined according to the personal data;

[0046] In step S130, a plurality of objects of different types are determined according to the feature similarity of the attribute information;

[0047] In step S140, first association data between two of the objects and second association data between the objects and the corresponding attribute values ​​are determined according to the corresponding relationship between the attribute information and the attribute values.

[0048] In step S150, a plurality of the objects, a plurality of the first associated data, and a plurality of the second associated data are input into an initial graph database model to generate a personal data model.

[0049] First, obtain personal data related to individuals from external sources (such as databases, APIs, user input, etc.). This personal data can be structured (such as table data) or unstructured (such as text, pictures, etc.). Parse the personal data to extract key information points, namely attribute information (such as file type, file upload time, user, etc.), and the attribute values ​​corresponding to these attribute information.

[0050] Based on the similarity of attribute information features (such as attribute value, attribute type, etc.), similar attribute information is classified as objects of the same type. For example, pictures, music, videos, etc. can be classified as "file" objects, while singers and actors can be classified as "person" objects, thereby streamlining the relationship nodes in the graph database and making the personal data model clearer and more efficient.

[0051] It should be noted that this implementation is based on RDF (Resource Description Framework) data to establish a model, that is, based on the subject-predicate-object data modeling method, which is used to describe the relationship between resources. The subject represents an entity or resource, the predicate represents the type of relationship between the subject and the object, and the object is the value or entity associated with the subject. For example, "<John,hasAge,25> " means "John's age is 25 years old". In this embodiment, the object is the subject, the attribute value corresponding to the object is the object, and the first associated data and the second associated data are the predicate. Therefore, the first associated data between the multiple objects and the second associated data between the multiple objects and the corresponding multiple attribute values ​​can be determined according to the corresponding relationship between the attribute information and the attribute value.

[0052] It is understandable that the above method is also applicable to building personal data models through attribute graphs. In attribute graph modeling, the graph consists of nodes and edges, and each node and edge can have its own attributes. The two graph data modeling methods differ in describing the structure and attributes between entities and relationships, and are suitable for different application scenarios. Node and edge attribute modeling is usually used for more flexible and intuitive graph operations, while triple modeling is more suitable for applications in semantics and knowledge representation.

[0053] Since the graph database directly stores edges (i.e., relationships between entities) as data, rather than as foreign key relationships between tables like traditional relational databases, the graph database does not need to perform multiple connection operations when querying relationships, which greatly improves query efficiency. Therefore, personal data containing complex relationships is suitable for personal data models based on graph databases. In the modeling process, by explicitly representing the objects, first associated data, and second associated data in the personal data, a streamlined and efficient data model is ensured, which is conducive to subsequent data analysis, query, and visualization, and thus facilitates users to manage and query their own personal data.

[0054] Optionally, according to the correspondence between the plurality of attribute information and the plurality of attribute values, first association data between the plurality of objects and second association data between the plurality of objects and the plurality of attribute values ​​are determined, and then the method includes:

[0055] Determine a plurality of the first associated data and a plurality of the second associated data whose repetitions meet a preset value as a plurality of target associated data; the repetition is the ratio of the number of the first associated data and the second associated data to the sum of the number of the first associated data and the second associated data respectively;

[0056] The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes:

[0057] Input the plurality of objects and the plurality of target association data into the initial graph database model to generate a personal data model.

[0058] The graph database stores data in the form of a graph structure. Each vertex, edge, and attribute requires a certain amount of storage space. Ignoring the first associated data and the second associated data with a small number (i.e., low repetition) can avoid creating a large number of unnecessary edges and vertices in the graph database, thereby saving storage space. If each attribute value is stored as a separate vertex or edge, especially when the second associated data between the object and the corresponding attribute value has a low repetition, the query efficiency will be affected due to the need to traverse a large number of irrelevant edges or vertices. Therefore, the first associated data with a high repetition and the second associated data are determined as target associated data. The target associated data will be frequently queried and referenced in the graph database, and the traversal path will be reduced during the query, thereby speeding up the query.

[0059] In an optional implementation manner, the determining the first associated data and the second associated data whose repetitions meet a preset value as target associated data may then include:

[0060] Determining common associated data from the target associated data according to similarities between the plurality of target associated data;

[0061] The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes:

[0062] The object, the target-related data, and the public-related data are input into an initial graph database model to generate a personal data model.

[0063] Public associated data can be shared by multiple edges. By obtaining public associated data based on the similarities in multiple target associated data, data redundancy and conflict caused by different target associated data describing the same relationship can be reduced, which helps ensure the consistency and accuracy of data in the personal data model. By querying related resources through public associated data, query statements can be simplified, thereby improving query efficiency. In addition, due to the enhanced consistency of data, query results are more accurate and reliable. At the same time, due to the simplification of query statements, users can also write and understand query statements more easily, thereby improving user experience.

[0064] In a specific implementation, the example code for establishing public associated data is as follows:

[0065] const(

[0066] GraphPredicateType = "type" / / Object type

[0067] GraphPredicateUser = "user" / / The user to whom the object belongs

[0068] GraphPredicateName = "name" / / Object name

[0069] GraphPredicateCreatedDate = "created_date" / / Object creation date

[0070] GraphPredicateCreatedTime = "created_time" / / Object creation time

[0071] GraphPredicateContext = "context" / / object content description

[0072] GraphPredicateFile = "file" / / The file to which the object belongs

[0073] GraphPredicateWherefrom = "wherefrom" / / Object source

[0074] GraphPredicateStyle = "style" / / Object style )

[0076] In a specific implementation, the example code for establishing target association data for each object is as follows:

[0077] Files refer to photos, videos, audios and documents manually uploaded by users, or pictures, movies, short videos, music, etc. downloaded from the Internet.

[0078] const(

[0079] GraphFilePredicateType = "file_type" / / file type, including image, video, audio, doc, etc.

[0080] GraphFilePredicateUploadDate = "file_upload_date" / / file upload date

[0081] GraphFilePredicateUploadTime = "file_upload_time" / / file upload time

[0082] GraphFilePredicateReleaseDate = "file_release_date" / / File release date, usually refers to songs, movies, albums, etc.

[0083] GraphFilePredicateReleaseTime = "file_release_time" / / File release time, usually refers to songs, movies, albums, etc.

[0084] GraphFilePredicateSize = "file_size" / / file size

[0085] GraphFilePredicateLocation = "file_location" / / file location

[0086] GraphFilePredicateMd5 = "file_md5" / / file MD5 )

[0088] People, artists automatically created by AI facial recognition or when you download music, albums, playlists or movies from the Internet.

[0089] const(

[0090] GraphHumanPredicateAge = "human_age" / / Human age )

[0092] Album, music album information automatically created when downloading songs from the Internet.

[0093] const(

[0094] GraphAlbumPredicateHuman = "album_human" / / Artist to whom the album belongs

[0095] GraphAlbumPredicateReleaseDate = "album_release_date" / / Album release date, usually refers to songs, movies, albums, etc.

[0096] GraphAlbumPredicateReleaseTime = "album_release_time" / / Album release time, usually refers to songs, movies, albums, etc. )

[0098] Playlist, music playlist information when downloading movies and TV shows from the Internet.

[0099] const(

[0100] GraphPlaylistPredicateStyle = "album_style" / / playlist style )

[0102] Application, Internet application information automatically created when downloading data from the Internet, not available yet.

[0103] Style, the style type automatically created when downloading data from the Internet, none at the moment.

[0104] Scene, automatically created by AI recognition, none yet.

[0105] Groups, groups you create yourself or group information you create when you join a group created by someone else.

[0106] const(

[0107] GraphGroupPredicateOwner="group_owner" / / Group owner

[0108] GraphGroupPredicateViceOwner = "group_vice_owner" / / Vice group owner

[0109] GraphGroupPredicateMember = "group_member" / / Group member

[0110] GraphGroupPredicateMemberNumber = "group_member_number" / / Number of group members )

[0112] User, user information on the device, including the device owner user or guest user.

[0113] const(

[0114] GraphUserPredicateNickname="user_nickname" )

[0116] Events, key device behavior records, such as when a device enters the binding state, an event record will be triggered.

[0117] const(

[0118] GraphEventPredicateEntity = "evt_entity" / / event entity

[0119] GraphEventPredicateType = "evt_type" / / event type

[0120] GraphEventPredicateLevel = "evt_level" / / event level )

[0122] Alarms are events that users need to be aware of, such as high device temperature, insufficient device storage space, etc.

[0123] const(

[0124] GraphAlarmPredicateEvent = "alarm_event" / / Event to which the alarm belongs

[0125] GraphAlarmPredicateParams = "alarm_params" / / alarm parameters )

[0127] Tasks, asynchronous task information triggered by users or automatically triggered by devices, such as users deleting files in batches and users creating multiple copies of batch devices.

[0128] const(

[0129] GraphTaskPredicateDef = "task_def" / / Task definition

[0130] GraphTaskPredicateGroup = "task_group" / / Task grouping

[0131] GraphTaskPredicatePriority = "task_priority" / / Task priority

[0132] GraphTaskPredicateState = "task_state" / / Task state

[0133] GraphTaskPredicateArgs = "task_args" / / Task parameters )

[0135] Operation, user operation behavior, such as a user uploading a file or downloading a file from a network disk.

[0136] const(

[0137] GraphOperatePredicateWho = "operate_who" / / Who is operating

[0138] GraphOperatePredicateAction = "operate_action" / / Operation behavior

[0139] GraphOperatePredicateWhose = "operate_whose" / / Whose operation GraphOperatePredicateWhat = "operate_what" / / What operation )

[0141] Optionally, inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes:

[0142] Using the plurality of objects as a plurality of intermediate node data of an initial graph database model;

[0143] A personal data model is generated by using a plurality of the first related data and a plurality of the second related data as a plurality of edge data of the initial graph data model.

[0144] The data in the graph database is a graph structure composed of nodes and edges, where nodes represent entities or objects and edges represent the relationship between entities. Using multiple objects as multiple intermediate node data of the initial graph database model, and using multiple first associated data and multiple second associated data as multiple edge data of the initial graph data model can directly display the connection and dependency between data, which is suitable for querying and displaying complex relational data (such as personal data).

[0145] In an optional implementation manner, the target association data and the public association data include pointing information between the objects and the objects, and between the objects and corresponding attribute values.

[0146] When building a model based on RDF data, directed edges are implemented through triples (SPO). A triple consists of a subject, a predicate, and an object. The predicate describes the relationship between the subject and the object. This relationship is represented in a graph as a directed edge from the node corresponding to the subject to the node corresponding to the object.

[0147] Optionally, the attribute information includes at least one of a file name, a file type, a file size, a creation date, a file owner, a file group, and a file source.

[0148] In an optional implementation, the object includes at least one of a file, a person, an album, a playlist, an application, a style, a scene, a group, a user, an event, an alarm, a task, and an operation.

[0149] For example, the sample code for creating object data is as follows:

[0150] const(

[0151] GraphObjectTypeFile = "file" / / file

[0152] GraphObjectTypeHuman="human" / / Character

[0153] GraphObjectTypeAlbum = "album" / / album

[0154] GraphObjectTypePlaylist="playlist" / / Song list

[0155] GraphObjectTypeApp = "app" / / Application

[0156] GraphObjectTypeStyle = "style" / / style

[0157] GraphObjectTypeScene="scene" / / scene

[0158] GraphObjectTypeChat="chat" / / Group

[0159] GraphObjectTypeUser = "user" / / user

[0160] GraphObjectTypeEvent="event" / / event

[0161] GraphObjectTypeAlarm = "alarm" / / alarm

[0162] GraphObjectTypeTask="task" / / Task

[0163] GraphObjectTypeOperate="operate" / / Operation )

[0165] As a second aspect of the present invention, a query method is also provided, comprising:

[0166] Importing personal data into a personal data model; the personal data model is generated by inputting objects determined according to attribute information of the personal data, first association data between multiple objects determined according to corresponding relationships between multiple attribute information and multiple attribute values, and second association data between multiple objects and multiple attribute values ​​into an initial graph database model;

[0167] The target data is queried according to the structured query language and query conditions; the query conditions include the object to which the target data belongs and the attribute value of the target data.

[0168] By explicitly indicating the objects, first associated data, and second associated data in the personal data in the aforementioned steps, a concise and efficient data model is established, thereby improving the efficiency and accuracy of personal data query. Figure 2 As shown, personal data is input into the personal data model to generate a data relationship graph. All points in the data relationship graph are related, and another point can be found from any point through a certain path.

[0169] In a specific implementation, based on the above data relationship diagram, the following query operations can be performed.

[0170] For example, to query all events that occurred on 2023-10-11, we use the public associated data "created_date" as the relationship hub to link objects in each dimension together. The query operation is as follows:

[0171] Query statement: gV().has('created_date','2023-10-11').all()

[0172] This statement queries all points, and the condition contains the predicate 'created_date' pointing to '2023-10-11'. In this way, all the files created on 2023-10-11 in the device, as well as the events, alarms, tasks, and groups generated can be filtered out;

[0173] For example, to query files created on 2023-10-11, you can add a condition based on the previous example to filter objects with type file. The query operation is as follows:

[0174] Query statement: gV().has('created_date','2023-10-11').has('type','file').all()

[0175] For example, to query photos taken on 2023-10-11 (pictures created on 2023-10-11), you can add a condition to filter files with file_type of image based on the previous example. The query operation is as follows:

[0176] Query statement:

[0177] g.V().has('created_date', '2023-10-11').has('type', 'file').has('file_type',

[0178] 'image').all()

[0179] To further query the photos of Zhang San taken on October 11, 2023, based on the previous example, add the condition that the file belongs to Zhang San. The query operation is as follows:

[0180] Query statement:

[0181] g.V().has('created_date', '2023-10-11').has('type', 'file').has('file_type',

[0182] 'image').hasR('file', 'Zhang San').all()

[0183] To further query the photos of Zhang San taken on October 11, 2023 and uploaded to folder A, based on the previous example, add the condition that file_location is "folder A". The query operation is as follows:

[0184] Query statement:

[0185] g.V().has('created_date', '2023-10-11').has('type', 'file').has('file_type',

[0186] 'image').hasR('file', 'Zhang San').has('file_location', 'folder A').all()

[0187] As a third aspect of the present invention, an electronic device is further provided, as Figure 3 shown, including:

[0188] One or more processors 101;

[0189] A memory 102, on which one or more computer programs are stored. When the one or more computer programs are executed by the one or more processors 101, the one or more processors 101 implement the personal data model generation method according to the first aspect of the present invention and the query method according to the second aspect.

[0190] The electronic device may further include one or more I / O interfaces 103 connected between the processor 101 and the memory 102 and configured to implement information interaction between the processor 101 and the memory 102 .

[0191] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface 103 (read-write interface) is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.

[0192] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.

[0193] As a fourth aspect of the present invention, Figure 4 As shown, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the personal data model generation method described in the first aspect and the query method described in the second aspect of the present disclosure are implemented.

[0194] It can be understood by a person of ordinary skill in the art that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can implement the method of any of the above-mentioned embodiments when executed. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0195] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.

Claims

1. A method for generating a personal data model based on a graph database, characterized in that: include: Access personal data; Determine, based on the personal data, a plurality of attribute information and a plurality of attribute values ​​corresponding to the attribute information one by one; determining a plurality of objects of different types according to feature similarities of the attribute information; Determine, according to the correspondence between the plurality of attribute information and the plurality of attribute values, first association data between the plurality of objects, and second association data between the plurality of objects and the plurality of corresponding attribute values; Input the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model.

2. The method for generating a personal data model according to claim 1, characterized in that: According to the correspondence between the plurality of attribute information and the plurality of attribute values, first association data between the plurality of objects and second association data between the plurality of objects and the plurality of attribute values ​​are determined, and then the method includes: Determine a plurality of the first associated data and a plurality of the second associated data whose repetitions meet a preset value as a plurality of target associated data; the repetition is the ratio of the number of the first associated data and the second associated data to the sum of the number of the first associated data and the second associated data respectively; The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes: Input the plurality of objects and the plurality of target association data into the initial graph database model to generate a personal data model.

3. The method for generating a personal data model according to claim 2, characterized in that: The step of determining the first associated data and the second associated data whose repetitions meet a preset value as target associated data comprises: Determining common associated data from the target associated data according to similarities between the plurality of target associated data; The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes: The object, the target-related data, and the public-related data are input into an initial graph database model to generate a personal data model.

4. The method for generating a personal data model according to claim 1, characterized in that: The step of inputting the plurality of objects, the plurality of the first associated data, and the plurality of the second associated data into an initial graph database model to generate a personal data model includes: Using the plurality of objects as a plurality of intermediate node data of an initial graph database model; A personal data model is generated by using a plurality of the first related data and a plurality of the second related data as a plurality of edge data of the initial graph data model.

5. The method for generating a personal data model according to claim 1, characterized in that: The target association data and the public association data include pointing information between the objects and the objects, and between the objects and corresponding attribute values.

6. The method for generating a personal data model according to any one of claims 1 to 5, characterized in that: The attribute information includes at least one of a file name, a file type, a file size, a creation date, a file owner, a file group, and a file source.

7. The method for generating a personal data model according to any one of claims 1 to 5, characterized in that: The object includes at least one of a file, a person, an album, a playlist, an application, a style, a scene, a group, a user, an event, an alarm, a task, and an operation.

8. A query method, characterized in that: include: Importing personal data into a personal data model; the personal data model is generated by inputting objects determined according to attribute information of the personal data, first association data between multiple objects determined according to corresponding relationships between multiple attribute information and multiple attribute values, and second association data between multiple objects and multiple attribute values ​​into an initial graph database model; Query target data according to structured query language and query conditions; The query condition includes the object to which the target data belongs and the attribute value of the target data.

9. An electronic device, characterized in that: include: one or more processors; A memory having one or more computer programs stored thereon, wherein when the one or more computer programs are executed by the one or more processors, the one or more processors implement the personal data model generation method according to any one of claims 1 to 7 and the query method according to claim 8.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the personal data model generation method described in any one of claims 1 to 7 and the query method described in claim 8 are implemented.

Citation Information

Patent Citations

  • User portrait construction method and system based on graph database and storage medium

    CN109871415A

  • E-commerce commodity attribute data processing method and device based on graph database

    CN113609175A

  • User contributed knowledge database

    US20090024590A1