Multi-modal data query language method and system of mixed structure

By dynamically building a multimodal data set query language, the problem of low compatibility between traditional SQL and multimodal data is solved, flexible and efficient query of multimodal data is realized, and more data types and nested operations are supported. The data pattern can be built independently, which improves the applicability of SQL.

CN119149561AActive Publication Date: 2024-12-17UNIV OF SCI & TECH BEIJING

Patent Information

Application Number
CN202411109001.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-04-25
Filing Date
2024-08-13
Publication Date
2024-12-17
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

Traditional SQL languages ​​cannot be effectively compatible with multimodal data, especially when there are nested attributes and dynamic changes in the data model, it cannot meet the query and operation requirements of multimodal data.

Method used

Provide a hybrid structure multimodal data query language method, allowing users to create data patterns independently, and dynamically build a multimodal data set query language by defining data pattern representation rules, attribute representation rules, value transformation rules and filtering conditions, supporting Query of single-layer or multi-layer data structures and nested relationships.

Benefits of technology

It realizes flexible and efficient query of multimodal data, supports more data types and nested operations, and users can dynamically build data patterns according to their needs during use, without relying on database administrators, improving SQL compatibility and usage flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149561A_ABST
    Figure CN119149561A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-modal data query language method and system of a mixed structure, and relates to the technical field of data processing. Comprising the following steps: a user autonomously creates a data mode of a multi-mode data set, and obtains a nesting relationship among different types of data elements; a key data structure or an algorithm is selected as a first-layer structure of the whole data mode, other data elements can be used as sub-structures nested in the first-layer structure, and a new data structure is formed by the algorithm; establishing a data element object according to a nested relationship formed by the data structure; according to a defined data mode representation rule, an attribute representation rule, a value transformation rule and an expression filtering condition, dynamic autonomous construction of a multi-mode data set query language is completed; and obtaining a query statement input by a user, and obtaining a query result according to the query statement and the constructed multi-modal data set query language. According to the method, the problem of low compatibility of the traditional SQL language and the multi-modal data is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for a hybrid structured multimodal data query language. Background Art

[0002] SQL (Structured Query Language) is a standardized language for managing relational storage data sets. It is a declarative, non-procedural language. On the one hand, users only need to describe their needs at the logical level, without having to worry about specific data storage, extraction and other operation steps, which simplifies the complexity of accessing storage data sets and allows users to focus more on the essence of the problem rather than paying too much attention to the underlying implementation details. On the other hand, query statements can be automatically optimized, and the storage data set management system selects the most effective execution plan based on the semantics of the query and the underlying data structure. The theoretical basis of SQL is the relational model, which organizes data into tabular form and provides a set of standardized operation methods based on relational algebra. By using SQL, users can easily implement various storage data set operations, including data query, data definition, data manipulation and data control.

[0003] Multimodal data refers to data from different types and formats, which can include text, images, audio, video, and other forms of information. Multimodal data with mixed structures combines structured, semi-structured, and unstructured data to provide a more comprehensive and rich description of the content. Multimodal data is stored in NoSQL databases. Unlike traditional relational storage data sets, there is currently no unified standard for the query language of multimodal data sets, which varies greatly from database to database. For example, MongoDB uses interface functions to operate data sets, Couchbase uses declarative N1QL (Non-first Normal Form Query Language) to retrieve data sets, Elasticsearch uses a custom DSL (Domain Specific Language) query syntax, and Neo4J uses the declarative query language Cypher.

[0004] With the rise of big data services such as the Internet, social networks, and intelligent recommendations, the demand for analysis and processing of multimodal data has increased significantly. Traditional SQL is no longer applicable when facing massive multi-source heterogeneous data. On the one hand, the data model does not match. SQL can only process atomic type attributes, because there are no nested attributes in the relational model, while nested structures are very common in the multimodal data model. Therefore, traditional SQL cannot meet the support for nested attributes in the multimodal data model. On the other hand, the table structure in the relational model is a fixed pattern defined in advance by the storage dataset administrator at the beginning of the storage dataset establishment, and cannot be dynamically adjusted by the end user in the process of using the storage dataset according to changes in demand. However, in the big data environment, data and demand updates are fast and real-time. It is difficult for the storage dataset administrator to consider all situations in advance. It is necessary for users to dynamically build patterns independently during use. This violates some paradigms and fixed patterns of traditional SQL, so SQL cannot be directly used for multimodal data, and it is impossible to take advantage of the powerful functions of SQL itself and its declarative and non-procedural characteristics.

[0005] In view of this, how to overcome the defects of the existing technology and solve the problem of low compatibility between the traditional SQL language and multimodal data is a problem to be solved in this technical field. Summary of the invention

[0006] In order to solve the technical problems existing in the prior art, the embodiment of the present invention provides a method and system for a hybrid structure multimodal data query language. The technical solution is as follows:

[0007] On the one hand, a method for a hybrid structure multimodal data query language is provided, the method is implemented by a hybrid structure multimodal data query language device, the method comprising:

[0008] S1. After organizing the existing data, the user independently creates the data model of the multimodal data set and obtains the nested relationship between different types of data elements in the data model; among them, multimodal data refers to the integration of structured, semi-structured and unstructured data.

[0009] S2. Select a key data structure or use an algorithm as the first-level data structure of the entire data model, use different types of data elements as the first-level data structure or elements or substructures under the first-level data structure, and use an algorithm to form a single-layer or multi-layer data structure.

[0010] S3. Establish data element objects according to the nested relationship formed by the single-layer or multi-layer data structure in S2 and the constructed query language.

