Sentence detection method and device

By parsing and constructing the SQL statement graph structure and detecting associated objects and conditions in the SQL statement, it solves the problem of huge result sets caused by the Cartesian product phenomenon, realizes automated detection and efficient Cartesian product detection, and improves data processing efficiency.

CN118444928BActive Publication Date: 2024-09-27HUNDSUN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410887651.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-09-27
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

In the existing technology, unspecified or invalid association conditions in SQL statements lead to the Cartesian product phenomenon, resulting in an abnormally large result set, and the existing solution requires a lot of manpower and material resources to update the whitelist, which is inefficient.

Method used

Obtain associated objects and effective association conditions by parsing SQL statements, build a statement graph structure, update the graph structure to reflect object characteristics, and perform connectivity detection to determine the Cartesian product phenomenon to achieve automatic detection and improve efficiency.

Benefits of technology

It realizes Cartesian product detection under any scenario and any version iteration cycle, improves detection efficiency, reduces the consumption of manpower and material resources, and enhances the universality and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118444928B
    Figure CN118444928B
Patent Text Reader

Abstract

The embodiments of the present specification provide a sentence detection method and device, wherein the sentence detection method includes: obtaining a sentence to be detected, and obtaining multiple associated objects and multiple valid associated conditions by parsing the sentence to be detected; using the multiple associated objects as nodes and the multiple valid associated conditions as edges to construct an initial statement graph structure corresponding to the sentence to be detected; determining object features corresponding to the multiple associated objects respectively, and updating the initial statement graph structure to a target statement graph structure according to the object features corresponding to each associated object; performing a connectivity check on the target statement graph structure, and determining a Cartesian product test result corresponding to the sentence to be detected based on the test result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the technical field of sentence detection, and in particular to a sentence detection method and device. Background Art

[0002] With the development of computer and Internet technology, the requirements for data processing efficiency are getting higher and higher. In the prior art, when writing SQL (structured query language) for data query, it may involve the situation of associating query data with multiple data tables. In this case, if the association condition is not specified in the SQL statement or the association condition is invalid, the query process will cause the Cartesian product phenomenon. The Cartesian product phenomenon (Cartesian Product Phenomenon) is actually when executing SQL queries, if the connection conditions between tables are not correctly specified, or the connection conditions are omitted or invalid, the database will return a result set of all possible combinations of all rows in two or more tables. This phenomenon will cause the result set to be abnormally large, because each row in each table will be combined with each row in another table. In order to avoid the Cartesian product phenomenon, the prior art usually adopts the method of configuring a large number of whitelists to distinguish between large and small result sets, but with the iteration of products, the table needs to be updated again when it is added, which will consume a lot of manpower and material resources. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention

[0003] In view of this, an embodiment of this specification provides a sentence detection method. One or more embodiments of this specification also relate to a sentence detection device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.

[0004] According to a first aspect of an embodiment of this specification, a sentence detection method is provided, including:

[0005] Acquire a statement to be detected, and obtain multiple associated objects and multiple valid associated conditions by parsing the statement to be detected;

[0006] Using the multiple associated objects as nodes and the multiple valid associated conditions as edges, constructing an initial statement graph structure corresponding to the statement to be detected;

[0007] Determine object features corresponding to the plurality of associated objects respectively, and update the initial statement graph structure to a target statement graph structure according to the object feature corresponding to each associated object;

[0008] A connectivity check is performed on the target sentence graph structure, and a Cartesian product test result corresponding to the sentence to be tested is determined according to the test result.

[0009] According to a second aspect of an embodiment of this specification, a sentence detection device is provided, including:

[0010] An acquisition module is configured to acquire a sentence to be detected, and obtain a plurality of associated objects and a plurality of valid associated conditions by parsing the sentence to be detected;

[0011] A construction module is configured to construct an initial statement graph structure corresponding to the statement to be detected by using the multiple associated objects as nodes and the multiple valid associated conditions as edges;

[0012] A determination module is configured to determine object features corresponding to the plurality of associated objects respectively, and update the initial statement graph structure to a target statement graph structure according to the object feature corresponding to each associated object;

[0013] The detection module is configured to perform connectivity detection on the target sentence graph structure, and determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result.

[0014] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0015] Memory and processor;

[0016] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above statement detection method are implemented.

[0017] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned statement detection method are implemented.

[0018] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions, which implement the steps of the above-mentioned statement detection method when executed by a processor.

[0019] The sentence detection method provided in the present embodiment can detect the Cartesian product phenomenon for any scenario and any version iteration cycle, and improve the detection efficiency. After obtaining the sentence to be detected, the sentence to be detected can be parsed first, so as to determine multiple associated objects and multiple valid associated conditions in the sentence according to the parsing result; on this basis, considering that there is a relationship between the associated objects and the valid associated conditions, and if the sentence is complete enough, there should also be a relationship between the associated objects. If not, it means that there is a Cartesian product phenomenon. Based on this feature, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the edges and nodes, an initial sentence graph structure corresponding to the sentence to be detected can be constructed; since the constructed initial sentence graph structure is obtained based on the basic logic of the sentence to be detected, and in the actual processing process, there may be a virtual relationship between the associated objects, so in order to ensure that the graph structure is intuitive and accurately reflects the logical relationship of the sentence, the object features corresponding to the multiple associated objects can be determined, and the initial sentence graph structure can be updated to the target sentence graph structure according to the object features corresponding to each associated object; finally, the connectivity detection can be performed on the target sentence graph structure to determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result. When testing the sentences to be tested, the detection can be completed by constructing a graph structure. No additional setting information is required to complete the detection of the sentences involved in any version and any iteration cycle. It is more universal and efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a schematic diagram of a sentence detection method provided by an embodiment of this specification;

