CN-116204552-B - Method, device, equipment and medium for determining query statement of graph data
Abstract
The application discloses a method, a device, equipment and a medium for determining a graph data query statement, which relate to the technical field of computers and comprise the steps of obtaining graph data query information and judging whether the graph data query information is legal, screening out the graph data query statement from a local preset graph data query statement library based on the graph data query information if the graph data query information is legal, obtaining statement query configuration information, determining a graph data query statement to be configured from the graph data query statement based on the statement query configuration information, and configuring the graph data query statement to be configured according to the statement query configuration information to obtain a target graph data query statement. By the technical scheme, the efficiency of determining the graph data query statement can be improved, the diversity of service requirements is increased, and the safety of the graph data query statement is improved.
Inventors
- DAI DI
Assignees
- 上海销氪信息科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230314
Claims (8)
- 1. A method for determining a query statement of graph data, comprising: Acquiring graph data query information and judging whether the graph data query information is legal or not; If the graph data query information is legal, screening graph data query sentences from a locally preset graph data query sentence library based on the graph data query information; Acquiring statement inquiry configuration information, determining a to-be-configured graph data inquiry statement from the graph data inquiry statement based on the statement inquiry configuration information, and configuring the to-be-configured graph data inquiry statement according to the statement inquiry configuration information to obtain a target graph data inquiry statement; the legal judgment comprises entity legal judgment, edge legal judgment, associated edge legal judgment, filter legal judgment, paging device legal judgment and occupation parameter legal judgment; The method comprises the steps of acquiring statement inquiry configuration information, determining a statement unique identifier and statement configuration parameters from the statement inquiry configuration information, wherein the statement inquiry configuration information is acquired by a preset information acquisition interface or a hypertext transfer protocol interface; The method comprises the steps of determining a diagram data query statement to be configured from the diagram data query statement based on statement query configuration information, and configuring the diagram data query statement according to the statement query configuration information, wherein the diagram data query statement corresponding to the statement unique identifier is selected from the diagram data query statement to serve as the diagram data query statement to be configured, and the diagram data query statement to be configured is configured by utilizing statement configuration parameters.
- 2. The method for determining a query statement of map data according to claim 1, wherein the obtaining the query information of map data comprises: acquiring the graph data query information which is sent by a client and contains a JSON format character string; and storing the graph data query information containing the JSON format character string to a locally preset database.
- 3. The method of claim 1, wherein the determining whether the graph data query information is legal comprises: Determining a target judgment rule from all preset judgment rules based on the graph data query information; judging whether the query information of the graph data is legal or not according to the target judging rule.
- 4. The method for determining a graph data query statement according to claim 1, wherein the step of screening the graph data query statement from a locally preset graph data query statement library based on the graph data query information comprises: executing a local preset mapping program; and mapping and inquiring the graph data query statement corresponding to the graph data query information from the local graph data query statement library by using the mapping program and based on the graph data query information.
- 5. The method according to any one of claims 1 to 4, wherein after the obtaining the target graph data query statement, further comprising: Determining a data presentation mode according to service requirements; and presenting the data information containing the target graph data query statement to the client according to the data presentation mode.
- 6. A graph data query statement determination apparatus, comprising: The judging module is used for acquiring the graph data query information and judging whether the graph data query information is legal or not; The query statement screening module is used for screening the graph data query statement from a locally preset graph data query statement library based on the graph data query information if the graph data query information is legal; The target graph data query statement determining module is used for acquiring statement query configuration information, determining a graph data query statement to be configured from the graph data query statement based on the statement query configuration information, and configuring the graph data query statement to be configured according to the statement query configuration information to obtain the target graph data query statement; the legal judgment comprises entity legal judgment, edge legal judgment, associated edge legal judgment, filter legal judgment, paging device legal judgment and occupation parameter legal judgment; The method comprises the steps of acquiring statement inquiry configuration information, determining a statement unique identifier and statement configuration parameters from the statement inquiry configuration information, wherein the statement inquiry configuration information is acquired by a preset information acquisition interface or a hypertext transfer protocol interface; The method comprises the steps of determining a diagram data query statement to be configured from the diagram data query statement based on statement query configuration information, and configuring the diagram data query statement according to the statement query configuration information, wherein the diagram data query statement corresponding to the statement unique identifier is selected from the diagram data query statement to serve as the diagram data query statement to be configured, and the diagram data query statement to be configured is configured by utilizing statement configuration parameters.
- 7. An electronic device, comprising: A memory for storing a computer program; A processor for executing the computer program to implement the graph data query statement determination method as claimed in any one of claims 1 to 5.
- 8. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the graph data query statement determination method of any one of claims 1 to 5.
Description
Method, device, equipment and medium for determining query statement of graph data Technical Field The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for determining a query statement of graph data. Background Database query statements are a special purpose programming language that is a standard computer language for managing access to and processing of databases. The graph database query language is a computer language specific to the graph database, such as Cypher, gremlin, DQL (data query language standard syntax) which can be used to manage graph data. Business personnel refer to staff who are responsible for specific special economic business in an organization, such as specific business of production, planning, sales, purchasing, financial accounting, statistics, price, advertising, and the like. Correspondingly, the technician refers to a professional technician who grasps the computer programming technology and can write the computer codes and sentences. The existing database query languages are written by a professional and stored in a server. Business personnel lack the ability to write a database query language and upload database query statements into a server. Currently, some software and internet services permit business personnel to submit custom query sentences, but the query sentences are easy to modify, lack of security verification, can only be applied to internal systems in a small range, and cannot be oriented to a large number of business personnel. From the above, how to improve the efficiency of determining the graph data query statement, increase the diversity of service requirements, and improve the security of the graph data query statement is a problem to be solved in the art in the process of determining the graph data query statement. Disclosure of Invention Accordingly, the present invention aims to provide a method, a device and a medium for determining a graph data query statement, which can improve the efficiency of determining the graph data query statement, increase the diversity of service requirements and improve the security of the graph data query statement. The specific scheme is as follows: in a first aspect, the application discloses a method for determining a query statement of graph data, which comprises the following steps: Acquiring graph data query information and judging whether the graph data query information is legal or not; If the graph data query information is legal, screening graph data query sentences from a locally preset graph data query sentence library based on the graph data query information; Acquiring statement query configuration information, determining a to-be-configured graph data query statement from the graph data query statement based on the statement query configuration information, and configuring the to-be-configured graph data query statement according to the statement query configuration information to obtain a target graph data query statement. Optionally, the acquiring the map data query information includes: acquiring the graph data query information which is sent by a client and contains a JSON format character string; and storing the graph data query information containing the JSON format character string to a locally preset database. Optionally, the determining whether the graph data query information is legal includes: Determining a target judgment rule from all preset judgment rules based on the graph data query information; judging whether the query information of the graph data is legal or not according to the target judging rule. Optionally, the screening the graph data query sentence from a locally preset graph data query sentence library based on the graph data query information includes: executing a local preset mapping program; and mapping and inquiring the graph data query statement corresponding to the graph data query information from the local graph data query statement library by using the mapping program and based on the graph data query information. Optionally, the acquiring statement queries configuration information, including: The statement query configuration information is acquired by a preset information acquisition interface or a hypertext transfer protocol interface; And determining the sentence unique identifier and the sentence configuration parameters from the sentence query configuration information. Optionally, the determining the to-be-configured graph data query statement from the graph data query statement based on the statement query configuration information, and configuring the to-be-configured graph data query statement according to the statement query configuration information includes: Screening the graph data query statement corresponding to the statement unique identifier from the graph data query statement to serve as a graph data query statement to be configured; And configuring the data query state