[0011] S4. Complete the dynamic and autonomous construction of the multimodal dataset query language based on the data element objects, the defined data model representation rules, the defined attribute representation rules, the defined value transformation rules, the defined common expression filtering conditions and the defined complex filtering conditions for nested type data elements.

[0012] S5. Obtain the query statement input by the user, and obtain the query result according to the query statement and the constructed multimodal dataset query language.

[0013] Optionally, the data element includes single-level or multi-level data elements.

[0014] The data element object includes: the attributes of the data element, the data type of the data element, and when the data type of the data element of the first level is a non-atomic type, the sub-data elements contained in the non-atomic type data element.

[0015] Optionally, the defined data mode representation rules include:

[0016] Use multiple expressions to represent all data elements and the nested relationships between different types of data elements.

[0017] Various expressions include multi-dimensional three-dimensional expressions and two-dimensional flat expressions.

[0018] The multi-dimensional three-dimensional expression method includes explicitly expressing the type of data elements and the attributes, types and characteristics of the sub-data elements contained in the data elements, separating data elements at the same level with commas, and distinguishing data elements at different levels with indentation.

[0019] The two-dimensional flat expression method includes flattening the nested relationship of data elements, placing all the flattened data elements on the same level, connecting the parent data elements and child data elements in the data elements with symbols, and for each data element at a level other than the first level, using all the data elements of the upper level of the level as prefixes.

[0020] Optionally, define attribute representation rules, including:

[0021] The attributes of the data elements of the first level are represented, and when the data type of the data elements of the first level is a non-atomic type, the attributes of the sub-data elements contained in the non-atomic data elements are represented.

[0022] The attributes of the data elements at the first level are represented, including:

[0023] When the data type of the data element of the first level is an atomic type, the attribute of the data element is the field name of the data element of the atomic type.

[0024] When the data type of the data element of the first level is a non-atomic type, the attribute of the non-atomic data element of the first level is the name of the non-atomic data element, and the attributes of the non-atomic data elements of other levels are the structure of the parent data elements of other levels, recursively until the structure of the non-atomic data elements of the first level.

[0025] Optionally, define value transformation rules, including:

[0026] Extract and transform the data content of the attributes described according to the attribute representation rules.

[0027] Optionally, define filtering conditions for the WHERE clause, including:

[0028] For atomic data elements, design common expression filtering conditions; for non-atomic data elements, design complex expression filtering conditions.

[0029] The filtering conditions include all satisfied and existence satisfied.

[0030] Optionally, obtaining a query statement input by a user in S5 and obtaining a query result according to the query statement and the constructed multimodal dataset query language include:

[0031] S51. Obtain a query statement input by a user, input the query statement into a module compiler, and obtain an output of the module compiler.

[0032] The module compiler output includes tokens output by the lexical analyzer, and a syntax analysis tree is obtained based on the tokens and the syntax analyzer.

[0033] S52. Input the module compiler output into the module parser to obtain the module parser output.

[0034] The module parser output includes the node values ​​of the syntax analysis tree output by the scanner, and the logical plan tree is obtained according to the node values ​​and the binder.

[0035] S53. Input the module parser output into the module permission checker to obtain whether access is allowed or not.

[0036] S54. If access is allowed, the module parser output is input into the module optimizer to obtain the module optimizer output.

[0037] If access is not allowed, the query ends.

[0038] S55. Input the module optimizer output to the module executor to obtain the query result.

[0039] On the other hand, a system of a hybrid structure multimodal data query language is provided, the system is applied to a method of a hybrid structure multimodal data query language, and the system includes:

[0040] The acquisition module is used for users to organize existing data, independently create data models of multimodal data sets, and obtain the nested relationships between different types of data elements in the data model; among them, multimodal data refers to the integration of structured, semi-structured and unstructured data.

[0041] The structure building module is used to select a key data structure or to use an algorithm as the first-level data structure of the entire data model, to use different types of data elements as the first-level data structure or elements or substructures under the first-level data structure, and to use an algorithm to form a single-layer or multi-layer data structure.

[0042] The establishment module is used to establish data element objects according to the nested relationship formed by the single-layer or multi-layer data structure and the constructed query language.

[0043] A construction module is used to complete the dynamic and autonomous construction of a multimodal dataset query language based on data element objects, defined data model representation rules, defined attribute representation rules, defined value transformation rules, and defined common expression filtering conditions and complex filtering conditions for nested type data elements.

[0044] The output module is used to obtain the query statement input by the user and obtain the query result according to the query statement and the constructed multimodal dataset query language.

[0045] On the other hand, a device for a hybrid-structured multimodal data query language is provided, the device for a hybrid-structured multimodal data query language comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the methods for the hybrid-structured multimodal data query language is implemented.

[0046] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the methods of the above-mentioned hybrid structure multimodal data query language.

[0047] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0048] In the embodiments of the present invention, the problem of low compatibility between the traditional SQL language and multimodal data sets is solved, and the extended SQL is conducive to concise and efficient retrieval of multimodal data.

[0049] The present invention dynamically and autonomously constructs data models. Different from traditional relational databases and SQL, where the database administrator constructs the data model in advance, the query language and method proposed in the present invention support users to dynamically and autonomously construct data models according to their needs during the use of the database without relying on the database administrator. At the same time, it supports more data types and nested operations, and is more flexible in both usage mode and specific operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 It is a method flow chart of a hybrid structure multimodal data query language provided by an embodiment of the present invention;

[0052] Figure 2 It is a data mode tree diagram provided by an embodiment of the present invention;

