WO2019228015A1 - 基于移动端NoSQL数据库的索引创建方法及装置 - Google Patents
基于移动端NoSQL数据库的索引创建方法及装置 Download PDFInfo
- Publication number
- WO2019228015A1 WO2019228015A1 PCT/CN2019/077439 CN2019077439W WO2019228015A1 WO 2019228015 A1 WO2019228015 A1 WO 2019228015A1 CN 2019077439 W CN2019077439 W CN 2019077439W WO 2019228015 A1 WO2019228015 A1 WO 2019228015A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- index
- storage structure
- nosql database
- nosql
- index information
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
Definitions
- the present application relates to the field of data query technology, and in particular, to a method and device for creating an index based on a mobile NoSQL database, a data query method and device, a computer device, and a computer-readable storage medium.
- the mainstream database on the mobile side is the relational database Sqlite.
- the NoSQL database (Not OnlyOnly SQL, which means "not only "It is SQL.”
- NoSQL is mainly used for the storage of massive data on the server side) is a better alternative.
- NoSQL databases are based on key-value stores and can only be used for extremely simple key-value queries.
- An index mechanism can also be established inside NoSQL databases, but the indexes created in this way are all related to the NoSQL The specific implementation is strongly correlated and has no portability.
- this application provides a method and device for creating an index based on a mobile NoSQL database, a data query method and device, a computer device, and a computer-readable storage medium.
- the NoSQL database is related by establishing an index outside the NoSQL database.
- the query does not need to carry out very complicated design on the application side, and is not related to the specific implementation of NoSQL, which is conducive to the better promotion of NoSQL databases and has portability.
- the index created according to the above index creation method to query data from a NoSQL database can achieve the purpose of fast query.
- an index creation method based on a mobile-end NoSQL database including:
- the index information corresponding to the corresponding attribute is stored in the numerical index storage structure or the character index storage structure;
- the address of the NoSQL database, the address of the numeric index storage structure, and the address of the character index storage structure are stored in the NoSql connection pool.
- an index creation device based on a mobile NoSQL database including:
- the index information setting module is used to set index information according to the attributes of the pre-stored data in the NoSQL database
- a storage module configured to determine, according to the type of the pre-stored data of the corresponding attribute, to store index information corresponding to the corresponding attribute into a numerical index storage structure or a character-type index storage structure;
- the NoSql connection pool is used to store the address of a NoSQL database, the address of a numeric index storage structure, and the address of a character index storage structure.
- a data query method based on a mobile-end NoSQL database including:
- a data query device based on a mobile-end NoSQL database including:
- An index information search module configured to find corresponding index information from a numerical index storage structure and / or a character index storage structure according to the query condition;
- An address obtaining module configured to obtain an address of a NoSQL database from a NoSql connection pool according to the index information
- a data search module is configured to search corresponding data from a corresponding NoSQL database according to the address of the NoSQL database.
- a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- the processor implements the computer program when the computer program is executed. Index creation method based on mobile NoSQL database.
- a computer-readable storage medium stores a computer program that executes the index creation method based on the mobile-end NoSQL database.
- a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- the processor implements the computer program when the computer program is executed.
- Data query method based on mobile NoSQL database.
- a computer-readable storage medium stores a computer program that executes the data query method based on the mobile-end NoSQL database.
- the present application uses the attributes of the pre-stored data in the NoSQL database to create an index.
- the index is created outside the NoSQL database to perform a relational query on the NoSQL database. This eliminates the need for a very complicated design on the application side.
- the specific implementation is irrelevant, which is conducive to the better promotion of NoSQL database and has portability.
- the index created according to the above index creation method to query data from a NoSQL database can achieve the purpose of fast query.
- FIG. 1 is a flowchart of a method for creating an index based on a mobile NoSQL database of the present application
- FIG. 2 is a structural block diagram of an index creation device based on a mobile-end NoSQL database of the present application
- FIG. 3 is a flowchart of a data query method based on a mobile-end NoSQL database of the present application
- FIG. 4 is a structural block diagram of a data query device based on a mobile NoSQL database of the present application.
- the method or device may include more or fewer operation steps or module units. .
- the execution order or the module structure of the device is not limited to the execution order or the module structure shown in the embodiment of the present application or the drawings.
- the method or the module structure shown in the embodiment or the drawings may be executed sequentially or in parallel.
- a mobile terminal NoSQL database index creation method is provided in this application. As shown in FIG. 1, the method includes:
- Step 101 Set the index information according to the attributes of the pre-stored data in the NoSQL database.
- Step 102 Determine, according to the type of the pre-stored data of the corresponding attribute, to store index information corresponding to the corresponding attribute into a numerical index storage structure or a character-type index storage structure;
- Step 103 Store the address of the NoSQL database, the address of the numeric index storage structure, and the address of the character index storage structure in the NoSql connection pool.
- the present application sets the index information through annotations. The purpose of doing so is to facilitate the application layer to set the index information without invading the original logic in the NoSQL database.
- the rules for numerical index sorting and character index sorting are different (the latter is lexicographic order).
- This application creates a dual index storage structure: a numerical index storage structure and a character index storage. structure.
- a numerical index storage structure When you create an index for a NoSQL database, you need to analyze whether the stored data in it is numeric or character.
- the pre-stored data is human information
- its data attributes can be age, name, height, weight, and so on.
- the data attribute is age, height, weight, etc.
- the data type is numeric
- the data attribute is name
- the data type is character.
- the numeric index storage structure and the character index storage structure need to be stored separately.
- step 102 is specifically performed as follows: storing the sorted index information into a numeric index storage structure or a character index storage structure.
- the purpose of sorting the numeric index is to prevent situations like "10" and less than "2", that is, if no numeric sort is added, the character sort processing will be performed. At this time, "10" will be less than "2" "Case. Because the index uses an ordered structure, the time complexity of a complex sort such as OrderBy reaches O (N). The entire index creation method does not need to intrude into the underlying database implementation and application layer implementation, which makes this index creation method highly portable.
- the present application manages multiple NoSql instances through a NoSql connection pool (Connection Pool), thereby facilitating the storage of indexes.
- this application also provides a device for creating an index based on a mobile NoSQL database, as described in the following embodiments. Because the principle of the mobile terminal NoSQL database-based index creation device solves the problem is similar to the mobile terminal NoSQL database-based index creation method, the implementation of the mobile terminal NoSQL database-based index creation device can refer to the mobile terminal NoSQL database-based index creation method. Implementation, repeated details will not be repeated.
- the term "unit” or "module” may be a combination of software and / or hardware that implements a predetermined function.
- FIG. 2 is a block diagram of a device for creating an index based on a mobile NoSQL database according to the present application, as shown in FIG. 2, including:
- the index information setting module 201 is configured to set index information according to the attributes of the pre-stored data in the NoSQL database;
- the storage module 202 is configured to determine, according to the type of the pre-stored data of the corresponding attribute, to store index information corresponding to the corresponding attribute into a numerical index storage structure or a character index storage structure;
- the NoSql connection pool 203 is used to store the address of a NoSQL database, the address of a numeric index storage structure, and the address of a character index storage structure.
- the storage module 202 is specifically configured to store the numerical index storage structure and the character index storage structure separately.
- the method further includes: a NoSQL comparator 204, configured to sort and process the index information corresponding to the corresponding attribute to obtain the index information after the sorting process;
- the storage module 202 is specifically configured to:
- the sorted index information is stored in a numeric index storage structure or a character index storage structure.
- the present application also proposes a data query method based on a mobile NoSQL database. As shown in FIG. 3, the method includes:
- Step 301 Receive a query condition.
- Step 302 Find corresponding index information from a numerical index storage structure and / or a character index storage structure according to the query condition.
- Step 303 Obtain the address of the NoSQL database from the NoSql connection pool according to the index information.
- Step 304 Find the corresponding data from the corresponding NoSQL database according to the address of the NoSQL database.
- step 302 specifically includes:
- the corresponding index information is found from the numerical index storage structure and / or the character index storage structure according to the attribute and type of the query condition.
- this application uses QueryClause to provide relational query statements, so that user code logic can be seamlessly transplanted.
- FIG. 4 is a structural block diagram of a data query device based on a mobile NoSQL database of the present application. As shown in FIG. 4, the device includes:
- a receiving module 401 configured to receive a query condition
- An index information searching module 402 configured to find corresponding index information from a numerical index storage structure and / or a character index storage structure according to the query condition;
- An address obtaining module 403, configured to obtain an address of a NoSQL database from a NoSql connection pool according to the index information;
- the data search module 404 is configured to search corresponding data from a corresponding NoSQL database according to the address of the NoSQL database.
- the index information search module 402 is specifically configured to:
- the corresponding index information is found from the numerical index storage structure and / or the character index storage structure according to the attribute and type of the query condition.
- An embodiment of the present application further provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- the processor executes the computer program, the mobile terminal is implemented based on the mobile terminal. Indexing method of NoSQL database.
- An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program that executes the index creation method based on the mobile-end NoSQL database.
- An embodiment of the present application further provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- the processor executes the computer program, the mobile terminal is implemented based on the mobile terminal.
- Data query method of NoSQL database
- An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program that executes the data query method based on the mobile terminal NoSQL database.
- this application uses the attributes of the pre-stored data in the NoSQL database to create an index.
- the index is created outside the NoSQL database to perform a relational query on the NoSQL database. This eliminates the need for a very complicated design on the application side and is beneficial to the NoSQL database. The better promotion of is not related to the specific implementation of NoSQL, which is conducive to the better promotion of NoSQL databases and has portability.
- This index creation method can be used in any nosql database. Using this index creation method allows the mobile terminal to freely choose a nosql database that meets the business requirements. Even if the database does not have a self-built index, it can also implement relational queries without modifying the upper-level services.
- the index created according to the above index creation method to query data from a NoSQL database can achieve the purpose of fast query.
- this application may be provided as a method, a system, or a computer program product. Therefore, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
- computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions
- the device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种基于移动端NoSQL数据库的索引创建方法及装置、数据查询方法及装置、计算机设备、计算机可读存储介质,涉及数据查询技术领域。该创建方法包括:根据NoSQL数据库中预存数据的属性设置索引信息(101);根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中(102);将NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地址存储在NoSql连接池中(103)。该方法通过NoSQL数据库中要预存数据的属性进行索引创建,是在NoSQL数据库外部建立索引进行关系查询,这样无需在应用端进行非常复杂的设计,与NoSQL的具体实现不相关,具有可移植性。
Description
本申请涉及数据查询技术领域,特别涉及一种基于移动端NoSQL数据库的索引创建方法及装置、数据查询方法及装置、计算机设备、计算机可读存储介质。
移动端的主流数据库是关系型数据库Sqlite,而相对于移动端较少的数据量以及较快的查询存储时间的需求来讲,更为简单、快速的NoSQL数据库(Not Only SQL,意即“不仅仅是SQL”。在现代的计算系统上,NoSQL主要用于服务端海量数据的存储)是一种更好的替代。但是NoSQL数据库是基于键值存储,只能用于极为简单的键值查询。为了实现NoSQL的关系查询,可以在应用端进行非常复杂的设计,但是这样不利于NoSQL数据库的更好的推广,还可以在NoSQL数据库内部建立索引机制,但是这样建立的索引均是与该NoSQL的具体实现强相关,无可移植性。
发明内容
有鉴于此,本申请提供了一种基于移动端NoSQL数据库的索引创建方法及装置、数据查询方法及装置、计算机设备、计算机可读存储介质,通过在NoSQL数据库外部建立索引来对NoSQL数据库进行关系查询,这样无需在应用端进行非常复杂的设计,与NoSQL的具体实现不相关,有利于NoSQL数据库的更好的推广,具有可移植性。依据上述索引创建方法创建的索引来从NoSQL数据库中查询数据,可以达到快速查询的目的。
为实现上述目的,本申请提供技术方案如下:
根据本申请的第一方面,提出了基于移动端NoSQL数据库的索引创建方法,包括:
根据NoSQL数据库中预存数据的属性设置索引信息;
根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中;
将NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地 址存储在NoSql连接池中。
根据本申请的第二方面,提出了基于移动端NoSQL数据库的索引创建装置,包括:
索引信息设置模块,用于根据NoSQL数据库中预存数据的属性设置索引信息;
存储模块,用于根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中;
NoSql连接池,用于存储NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地址。
根据本申请的第三方面,提出了基于移动端NoSQL数据库的数据查询方法,包括:
接收查询条件;
根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息;
根据所述索引信息从NoSql连接池中获取NoSQL数据库的地址;
根据所述NoSQL数据库的地址,从相应的NoSQL数据库查找相应的数据。
根据本申请的第四方面,提出了基于移动端NoSQL数据库的数据查询装置,包括:
接收模块,用于接收查询条件;
索引信息查找模块,用于根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息;
地址获取模块,用于根据所述索引信息从NoSql连接池中获取NoSQL数据库的地址;
数据查找模块,用于根据所述NoSQL数据库的地址,从相应的NoSQL数据库查找相应的数据。
根据本申请的第五方面,提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述所述基于移动端NoSQL数据库的索引创建方法。
根据本申请的第六方面,提出了一种计算机可读存储介质,所述计算机可读存储介质存储有执行上述所述基于移动端NoSQL数据库的索引创建方法的计算机程序。
根据本申请的第七方面,提出了一种计算机设备,包括存储器、处理器及存储在存 储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述所述基于移动端NoSQL数据库的数据查询方法。
根据本申请的第八方面,提出了一种计算机可读存储介质,所述计算机可读存储介质存储有执行上述所述基于移动端NoSQL数据库的数据查询方法的计算机程序。
由以上技术方案可见,本申请通过NoSQL数据库中要预存数据的属性进行索引创建,是在NoSQL数据库外部建立索引来对NoSQL数据库进行关系查询,这样无需在应用端进行非常复杂的设计,与NoSQL的具体实现不相关,有利于NoSQL数据库的更好的推广,具有可移植性。依据上述索引创建方法创建的索引来从NoSQL数据库中查询数据,可以达到快速查询的目的。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一种基于移动端NoSQL数据库的索引创建方法流程图;
图2是本申请一种基于移动端NoSQL数据库的索引创建装置结构框图;
图3是本申请一种基于移动端NoSQL数据库的数据查询方法流程图;
图4是本申请一种基于移动端NoSQL数据库的数据查询装置结构框图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面参考本申请的若干代表性实施方式,详细阐释本申请的原理和精神。
虽然本申请提供了如下述实施例或附图所示的方法操作步骤或装置结构,但基于常规或者无需创造性的劳动在所述方法或装置中可以包括更多或者更少的操作步骤或模 块单元。在逻辑性上不存在必要因果关系的步骤或结构中,这些步骤的执行顺序或装置的模块结构不限于本申请实施例或附图所示的执行顺序或模块结构。所述的方法或模块结构的在实际中的装置或终端产品应用时,可以按照实施例或者附图所示的方法或模块结构进行顺序执行或者并行执行。
下面介绍本申请的具体技术方案。
传统的移动端NoSQL数据库,如realm、objectbox的索引建立和关系查询均是基于自己的数据库特定实现,不具备通用性。基于此,在本申请提供了一种基于移动端NoSQL数据库的索引创建方法,如图1所示,该方法包括:
步骤101:根据NoSQL数据库中预存数据的属性设置索引信息;
步骤102:根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中;
步骤103:将NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地址存储在NoSql连接池中。
在本申请的一种实施方式中,本申请通过注解(Annotation)来设置索引信息,这样做的目的是方便应用层设置索引信息,对NoSQL数据库中的原有逻辑无侵入。
在本申请的一种实施方式中,针对数值型索引排序与字符型索引排序的规则不同(后者是字典序),本申请创建了双索引存储结构:数值型索引存储结构和字符型索引存储结构。在为NoSQL数据库创建索引时,需要分析其中的预存数据属于数值型还是字符型。比如,当预存数据为人的信息时,其数据属性可以是年龄、姓名、身高、体重等等。针对数据属性是年龄、身高、体重等,其数据类型属于数值型,针对数据属性是姓名时,其数据类型属于字符型。数值型索引存储结构和字符型索引存储结构需要分开存储。
在本申请的一种实施方式中,现有的NoSQL数据库中一般存在字符型索引排序,不存在数值型排序,因此,本申请会将与相应属性相对应的索引信息进行排序处理(此处所指的是数值型排序),获得排序处理后的索引信息,然后步骤102具体按照如下执行:将排序处理后的索引信息存入数值型索引存储结构或字符型索引存储结构中。其中对数值型索引进行排序处理的目的是防止类似“10”小于“2”的情况发生,也就是说不添加数值型排序,会根据字符型排序处理,此时会出现“10”小于“2”的情况。由于索引采用有序结构,使得OrderBy这样的复杂排序时间复杂度达到O(N)。整个索引创建方法无需侵入底层数据库实现以及应用层实现,使得本索引创建方法具有强大的可 移植性。
在本申请的一种实施方式中,本申请通过NoSql连接池(Connection Pool)来管理多个NoSql实例,从而方便索引的存储。
基于同一申请构思,本申请还提供了一种基于移动端NoSQL数据库的索引创建装置,如下面的实施例所述。由于基于移动端NoSQL数据库的索引创建装置解决问题的原理与基于移动端NoSQL数据库的索引创建方法相似,因此基于移动端NoSQL数据库的索引创建装置的实施可以参见基于移动端NoSQL数据库的索引创建方法的实施,重复之处不再赘述。以下所使用的,术语“单元”或者“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是本申请一种基于移动端NoSQL数据库的索引创建装置结构框图,如图2所示,包括:
索引信息设置模块201,用于根据NoSQL数据库中预存数据的属性设置索引信息;
存储模块202,用于根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中;
NoSql连接池203,用于存储NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地址。
在本申请的一种实施方式中,所述存储模块202具体用于:将所述数值型索引存储结构和字符型索引存储结构分开存储。
在本申请的一种实施方式中,还包括:NoSQL比较器204,用于将与相应属性相对应的索引信息进行排序处理,获得排序处理后的索引信息;
所述存储模块202具体用于:
将排序处理后的索引信息存入数值型索引存储结构或字符型索引存储结构中。
基于上述索引创建方法,本申请还提出了基于移动端NoSQL数据库的数据查询方法,如图3所示,该方法包括:
步骤301:接收查询条件;
步骤302:根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息;
步骤303:根据所述索引信息从NoSql连接池中获取NoSQL数据库的地址;
步骤304:根据所述NoSQL数据库的地址,从相应的NoSQL数据库查找相应的数据。
在本申请的一种实施方式中,步骤302具体包括:
确定所述查询条件的属性和类型;
根据所述查询条件的属性和类型从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息。
本申请在执行数据查询时,采用Query Clause来提供关系型查询语句,使用户代码逻辑做到无缝移植。
基于同一申请构思,本申请实施例中还提供了一种基于移动端NoSQL数据库的索引创建装置,如下面的实施例所述。图4是本申请一种基于移动端NoSQL数据库的数据查询装置结构框图,如图4所示,该装置包括:
接收模块401,用于接收查询条件;
索引信息查找模块402,用于根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息;
地址获取模块403,用于根据所述索引信息从NoSql连接池中获取NoSQL数据库的地址;
数据查找模块404,用于根据所述NoSQL数据库的地址,从相应的NoSQL数据库查找相应的数据。
在本申请的一种实施方式中,所述索引信息查找模块402具体用于:
确定所述查询条件的属性和类型;
根据所述查询条件的属性和类型从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息。
本申请实施例还提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述所述基于移动端NoSQL数据库的索引创建方法。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有 执行上述所述基于移动端NoSQL数据库的索引创建方法的计算机程序。
本申请实施例还提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述所述基于移动端NoSQL数据库的数据查询方法。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有执行上述所述基于移动端NoSQL数据库的数据查询方法的计算机程序。
综上所述,本申请通过NoSQL数据库中要预存数据的属性进行索引创建,是在NoSQL数据库外部建立索引来对NoSQL数据库进行关系查询,这样无需在应用端进行非常复杂的设计,有利于NoSQL数据库的更好的推广,与NoSQL的具体实现不相关,有利于NoSQL数据库的更好的推广,具有可移植性。该索引创建方法可以用于任何nosql数据库。使用本索引创建方法能够让移动端自由选择符合业务要求的nosql数据库,即使该数据库无自建索引,也可以实现关系查询,而无需修改上层业务。依据上述索引创建方法创建的索引来从NoSQL数据库中查询数据,可以达到快速查询的目的。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请实施例可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (14)
- 一种基于移动端NoSQL数据库的索引创建方法,其特征在于,包括:根据NoSQL数据库中预存数据的属性设置索引信息;根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中;将NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地址存储在NoSql连接池中。
- 如权利要求1所述的基于移动端NoSQL数据库的索引创建方法,其特征在于,所述数值型索引存储结构和字符型索引存储结构分开存储。
- 如权利要求1所述的基于移动端NoSQL数据库的索引创建方法,其特征在于,还包括:将与相应属性相对应的索引信息进行排序处理,获得排序处理后的索引信息;将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中,包括:将排序处理后的索引信息存入数值型索引存储结构或字符型索引存储结构中。
- 一种基于移动端NoSQL数据库的索引创建装置,其特征在于,包括:索引信息设置模块,用于根据NoSQL数据库中预存数据的属性设置索引信息;存储模块,用于根据相应属性的预存数据的类型,确定将与相应属性相对应的索引信息存入数值型索引存储结构或字符型索引存储结构中;NoSql连接池,用于存储NoSQL数据库的地址、数值型索引存储结构的地址和字符型索引存储结构的地址。
- 如权利要求4所述的基于移动端NoSQL数据库的索引创建装置,其特征在于,所述存储模块具体用于:将所述数值型索引存储结构和字符型索引存储结构分开存储。
- 如权利要求4所述的基于移动端NoSQL数据库的索引创建装置,其特征在于,还包括:NoSQL比较器,用于将与相应属性相对应的索引信息进行排序处理,获得排序处理后的索引信息;所述存储模块具体用于:将排序处理后的索引信息存入数值型索引存储结构或字符型索引存储结构中。
- 一种基于移动端NoSQL数据库的数据查询方法,其特征在于,包括:接收查询条件;根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应 的索引信息;根据所述索引信息从NoSql连接池中获取NoSQL数据库的地址;根据所述NoSQL数据库的地址,从相应的NoSQL数据库查找相应的数据。
- 如权利要求7所述的基于移动端NoSQL数据库的数据查询方法,其特征在于,根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息,包括:确定所述查询条件的属性和类型;根据所述查询条件的属性和类型从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息。
- 一种基于移动端NoSQL数据库的数据查询装置,其特征在于,包括:接收模块,用于接收查询条件;索引信息查找模块,用于根据所述查询条件从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息;地址获取模块,用于根据所述索引信息从NoSql连接池中获取NoSQL数据库的地址;数据查找模块,用于根据所述NoSQL数据库的地址,从相应的NoSQL数据库查找相应的数据。
- 如权利要求9所述的基于移动端NoSQL数据库的数据查询装置,其特征在于,所述索引信息查找模块具体用于:确定所述查询条件的属性和类型;根据所述查询条件的属性和类型从数值型索引存储结构和/或字符型索引存储结构中查找到相应的索引信息。
- 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至3任一所述方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有执行权利要求1至3任一所述方法的计算机程序。
- 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求7至8任一所述方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有执行 权利要求7至8任一所述方法的计算机程序。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810527206.8A CN108776678B (zh) | 2018-05-29 | 2018-05-29 | 基于移动端NoSQL数据库的索引创建方法及装置 |
CN201810527206.8 | 2018-05-29 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019228015A1 true WO2019228015A1 (zh) | 2019-12-05 |
Family
ID=64027930
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/077439 WO2019228015A1 (zh) | 2018-05-29 | 2019-03-08 | 基于移动端NoSQL数据库的索引创建方法及装置 |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN108776678B (zh) |
TW (1) | TWI706260B (zh) |
WO (1) | WO2019228015A1 (zh) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108776678B (zh) * | 2018-05-29 | 2020-07-03 | 阿里巴巴集团控股有限公司 | 基于移动端NoSQL数据库的索引创建方法及装置 |
CN109637602B (zh) * | 2018-11-23 | 2021-06-18 | 金色熊猫有限公司 | 医疗数据存储和查询方法、装置、存储介质及电子设备 |
CN109656923B (zh) * | 2018-12-19 | 2020-11-24 | 北京字节跳动网络技术有限公司 | 一种数据处理方法、装置、电子设备及存储介质 |
US11762859B2 (en) | 2020-09-28 | 2023-09-19 | International Business Machines Corporation | Database query with index leap usage |
CN112486915B (zh) * | 2020-12-18 | 2023-01-20 | 上海哔哩哔哩科技有限公司 | 数据存储方法及装置 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140324876A1 (en) * | 2013-04-25 | 2014-10-30 | International Business Machines Corporation | Management of a database system |
CN104794123A (zh) * | 2014-01-20 | 2015-07-22 | 阿里巴巴集团控股有限公司 | 一种为半结构化数据构建NoSQL数据库索引的方法及装置 |
CN105488050A (zh) * | 2014-09-17 | 2016-04-13 | 阿里巴巴集团控股有限公司 | 一种数据库多索引方法、装置及系统 |
CN106874329A (zh) * | 2016-07-15 | 2017-06-20 | 阿里巴巴集团控股有限公司 | 数据库表索引的实现方法和装置 |
US20170193079A1 (en) * | 2016-01-06 | 2017-07-06 | Dell Software, Inc. | Smart exchange database index |
CN108776678A (zh) * | 2018-05-29 | 2018-11-09 | 阿里巴巴集团控股有限公司 | 基于移动端NoSQL数据库的索引创建方法及装置 |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103177027B (zh) * | 2011-12-23 | 2016-02-17 | 北京新媒传信科技有限公司 | 获取动态Feed索引的方法和系统 |
CN103514229A (zh) * | 2012-06-29 | 2014-01-15 | 国际商业机器公司 | 用于在分布式数据库系统中处理数据库数据的方法和装置 |
WO2014144889A2 (en) * | 2013-03-15 | 2014-09-18 | Amazon Technologies, Inc. | Scalable analysis platform for semi-structured data |
CN103902702B (zh) * | 2014-03-31 | 2017-11-28 | 北京皮尔布莱尼软件有限公司 | 一种数据存储系统和存储方法 |
TWI522827B (zh) * | 2015-01-09 | 2016-02-21 | Chunghwa Telecom Co Ltd | Real-time storage and real-time reading of huge amounts of data for non-related databases |
CN104915450B (zh) * | 2015-07-01 | 2017-11-28 | 武汉大学 | 一种基于HBase的大数据存储与检索方法及系统 |
CN105447105A (zh) * | 2015-11-13 | 2016-03-30 | 福建农林大学 | 基于NoSQL的分布式物联网数据的单字段区间索引查询方式 |
CN106372177B (zh) * | 2016-08-30 | 2019-09-27 | 东华大学 | 支持混合数据类型的关联查询及模糊分组的查询扩展方法 |
CN108090064B (zh) * | 2016-11-21 | 2021-10-08 | 腾讯科技(深圳)有限公司 | 一种数据查询方法、装置、数据存储服务器及系统 |
CN106528898A (zh) * | 2017-01-04 | 2017-03-22 | 泰康保险集团股份有限公司 | 将非关系型数据库数据转换到关系型数据库的方法及装置 |
-
2018
- 2018-05-29 CN CN201810527206.8A patent/CN108776678B/zh active Active
-
2019
- 2019-02-25 TW TW108106323A patent/TWI706260B/zh active
- 2019-03-08 WO PCT/CN2019/077439 patent/WO2019228015A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140324876A1 (en) * | 2013-04-25 | 2014-10-30 | International Business Machines Corporation | Management of a database system |
CN104794123A (zh) * | 2014-01-20 | 2015-07-22 | 阿里巴巴集团控股有限公司 | 一种为半结构化数据构建NoSQL数据库索引的方法及装置 |
CN105488050A (zh) * | 2014-09-17 | 2016-04-13 | 阿里巴巴集团控股有限公司 | 一种数据库多索引方法、装置及系统 |
US20170193079A1 (en) * | 2016-01-06 | 2017-07-06 | Dell Software, Inc. | Smart exchange database index |
CN106874329A (zh) * | 2016-07-15 | 2017-06-20 | 阿里巴巴集团控股有限公司 | 数据库表索引的实现方法和装置 |
CN108776678A (zh) * | 2018-05-29 | 2018-11-09 | 阿里巴巴集团控股有限公司 | 基于移动端NoSQL数据库的索引创建方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN108776678A (zh) | 2018-11-09 |
CN108776678B (zh) | 2020-07-03 |
TW202004526A (zh) | 2020-01-16 |
TWI706260B (zh) | 2020-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019228015A1 (zh) | 基于移动端NoSQL数据库的索引创建方法及装置 | |
Deng et al. | The Data Civilizer System. | |
CN106547796B (zh) | 数据库的执行方法及装置 | |
US10311105B2 (en) | Filtering queried data on data stores | |
US8972387B2 (en) | Smarter search | |
US10565201B2 (en) | Query processing management in a database management system | |
US20080222129A1 (en) | Inheritance of attribute values in relational database queries | |
Junghanns et al. | Cypher-based graph pattern matching in Gradoop | |
JP2016532173A (ja) | 意味情報、キーワード拡張及びそれに関するキーワード検索の方法及びシステム | |
US11269880B2 (en) | Retroreflective clustered join graph generation for relational database queries | |
CN112000773B (zh) | 基于搜索引擎技术的数据关联关系挖掘方法及应用 | |
EP3182296B1 (en) | Dbms-supported score assignment | |
US20150039623A1 (en) | System and method for integrating data | |
CN112015741A (zh) | 一种海量数据的分库分表存储方法与装置 | |
CN108255852B (zh) | Sql执行方法及装置 | |
CN107346317A (zh) | 一种数据查询方法和装置 | |
US20150199409A1 (en) | Item counting in guided information access systems | |
US20180341709A1 (en) | Unstructured search query generation from a set of structured data terms | |
US10216792B2 (en) | Automated join detection | |
US20230315701A1 (en) | Data unification | |
US11880370B2 (en) | Retroreflective join graph generation for relational database queries | |
KR20230122681A (ko) | 스탠드 인 테이블들 | |
JP2017010376A (ja) | マートレス検証支援システムおよびマートレス検証支援方法 | |
Bicevska et al. | NoSQL-based data warehouse solutions: sense, benefits and prerequisites | |
US11423027B2 (en) | Text search of database with one-pass indexing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19810095 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19810095 Country of ref document: EP Kind code of ref document: A1 |