[0021] Figure 2 is a flow chart of a sentence detection method provided by an embodiment of this specification;

[0022] Figure 3a is a schematic diagram of an SQL statement in a statement detection method provided by an embodiment of this specification;

[0023] Figure 3b is a schematic diagram of a sentence graph structure in a sentence detection method provided by an embodiment of the present specification;

[0024] Figure 4 is a flow chart of a processing process of a sentence detection method provided by an embodiment of this specification;

[0025] Figure 5 is a structural schematic diagram of a sentence detection device provided by an embodiment of this specification;

[0026] Figure 6It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0027] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0028] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0029] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0030] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0031] In this specification, a sentence detection method is provided. This specification also relates to a sentence detection device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.

[0032] See also Figure 1As shown in the schematic diagram, the sentence detection method provided in this embodiment can detect the Cartesian product phenomenon for any scenario and any version iteration cycle, and improve the detection efficiency. After obtaining the sentence to be detected, the sentence to be detected can be parsed first to determine multiple associated objects and multiple valid associated conditions in the sentence according to the parsing result; on this basis, considering that there is a relationship between the associated object and the valid associated condition, and if the sentence is complete enough, there should also be a relationship between the associated objects. If not, it means that there is a Cartesian product phenomenon. Based on this feature, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the edges and nodes, an initial statement graph structure corresponding to the sentence to be detected can be constructed; since the constructed initial statement graph structure is obtained based on the basic logic of the sentence to be detected, and in the actual processing process, there may be a virtual relationship between the associated objects, so in order to ensure that the graph structure is intuitive and accurately reflects the logical relationship of the sentence, the object features corresponding to the multiple associated objects can be determined, and the initial statement graph structure can be updated to the target statement graph structure according to the object features corresponding to each associated object; finally, the target statement graph structure can be connected to detect the Cartesian product detection result corresponding to the sentence to be detected according to the detection result. When testing the sentences to be tested, the detection can be completed by constructing a graph structure. No additional setting information is required to complete the detection of the sentences involved in any version and any iteration cycle. It is more universal and efficient.

[0033] See also Figure 2 , Figure 2 A flowchart of a sentence detection method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0034] Step S202: obtaining a statement to be detected, and obtaining a plurality of associated objects and a plurality of valid associated conditions by parsing the statement to be detected.

[0035] The statement detection method provided in this embodiment is used to detect the Cartesian product phenomenon for any type of SQL statement, so that the cause of the Cartesian product phenomenon can be pointed out according to the detection result, thereby facilitating the statement submitter to update the SQL statement to improve data processing efficiency.

[0036] Specifically, the statement to be detected specifically refers to the SQL statement that needs to perform Cartesian product phenomenon detection at the current moment, which can be an SQL statement corresponding to any data operation requirement, and this embodiment does not make any limitation here. Correspondingly, the associated object specifically refers to the data table involved in the statement to be detected, which corresponds to the data table name; correspondingly, the valid associated condition specifically refers to the valid and legal condition in the statement condition involved in the data operation on the associated object, and the condition in where is also defined as an associated condition, wherein whether the associated condition is valid can be checked for its legality by setting rules, that is, checking whether it is useful in the execution of this statement, so that the valid associated condition can be screened out from the associated condition, so as to facilitate the subsequent construction of the initial statement graph structure in combination with multiple associated objects.

[0037] Based on this, in order to be able to detect the Cartesian product phenomenon for any scenario and any version iteration cycle, and to improve the detection efficiency, after obtaining the sentence to be detected, the sentence to be detected can be parsed first, so as to determine multiple associated objects and multiple valid associated conditions in the sentence according to the parsing results; on this basis, considering that there is a relationship between the associated objects and the valid associated conditions, and if the sentence is complete enough, there should also be a relationship between the associated objects. If not, it means that there is a Cartesian product phenomenon. Based on this feature, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the edges and nodes, the initial statement graph structure corresponding to the sentence to be detected can be constructed; since the constructed initial statement graph structure is obtained based on the basic logic of the sentence to be detected, and in the actual processing process, there may be a virtual relationship between the associated objects, so in order to ensure that the graph structure is intuitive and accurately reflects the logical relationship of the sentence, the object features corresponding to the multiple associated objects can be determined, and the initial statement graph structure can be updated to the target statement graph structure according to the object features corresponding to each associated object; finally, the connectivity detection can be performed on the target statement graph structure to determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result.

[0038] Furthermore, before obtaining the sentence to be detected, in order to detect the Cartesian product phenomenon of the sentence in the current scenario and avoid affecting the efficiency of subsequent data operations, the sentence to be detected can be determined in the following manner. In this embodiment, the specific implementation is as follows:

[0039] At least one candidate sentence is parsed according to a multi-dimensional syntax parsing strategy using a preset target syntax tree to obtain at least one syntax tree node; the at least one syntax tree node is filtered, and a sentence to be detected is determined in the at least one candidate sentence according to the filtering result.

[0040] Specifically, the target syntax tree specifically refers to the syntax tree used when performing syntax parsing on the candidate sentences, which can be an abstract syntax tree (AST), a phrase structure tree (Phrase Structure Tree), a dependency syntax tree (Dependency Syntax Tree), etc. This embodiment does not make any limitation here. Correspondingly, the multi-dimensional syntax parsing strategy specifically refers to the strategy used when parsing the candidate sentences. The strategy can parse the candidate sentences from multiple dimensions, such as through the syntax parsing dimension, the lexical parsing dimension, etc. Correspondingly, the syntax tree node specifically refers to the syntax tree node obtained after parsing the candidate sentences according to the syntax tree, and the sentences to be detected that are associated with the query requirements can be obtained by filtering the syntax tree nodes.