[0053] Figure 3 is the data content corresponding to the data mode provided in the embodiment of the present invention;

[0054] Figure 4 It is a nested relationship diagram between different types of data elements in the data model provided by the embodiment of the present invention;

[0055] Figure 5 The data mode representation rules of the multi-dimensional stereoscopic method and the two-dimensional flat method provided by the embodiment of the present invention;

[0056] Figure 6 The data symbols and their meanings provided by the embodiment of the present invention are compared;

[0057] Figure 7 is a corresponding relationship diagram of attribute representation rules and value transformation rules provided by an embodiment of the present invention;

[0058] Figure 8 It is a system architecture diagram of a multimodal data set query language that supports dynamic and autonomous construction of data models, provided by an embodiment of the present invention;

[0059] Fig. 9 is a diagram of a permission control mode provided by an embodiment of the present invention;

[0060] Fig.10 is a data mode tree diagram provided by Embodiment 1 of the present invention;

[0061] Fig.11It is a data mode tree diagram provided by Embodiment 2 of the present invention;

[0062] Fig.12 This is the data model tree diagram provided by Example 3 of the present invention.

[0063] Fig.13 It is a system block diagram of a hybrid structure multimodal data query language provided by an embodiment of the present invention;

[0064] Fig.14 It is a structural diagram of a device for a hybrid multimodal data query language provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0066] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0067] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0068] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0069] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0070] The embodiment of the present invention provides a method for a hybrid structure multimodal data query language, which can be implemented by a hybrid structure multimodal data query language device, and the hybrid structure multimodal data query language device can be a terminal or a server. Figure 1 The method flow chart of the hybrid structure multimodal data query language shown in the figure, the processing flow of the method may include the following steps:

[0071] S1. After the user organizes the existing data, he or she can independently create the data model of the multimodal data set and obtain the nested relationship between different types of data elements in the data model. The hybrid structure of multimodality refers to the integration of structured, semi-structured and unstructured data.

[0072] In a feasible implementation manner, the data model acquired by the present invention is created independently by the user, and is not generated by the system or defined in advance by a database administrator.

[0073] S2. Select a key data structure or use an algorithm as the first-level data structure of the entire data model. Different types of data elements in S1 can be used as the first-level data structure or elements or substructures under the structure, and use an algorithm to form a new data structure.

[0074] In a feasible implementation, a key data structure is selected from S1; wherein the data structure is a structure of data elements.

[0075] Furthermore, a key data structure is selected, or a key data structure is selected and supplemented by an algorithm. By writing a program, the data elements in the data model are organized together according to certain rules and subsequently transformed and applied. The algorithm is used to cooperate with the data structure to form a program.

[0076] S3. Create data element objects based on the nested relationship and the constructed query language.

[0077] Optionally, the data element includes single-level or multi-level data elements.

[0078] The data element object includes: the attributes of the data element, the data type of the data element, and when the data type of the data element of the first level is a non-atomic type, the sub-data elements contained in the non-atomic type data element.

[0079] In a feasible implementation, when the data element object is an atomic source data type, each attribute is a simple field name and does not contain structural information, but some atomic data elements contain features. These features are further restrictions on data elements. Since the features accompany the data elements, they do not affect the atomicity of the data elements, and the atomic data elements with features are still indivisible. When the data element object is a non-atomic type, the attribute of the first-level non-atomic data element is its own name, and the attributes of other-level data elements need to contain the structure of the data element of its parent data element, recursively until the first-level data element. The specific form needs to follow the attribute representation rules to accurately locate the attributes of deeply nested data elements in a path navigation manner.

[0080] S4. Complete the dynamic and autonomous construction of the multimodal dataset query language based on the data element objects, the defined data model representation rules, the defined attribute representation rules, the defined value transformation rules, the defined common expression filtering conditions and the defined complex filtering conditions for nested type data elements.

[0081] Optionally, the defined data model representation rules represent all data elements in the heterogeneous data model and the relationships between different data elements in two ways: multi-dimensional stereoscopic representation and two-dimensional flat representation. The data model tree diagram is as follows: Figure 2 As shown, the data content corresponding to the data mode is as follows Figure 3 As shown, specifically including:

[0082] like Figure 4 As shown, multiple expressions are used to represent all data elements and the nested relationships between different types of data elements.

[0083] like Figure 5 As shown, the various expressions include multi-dimensional stereoscopic expressions and two-dimensional flat expressions.

[0084] The multi-dimensional three-dimensional expression method includes explicitly expressing the type of data elements and the attributes, types and characteristics of the sub-data elements contained in the data elements, separating data elements at the same level with commas, and distinguishing data elements at different levels with indentation.

[0085] The two-dimensional flattened expression method includes flattening the nested relationship of data elements, placing all the flattened data elements on the same level, connecting the parent data elements and child data elements in the data elements with symbols, and prefixing all the data elements of the upper level of each data element except the first level. The data symbols and their meanings are compared as follows: Figure 6 shown.

[0086] In a feasible implementation, "." is used to connect the parent data element and the child data element, and each non-first-level data element will be prefixed with all the data elements in the upper layer. The two data mode representations are exactly the same for atomic data elements, and the difference lies in how non-atomic data elements represent the child data elements they contain.

[0087] Optionally, the defined attribute representation rules represent the attributes of the first-level data elements and the attributes of all the sub-data elements contained therein when the first-level data elements are non-atomic types, thereby accurately locating the attributes of the deep-level data elements, specifically including:

[0088] The attributes of the data elements of the first level are represented, and when the data type of the data elements of the first level is a non-atomic type, the attributes of the sub-data elements contained in the non-atomic data elements are represented.

