Data query method, device, storage medium and product based on graph database
Through the data query method based on the graph database, the user-defined query conditions are parsed and the correlation between funds and attribute information is established in the graph database, which solves the problem that the existing fund screening method cannot meet the needs of personalized query and improves the efficiency of fund query. efficiency and user experience.
Patent Information
- Application Number
- CN202110149296.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-03
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-02-03
AI Technical Summary
Existing fund screening methods can only select query conditions from pre-configured fields and query methods, which cannot meet users' personalized query needs, resulting in a low match between query results and user needs.
The data query method based on the graph database is used to obtain user-defined query conditions for semantic analysis, and establish the relationship between funds and attribute information in the graph database to support user-defined query conditions and improve retrieval efficiency.
It can meet the personalized fund query needs of users, improve the efficiency and user experience of fund queries, and improve the matching between query results and user needs.
Smart Images

Figure CN112800285B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big data, and in particular to a data query method, device, storage medium and product based on a graph database. Background Art
[0002] As the financial market continues to grow, the scale of fund products is getting bigger and bigger. Due to the large number of funds, investors often have a difficult time choosing funds.
[0003] In order to enable investors to accurately screen investment fund products, the prior art generally provides users with a fund filter, which is pre-configured with query fields and query methods set by developers according to business scenarios or needs. Users can select any of the above fields and query methods to implement fund screening operations.
[0004] However, when using the above method to screen funds, investors can only select query conditions from pre-configured query fields and query methods, and cannot query flexibly and independently, and cannot meet users' personalized query needs, resulting in a low match between query results and user needs. Summary of the invention
[0005] The present invention discloses a data query method, device, storage medium and product based on a graph database, which are used to solve the technical problem that the existing fund screening method can only select query conditions from pre-configured query fields and query methods, but cannot conduct independent and flexible query.
[0006] The first aspect of the present disclosure is to provide a data query method based on a graph database, comprising:
[0007] Acquire a query request sent by a terminal device, wherein the query request includes a query condition corresponding to the fund information to be queried defined by a user, and the query condition includes at least one attribute information;
[0008] Performing semantic parsing operation on the query condition of the fund information to be queried defined by the user to obtain a parsing result;
[0009] According to the analysis result, a data query operation is performed in a preset graph database to obtain a query result, wherein the graph database stores a plurality of fund nodes, and each fund node corresponds to a plurality of attribute information;
[0010] The query result is sent to the terminal device so that the terminal device displays the query result on a preset display interface.
[0011] A second aspect of the present disclosure is to provide a data query method based on a graph database, comprising:
[0012] Displaying a preset query condition configuration interface on the display interface, wherein the query condition configuration interface includes a plurality of fund attribute information input boxes;
[0013] Obtaining the user-defined query conditions entered by the user in each of the fund attribute information input boxes, and generating a query request according to the query conditions;
[0014] Sending the query request to a server so that the server performs a semantic analysis operation on the query request to obtain a parsing result, and performing a data query operation in a preset graph database according to the parsing result to obtain a query result, wherein the graph database stores a plurality of fund nodes, and each fund node corresponds to a plurality of attribute information;
[0015] The query result sent by the data query device is obtained, and the query result is displayed on the display interface.
[0016] The third aspect of the present disclosure is to provide a data query device based on a graph database, comprising:
[0017] An acquisition module, used for acquiring a query request sent by a terminal device, wherein the query request includes a user-defined query condition corresponding to the fund information to be queried, and the query condition includes at least one attribute information;
[0018] A parsing module, used for performing semantic parsing operation on the query conditions of the fund information to be queried defined by the user to obtain a parsing result;
[0019] A query module, used to perform a data query operation in a preset graph database according to the analysis result to obtain a query result, wherein the graph database stores a plurality of fund nodes, and each fund node corresponds to a plurality of attribute information;
[0020] The sending module is used to send the query result to the terminal device so that the terminal device displays the query result on a preset display interface.
[0021] A fourth aspect of the present disclosure is to provide a terminal device, including:
[0022] A display module, used to display a preset query condition configuration interface on a display interface, wherein the query condition configuration interface includes a plurality of fund attribute information input boxes;
[0023] An input module, used to obtain the user-defined query conditions entered by the user in each of the fund attribute information input boxes, and generate a query request according to the query conditions;
[0024] A communication module, used for sending the query request to a server, so that the server performs a semantic analysis operation on the query request to obtain a parsing result, and performs a data query operation in a preset graph database according to the parsing result to obtain a query result, wherein the graph database stores a plurality of fund nodes, and each fund node corresponds to a plurality of attribute information;
[0025] The result acquisition module is used to acquire the query result sent by the data query device and display the query result on the display interface.
[0026] A fifth aspect of the present disclosure is to provide an electronic device, comprising: a memory, a processor;
[0027] Memory; Memory for storing instructions executable by the processor;
[0028] Among them, the processor is used to call the program instructions in the memory to execute the data query method based on the graph database as described in the first aspect.
[0029] The sixth aspect of the present disclosure is to provide a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the data query method based on the graph database as described in the first aspect.
[0030] The seventh aspect of the present disclosure is to provide a computer program product, including a computer program, which, when executed by a processor, implements the data query method based on the graph database as described in the first aspect.
[0031] The data query method, device, storage medium and product based on the graph database provided by the present disclosure establish the association relationship between the fund and each attribute information by adopting the graph database. Since the graph database is characterized by its very high retrieval efficiency and is almost unaffected by the total amount of data, it can support various user-defined query conditions. In this way, the efficiency of fund query can be improved on the basis of meeting the personalized fund query needs of users, and the user experience can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure, and a person skilled in the art can also obtain other drawings based on these drawings.
[0033] Figure 1 A schematic diagram of the system architecture on which the present disclosure is based;
[0034] Figure 2 A schematic diagram of a flow chart of a data query method based on a graph database provided in the first embodiment of the present disclosure;
[0035] Figure 3 A schematic diagram of an application scenario provided for an embodiment of the present disclosure;
[0036] Figure 4 A schematic diagram of the flow of a data query method based on a graph database provided in the second embodiment of the present disclosure;
[0037] Figure 5 A schematic diagram of the structure of a fund node in the graph database provided in an embodiment of the present disclosure;
[0038] Figure 6 Another system architecture diagram provided for an embodiment of the present disclosure;
[0039] Figure 7 A schematic diagram of the flow of a data query method based on a graph database provided in Embodiment 3 of the present disclosure;
[0040] Figure 8 A schematic diagram of a query condition configuration interface provided in an embodiment of the present disclosure;
[0041] Fig. 9 A schematic diagram of the structure of a data query device based on a graph database provided in Embodiment 4 of the present disclosure;
[0042] Fig.10 A schematic diagram of the structure of a terminal device provided in Embodiment 5 of the present disclosure;
[0043] Fig.11 This is a schematic diagram of the structure of an electronic device provided in Embodiment 6 of the present disclosure. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. All other embodiments obtained based on the embodiments in the present disclosure belong to the scope of protection of the present disclosure.
[0045] In response to the technical problem that the existing fund screening method mentioned above can only select query conditions from pre-configured query fields and query methods, and cannot conduct independent and flexible queries, the present disclosure provides a data query method, device, storage medium and product based on a graph database.
[0046] It should be noted that the data query method, device, storage medium and product provided by the present disclosure based on the graph database can be used in various scenarios of fund screening according to the attribute information of the fund.
[0047] In order to enable investment users to implement the screening operation of fund products, the prior art generally provides a fund filter, through which investment users can input content that meets the query specifications of the fund filter to implement the query operation of the fund. However, on the one hand, when using the above method to query funds, it is only possible to query based on the defined conditional query indicators, and it is not possible to query independently and flexibly. On the other hand, since each fund often corresponds to irregular data such as daily net value information and quarterly reports that change, it also corresponds to some static data, which cannot be aligned in time. All the information corresponding to the above funds is stored in different tables. When screening funds according to the defined conditional query indicators, it is impossible to determine the relationship between the tables, and thus it is impossible to accurately implement the screening operation of the funds.
[0048] In the process of solving the above technical problems, the inventors found through research that in order to enable investment users to screen funds according to their own personalized needs, a graph database can be selected to store fund information. In the graph database, an association relationship between a fund and its corresponding attribute information can be established. In addition, since the retrieval efficiency of the graph database is not affected by the total amount of data, the retrieval efficiency can be improved. Therefore, various user-defined query conditions can be supported. Therefore, on the basis of meeting the user's personalized fund query needs, the efficiency of fund query can be improved, and the user experience can be further improved.
[0049] Figure 1 This is a schematic diagram of the system architecture based on which the present disclosure is based. Figure 1 As shown, the system architecture based on the present disclosure at least includes: a terminal device 1 and a server 2, wherein the server 2 is provided with a data query device based on a graph database, and the data query device based on a graph database can be written in languages such as C / C++, Java, Shell or Python; the terminal device 1 can be, for example, a desktop computer, a tablet computer, etc. The terminal device 1 can be connected to the server 2 in communication, so that the two can exchange information.
[0050] Figure 2 A flowchart of a data query method based on a graph database provided in the first embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:
[0051] Step 201: Acquire a query request sent by a terminal device, wherein the query request includes a user-defined query condition corresponding to the fund information to be queried, and the query condition includes at least one attribute information.
[0052] The execution subject of this embodiment is a data query device based on a graph database. The data query device based on a graph database can be coupled to a server. The server can be communicatively connected with a terminal device, thereby being able to exchange information with the terminal device.
[0053] In this embodiment, when the user needs to filter funds, he can input the query conditions corresponding to the fund information to be queried on the terminal device according to actual needs, wherein the query conditions may include at least one attribute value corresponding to the fund information to be queried. For example, the query conditions may be fund style: growth type; unit net value: 2; growth: 100%.
[0054] The terminal device can generate a query request according to the query condition input by the user, and send the query request to a server provided with a data query device based on a graph database. Accordingly, the data query device based on the graph database can obtain the query request.
[0055] Specifically, the user may be an investor.
[0056] Step 202: perform semantic parsing on the query conditions of the user-defined fund information to be queried to obtain parsing results.
[0057] In this embodiment, since the query request input by the user is generally a text field, the data query device based on the graph database cannot directly perform a fund query operation based on the query condition. Therefore, after obtaining the query request, the query condition can first be semantically parsed to obtain the parsing result.
[0058] Step 203: Based on the analysis result, a data query operation is performed in a preset graph database to obtain a query result, wherein the graph database stores a plurality of fund nodes, and each fund node corresponds to a plurality of attribute information.
[0059] In this embodiment, after completing the semantic parsing operation on the query conditions and obtaining the parsing results, a data query operation can be performed in a preset graph database based on the parsing results to obtain the query results.
[0060] Specifically, the basic meaning of a graph database is to store and query data in a data structure called a "graph", rather than a database that stores images. Its data model is mainly represented by nodes and relationships (edges), and can also process key-value pairs. The preset graph database can store multiple fund nodes, and each fund node corresponds to multiple attribute information. The fund node and its corresponding attribute information can be connected through edges.
[0061] By establishing the association between fund nodes and attribute information in the graph database, and based on the high query efficiency of the graph database, it is possible to support the need for data query based on user-defined query conditions.
[0062] Step 204: Send the query result to the terminal device, so that the terminal device displays the query result on a preset display interface.
[0063] In this embodiment, after obtaining the query result in the graph database, the query result can be sent to the terminal device to facilitate the user to perform subsequent fund viewing and purchase operations. Correspondingly, after obtaining the query result, the terminal device can display the query result on the display interface.
[0064] Figure 3 A schematic diagram of an application scenario provided by an embodiment of the present disclosure, such as Figure 3 As shown, the terminal device 33 can initiate a query request, which includes a user-defined query condition: indicator 1>80% AND (indicator 2>indicator 3 / indicator 4 OR indicator 5<100). According to the query request, semantic analysis 32 is performed to obtain a parsing result. According to the parsing result, a data query operation is performed in the graph database 31 to obtain a query result. The query result is fed back to the terminal device 33 for display.
[0065] The data query method based on the graph database provided in this embodiment establishes the association between the fund and each attribute information by adopting the graph database. Since the graph database is characterized by its very high retrieval efficiency and is almost unaffected by the total amount of data, it can support various user-defined query conditions. Therefore, it can improve the efficiency of fund query on the basis of meeting the personalized fund query needs of users, improve the matching degree between query results and user needs, and further improve the user experience.
[0066] Further, based on the above embodiment 1, step 202 specifically includes:
[0067] According to the mapping relationship between the preset query conditions and the attribute information identifiers in the graph database, a semantic parsing operation is performed on the query conditions to obtain the parsing result.
[0068] In this embodiment, in order to implement the semantic parsing operation of the query condition, a mapping relationship between the query condition and each attribute information identifier in the graph database can be established in advance. Therefore, after obtaining the query request, the parsing operation of the query condition can be implemented according to the mapping relationship between the query condition and each attribute information identifier in the graph database.
[0069] Continuing with the above example, the query condition can be: Fund Style: Growth; Unit Net Value: 2; Growth: 100%. After semantic parsing of the query condition, the parsing result can be: P0001 = Growth; P20006 = 2; P20007 = 100%. Among them, P0001 is the fund style, P20006 is the unit net value, and P20007 is growth.
[0070] The data query method based on the graph database provided in this embodiment can, after obtaining the query request, implement the analysis operation of the query condition according to the mapping relationship between the query condition and each attribute information identifier in the graph database, thereby realizing the data query operation in the graph database and improving the efficiency of data query.
[0071] Figure 4 The flowchart of the data query method based on the graph database provided in the second embodiment of the present disclosure is as follows. Based on the first embodiment, before step 203, the following steps are further included:
[0072] Step 401: Obtain a graph database establishment request.
[0073] Step 402: Establish a request according to the graph database to obtain all attribute information corresponding to multiple funds to be processed.
[0074] Step 403: For each fund to be processed, the fund to be processed is used as the main node in the graph database, and each attribute information corresponding to the fund to be processed is used as the attribute node corresponding to the main node. According to the identification information of the fund to be processed and the time information corresponding to each attribute information, an edge between each attribute node and the main node is established to obtain the graph database.
[0075] In this embodiment, before using the graph database for data query, it is necessary to first establish the graph database. Specifically, a graph database establishment request can be obtained. According to the graph database establishment request, all attribute information corresponding to multiple funds to be processed is obtained from a preset data server.
[0076] Each fund is set as a main node, and the attribute information corresponding to each fund is used as the attribute node corresponding to the main node of the fund. The edge between the attribute node and the main node is constructed through the identification information of the fund to be processed and the time information corresponding to each attribute information to obtain the graph database.
[0077] Figure 5 A schematic diagram of the structure of a fund node in the graph database provided by the embodiment of the present disclosure is shown in FIG. Figure 5As shown, the fund node can be the main node 51, and the multiple attributes corresponding to it can be the attribute nodes 52 corresponding to the main node. The edge between the main node 51 and each attribute node 52 can have the time attribute and identification information of the main node.
[0078] Further, based on any of the above embodiments, before step 303, the method further includes:
[0079] A fund adding request is obtained, wherein the fund adding request includes all attribute information corresponding to the fund to be added.
[0080] According to the fund adding request, a new main node is established in the graph database according to the fund to be added, and each attribute information corresponding to the fund to be added is used as the attribute node corresponding to the new main node. According to the identification information of the fund to be added and the time information corresponding to each attribute information, an edge is established between each attribute node and the new main node to complete the adding operation of the fund to be added.
[0081] In this embodiment, if the graph database needs to be updated, a new master node can be established based on the fund to be added, without affecting the original graph database.
[0082] Specifically, a fund adding request may be obtained, wherein the fund adding request includes all attribute information corresponding to the fund to be added. According to the fund adding request, a new main node is established in the graph database according to the fund to be added, and each attribute information corresponding to the fund to be added is used as an attribute node corresponding to the new main node. According to the identification information of the fund to be added and the time information corresponding to each attribute information, an edge is established between each attribute node and the new main node, thereby completing the adding operation of the fund to be added.
[0083] The data query method based on the graph database provided in this embodiment can establish the association relationship between each fund to be processed and the attribute information by constructing a graph database according to all the funds to be processed, and benefit from the high query efficiency of the graph database, thereby supporting the demand for data query according to user-defined query conditions.
[0084] Further, based on any of the above embodiments, after step 204, the method further includes:
[0085] The query request and the query result are associated and stored in a data server.
[0086] In this embodiment, in order to further improve the query efficiency of the fund, after completing a data query operation according to the query request, the query request and the query result can be associated and stored in the data server. Therefore, when the same query request is received again in the future, there is no need to perform a data query operation from the graph database, and the query result corresponding to the query request can be directly obtained from the data server.
[0087] Figure 6 Another system architecture diagram provided for an embodiment of the present disclosure is as follows: Figure 6 The system architecture diagram based on this embodiment at least includes a terminal device 61, a server 62 and a data server 63, wherein a data query device based on a graph database is provided in the server 62. The server 2 is respectively connected to the terminal device 61 and the data server 63 for communication, so that information can be exchanged with the terminal device 61 and the data server 63 respectively.
[0088] Further, based on any of the above embodiments, after step 201, the method further includes:
[0089] Determine whether the query request is already stored in the data server.
[0090] If so, obtain the query result corresponding to the query request, and send the query result to the terminal device.
[0091] In this embodiment, after obtaining the query request, it can first be determined whether the query result corresponding to the query request has been stored in the data server. If so, the query result corresponding to the query request can be directly obtained from the data server, and the query result can be sent to the terminal device for display. On the contrary, if not, a data query operation can be performed in the graph database according to the query request.
[0092] The data query method based on the graph database provided in this embodiment associates and stores the query request and the query result in the data server. Therefore, when the same query request is received again in the future, there is no need to perform data query operation from the graph database, thereby further improving the efficiency of fund query and user experience.
[0093] Figure 7 A flow chart of a data query method based on a graph database provided in the third embodiment of the present disclosure, such as Figure 7 As shown, the method includes:
[0094] Step 701: Display a preset query condition configuration interface on a display interface, wherein the query condition configuration interface includes a plurality of fund attribute information input boxes.
[0095] Step 702: Obtain the user-defined query conditions entered by the user in each of the fund attribute information input boxes, and generate a query request according to the query conditions.
[0096] Step 703: Send the query request to the server so that the server performs a semantic analysis operation on the query request to obtain a analysis result. According to the analysis result, a data query operation is performed in a preset graph database to obtain a query result, wherein the graph database stores a plurality of fund nodes, and each fund node corresponds to a plurality of attribute information.
[0097] Step 704: Obtain the query result sent by the data query device, and display the query result on the display interface.
[0098] The execution subject of this embodiment is a terminal device, which can be connected to a server in communication, and the server can be coupled to a data query device based on a graph database, so that the terminal device can exchange information with the data query device based on a graph database.
[0099] Figure 8 A schematic diagram of a query condition configuration interface provided in an embodiment of the present disclosure, such as Figure 8 As shown, a plurality of fund attribute information input boxes may be displayed on the query condition configuration interface schematic diagram, and the user may input query conditions in the plurality of fund attribute information input boxes according to actual needs.
[0100] In this embodiment, the query condition configuration interface can be displayed on the terminal device first, so that the user can enter the custom query condition on the display interface according to the actual needs. According to the query condition, a query request is generated, and the query request is sent to a server provided with a data query device based on a graph database. The data query device based on the graph database can perform a semantic parsing operation on the query request according to the query request to obtain a parsing result, and perform a data query operation in a preset graph database according to the parsing result to obtain a query result, wherein the graph database stores multiple fund nodes, and each fund node corresponds to multiple attribute information.
[0101] Accordingly, after the data query device based on the graph database obtains the query result, the server provided with the data query device based on the graph database can send the query result to the terminal device. In order to facilitate the user to perform subsequent operations such as viewing and buying funds, the terminal device can display the query result on the display interface after obtaining the query result.
[0102] The data query method based on the graph database provided in this embodiment obtains the user's customized query conditions, generates a query request and sends it to a server provided with a data query device based on the graph database, so that the data query device based on the graph database can perform a semantic analysis operation on the query request according to the query request to obtain the analysis result, and perform a data query operation in the preset graph database according to the analysis result to obtain the query result. The query result is sent to the terminal device for display. By adopting the graph database, an association relationship between the fund and each attribute information is established. Since the characteristic of the graph database is that its retrieval efficiency is very high and is almost unaffected by the total amount of data, it can support various customized query conditions of the user. Thereby, on the basis of meeting the personalized fund query needs of the user, the efficiency of fund query can be improved, and the user experience can be further improved.
[0103] Fig. 9 This is a schematic diagram of the structure of a data query device based on a graph database provided in Embodiment 4 of the present disclosure, such as Fig. 9 As shown, the data query device 90 based on the graph database includes: an acquisition module 91, a parsing module 92, a query module 93 and a sending module 94. The acquisition module 91 is used to obtain the query request sent by the terminal device, wherein the query request includes the query conditions corresponding to the fund information to be queried defined by the user, and the query conditions include at least one attribute information. The parsing module 92 is used to perform semantic parsing operations on the query conditions of the fund information to be queried defined by the user to obtain parsing results. The query module 93 is used to perform data query operations in a preset graph database according to the parsing results to obtain query results, wherein the graph database stores multiple fund nodes, and each fund node corresponds to multiple attribute information. The sending module 94 is used to send the query results to the terminal device so that the terminal device displays the query results on a preset display interface.
[0104] The data query device based on the graph database provided in this embodiment establishes the association between the fund and each attribute information by adopting the graph database. Since the graph database is characterized by its very high retrieval efficiency and is almost unaffected by the total amount of data, it can support various user-defined query conditions. Therefore, it can improve the efficiency of fund query on the basis of meeting the personalized fund query needs of users, improve the matching degree between query results and user needs, and further improve the user experience.
[0105] Further, on the basis of the fourth embodiment, the parsing module is used to: perform semantic parsing operation on the query condition according to the mapping relationship between the preset query condition and each attribute information identifier in the graph database to obtain the parsing result.
[0106] Furthermore, based on the fourth embodiment, the device further includes:
[0107] A request acquisition module is used to obtain a request to establish a graph database;
[0108] The acquisition module is further used to establish a request according to the graph database to obtain all attribute information corresponding to the multiple funds to be processed;
[0109] The processing module is used to take each fund to be processed as a main node in a graph database, take each attribute information corresponding to the fund to be processed as an attribute node corresponding to the main node, establish an edge between each attribute node and the main node according to the identification information of the fund to be processed and the time information corresponding to each attribute information, and obtain the graph database.
[0110] Further, on the basis of any of the above embodiments, the device further includes: a request acquisition module and a processing module, wherein the request acquisition module is further used to acquire a fund adding request, wherein the fund adding request includes all attribute information corresponding to the fund to be added. The processing module is further used to establish a new main node in the graph database according to the fund to be added according to the fund adding request, use each attribute information corresponding to the fund to be added as an attribute node corresponding to the new main node, establish edges between each attribute node and the new main node according to the identification information of the fund to be added and the time information corresponding to each attribute information, and complete the adding operation of the fund to be added.
[0111] Furthermore, based on any of the above embodiments, the device further includes: a storage module, configured to associate the query request with the query result and store it in a data server.
[0112] Further, based on any of the above embodiments, the device further includes: a judgment module and a query module. The judgment module is used to judge whether the query request has been stored in the data server. The query module is also used to obtain the query result corresponding to the query request if so, and send the query result to the terminal device.
[0113] Fig.10 This is a schematic diagram of the structure of the terminal device 110 provided in the fifth embodiment of the present disclosure, as shown in FIG. Fig.10As shown, the terminal device 110 includes: a display module 111, an input module 112, a communication module 113 and a result acquisition module 114. The display module 111 is used to display a preset query condition configuration interface on the display interface, and the query condition configuration interface includes multiple fund attribute information input boxes. The input module 112 is used to obtain the user-defined query conditions entered by the user in each of the fund attribute information input boxes, and generate a query request according to the query conditions. The communication module 113 is used to send the query request to the server so that the server performs a semantic parsing operation on the query request to obtain a parsing result, and performs a data query operation in a preset graph database according to the parsing result to obtain a query result, wherein the graph database stores multiple fund nodes, and each fund node corresponds to multiple attribute information. The result acquisition module 114 is used to obtain the query result sent by the data query device and display the query result on the display interface.
[0114] Fig.11 A structural diagram of an electronic device provided in Embodiment 6 of the present disclosure, such as Fig.11 As shown, the device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0115] The device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0116] The processing component 1202 generally controls the overall operation of the device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.
[0117] The memory 1204 is configured to store various types of data to support the operation of the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0118] The power supply component 1206 provides power to the various components of the device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1200.
[0119] The multimedia component 1208 includes a screen that provides an output interface between the device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0120] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0121] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0122] The sensor assembly 1214 includes one or more sensors for providing various aspects of the status assessment of the device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the device 1200, the relative positioning of components, such as the display and keypad of the device 1200, the sensor assembly 1214 can also detect the position change of the device 1200 or a component of the device 1200, the presence or absence of user contact with the device 1200, the orientation or acceleration / deceleration of the device 1200, and the temperature change of the device 1200. The sensor assembly 1214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0123] The communication component 1216 is configured to facilitate wired or wireless communication between the device 1200 and other devices. The device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0124] In an exemplary embodiment, the device 1200 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned methods.
[0125] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including instructions, and the instructions can be executed by the processor 1220 of the device 1200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0126] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a terminal device, enables the terminal device to execute the above-mentioned data query method based on a graph database of the terminal device.
[0127] Another embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, can execute the data query method based on the graph database of the above-mentioned terminal device.
[0128] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0129] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A data query method based on a graph database, characterized in that: include: Acquire a query request sent by a terminal device, wherein the query request includes a query condition corresponding to the fund information to be queried defined by a user, and the query condition includes at least one attribute information; Performing semantic parsing operation on the query conditions of the user-defined fund information to be queried, and obtaining parsing results that can directly perform fund query operations based on the graph database; According to the analysis result, a data query operation is performed in a preset graph database to obtain a query result, wherein the graph database stores a plurality of fund nodes, each fund node corresponds to a plurality of attribute information, and the graph database also stores an association relationship between the fund node and each of the attribute information; Sending the query result to the terminal device so that the terminal device displays the query result on a preset display interface; The performing semantic parsing operation on the query condition of the fund information to be queried defined by the user to obtain the parsing result includes: According to the mapping relationship between the preset query condition and each attribute information identifier in the graph database, a semantic parsing operation is performed on the query condition to obtain the parsing result, where the parsing result is the query condition represented by the attribute information identifier; After sending the query result to the terminal device, the method further includes: Associating the query request with the query result and storing it in a data server; Correspondingly, after obtaining the query request sent by the terminal device, the method further includes: Determining whether the query request has been stored in the data server; If so, obtain the query result corresponding to the query request, and send the query result to the terminal device.
2. The method according to claim 1, characterized in that According to the analysis result, before performing a data query operation in a preset graph database to obtain the query result, the method further includes: Get the graph database establishment request; According to the graph database establishment request, all attribute information corresponding to the multiple funds to be processed is obtained; For each fund to be processed, the fund to be processed is used as the main node in the graph database, and each attribute information corresponding to the fund to be processed is used as the attribute node corresponding to the main node. According to the identification information of the fund to be processed and the time information corresponding to each attribute information, an edge between each attribute node and the main node is established to obtain the graph database.
3. The method according to claim 2, characterized in that For each fund to be processed, the fund to be processed is used as a main node in the graph database, and each attribute information corresponding to the fund to be processed is used as an attribute node corresponding to the main node. According to the identification information of the fund to be processed and the time information corresponding to each attribute information, an edge between each attribute node and the main node is established. After obtaining the graph database, the method further includes: Obtain a fund adding request, wherein the fund adding request includes all attribute information corresponding to the fund to be added; According to the fund adding request, a new main node is established in the graph database according to the fund to be added, and each attribute information corresponding to the fund to be added is used as the attribute node corresponding to the new main node. According to the identification information of the fund to be added and the time information corresponding to each attribute information, an edge is established between each attribute node and the new main node to complete the adding operation of the fund to be added.
4. A data query method based on a graph database, characterized in that: include: Displaying a preset query condition configuration interface on the display interface, wherein the query condition configuration interface includes a plurality of fund attribute information input boxes; Obtaining the user-defined query conditions entered by the user in each of the fund attribute information input boxes, and generating a query request according to the query conditions; The query request is sent to the server so that the server first determines whether the query request has been stored. If so, the query result corresponding to the query request is obtained and the query result is sent to the terminal device. If not, a semantic parsing operation is performed on the query request according to the mapping relationship between the preset query condition and each attribute information identifier in the graph database to obtain a parsing result that can directly perform a fund query operation based on the graph database. According to the parsing result, a data query operation is performed in the preset graph database to obtain a query result, wherein the graph database stores a plurality of fund nodes, each of which corresponds to a plurality of attribute information respectively, and the graph database also stores the association relationship between the fund node and each of the attribute information, and the parsing result is a query condition represented by the attribute information identifier; The query result sent by the data query device is obtained, and the query result is displayed on the display interface.
5. A data query device based on a graph database, characterized in that: include: An acquisition module, used for acquiring a query request sent by a terminal device, wherein the query request includes a user-defined query condition corresponding to the fund information to be queried, and the query condition includes at least one attribute information; A parsing module, used to perform semantic parsing operations on the query conditions of the user-defined fund information to be queried, and obtain parsing results that can directly perform fund query operations based on the graph database; A query module, used to perform a data query operation in a preset graph database according to the analysis result to obtain a query result, wherein the graph database stores a plurality of fund nodes, each of which corresponds to a plurality of attribute information, and the graph database also stores an association relationship between the fund node and each of the attribute information; The sending module is used to send the query result to the terminal device so that the terminal device displays the query result on a preset display interface; the parsing module is used to: According to the mapping relationship between the preset query condition and each attribute information identifier in the graph database, a semantic parsing operation is performed on the query condition to obtain the parsing result, where the parsing result is the query condition represented by the attribute information identifier; The device also includes: A storage module, used for associating the query request with the query result and storing it in a data server; A determination module, configured to determine whether the query request has been stored in the data server after the acquisition module acquires the query request sent by the terminal device; The query module is further used to obtain the query result corresponding to the query request and send the query result to the terminal device.
6. The device according to claim 5, characterized in that The device also includes: A request acquisition module is used to obtain a request to establish a graph database; The acquisition module is further used to establish a request according to the graph database to obtain all attribute information corresponding to the multiple funds to be processed; The processing module is used to take each fund to be processed as a main node in a graph database, take each attribute information corresponding to the fund to be processed as an attribute node corresponding to the main node, establish an edge between each attribute node and the main node according to the identification information of the fund to be processed and the time information corresponding to each attribute information, and obtain the graph database.
7. The device according to claim 6, characterized in that The device also includes: The request acquisition module is further used to acquire a fund adding request, wherein the fund adding request includes all attribute information corresponding to the fund to be added; The processing module is also used to establish a new main node in the graph database according to the fund to be added according to the fund adding request, use the attribute information corresponding to the fund to be added as the attribute node corresponding to the new main node, and establish edges between each attribute node and the new main node according to the identification information of the fund to be added and the time information corresponding to each attribute information, so as to complete the addition operation of the fund to be added.
8. A terminal device, characterized in that: include: A display module, used to display a preset query condition configuration interface on a display interface, wherein the query condition configuration interface includes a plurality of fund attribute information input boxes; An input module, used to obtain the user-defined query conditions entered by the user in each of the fund attribute information input boxes, and generate a query request according to the query conditions; A communication module, used for sending the query request to the server, so that the server first determines whether the query request has been stored, and if so, obtains the query result corresponding to the query request, and sends the query result to the terminal device, and if not, performs a semantic parsing operation on the query request according to the mapping relationship between the preset query condition and each attribute information identifier in the graph database, obtains a parsing result that can directly perform a fund query operation based on the graph database, and performs a data query operation in the preset graph database according to the parsing result to obtain a query result, wherein the graph database stores a plurality of fund nodes, each fund node corresponds to a plurality of attribute information, and the graph database also stores the association relationship between the fund node and each of the attribute information, and the parsing result is a query condition represented by the attribute information identifier; The result acquisition module is used to acquire the query result sent by the data query device and display the query result on the display interface.
9. An electronic device, characterized in that: include: Memory, processor; Memory; a memory for storing instructions executable by the processor; Wherein, the processor is used to call the program instructions in the memory to execute the data query method based on the graph database as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data query method based on a graph database as described in any one of claims 1 to 4.
11. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the data query method based on the graph database according to any one of claims 1 to 4.
Citation Information
Patent Citations
Query method and device based on graph database, computer equipment and storage medium
CN110765295A
Data query method and device and storage medium
CN112416962A