[0041] Based on this, when determining the sentences to be detected that need to contain the Cartesian product phenomenon at the current moment, the preset target syntax tree can be used to parse at least one candidate sentence according to the multi-dimensional syntax parsing strategy, so as to obtain at least one syntax tree node corresponding to at least one candidate sentence according to the parsing result; on this basis, filtering can be performed on at least one syntax tree node, so that the candidate sentence containing the query logic can be determined as the sentence to be detected in at least one candidate sentence according to the filtering result.

[0042] For example, get Figure 3a The SQL statement that needs to be detected is shown in the figure. After that, the AST syntax tree can be used to perform lexical analysis, syntax analysis, ast conversion and other parsing operations on the SQL statement. Thus, the syntax tree node can be obtained according to the parsing result. Further, after obtaining the syntax tree node, the syntax tree node can be filtered to collect all query statements according to the filtering result. At this time, an original SQL statement a and a nested SQL statement b will be obtained. On this basis, SQL statement a can be selected as the SQL statement to be detected to detect the Cartesian product phenomenon. After completing the detection of the Cartesian product phenomenon of SQL statement a, the Cartesian product phenomenon can be detected on SQL statement b.

[0043] In summary, by parsing the candidate sentences according to the preset syntax tree, the sentences to be detected for the associated query can be screened out according to the parsing results, so that the Cartesian product phenomenon of the sentences can be detected later.

[0044] Furthermore, when parsing the sentence to be detected to obtain the associated conditions and associated objects, it is necessary to perform a legality check on the associated conditions obtained by the analysis, so as to construct an initial sentence graph structure that matches the sentence to be detected, so as to perform the subsequent analysis of the Cartesian product phenomenon. In this embodiment, the specific implementation method is as follows:

[0045] The statement to be detected is parsed according to a preset syntax tree to obtain multiple associated objects and multiple associated conditions; the conditional legitimacy is detected for each of the multiple associated conditions, and multiple valid associated conditions are determined according to the detection results.

[0046] Specifically, the association condition refers to the statement condition involved in the data operation on the association object. Correspondingly, the legality check refers to the availability check of each association condition when executing the statement. Based on the legality check, it can be determined whether any of the multiple association conditions is available when the statement is executed, so that the valid association conditions can be screened out according to the legality check result.

[0047] Based on this, when parsing the statement to be tested, the statement to be tested can be parsed according to the preset syntax tree first to obtain multiple associated objects and multiple associated conditions; on this basis, in order to ensure that the initial statement graph structure constructed subsequently may represent the logical relationship of the statement to be tested, the conditional legitimacy can be checked separately for the multiple associated conditions, so that multiple valid associated conditions can be determined according to the test results, so as to facilitate the subsequent construction of the initial statement graph structure.

[0048] In practical applications, in order to ensure that the valid association conditions output after the legitimacy check are sufficiently accurate, the legitimacy check can be completed by checking the fields and field attribute information. In this embodiment, the specific implementation is as follows:

[0049] Determine the table name field included in the target association condition, and the field attribute information corresponding to the table name field; when the table name field corresponds to a set number of data tables and the field attribute information is an index field type, determine that the target association condition passes the condition legality detection, and use the target association condition as a valid association condition.

[0050] Specifically, the target association condition specifically refers to any one of the multiple association conditions. Correspondingly, the table name field specifically refers to the field to which the table name involved in the target association condition belongs. Correspondingly, the field attribute information specifically refers to the attribute information corresponding to each table name field, which can reflect whether the target association condition has a primary key field or a unique index field, and is used to characterize whether the target association condition can guarantee uniqueness.

[0051] Based on this, when performing a legitimacy check on the target association condition, you can first determine the table name field included in the target association condition, as well as the field attribute information corresponding to the table name field; on this basis, you can combine the table name field and the field attribute information to perform a legitimacy check on the target association condition. If the table name field corresponds to a set number of data tables and the field attribute information is an index field type, it can be determined that the target association condition passes the condition legitimacy check. At this time, the target association condition can be used as a valid association condition. After each association condition has been processed, multiple valid association conditions can be screened out for subsequent initial statement graph structure construction.

[0052] In summary, by combining field attribute information and table name fields to check the validity of each association condition, we can ensure the accurate positioning of valid association conditions with legality. Based on this, the subsequent initial graph structure construction can obtain a graph structure that fully reflects the statement execution logic, thereby improving the accuracy of Cartesian product phenomenon detection.

[0053] In addition, since the sentence to be detected may contain a small number of associated objects, when the number is less than a certain threshold, the Cartesian product phenomenon will not occur. In order to avoid wasting detection time, the number of associated objects can be detected to determine whether sentence detection processing is required. In this embodiment, the specific implementation method is as follows:

[0054] When it is determined according to the analysis result that the number of associated objects is greater than a preset number threshold, the step of performing conditional legitimacy checks on the multiple associated conditions respectively is performed; when it is determined according to the analysis result that the number of associated objects is less than or equal to the preset number threshold, the Cartesian product test result corresponding to the statement to be tested is determined to be that there is no Cartesian product problem.

[0055] In actual applications, the preset quantity threshold can be set according to actual needs, and this embodiment does not make any limitation here.