[0089] The attributes of the data elements at the first level are represented, including:

[0090] When the data type of the data element of the first level is an atomic type, the attribute of the data element is the field name of the data element of the atomic type.

[0091] When the data type of the data element of the first level is a non-atomic type, the attribute of the non-atomic data element of the first level is the name of the non-atomic data element, and the attributes of the non-atomic data elements of other levels are the structure of the parent data elements of other levels, recursively until the structure of the non-atomic data elements of the first level.

[0092] In a feasible implementation, the attributes of the first-level data elements and the attributes of all the child data elements contained in the first-level data elements when the first-level data elements are non-atomic types are represented, thereby accurately locating the attributes of the deep-level data elements. The three core symbols of the attribute representation rules are: ".", "[n]", and "[ ]". "." is used to connect the attributes of data elements of two adjacent levels. The left side is the attribute of the parent data element, and the right side is the attribute of the child data element. It is similar to the two-dimensional flattening method in the data pattern representation rule, but the difference is that the former needs to specify the data type, while the latter only applies to the attribute itself. "[n]" is used to describe the nth child attribute of an array type attribute or to represent the nth row of a table type attribute. The specific meaning depends on whether the attribute before "[n]" is an array type or a table type. "[ ]" is used to represent all sub-attributes of an array type attribute, and is usually followed by "." or "[n]" to specify the next level attributes of all sub-attributes.

[0093] Optionally, define value transformation rules, including:

[0094] Extract and transform the data content of the attributes described according to the attribute representation rules.

[0095] In a feasible implementation, the attributes described by the attribute representation rules are mapped to the transformation of the data content, especially the data content of the sub-data elements contained in the non-atomic data elements, which need to be extracted and transformed in accordance with the attribute representation rules. This rule is generally used when the first-layer data elements are non-atomic types, and the sub-data elements they contain are also non-atomic types, that is, when multiple layers of non-atomic data elements are nested, and the attribute representation rules use "[ ]", there will be value transformations. The data content no longer maintains the original structure, but selectively extracts part of the data content and combines it according to the attribute representation rules. The result of the combination changes the structure of the original data content into a form that better meets user needs, and can be processed secondary based on the transformed results. The corresponding relationship between the attribute representation rules and the value transformation rules is as follows: Figure 7 shown.

[0096] The attribute representation rule is the rule for the field name, and the value transformation rule is the rule for the field value. The value transformation rule is mainly for the case where the data type is an array attribute and the data type is a table attribute. This type of nested attribute can exist alone or be nested in other data types. The specific rule is: the attribute representation rule can be flexibly applied to extract the values ​​of the same position point or position area of ​​each table attribute in the array attribute to form a new array. If the same position point is extracted, the result of the value transformation should be a one-dimensional array, and each element is a single value extracted; if the same position area is extracted, the result of the value transformation should be a two-dimensional array, and each element is a group of values ​​extracted, and each forms a sub-array, nested in the array of the value transformation result, thus forming a two-dimensional array. The reason for using a two-dimensional array to represent the result of the value transformation is to maintain the structure of the original data. Only one transformation is performed for one value transformation operation. Clearly dividing the granularity of the value transformation is conducive to users flexibly using data at different stages for analysis or processing.

[0097] Optionally, define common expression filter conditions and complex filter conditions for nested data elements, including:

[0098] For atomic data elements, design common expression filtering conditions; for non-atomic data elements, design complex expression filtering conditions.

[0099] In a feasible implementation manner, in addition to being different from atomic types in data mode representation and attribute representation, non-atomic data elements also have separate designs for filtering conditions during querying. When a non-atomic data element contains sub-data elements, the query needs to consider the structures of multiple data elements at the same time. Based on this, the present invention designs two preconditions, namely, all are satisfied and there are satisfied, to cope with the filtering conditions of non-atomic data elements.

[0100] For atomic data elements, design common expression filtering conditions, including:

[0101] The filtering conditions for string-type data elements include is empty, is not empty, is equal to, is not equal to, starts with XXX, does not start with XXX, ends with XXX, does not end with XXX, contains XXX, and does not contain XXX.

[0102] The filtering conditions for numeric data elements include empty, not empty, equal to, not equal to, greater than, greater than or equal to, less than, and less than or equal to.

[0103] The data element filtering conditions for the candidate type are the same as those for the string type.

[0104] The filtering conditions for range-type data elements are the same as those for numeric-type data elements. You can apply the filtering conditions once for the upper and lower bounds of the range, specifying the TOP and BOTTOM keywords respectively.

[0105] The filtering conditions for image and file data elements include empty and not empty.

[0106] For non-atomic data elements, design complex expression filtering conditions. Specifically include:

[0107] The table-type data element filtering conditions include position points and position areas. The position point refers to a value in a row or column. The value is of atomic type and the atomic type data element filtering conditions can be reused. The position area refers to a group of values ​​in a row or column. A group of values ​​in a column is regarded as an array, and the data type in the array is of atomic type. The array-type data element filtering conditions can be reused. A group of values ​​in a row is regarded as a container, and the data types in the container are all of atomic type. The container-type data element filtering conditions can be reused.

[0108] The filter conditions for array-type data elements include the two prefixes "existence meets" and "all meets", plus the filter conditions for the data type contained in the array.

[0109] The container-type data element filter condition includes the sum of all types of data element filter conditions contained in the container.

[0110] The data element filter condition of the generator type includes the sum of all types of data element filter conditions contained in the generator.

[0111] In addition, you can combine all expression filter conditions of the above ten data types through AND / OR keywords to form more flexible and specific query conditions.

[0112] The present invention is mainly aimed at the storage data set management system that has been developed by professional storage data set developers, and the system also supports program developers, storage data set administrators, ordinary users and complex users with a certain scientific and technological background. Non-computer professionals who directly use the system in applications based on the system can also customize data models and complete data definition, operation, query and control based on the data models defined by themselves or others, reducing the secondary development and use difficulty of storage data sets.

[0113] The data model targeted by the present invention is a data model with heterogeneity. The heterogeneity does not refer to the heterogeneity of data elements in one data model, but the heterogeneity of multiple data models. The elements that form the heterogeneous data model should include a group of data elements, among which there is at least one non-atomic data element. The data model targeted by the present invention includes data types and attributes. There are two types of data types: atomic source data types and non-atomic data types derived from the source data types. An attribute is a name. For data elements of the first level, the name is a string. For data elements of other levels, the name needs to follow the attribute representation rules defined by the present invention. The attribute representation rules describe the attributes of the sub-data elements contained in the data elements of the first level when they are non-atomic types.

[0114] The query language proposed in the present invention has the following functions:

[0115] (1) Define heterogeneous data models. You can define them from scratch or derive new data models by combining existing data models and data types.

[0116] (2) Modify, delete and merge heterogeneous data patterns. The modification operation includes adding new data elements to the data pattern, adding new sub-data elements to data elements of non-atomic data types in the data pattern, deleting data elements in the data pattern, deleting sub-data elements contained in data elements of non-atomic data types in the data pattern, modifying data elements in the data pattern, and modifying sub-data elements contained in data elements of non-atomic data types in the data pattern. The deletion operation refers to deleting the entire data pattern. Whether this operation is successful depends on whether the data content is stored in the data pattern. If the data content is stored, the deletion operation cannot be performed. Otherwise, the deletion operation can be performed. The fusion operation refers to splicing multiple heterogeneous data patterns into one data pattern through a certain data element. The fused data pattern can selectively contain data elements of multiple data patterns before the fusion.

[0117] (3) Perform query operations on heterogeneous data models. This query refers to displaying the data elements contained in the data model, especially the sub-data elements contained in the non-atomic data elements. Since the sub-data elements can also be non-atomic, the data elements can contain multiple levels according to the data types of the sub-data elements contained in them. The results of the query operation need to reflect the hierarchical structure of all data elements and all the sub-data elements contained in them.

[0118] (4) Insert, modify, and delete data content corresponding to heterogeneous data schemas. Data content depends on the data schema. The insert operation requires that the data content be inserted completely in accordance with the format of the data schema. The modify operation replaces the old data content with the new data content. The delete operation removes one or more entire data contents from the stored data set.

[0119] (5) Performing a query operation on the data content corresponding to the heterogeneous data mode. The query filters the data content and returns the data content that meets the query conditions. The query language proposed in the present invention designs corresponding filtering methods for source data types, non-atomic data types containing source data types, and non-atomic data types containing non-atomic data types. There are common filtering methods and unique filtering methods that are different from other data types. In addition, multiple filtering methods can be superimposed to construct a more complex filtering method, thereby returning more accurate data content.

[0120] (6) Perform permission control operations on storage data sets. The resources in the storage data set include data models, data content, roles, and users. Different operations can be performed on these resources. The collection of resources and operations constitutes permissions, which can be understood as operations on resources. Controlling permissions is to restrict who can perform which operations on which resources.

[0121] S5. Obtain the query statement input by the user, and obtain the query result according to the query statement and the constructed multimodal dataset query language.

[0122] Optionally, the present invention provides a system for a multimodal dataset query language that supports dynamic and autonomous construction of data models. Figure 8 As shown, the above step S5 may include the following steps S51-S55:

[0123] S51. The system receives a query statement input by a user, inputs the query statement into a module compiler, first passes through a lexical analyzer to output tokens, then passes through a syntax analyzer to output a syntax analysis tree, and obtains module compiler output.

[0124] In a feasible implementation, the compiler consists of two parts: a lexical analyzer and a syntax analyzer. The lexical analyzer reads the input query statement and breaks it into a series of tokens. These tokens represent the basic elements of the query language, such as keywords, identifiers, operators, etc. The syntax analyzer receives the output of the lexical analyzer (token sequence) and builds a syntax analysis tree. The tree represents the structure of the query statement and is used to ensure that the query complies with the grammatical rules.

[0125] S52. The module compiler output is input to the module parser, the node values ​​of the syntax analysis tree are first output through the scanner, and then the logical plan tree is output through the binder to obtain the module parser output.

[0126] In a feasible implementation, the main responsibility of the parser is to parse the syntax tree generated by the lexical and grammatical analyzer and convert it into an internal representation that the system can further process, namely the logical plan tree, in preparation for query execution. This conversion process is crucial to understanding and executing user queries, as it ensures the correctness and efficiency of the queries. The syntax tree is traversed using the DFS (Depth-First-Search) algorithm, and the corresponding conversion rules are applied to each node to generate a logical plan tree. The logical plan tree converts the query into a series of operations, such as scanning, filtering, and joining, by generating a tree structure that is closer to the final execution plan. Each node on the logical plan tree corresponds to an operation, which is arranged from bottom to top in the order in which the operations are executed.

[0127] S53, the module parser output is input into the module permission checker, and it passes through the access control list acquirer, the logical plan tree traverser, the resource permission checker, and the operation permission checker in sequence, and finally outputs whether it is allowed, and obtains whether access is allowed or not.