[0056] Based on this, when it is determined according to the analysis result that the number of associated objects is greater than the preset number threshold, it means that the multiple associated objects contained in the sentence to be detected may produce a Cartesian product phenomenon, so the step of performing conditional legitimacy detection on the multiple associated conditions can be performed respectively; so as to perform subsequent detection of the Cartesian product phenomenon. When it is determined according to the analysis result that the number of associated objects is less than or equal to the preset number threshold, it means that the associated objects contained in the sentence to be detected will not produce a Cartesian product phenomenon, so it can be determined that the Cartesian product detection result corresponding to the sentence to be detected does not have a Cartesian product problem.

[0057] Using the above example, after determining that the statement to be detected is SQL statement a, the SQL statement can be parsed through the AST abstract syntax tree. According to the parsing results, all associated objects can be obtained, which are {table qp; table fig; table qpv; table pr; table qpbm; subquery qpv; table g; table qpm}. If the number of associated objects corresponding to the SQL statement is greater than or equal to 2, it is determined that it constitutes the basic condition for causing the Cartesian product phenomenon, so the Cartesian product phenomenon can be detected for the SQL statement. Further, by parsing the SQL statement through the syntax tree, 6 associated conditions can be obtained, which are {①fig.product_id=qp.product_id; ②qpv.product_name=qp.product_name; ③pr.product_id='CP1'; ④using(product_id); ⑤qpm.product_name='xxx system'; ⑥g.id=qp.product_id'}.

[0058] Furthermore, considering that there may be valid and invalid association conditions in the association conditions, it is necessary to filter the association conditions. The filtering of valid association conditions means that the association conditions must contain two fields with different table names, and one field must be the primary key or unique index to ensure its uniqueness. Therefore, the legality of the above 6 association conditions is checked in combination with the table creation statements of each table, and it is determined that the association condition ① fig.product_id = qp.product_id; is a unique index in the qp table, so the condition is legal; the association condition ② qpv.product_name = qp.product_name; has no unique index or primary key, and the condition is illegal; the association condition ③ pr.product_id = 'CP1'; has only one table field, which is illegal; ④ using (product_id); using using is legal; ⑤ qpm.product_name = 'xxx system'; has only one table field, which is illegal; ⑥ g.id = qp.product_id' id is the primary key, and the condition is legal.

[0059] On this basis, it is determined that among the six association conditions, association conditions ①④⑥ are valid association conditions. Subsequently, the initial statement graph structure can be constructed by combining the valid association conditions {①④⑥} and the association objects {table qp; table fig; table qpv; table pr; table qpbm; subquery qpv; table g; table qpm}, thereby realizing the subsequent Cartesian product detection for SQL statement a.

[0060] In summary, by performing legitimacy checks on multiple associated conditions, it can be ensured that the initial statement graph structure constructed subsequently can fully reflect the statement logic of the statement to be tested, so that the Cartesian product phenomenon can be detected on this basis later.

[0061] Step S204: construct an initial statement graph structure corresponding to the statement to be detected by using the multiple associated objects as nodes and the multiple valid associated conditions as edges.

[0062] Specifically, after obtaining multiple associated objects and multiple valid associated conditions, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the nodes and edges, an initial sentence graph structure corresponding to the sentence to be detected can be constructed. The initial sentence graph structure specifically refers to an undirected graph constructed by using associated objects as nodes and valid associated conditions as edges.

[0063] Using the above example, after obtaining the valid association conditions {①④⑥} and the association objects {table qp; table fig; table qpv; table pr; table qpbm; subquery qpv; table g; table qpm}, we can use each association object as a node and the valid association conditions as an edge to construct the following: Figure 3b The initial statement graph structure shown.

[0064] Step S206: determine the object features corresponding to the multiple associated objects respectively, and update the initial statement graph structure to a target statement graph structure according to the object feature corresponding to each associated object.

[0065] Specifically, after the initial statement graph structure is obtained as mentioned above, further, considering that some associated objects may be affected by their own attribute characteristics and no Cartesian product phenomenon will occur, on this basis, if the initial statement graph structure is directly subjected to connectivity detection to determine the Cartesian product detection result, the attribute characteristics of the associated objects may be ignored. Therefore, in order to ensure that the initial statement graph structure can feedback the Cartesian product phenomenon in combination with the attribute characteristics of the associated objects, the object characteristics corresponding to multiple associated objects can be determined first, and then the initial statement graph structure can be updated to the target statement graph structure according to the object characteristics corresponding to each associated object, so that the Cartesian product phenomenon of the sentence to be detected can be determined by subsequently detecting the target statement graph structure.

[0066] Among them, the object feature specifically refers to the feature information that characterizes whether the associated object will cause the Cartesian product phenomenon. Based on this feature, it can be determined whether the associated object needs to be ignored when performing Cartesian product phenomenon detection. Correspondingly, the target sentence graph structure specifically refers to the undirected graph obtained by updating the initial sentence graph structure using the object feature and adding new virtual edges.

[0067] Furthermore, when updating the initial statement graph structure, in order to ensure that the relationship between the corresponding nodes of the associated objects in the initial statement graph structure is reconstructed so that it better matches the statement to be detected, the graph node pairs to be updated can be determined by traversing the graph nodes, and the graph structure can be updated based on this, so that the target statement graph structure that accurately reflects the logical relationship of the statement to be detected can be obtained. In this embodiment, the specific implementation method is as follows:

[0068] Determine the object dependency relationship between the multiple associated objects according to the object features corresponding to each associated object; traverse the graph nodes included in the initial statement graph structure according to the object dependency relationship, and determine the graph node pair to be updated according to the traversal result; add edges to the first graph node and the second graph node associated with the graph node pair to be updated in the initial statement graph structure, and generate the target statement graph structure according to the adding result.

[0069] Specifically, the object dependency refers to the object dependency between related objects, based on which it can be determined whether a new edge needs to be established between related objects. Correspondingly, the graph node pair to be updated refers to a set of two graph nodes in the initial statement graph structure that need to be updated.

[0070] Based on this, in order to ensure that the target statement graph structure can intuitively and accurately reflect the execution logic of the statement to be tested, and to ensure that the Cartesian product detection can combine the attribute characteristics of the associated objects to decide whether they need to be tested, the object dependency relationship between multiple associated objects can be determined according to the object characteristics corresponding to each associated object; thereafter, the graph nodes contained in the initial statement graph structure can be traversed according to the object dependency relationship, so that the graph node pairs to be updated can be determined according to the traversal results; on this basis, edges can be added to the first graph node and the second graph node associated with the graph node pair to be updated in the initial statement graph structure, so that the target statement graph structure can be generated according to the adding results.

[0071] Using the above example, we get Figure 3b After the initial statement graph structure shown, it is further possible to combine the characteristics of the associated objects to determine whether the associated objects will not cause the Cartesian product phenomenon. The pre-set characteristic conditions that will not cause the Cartesian product are as follows in Table 1:

[0072] Table 1

[0073]

[0074] On this basis, it is determined that the associated object [subquery qpv1] uses limit 1, that is, the associated object will only generate one piece of data, satisfying the above conditions, and it is determined that it will not cause the Cartesian product phenomenon. Therefore, whether the associated object has a legal association condition can be determined to not cause the Cartesian product phenomenon. Therefore, in order to ensure the connectivity of the undirected graph, it is considered that the associated object has a legal association condition with the table qpbm, that is, there is a virtual edge between the two. Figure 3b The initial statement graph structure shown in the figure is updated by completing the edge from the associated object qpv1 to the associated object qpbm, and the following can be obtained: Figure 3b The target statement graph structure shown in the figure can subsequently perform connectivity detection on the target statement graph structure to determine the Cartesian product phenomenon of SQL statement a.

[0075] In summary, by updating the initial statement graph structure to the target statement graph structure, it can be ensured that the target statement graph structure can ignore the associated objects that do not have the Cartesian phenomenon, and the target statement graph structure is obtained by completing the virtual edges, thereby ensuring the accuracy of Cartesian product phenomenon detection.

[0076] Step S208, performing connectivity detection on the target sentence graph structure, and determining the Cartesian product detection result corresponding to the sentence to be detected according to the detection result.

[0077] Specifically, after obtaining the target sentence graph structure as described above, considering that the target sentence graph structure is an undirected graph, and the relationship between the graph nodes in the graph can reflect the relationship between the associated objects, and there are no associated objects with edges, it is determined that there may be a Cartesian product phenomenon, so a connectivity test can be performed on the target sentence graph structure to determine the Cartesian product test result corresponding to the sentence to be tested based on the test result. Among them, the Cartesian product test result is the result of determining whether the sentence to be tested has a Cartesian product phenomenon after performing a connectivity test on the target sentence graph structure.

[0078] Furthermore, when the connectivity check is performed on the target sentence graph structure, it is actually to check whether the graph structure is a connected graph, so that it can be determined whether the sentence to be checked has a Cartesian product phenomenon based on the judgment of the connected graph. In this embodiment, the specific implementation method is as follows:

[0079] A connectivity check is performed on the target statement graph structure; when it is determined according to the test results that the target statement graph structure is a connected graph, the Cartesian product test result corresponding to the statement to be tested is determined to be that there is no Cartesian product problem; when it is determined according to the test results that the target statement graph structure is a disconnected graph, the Cartesian product test result corresponding to the statement to be tested is determined to be that there is a Cartesian product problem.

[0080] Based on this, after the target statement graph structure is tested for connectivity, if the target statement graph structure is determined to be a connected graph according to the test results, it means that the associated objects and associated conditions contained in the statement to be tested are all associated, so it can be determined that the Cartesian product test result corresponding to the statement to be tested does not have a Cartesian product problem. If the target statement graph structure is determined to be a non-connected graph according to the test results, it means that there are unconnected associated objects in the target statement graph structure, and this single associated object may cause a Cartesian product phenomenon, so it is determined that the Cartesian product test result corresponding to the statement to be tested has a Cartesian product problem, so that the cause of the Cartesian product phenomenon can be determined after the cause is located later.

[0081] Furthermore, in the case where the statement to be detected has a Cartesian product problem, in order to be able to clearly indicate to the party submitting the statement the reason for the Cartesian product phenomenon, the problem report can be constructed in combination with the connected components of the graph structure, thereby facilitating the user to make adjustments to the statement to improve data operation efficiency. In this embodiment, the specific implementation method is as follows:

[0082] Determine at least two connected components associated with the target sentence graph structure; construct an object set corresponding to each connected component based on the multiple associated objects and the at least two connected components; determine missing condition information between the object sets corresponding to each connected component, and construct a Cartesian product problem report corresponding to the sentence to be detected based on the missing condition information.

[0083] Specifically, the connected component refers to the connected component obtained after analyzing the graph structure of the target sentence. Since the sentence to be detected has a Cartesian product phenomenon, at least two connected components can be obtained by analyzing the graph structure corresponding to the sentence. Correspondingly, the object set refers to the set of associated objects involved in each connected component. Correspondingly, the missing condition information refers to the conditions missing between the object sets. Based on the conditions, the inclusion that causes the Cartesian product phenomenon can be generated, so that the user who submits the statement can accurately locate the cause of the Cartesian product phenomenon.

[0084] Based on this, in order to facilitate the user who submits the sentence to be tested to accurately locate the cause of the Cartesian product phenomenon, after determining that the sentence to be tested has the Cartesian product phenomenon, at least two connected components associated with the target sentence graph structure can be determined first; on this basis, an object set corresponding to each connected component can be constructed based on multiple associated objects and at least two connected components; thereafter, the missing condition information between the object sets corresponding to each connected component can be determined, so that a Cartesian product problem report corresponding to the sentence to be tested can be constructed based on the missing condition information.

[0085] Using the above example, we get Figure 3bAfter the target sentence graph structure is shown, the connectivity check can be performed on the target sentence graph structure, such as Figure 3b The target statement graph structure shown is not a connected graph, so it is determined that SQL statement a has a Cartesian product phenomenon. Figure 3b The target sentence graph structure shown involves multiple connected components, and it is determined that there are four table sets, namely, table set 1 [qp; fig; g], table set 2 [pr; qpbm], table set 3 [qpv], and table set 4 [qpm]; and it is determined that there are no legal association conditions when the above four table sets are connected, based on which a report is generated and fed back to the user.

[0086] The sentence detection method provided in the present embodiment can detect the Cartesian product phenomenon for any scenario and any version iteration cycle, and improve the detection efficiency. After obtaining the sentence to be detected, the sentence to be detected can be parsed first, so as to determine multiple associated objects and multiple valid associated conditions in the sentence according to the parsing result; on this basis, considering that there is a relationship between the associated objects and the valid associated conditions, and if the sentence is complete enough, there should also be a relationship between the associated objects. If not, it means that there is a Cartesian product phenomenon. Based on this feature, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the edges and nodes, an initial sentence graph structure corresponding to the sentence to be detected can be constructed; since the constructed initial sentence graph structure is obtained based on the basic logic of the sentence to be detected, and in the actual processing process, there may be a virtual relationship between the associated objects, so in order to ensure that the graph structure is intuitive and accurately reflects the logical relationship of the sentence, the object features corresponding to the multiple associated objects can be determined, and the initial sentence graph structure can be updated to the target sentence graph structure according to the object features corresponding to each associated object; finally, the connectivity detection can be performed on the target sentence graph structure to determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result. When testing the sentences to be tested, the detection can be completed by constructing a graph structure. No additional setting information is required to complete the detection of the sentences involved in any version and any iteration cycle. It is more universal and efficient.

[0087] The following combination Figure 4 , taking the application of the sentence detection method provided in this specification in the query sentence detection scenario as an example, the sentence detection method is further described. Figure 4 A processing flow chart of a sentence detection method provided in an embodiment of the present specification is shown, which specifically includes the following steps.

[0088] Step S402: parse at least one candidate sentence using a preset target syntax tree according to a multi-dimensional syntax parsing strategy to obtain at least one syntax tree node.

[0089] Step S404: filtering at least one syntax tree node, and determining a sentence to be detected from at least one candidate sentence according to the filtering result.

[0090] Step S406: parse the sentence to be detected according to a preset syntax tree to obtain multiple associated objects and multiple associated conditions.

[0091] Step S408, performing conditional validity checks on the multiple association conditions respectively, and determining multiple valid association conditions according to the check results.

[0092] Among them, the condition legitimacy check of any one of the multiple association conditions includes: determining the table name field included in the target association condition, and the field attribute information corresponding to the table name field; when the table name field corresponds to a set number of data tables and the field attribute information is an index field type, determining that the target association condition passes the condition legitimacy check, and taking the target association condition as a valid association condition.

[0093] Step S410, using multiple associated objects as nodes and multiple valid associated conditions as edges, to construct an initial statement graph structure corresponding to the statement to be detected.

[0094] Step S412: determining object features corresponding to the plurality of associated objects respectively, and determining object dependency relationships between the plurality of associated objects according to the object features corresponding to each associated object.

[0095] Step S414, traverse the graph nodes included in the initial statement graph structure according to the object dependency relationship, and determine the graph node pairs to be updated according to the traversal results.

[0096] Step S416, adding edges to the first graph node and the second graph node associated with the graph node pair to be updated in the initial statement graph structure, and generating a target statement graph structure according to the adding result.

[0097] Step S418, performing connectivity detection on the target sentence graph structure.

[0098] Step S420, when it is determined according to the detection result that the target sentence graph structure is a non-connected graph, it is determined that the Cartesian product detection result corresponding to the sentence to be detected is that there is a Cartesian product problem.

[0099] Step S422, determining at least two connected components associated with the target sentence graph structure, and constructing an object set corresponding to each connected component based on multiple associated objects and the at least two connected components.

[0100] Step S424, determining the missing condition information between the object sets corresponding to each connected component, and constructing a Cartesian product problem report corresponding to the statement to be detected according to the missing condition information.

[0101] In summary, in order to be able to detect the Cartesian product phenomenon for any scenario and any version iteration cycle, and to improve the detection efficiency, after obtaining the sentence to be detected, the sentence to be detected can be parsed first, so as to determine multiple associated objects and multiple valid associated conditions in the sentence according to the parsing results; on this basis, considering that there is a relationship between the associated object and the valid associated condition, and if the sentence is complete enough, there should also be a relationship between the associated objects. If not, it means that there is a Cartesian product phenomenon. Based on this feature, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the edges and nodes, the initial statement graph structure corresponding to the sentence to be detected can be constructed; since the constructed initial statement graph structure is obtained based on the basic logic of the sentence to be detected, and in the actual processing process, there may be a virtual relationship between the associated objects, so in order to ensure that the graph structure is intuitive and accurately reflects the logical relationship of the sentence, the object features corresponding to the multiple associated objects can be determined, and the initial statement graph structure can be updated to the target statement graph structure according to the object features corresponding to each associated object; finally, the connectivity test can be performed on the target statement graph structure to determine the Cartesian product test result corresponding to the sentence to be detected according to the test result. When testing the sentences to be tested, the detection can be completed by constructing a graph structure. No additional setting information is required to complete the detection of the sentences involved in any version and any iteration cycle. It is more universal and efficient.

[0102] Corresponding to the above method embodiment, this specification also provides a sentence detection device embodiment, Figure 5 FIG. 2 shows a schematic diagram of a sentence detection device provided by an embodiment of the present specification. Figure 5 As shown, the device comprises:

[0103] An acquisition module 502 is configured to acquire a sentence to be detected, and obtain a plurality of associated objects and a plurality of valid associated conditions by parsing the sentence to be detected;

[0104] A construction module 504 is configured to construct an initial statement graph structure corresponding to the statement to be detected by using the multiple associated objects as nodes and the multiple valid associated conditions as edges;

[0105] A determination module 506 is configured to determine object features corresponding to the plurality of associated objects respectively, and update the initial statement graph structure to a target statement graph structure according to the object feature corresponding to each associated object;

[0106] The detection module 508 is configured to perform connectivity detection on the target sentence graph structure, and determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result.

[0107] In an optional embodiment, the acquisition module 502 is further configured to:

[0108] The statement to be detected is parsed according to a preset syntax tree to obtain multiple associated objects and multiple associated conditions; the conditional legitimacy is detected for each of the multiple associated conditions, and multiple valid associated conditions are determined according to the detection results.

[0109] In an optional embodiment, the condition legitimacy detection of any one of the multiple association conditions includes:

[0110] Determine the table name field included in the target association condition, and the field attribute information corresponding to the table name field; when the table name field corresponds to a set number of data tables and the field attribute information is an index field type, determine that the target association condition passes the condition legality detection, and use the target association condition as a valid association condition.

[0111] In an optional embodiment, the determining module 506 is further configured to:

[0112] Determine the object dependency relationship between the multiple associated objects according to the object features corresponding to each associated object; traverse the graph nodes included in the initial statement graph structure according to the object dependency relationship, and determine the graph node pair to be updated according to the traversal result; add edges to the first graph node and the second graph node associated with the graph node pair to be updated in the initial statement graph structure, and generate the target statement graph structure according to the adding result.

[0113] In an optional embodiment, the detection module 508 is further configured to:

[0114] A connectivity check is performed on the target statement graph structure; when it is determined according to the test results that the target statement graph structure is a connected graph, the Cartesian product test result corresponding to the statement to be tested is determined to be that there is no Cartesian product problem; when it is determined according to the test results that the target statement graph structure is a disconnected graph, the Cartesian product test result corresponding to the statement to be tested is determined to be that there is a Cartesian product problem.

[0115] In an optional embodiment, when the sentence to be detected has a Cartesian product problem, the device further includes:

[0116] The report generation module is configured to determine at least two connected components associated with the target sentence graph structure; construct an object set corresponding to each connected component based on the multiple associated objects and the at least two connected components; determine missing condition information between the object sets corresponding to each connected component, and construct a Cartesian product problem report corresponding to the sentence to be detected based on the missing condition information.

[0117] In an optional embodiment, the acquisition module 502 is further configured to:

[0118] When it is determined according to the analysis result that the number of associated objects is greater than a preset number threshold, the step of performing conditional legitimacy checks on the multiple associated conditions respectively is performed; when it is determined according to the analysis result that the number of associated objects is less than or equal to the preset number threshold, the Cartesian product test result corresponding to the statement to be tested is determined to be that there is no Cartesian product problem.

[0119] In an optional embodiment, the device further comprises:

[0120] The sentence parsing module is configured to parse at least one candidate sentence according to a multi-dimensional syntax parsing strategy using a preset target syntax tree to obtain at least one syntax tree node; filter the at least one syntax tree node, and determine a sentence to be detected in the at least one candidate sentence according to the filtering result.

[0121] The sentence detection device provided in the present embodiment can detect the Cartesian product phenomenon for any scenario and any version iteration cycle, and improve the detection efficiency. After obtaining the sentence to be detected, the sentence to be detected can be parsed first, so as to determine multiple associated objects and multiple valid associated conditions in the sentence according to the parsing result; on this basis, considering that there is a relationship between the associated objects and the valid associated conditions, and if the sentence is complete enough, there should also be a relationship between the associated objects. If not, it means that there is a Cartesian product phenomenon. Based on this feature, multiple associated objects can be used as nodes and multiple valid associated conditions can be used as edges. By connecting the edges and nodes, an initial sentence graph structure corresponding to the sentence to be detected can be constructed; since the constructed initial sentence graph structure is obtained based on the basic logic of the sentence to be detected, and in the actual processing process, there may be a virtual relationship between the associated objects, so in order to ensure that the graph structure is intuitive and accurately reflects the logical relationship of the sentence, the object features corresponding to the multiple associated objects can be determined, and the initial sentence graph structure can be updated to the target sentence graph structure according to the object features corresponding to each associated object; finally, the connectivity detection can be performed on the target sentence graph structure to determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result. When testing the sentences to be tested, the detection can be completed by constructing a graph structure. No additional setting information is required to complete the detection of the sentences involved in any version and any iteration cycle. It is more universal and efficient.

[0122] The above is a schematic scheme of a sentence detection device of this embodiment. It should be noted that the technical scheme of the sentence detection device and the technical scheme of the above sentence detection method belong to the same concept, and the details not described in detail in the technical scheme of the sentence detection device can be referred to the description of the technical scheme of the above sentence detection method.

[0123] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0124] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0125] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0126] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 600 may also be a mobile or stationary server.