[0128] In a feasible implementation mode, the permission control mode is as follows: Fig. 9 As shown in the figure, the purpose of the permission checker is to confirm whether the user who initiated the query has the permission to execute the query, thereby ensuring that only authorized users can perform specific query operations. The permission checker traverses the logical plan tree, first judging whether the user can perform such operations based on the current user's ACL (Access Control List), and checking whether the attributes of the current operation are legal.

[0129] S54. If access is allowed, the module parser output is input into the module optimizer, first passes through the logical plan tree optimizer, outputs the logical plan tree after rule optimization, and then passes through the physical execution tree constructor, outputs the physical execution tree, and obtains the module optimizer output.

[0130] If access is not allowed, the query ends.

[0131] In a feasible implementation, the main responsibility of the optimizer is to optimize the ordering of operation nodes on the logical plan tree based on a specific method without affecting the original logic and semantics, and to convert the abstract operation nodes on the logical plan tree into specific operation nodes for a specific system according to the specific scenario.

[0132] S55, enter the fifth module executor, output the search result data through the physical execution tree iterator, and return it to the user.

[0133] In a feasible implementation, the main function of the executor is to convert the execution plan generated by the optimizer into actual storage data set operations and finally generate query results. The query language executor proposed in the present invention selects the volcano model as the data model. The volcano model is represented as a tree, in which the leaf nodes are usually data scanning operations, and the intermediate nodes are various data processing operations. Data flows from the leaf nodes to the root nodes, and each layer of nodes performs certain processing on the data. Each operation in the volcano model is implemented as an iterator. These iterators interact through a unified interface (usually including methods such as next and close). In the volcano model, data is not generated all at once, but is generated step by step through the iterator interface. When the executor calls the method of an operation, the operation generates the next data element and passes it to the upper layer operation.

[0134] For example, Example 1 corresponds to the establishment of corresponding data element objects and the definition of data model representation rules of the present invention.

[0135] The data model tree is as follows Fig.10 As shown in the figure, the first case is the data recording of the interface preparation process and fatigue performance of ceramic matrix composites. Interface preparation requires multiple stages, and the preparation processes adopted in each stage may be the same or different, and the parameters of the same process are not exactly the same. Different combinations of these variables will affect the fatigue performance of ceramic matrix composites. Fig.10It is a tree diagram of the template schema. The template contains three first-level attributes, namely materialGrade of STRING type, Process of ARRAY type, and fatiguePerformance of CONTAINER type. Process nests GENERATOR type, that is, each element of Process is a second-level attribute of GENERATOR type, representing a set of options for the preparation process. The second-level attributes contain three third-level attributes, all of which are CONTAINER type, representing four preparation processes. Each preparation process contains some fourth-level attributes. FatiguePerformance nests two second-level attributes, namely loadPeak of NUMBER type, Cycles of NUMBER type, and fractureOrNot of CHOICE type.

[0136] This case mainly demonstrates that the combination of GENERATOR, CONTAINER and ARRAY can create a very flexible template. The four preparation processes correspond to the properties of the four CONTAINER types, which are stored as options in the GENERATOR type, that is, the GENERATOR has four CONTAINER options, and each GENERATOR is an element of the ARRAY. Such a template structure can cover all the sequential permutations and combinations of the four processes, greatly simplifying the process of scientific researchers to organize experimental data.

[0137] Embodiment 2: Corresponding to the defined attribute representation rules and the defined value transformation rules of the present invention, the filtering conditions of the WHERE clause are specially designed for non-atomic data elements.

[0138] The data model tree is as follows Fig.11 As shown in the figure, the second case is the data recording of multi-sample cell experiments on nerve repair materials. There are multiple samples of each nerve repair material. We want to do multiple cell experiments on each sample of each material and record the data, so as to explore the influence of different materials, different samples and cell experiment parameters on the experimental results. Fig.11It is a tree diagram of the template schema. The template contains two first-level attributes, namely materialName of STRING type and neurorePairData of ARRAY type. NeurorePairData nests CONTAINER type, that is, each element of neurorePairData is a second-level attribute of CONTAINER type, representing a sample of neural repair material. The second-level attribute contains three third-level attributes, namely orientation of STRING type, cellExperiment of TABLE type, and surfaceTopology of STRING type. CellExperiment nests four fourth-level attributes, that is, the four columns of the table are cellSourceSpecies of STRING type, primaryOrNot of CHOICE type, stemCell of STRING type, and cellGeneration of NUMBER type.

[0139] The following are three examples of complex queries to help you better understand DCQL (Dynamic Container Query Language).

[0140] Query1, find out the names of the materials of primary cultured cells used in every cell experiment for a sample.

[0141]

[0142] Query2, calculate the average value of cellGeneration of cellExperiment whose orientation is multi-directional.

[0143]

[0144] Query 3, query the cell generations of the first two samples of nerve repair materials, and these two samples need to simultaneously meet the following two conditions: the stemCells in each experiment of the first sample are mouse fibroblasts, and the stemCells in each experiment of the second sample are human embryonic stem cells.

[0145]

[0146] Example 3: The data model tree is as follows Fig.12As shown in the figure, the third case is a data record of measuring the corrosion of high-speed rail materials. There are two templates in the stored data set: "High-speed rail material composition information" and "High-speed rail material corrosion and environment". Now we want to splice the two together through the public field materialGrade to explore the impact of material composition on corrosion rate. Fig.12 It is a tree diagram of template schema. S1 and S2 are two templates participating in JOIN, and S3 is the template after splicing. The check mark selects the attribute participating in JOIN.