[0127] The processor 620 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned statement detection method.

[0128] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above sentence detection method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above sentence detection method.

[0129] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above statement detection method when executed by a processor.

[0130] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned sentence detection method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned sentence detection method.

[0131] An embodiment of the present specification also provides a computer program product, including a computer program or instructions, which implements the steps of the above statement detection method when executed by a processor.

[0132] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned sentence detection method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned sentence detection method.

[0133] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0134] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0135] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0136] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0137] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well.

Claims

1. A sentence detection method, characterized in that: include: Acquire a statement to be detected, and obtain multiple associated objects and multiple valid associated conditions by parsing the statement to be detected, wherein the valid associated condition is an associated condition that is valid and legal during the execution of the statement to be detected; Using the multiple associated objects as nodes and the multiple valid associated conditions as edges, constructing an initial statement graph structure corresponding to the statement to be detected; Determine the object features corresponding to the multiple associated objects respectively, and determine the object dependency relationship between the multiple associated objects according to the object features corresponding to each associated object; traverse the graph nodes included in the initial statement graph structure according to the object dependency relationship, and determine the graph node pair to be updated according to the traversal result; add edges to the first graph node and the second graph node associated with the graph node pair to be updated in the initial statement graph structure to generate a target statement graph structure; A connectivity check is performed on the target sentence graph structure, and a Cartesian product test result corresponding to the sentence to be tested is determined according to the test result.

2. The sentence detection method according to claim 1, characterized in that: The obtaining of multiple associated objects and multiple valid associated conditions by parsing the statement to be detected includes: Parsing the sentence to be detected according to a preset syntax tree to obtain multiple associated objects and multiple associated conditions; The multiple association conditions are respectively subjected to conditional validity checks, and multiple valid association conditions are determined according to the check results.

3. The sentence detection method according to claim 2, characterized in that: The condition legitimacy detection of any one of the multiple association conditions includes: Determine the table name field included in the target association condition, and the field attribute information corresponding to the table name field; In the case that the table name field corresponds to a set number of data tables and the field attribute information is of an index field type, it is determined that the target association condition passes the condition legality detection, and the target association condition is used as a valid association condition.

4. The sentence detection method according to claim 1, characterized in that: The performing connectivity detection on the target sentence graph structure and determining the Cartesian product detection result corresponding to the sentence to be detected according to the detection result includes: Performing connectivity detection on the target sentence graph structure; When it is determined according to the detection result that the target sentence graph structure is a connected graph, determining that the Cartesian product detection result corresponding to the sentence to be detected does not have a Cartesian product problem; When it is determined according to the detection result that the target sentence graph structure is a non-connected graph, it is determined that the Cartesian product detection result corresponding to the sentence to be detected is that there is a Cartesian product problem.