[0147]

[0148] The query language of the present invention differs from the existing N1QL in three aspects: 1. The query language of the present invention is targeted at the independently developed dynamic container storage model, rather than native JSON, and has a total of ten data types. N1QL targets native JSON and has a total of six data types. The advantage of the query language of the present invention is that the data types are closer to the natural thinking mode of scientific researchers, easy to read and use, and do not require too much computer knowledge or learning JSON, and are more user-friendly; 2. The query language of the present invention has a simpler syntax when operating on array elements; 3. The query language of the present invention supports schema, that is, it supports mode. Each template has a corresponding mode, and data with the same mode is stored in the same template, while N1QL does not support schema, and data of any structure can be put into the same bucket. The consequence of this is that the fields are not unified and disorganized, and users are required to frequently use IS MISSING to determine whether a field exists. More processing and conditional judgment are required during retrieval, which affects query performance.

[0149] Different from traditional SQL, the query language of the present invention has N patterns and M templates, while SQL has one pattern and M tables. The query language of the present invention can form N patterns (structures) because of the diversity of data types and support for nesting, while SQL has only one pattern, which is table.

[0150] In the embodiments of the present invention, the problem of low compatibility between the traditional SQL language and multimodal data sets is solved, and the extended SQL is conducive to concise and efficient retrieval of multimodal data.

[0151] The present invention dynamically and autonomously constructs data models. Different from traditional relational databases and SQL, where the database administrator constructs the data model in advance, the query language and method proposed in the present invention support users to dynamically and autonomously construct data models according to their needs during the use of the database without relying on the database administrator. At the same time, it supports more data types and nested operations, and is more flexible in both usage mode and specific operations.

[0152] Fig.13 The system block diagram of a hybrid structure multimodal data query language according to an exemplary embodiment is shown, and the system is used for a hybrid structure multimodal data query language method. Fig.13 The system includes an acquisition module 1310, a structure construction module 1320, a creation module 1330, a construction module 1340 and an output module 1350. Among them:

[0153] The acquisition module 1310 is used for the user to organize the existing data, independently create the data model of the multimodal data set, and obtain the nested relationship between different types of data elements in the data model; wherein, multimodal data refers to the integration of structured, semi-structured and unstructured data.

[0154] The structure building module 1320 is used to select a key data structure or use an algorithm as the first-level data structure of the entire data model, use different types of data elements as the first-level data structure or elements or substructures under the first-level data structure, and use an algorithm to form a single-layer or multi-layer data structure.

[0155] The establishment module 1330 is used to establish data element objects according to the nested relationship formed by the single-layer or multi-layer data structure and the constructed query language.

[0156] The construction module 1340 is used to complete the dynamic and autonomous construction of the multimodal dataset query language according to the data element objects, the defined data model representation rules, the defined attribute representation rules, the defined value transformation rules and the defined WHERE clause filtering conditions.

[0157] The output module 1350 is used to obtain the query statement input by the user, and obtain the query result according to the query statement and the constructed multimodal dataset query language.

[0158] In the embodiments of the present invention, the problem of low compatibility between the traditional SQL language and multimodal data sets is solved, and the extended SQL is conducive to concise and efficient retrieval of multimodal data.

[0159] The present invention dynamically and autonomously constructs data models. Different from traditional relational databases and SQL, where the database administrator constructs the data model in advance, the query language and method proposed in the present invention support users to dynamically and autonomously construct data models according to their needs during the use of the database without relying on the database administrator. At the same time, it supports more data types and nested operations, and is more flexible in both usage mode and specific operations.

[0160] Fig.14 is a schematic diagram of a structure of a device for a hybrid multimodal data query language provided by an embodiment of the present invention, such as Fig.14 As shown, the device of the hybrid structure multimodal data query language may include the above Fig.13 The system of the hybrid structure multimodal data query language is shown. Optionally, the device 410 of the hybrid structure multimodal data query language may include a first processor 2001 .

[0161] Optionally, the device 410 for a multimodal data query language with a mixed structure may further include a memory 2002 and a transceiver 2003 .

[0162] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0163] Combine the following Fig.14 The components of the hybrid multimodal data query language device 410 are specifically introduced as follows:

[0164] The first processor 2001 is the control center of the device 410 of the hybrid structure multimodal data query language, which can be a processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs).

[0165] Optionally, the first processor 2001 may execute various functions of the device 410 for the hybrid structured multimodal data query language by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002 .

[0166] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Fig.14 CPU0 and CPU1 are shown in FIG.

[0167] In a specific implementation, as an embodiment, the hybrid structure multimodal data query language device 410 may also include multiple processors, such as Fig.14The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0168] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0169] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001, or may exist independently, and may be accessed through the interface circuit ( Fig.14 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0170] The transceiver 2003 is used to communicate with a network device or a terminal device.

[0171] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Fig.14 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0172] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently, and may be implemented through the interface circuit ( Fig.14 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0173] It should be noted that Fig.14 The structure of the hybrid structure multimodal data query language device 410 shown in the figure does not constitute a limitation on the router, and the actual knowledge structure recognition device may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0174] In addition, the technical effects of the hybrid-structured multimodal data query language device 410 can refer to the technical effects of the hybrid-structured multimodal data query language method described in the above method embodiment, which will not be repeated here.