5. The sentence detection method according to claim 4, characterized in that: In the case where the sentence to be detected has a Cartesian product problem, after the step of determining the Cartesian product detection result corresponding to the sentence to be detected according to the detection result is performed, the method further includes: Determining at least two connected components associated with the target sentence graph structure; Constructing an object set corresponding to each connected component based on the multiple associated objects and the at least two connected components; Determine missing condition information between the object sets corresponding to each connected component, and construct a Cartesian product problem report corresponding to the sentence to be detected based on the missing condition information.

6. The sentence detection method according to claim 2, characterized in that: Also includes: When it is determined according to the analysis result that the number of associated objects is greater than a preset number threshold, executing the step of respectively performing conditional legitimacy detection on the multiple associated conditions; When it is determined according to the analysis result that the number of associated objects is less than or equal to a preset number threshold, it is determined that the Cartesian product detection result corresponding to the sentence to be detected is that there is no Cartesian product problem.

7. The sentence detection method according to any one of claims 1 to 6, characterized in that: Before the step of obtaining the statement to be detected is executed, the following step is also included: Parsing at least one candidate sentence according to a multi-dimensional syntax parsing strategy using a preset target syntax tree to obtain at least one syntax tree node; Filtering is performed on the at least one syntax tree node, and a sentence to be detected is determined from the at least one candidate sentence according to the filtering result.

8. A sentence detection device, characterized in that: include: An acquisition module is configured to acquire a statement to be detected, and obtain a plurality of associated objects and a plurality of valid associated conditions by parsing the statement to be detected, wherein the valid associated condition is an associated condition that is valid and legal during the execution of the statement to be detected; A construction module is configured to construct an initial statement graph structure corresponding to the statement to be detected by using the multiple associated objects as nodes and the multiple valid associated conditions as edges; A determination module is configured to determine object features corresponding to the multiple associated objects respectively, determine the object dependency relationship between the multiple associated objects according to the object features corresponding to each associated object; traverse the graph nodes included in the initial statement graph structure according to the object dependency relationship, and determine the graph node pair to be updated according to the traversal result; add edges to the first graph node and the second graph node associated with the graph node pair to be updated in the initial statement graph structure to generate a target statement graph structure; The detection module is configured to perform connectivity detection on the target sentence graph structure, and determine the Cartesian product detection result corresponding to the sentence to be detected according to the detection result.

9. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 7.

11. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.