[0175] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0176] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0177] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A hybrid structure multimodal data query language method, It is characterized in that The method comprises: S1. After arranging the existing data, the user independently creates the data model of the multimodal data set and obtains the nested relationship between different types of data elements in the data model; multimodal data refers to the integration of structured, semi-structured and unstructured data; S2. Select a key data structure or an algorithm as the first-level data structure of the entire data model, use different types of data elements as the first-level data structure or elements or substructures under the first-level data structure, and use the algorithm to form a single-layer or multi-layer data structure; S3, establishing a data element object according to the nested relationship formed by the single-layer or multi-layer data structure described in S2 and the constructed query language; S4. Dynamically and autonomously construct a multimodal data set query language according to the data element object, the defined data mode representation rule, the defined attribute representation rule, the defined value transformation rule, and the defined common expression filtering conditions and the complex filtering conditions for nested type data elements; S5. Obtain a query statement input by the user, and obtain a query result according to the query statement and the constructed multimodal dataset query language.

2. The method of hybrid structure multimodal data query language according to claim 1, It is characterized in that The data elements include single-layer or multi-layer data elements; The data element object includes: attributes of the data element, data type of the data element, and when the data type of the data element of the first level is a non-atomic type, sub-data elements contained in the non-atomic type data element.

3. The method of hybrid structure multimodal data query language according to claim 1, It is characterized in that The defined data mode representation rules include: Use multiple expressions to represent all data elements and the nested relationships between different types of data elements; The multiple expressions include a multi-dimensional stereoscopic expression and a two-dimensional flat expression; The multi-dimensional stereoscopic expression includes explicitly expressing the type of data elements and the attributes, types and characteristics of sub-data elements contained in the data elements, separating data elements at the same level with commas, and distinguishing data elements at different levels with indentation positions; The two-dimensional flattened expression method includes flattening the nested relationship of data elements, placing all the flattened data elements at the same level, connecting the parent data elements and the child data elements in the data elements with symbols, and for each data element at a level other than the first level, using all the data elements of the upper level of the level as prefixes.

4. The method of hybrid structure multimodal data query language according to claim 1, It is characterized in that The defined attribute representation rules include: Representing the attributes of the data elements of the first level, and when the data type of the data elements of the first level is a non-atomic type, representing the attributes of the sub-data elements contained in the data elements of the non-atomic type; The representation of the attributes of the data elements of the first level includes: When the data type of the data element of the first level is an atomic type, the attribute of the data element is the field name of the data element of the atomic type; When the data type of the data element of the first level is a non-atomic type, the attribute of the non-atomic data element of the first level is the name of the non-atomic data element, and the attributes of the non-atomic data elements of other levels are the structure of the parent data elements of other levels, recursively until the structure of the non-atomic data elements of the first level.

5. The method of hybrid structure multimodal data query language according to claim 1, It is characterized in that The defined value transformation rules include: Extract and transform the data content of the attributes described according to the attribute representation rules.

6. The method of hybrid structure multimodal data query language according to claim 1, It is characterized in that The defined common expression filtering conditions and complex filtering conditions for nested data elements include: For atomic data elements, design common expression filtering conditions; for non-atomic data elements, design complex expression filtering conditions; The filtering conditions include all satisfied and existence satisfied.

7. The method of hybrid structure multimodal data query language according to claim 1, It is characterized in that The step of obtaining a query statement input by a user in S5 and obtaining a query result according to the query statement and the constructed multimodal dataset query language includes: S51, obtaining a query statement input by a user, inputting the query statement into a module compiler, and obtaining an output of the module compiler; The module compiler output includes lexical units output by a lexical analyzer, and a grammatical analysis tree is obtained according to the lexical units and the grammatical analyzer; S52, inputting the module compiler output into a module parser to obtain a module parser output; The module parser output includes node values ​​of the syntax analysis tree output by the scanner, and a logical plan tree is obtained according to the node values ​​and the binder; S53, inputting the module parser output into the module permission checker to obtain whether access is allowed or not; S54, if access is allowed, inputting the module parser output into the module optimizer to obtain the module optimizer output; If access is not allowed, the query ends; S55, input the module optimizer output to the module executor to obtain the query result.

8. A system of a hybrid structure multimodal data query language, wherein the system of the hybrid structure multimodal data query language is used to implement the method of the hybrid structure multimodal data query language according to any one of claims 1 to 7, It is characterized in that The system comprises: The acquisition module is used for users to organize existing data, independently create data models of multimodal data sets, and obtain the nested relationships between different types of data elements in the data model; A structure building module is used to select a key data structure or an algorithm as the first-level data structure of the entire data model, use different types of data elements as the first-level data structure or elements or substructures under the first-level data structure, and use an algorithm to form a single-layer or multi-layer data structure; An establishment module, used to establish a data element object according to the nested relationship formed by the single-layer or multi-layer data structure and the constructed query language; A construction module, for completing the dynamic and autonomous construction of a multimodal dataset query language according to the data element objects, defined data mode representation rules, defined attribute representation rules, defined value transformation rules, and defined common expression filtering conditions and complex filtering conditions for nested type data elements; The output module is used to obtain the query statement input by the user and obtain the query result according to the query statement and the constructed multimodal dataset query language.

9. A hybrid multimodal data query language device, It is characterized in that The device of the hybrid structure multimodal data query language includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • XML enquire method based on multi-modality indexes structure

    CN101183385A

  • Dynamic database query system and method based on metadata

    CN102799644A

  • SQL interpreter of HBase and optimization method

    CN111309757A

  • Query method and system based on multi-data engine dynamic loading

    CN113032423A

  • Method and device for merging data structure of multiple prefessional dictionary for electronic dictionary

    CN1641640A

Cited By

  • Multi-modal time sequence mixed query system and method

    CN120086243A