CN107622070A - A kind of data base management method and device - Google Patents
A kind of data base management method and device Download PDFInfo
- Publication number
- CN107622070A CN107622070A CN201610560942.4A CN201610560942A CN107622070A CN 107622070 A CN107622070 A CN 107622070A CN 201610560942 A CN201610560942 A CN 201610560942A CN 107622070 A CN107622070 A CN 107622070A
- Authority
- CN
- China
- Prior art keywords
- database
- statement
- action statement
- split
- mapping relations
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域technical field
本发明涉及数据库管理技术领域,尤其涉及一种数据库管理方法及装置。The invention relates to the technical field of database management, in particular to a database management method and device.
背景技术Background technique
通常操作数据库是通过调用计算机语言提供的操作数据库的API(应用编程接口),来查询或更新数据库中的数据。现有的操作数据库的方案通常是调用计算机语言提供的访问数据库的API,来查询或更新数据库,并返回结果。故现有的调用数据库API的方案,没法重用操作数据库的代码。如果是编译型语言,调试代码不方便,每次更改代码后,都要重新编译代码,开发效率不高。Usually, the operation of the database is to query or update the data in the database by calling the API (application programming interface) provided by the computer language to operate the database. Existing schemes for operating databases usually call APIs provided by computer languages for accessing databases to query or update databases and return results. Therefore, the existing scheme of calling the database API cannot reuse the code for operating the database. If it is a compiled language, it is inconvenient to debug the code. Every time the code is changed, the code must be recompiled, and the development efficiency is not high.
发明内容Contents of the invention
本发明要解决的技术问题在于,针对上述现有技术数据库API调用效率低的问题,提供一种数据库管理方法及装置。The technical problem to be solved by the present invention is to provide a database management method and device for the above-mentioned problem of low efficiency of database API calling in the prior art.
本发明解决其技术问题所采用的技术方案是:The technical solution adopted by the present invention to solve its technical problems is:
一方面,构造一种数据库管理方法,包括:On the one hand, construct a database management method, including:
定义数据库中包括增加、删除、修改、查找及存储的操作语句;Define the operation statement including adding, deleting, modifying, searching and storing in the database;
建立所定义的操作语句与对应数据库API的映射关系;Establish the mapping relationship between the defined operation statement and the corresponding database API;
依据所述映射关系将所述操作语句拆分为多个参数及数据库操作类型;Splitting the operation statement into multiple parameters and database operation types according to the mapping relationship;
分别输入多个所述参数的值,依据所述参数的值以及所述数据库操作类型调用数据库API。Input multiple values of the parameters respectively, and call the database API according to the values of the parameters and the type of the database operation.
在本发明所述的数据库管理方法中,所述建立所定义的操作语句与对应数据库API的映射关系的步骤包括以下子步骤:In the database management method of the present invention, the step of establishing the mapping relationship between the defined operation statement and the corresponding database API includes the following sub-steps:
建立所定义的操作语句与对应数据库API的映射关系;Establish the mapping relationship between the defined operation statement and the corresponding database API;
依据所述映射关系,获取与数据库管理任务项相对应的脚本;Acquiring scripts corresponding to database management task items according to the mapping relationship;
对所述数据库执行所述脚本以动态操作数据库。The script is executed against the database to dynamically manipulate the database.
在本发明所述的数据库管理方法中,所述依据所述映射关系将所述操作语句拆分为多个参数及数据库操作类型的步骤包括以下子步骤:In the database management method of the present invention, the step of splitting the operation statement into multiple parameters and database operation types according to the mapping relationship includes the following sub-steps:
依据所述映射关系拆分所要解析的字符串,从而得到数据库操作语句数组;splitting the character string to be parsed according to the mapping relationship, so as to obtain an array of database operation statements;
遍历所述数据库操作语句数组以将所述操作语句拆分为多个参数及数据库操作类型。The database operation statement array is traversed to split the operation statement into a plurality of parameters and database operation types.
在本发明所述的数据库管理方法中,所述分别输入多个所述参数的值,依据所述参数的值以及所述数据库操作类型调用数据库API的步骤还包括:In the database management method of the present invention, the step of inputting a plurality of values of the parameters respectively, and calling the database API according to the values of the parameters and the database operation type also includes:
调用数据库API查询数据库,并将数据库返回结果存放至一个变量。Call the database API to query the database, and store the result returned by the database into a variable.
在本发明所述的数据库管理方法中,所述遍历所述数据库操作语句数组以将所述操作语句拆分为多个参数及数据库操作类型的步骤包括以下步骤:In the database management method of the present invention, the step of traversing the database operation statement array to split the operation statement into multiple parameters and database operation types includes the following steps:
S321、检测是否存在未处理的操作语句,若存在,则取下一个操作语句,其中,所述数据库操作语句数组包括多个操作语句;S321. Detect whether there is an unprocessed operation statement, and if so, remove the next operation statement, wherein the database operation statement array includes a plurality of operation statements;
S322、将所述操作语句拆分为多个参数及数据库操作类型,返回步骤S321,直至多个所述操作语句处理完成。S322. Split the operation statement into multiple parameters and database operation types, and return to step S321 until the processing of multiple operation statements is completed.
另一方面,提供一种数据库管理装置,包括:In another aspect, a database management device is provided, including:
定义单元,用于定义数据库中包括增加、删除、修改、查找及存储的操作语句;The definition unit is used to define the operation statements including adding, deleting, modifying, searching and storing in the database;
映射建立单元,用于建立所定义的操作语句与对应数据库API的映射关系;A mapping establishment unit, configured to establish a mapping relationship between the defined operation statement and the corresponding database API;
拆分单元,用于依据所述映射关系将所述操作语句拆分为多个参数及数据库操作类型;A splitting unit, configured to split the operation statement into multiple parameters and database operation types according to the mapping relationship;
调用单元,用于分别输入多个所述参数的值,依据所述参数的值以及所述数据库操作类型调用数据库API。The calling unit is used to respectively input the values of a plurality of parameters, and call the database API according to the values of the parameters and the type of the database operation.
在本发明所述的数据库管理装置中,所述映射建立单元包括:In the database management device of the present invention, the mapping establishment unit includes:
映射建立模块,用于建立所定义的操作语句与对应数据库API的映射关系;A mapping establishment module, used to establish the mapping relationship between the defined operation statement and the corresponding database API;
脚本获取模块,用于依据所述映射关系,获取与数据库管理任务项相对应的脚本;A script acquiring module, configured to acquire scripts corresponding to database management task items according to the mapping relationship;
脚本执行模块,用于对所述数据库执行所述脚本以动态操作数据库。The script execution module is used to execute the script on the database to dynamically operate the database.
在本发明所述的数据库管理装置中,所述拆分单元包括:In the database management device of the present invention, the splitting unit includes:
字符串拆分模块,用于依据所述映射关系拆分所要解析的字符串,从而得到数据库操作语句数组;A string splitting module, configured to split the character string to be parsed according to the mapping relationship, so as to obtain an array of database operation statements;
数组遍历模块,用于遍历所述数据库操作语句数组以将所述操作语句拆分为多个参数及数据库操作类型。The array traversal module is used for traversing the database operation statement array to split the operation statement into multiple parameters and database operation types.
在本发明所述的数据库管理装置中,所述调用单元还用于:In the database management device according to the present invention, the calling unit is also used for:
调用数据库API查询数据库,并将数据库返回结果存放至一个变量。Call the database API to query the database, and store the result returned by the database into a variable.
在本发明所述的数据库管理装置中,所述数组遍历模块包括:In the database management device of the present invention, the array traversal module includes:
语句检测子模块,用于检测是否存在未处理的操作语句,若存在,则取下一个操作语句,其中,所述数据库操作语句数组包括多个操作语句;The statement detection submodule is used to detect whether there is an unprocessed operation statement, and if it exists, then take the next operation statement, wherein the database operation statement array includes a plurality of operation statements;
拆分子模块,用于将所述操作语句拆分为多个参数及数据库操作类型。The split sub-module is used to split the operation statement into multiple parameters and database operation types.
上述公开的一种数据库管理方法及装置具有以下有益效果:通过重新定义数据库操作语句并对其进行拆分,提高了数据库编写程序的效率。The database management method and device disclosed above have the following beneficial effects: by redefining database operation statements and splitting them, the efficiency of database programming is improved.
附图说明Description of drawings
图1为本发明提供的一种数据库管理方法流程图;Fig. 1 is a kind of database management method flowchart provided by the present invention;
图2为本发明提供的一种数据库管理装置框图。Fig. 2 is a block diagram of a database management device provided by the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
本发明提供了一种数据库管理方法及装置,其目的在于,通过重新定义数据库操作语句并对其进行拆分,提高了数据库编写程序的效率。本发明具体包含两个部分,一个部分是数据库操作语句,用于编写操作数据库的动态语句; 第二个部分是解析引擎,解析数据库操作语句,调用数据库API,并返回结果。The invention provides a database management method and device. The purpose is to improve the efficiency of database programming by redefining database operation sentences and splitting them. The present invention specifically includes two parts, one part is a database operation statement, which is used to write dynamic statements for operating the database; the second part is an analysis engine, which parses the database operation statement, calls the database API, and returns the result.
参见图1,图1为本发明提供的一种数据库管理方法流程图,该数据库管理方法包括步骤S1-S4:Referring to Fig. 1, Fig. 1 is a flow chart of a database management method provided by the present invention, the database management method includes steps S1-S4:
S1、定义数据库中包括增加、删除、修改、查找及存储的操作语句;具体的,定义的操作语句如下:S1. The definition database includes operation statements for adding, deleting, modifying, searching and storing; specifically, the defined operation statements are as follows:
1、GetData(tableName,columnNames,filterCondition,recordCount,resultVarName),1. GetData(tableName, columnNames, filterCondition, recordCount, resultVarName),
从数据库中查询数据。Query data from the database.
参数说明:tableName:数据库表名称。columnNames:数据库字段列表。filterCondition:查询的过滤条件。recordCount:设置返回的记录数。resultVarName:存放数据库查询结果的变量名称。Parameter description: tableName: database table name. columnNames: A list of database fields. filterCondition: The filter condition of the query. recordCount: Set the number of records returned. resultVarName: The name of the variable that stores the database query results.
2、InsertData(tableName,idFieldName,idVarName,idType,fieldAndValueStr,resultVarName),往数据库中插入数据。2. InsertData(tableName, idFieldName, idVarName, idType, fieldAndValueStr, resultVarName), insert data into the database.
参数说明:tableName:数据库表名称,idFieldName:主键字段名。idVarName:主键变量名称,用于保存主键值。idType:主键值的生成方式。fieldAndValueStr:字段和对应值合并在一起的字符串。resultVarName:保存插入结果的变量名称。Parameter description: tableName: database table name, idFieldName: primary key field name. idVarName: Primary key variable name, used to save the primary key value. idType: How the primary key value is generated. fieldAndValueStr: A string that combines the field and its corresponding value. resultVarName: The name of the variable that holds the insertion result.
3、UpdateData(tableName,fieldAndValueStr,updateCondition,resultVarName),更改数据库。3. UpdateData(tableName, fieldAndValueStr, updateCondition, resultVarName), change the database.
参数说明:tableName:数据库表名称,fieldAndValueStr:字段和对应值合并在一起的字符串。updateCondition:更改条件。resultVarName:保存更改结果的变量名称。Parameter description: tableName: the name of the database table, fieldAndValueStr: the string that combines the field and the corresponding value. updateCondition: Change condition. resultVarName: The name of the variable that holds the result of the change.
4、DeleteData(tableName,deleteCondition,resultVarName),删除数据库中的数据。4. DeleteData(tableName, deleteCondition, resultVarName), delete the data in the database.
参数说明:tableName:数据库表名称,deleteCondition:删除条件。resultVarName:保存删除结果的变量名称。Parameter description: tableName: database table name, deleteCondition: delete condition. resultVarName: The variable name to save the delete result.
5、ExecuteSql(outputVarType,outputVarName,sqlType,spNameOrSql,spOrSqlPara,resultVarName),执行SQL语句或存储过程。5. ExecuteSql (outputVarType, outputVarName, sqlType, spNameOrSql, spOrSqlPara, resultVarName), execute SQL statement or stored procedure.
参数说明:outputVarType:存放SQL语句或存储过程执行结果的变量类型。outputVarName:存放SQL语句或存储过程执行结果的变量名称。sqlType:类型,SQL或存储过程。spNameOrSql:存储过程名称或SQL语句。spOrSqlPara:存储过程或SQL语句的参数。resultVarName:保存执行是否成功的变量名称。Parameter description: outputVarType: the variable type that stores the execution results of SQL statements or stored procedures. outputVarName: the name of the variable that stores the execution result of the SQL statement or stored procedure. sqlType: type, SQL or stored procedure. spNameOrSql: Stored procedure name or SQL statement. spOrSqlPara: The parameters of the stored procedure or SQL statement. resultVarName: The name of the variable that saves whether the execution is successful.
S2、建立所定义的操作语句与对应数据库API的映射关系;所述步骤S2包括子步骤S21-S23:S2. Establish the mapping relationship between the defined operation statement and the corresponding database API; the step S2 includes substeps S21-S23:
S21、建立所定义的操作语句与对应数据库API的映射关系;S21. Establish a mapping relationship between the defined operation statement and the corresponding database API;
S22、依据所述映射关系,获取与数据库管理任务项相对应的脚本;S22. Acquire scripts corresponding to database management task items according to the mapping relationship;
S23、对所述数据库执行所述脚本以动态操作数据库。S23. Execute the script on the database to dynamically operate the database.
S3、依据所述映射关系将所述操作语句拆分为多个参数及数据库操作类型;所述步骤S3包括子步骤S31-S32:S3. Split the operation statement into multiple parameters and database operation types according to the mapping relationship; the step S3 includes substeps S31-S32:
S31、依据所述映射关系拆分所要解析的字符串,从而得到数据库操作语句数组;S31. Split the character string to be parsed according to the mapping relationship, so as to obtain an array of database operation statements;
S32、遍历所述数据库操作语句数组以将所述操作语句拆分为多个参数及数据库操作类型。所述步骤S32包括子步骤S321-S322:S32. Traverse the database operation statement array to split the operation statement into multiple parameters and database operation types. The step S32 includes sub-steps S321-S322:
S321、检测是否存在未处理的操作语句,若存在,则取下一个操作语句,其中,所述数据库操作语句数组包括多个操作语句;S321. Detect whether there is an unprocessed operation statement, and if so, remove the next operation statement, wherein the database operation statement array includes a plurality of operation statements;
S322、将所述操作语句拆分为多个参数及数据库操作类型,返回步骤S321,直至多个所述操作语句处理完成。S322. Split the operation statement into multiple parameters and database operation types, and return to step S321 until the processing of multiple operation statements is completed.
S4、分别输入多个所述参数的值,依据所述参数的值以及所述数据库操作类型调用数据库API。调用数据库API查询数据库,并将数据库返回结果存放至一个变量。根据数据库操作类型,如InsertData或GetData,和用户输入的参数的值,调用对应的数据库API,将返回结果作为变量值。S4. Input a plurality of values of the parameters respectively, and call the database API according to the values of the parameters and the type of the database operation. Call the database API to query the database, and store the result returned by the database into a variable. According to the type of database operation, such as InsertData or GetData, and the value of the parameter input by the user, call the corresponding database API, and use the returned result as the variable value.
综上所述,本发明首先读取一个包含动态数据库语句的字符串,拆分该字符串,得到一个或多个数据库操作语句,依次处理每个数据库操作语句,将数据库操作语句拆分成一个数据库操作类型和多个参数,然后调用计算机语言提供的访问数据库的API并返回结果。In summary, the present invention first reads a character string that contains a dynamic database statement, splits the character string to obtain one or more database operation statements, processes each database operation statement in turn, and splits the database operation statement into one Database operation type and multiple parameters, and then call the API provided by the computer language to access the database and return the result.
参见图2,图2为本发明提供的一种数据库管理装置100框图,该数据库 管理装置100通过在系统中设置相应的程序实现,该数据库管理装置100包括定义单元1、映射建立单元2、拆分单元3及调用单元4。Referring to Fig. 2, Fig. 2 is a block diagram of a database management device 100 provided by the present invention, the database management device 100 is implemented by setting corresponding programs in the system, the database management device 100 includes a definition unit 1, a mapping establishment unit 2, a demolition unit Sub-unit 3 and calling unit 4.
定义单元1用于定义数据库中包括增加、删除、修改、查找及存储的操作语句;The definition unit 1 is used to define operation statements including addition, deletion, modification, search and storage in the database;
映射建立单元2用于建立所定义的操作语句与对应数据库API的映射关系;The mapping establishment unit 2 is used to establish the mapping relationship between the defined operation statement and the corresponding database API;
拆分单元3用于依据所述映射关系将所述操作语句拆分为多个参数及数据库操作类型;The splitting unit 3 is used to split the operation statement into multiple parameters and database operation types according to the mapping relationship;
调用单元4用于分别输入多个所述参数的值,依据所述参数的值以及所述数据库操作类型调用数据库API。The calling unit 4 is used to respectively input a plurality of values of the parameters, and call the database API according to the values of the parameters and the type of the database operation.
优选的,所述映射建立单元2包括:Preferably, the mapping establishment unit 2 includes:
映射建立模块,用于建立所定义的操作语句与对应数据库API的映射关系;A mapping establishment module, used to establish the mapping relationship between the defined operation statement and the corresponding database API;
脚本获取模块,用于依据所述映射关系,获取与数据库管理任务项相对应的脚本;A script acquiring module, configured to acquire scripts corresponding to database management task items according to the mapping relationship;
脚本执行模块,用于对所述数据库执行所述脚本以动态操作数据库。The script execution module is used to execute the script on the database to dynamically operate the database.
优选的,所述拆分单元3包括:Preferably, the splitting unit 3 includes:
字符串拆分模块,用于依据所述映射关系拆分所要解析的字符串,从而得到数据库操作语句数组;A string splitting module, configured to split the character string to be parsed according to the mapping relationship, so as to obtain an array of database operation statements;
数组遍历模块,用于遍历所述数据库操作语句数组以将所述操作语句拆分为多个参数及数据库操作类型。The array traversal module is used for traversing the database operation statement array to split the operation statement into multiple parameters and database operation types.
优选的,所述调用单元4还用于:Preferably, the calling unit 4 is also used for:
调用数据库API查询数据库,并将数据库返回结果存放至一个变量。Call the database API to query the database, and store the result returned by the database into a variable.
优选的,所述数组遍历模块包括:Preferably, the array traversal module includes:
语句检测子模块,用于检测是否存在未处理的操作语句,若存在,则取下一个操作语句,其中,所述数据库操作语句数组包括多个操作语句;The statement detection submodule is used to detect whether there is an unprocessed operation statement, and if it exists, then take the next operation statement, wherein the database operation statement array includes a plurality of operation statements;
拆分子模块,用于将所述操作语句拆分为多个参数及数据库操作类型。The split sub-module is used to split the operation statement into multiple parameters and database operation types.
本文提供了实施例的各种操作。在一个实施例中,所述的一个或操作可以 构成一个或计算机可读介质上存储的计算机可读指令,其在被电子设备执行时将使得计算设备执行所述操作。描述一些或所有操作的顺序不应当被解释为暗示这些操作必需是顺序相关的。本领域技术人员将理解具有本说明书的益处的可替代的排序。而且,应当理解,不是所有操作必需在本文所提供的每个实施例中存在。Various operations of embodiments are provided herein. In one embodiment, the one or operations described may constitute one or computer-readable instructions stored on a computer-readable medium which, when executed by an electronic device, will cause the computing device to perform the operations described. The order in which some or all operations are described should not be construed to imply that these operations are necessarily order-dependent. Alternative orderings will be appreciated by those skilled in the art with the benefit of this description. Also, it should be understood that not all operations need to be present in every embodiment provided herein.
而且,本文所使用的词语“优选的”意指用作实例、示例或例证。奉文描述为“优选的”任意方面或设计不必被解释为比其他方面或设计更有利。相反,词语“优选的”的使用旨在以具体方式提出概念。如本申请中所使用的术语“或”旨在意指包含的“或”而非排除的“或”。即,除非另外指定或从上下文中清楚,“X使用A或B”意指自然包括排列的任意一个。即,如果X使用A;X使用B;或X使用A和B二者,则“X使用A或B”在前述任一示例中得到满足。Also, the word "preferred" as used herein means serving as an example, instance or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as advantageous over other aspects or designs. Rather, use of the word "preferably" is intended to present concepts in a concrete manner. As used in this application, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from context, "X employs A or B" is meant to naturally include either of the permutations. That is, if X employs A; X employs B; or X employs both A and B, then "X employs A or B" is satisfied in any of the foregoing instances.
而且,尽管已经相对于一个或实现方式示出并描述了本公开,但是本领域技术人员基于对本说明书和附图的阅读和理解将会想到等价变型和修改。本公开包括所有这样的修改和变型,并且仅由所附权利要求的范围限制。特别地关于由上述组件(例如元件、资源等)执行的各种功能,用于描述这样的组件的术语旨在对应于执行所述组件的指定功能(例如其在功能上是等价的)的任意组件(除非另外指示),即使在结构上与执行本文所示的本公开的示范性实现方式中的功能的公开结构不等同。此外,尽管本公开的特定特征已经相对于若干实现方式中的仅一个被公开,但是这种特征可以与如可以对给定或特定应用而言是期望和有利的其他实现方式的一个或其他特征组合。而且,就术语“包括”、“具有”、“含有”或其变形被用在具体实施方式或权利要求中而言,这样的术语旨在以与术语“包含”相似的方式包括。Moreover, although the disclosure has been shown and described with respect to one or an implementation, equivalent alterations and modifications will occur to others skilled in the art upon the reading and understanding of this specification and the annexed drawings. The present disclosure includes all such modifications and variations and is limited only by the scope of the appended claims. With particular regard to the various functions performed by the above-described components (eg, elements, resources, etc.), terminology used to describe such components is intended to correspond to Any component (unless otherwise indicated), even if not structurally equivalent to the disclosed structure that performs the function in the exemplary implementations of the present disclosure shown herein. Furthermore, although a particular feature of the present disclosure has been disclosed with respect to only one of several implementations, such feature may be combined with one or other features of other implementations as may be desirable and advantageous for a given or particular application. combination. Moreover, to the extent the terms "comprises", "has", "comprising" or variations thereof are used in the detailed description or the claims, such terms are intended to be encompassed in a manner similar to the term "comprising".
本发明实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。上述提到的存储介质可以 是只读存储器,磁盘或光盘等。上述的各装置或系统,可以执行相应方法实施例中的存储方法。Each functional unit in the embodiment of the present invention may be integrated into one processing module, or each unit may physically exist separately, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are realized in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, and the like. Each of the above devices or systems may execute the storage method in the corresponding method embodiment.
综上所述,虽然本发明已以优选实施例揭露如上,但上述优选实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种更动与润饰,因此本发明的保护范围以权利要求界定的范围为准。In summary, although the present invention has been disclosed above with preferred embodiments, the above preferred embodiments are not intended to limit the present invention, and those of ordinary skill in the art can make various modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope defined in the claims.
Claims (10)
- A kind of 1. data base management method, it is characterised in that including:Defining database includes the action statement of increase, deletion, modification, lookup and storage;Action statement defined in foundation and correspondence database API mapping relations;The action statement is split as multiple parameters and database manipulation type according to the mapping relations;The value of multiple parameters is inputted respectively, and database is called according to the value of the parameter and the database manipulation type API。
- 2. data base management method according to claim 1, it is characterised in that action statement defined in the foundation with The step of correspondence database API mapping relations, includes following sub-step:Action statement defined in foundation and correspondence database API mapping relations;According to the mapping relations, the script corresponding with database management tasks item is obtained;The script is performed to the database with dynamic operation database.
- 3. data base management method according to claim 1, it is characterised in that described according to described in mapping relations general Action statement, which is split as the step of multiple parameters and database manipulation type, includes following sub-step:The character string to be parsed is split according to the mapping relations, so as to obtain data base manipulation statement array;The data base manipulation statement array is traveled through so that the action statement is split as into multiple parameters and database manipulation type.
- 4. data base management method according to claim 1, it is characterised in that described to input multiple parameters respectively Value, also include according to the step of value of the parameter and database manipulation type calling database API:Database API inquiry databases are called, and database returning result is deposited to a variable.
- 5. data base management method according to claim 3, it is characterised in that the traversal data base manipulation statement Array the step of the action statement is split as into multiple parameters and database manipulation type to comprise the following steps:S321, detect whether untreated action statement be present, if in the presence of, next action statement is taken, wherein, the data Storehouse action statement array includes multiple action statement;S322, the action statement is split as to multiple parameters and database manipulation type, return to step S321, until multiple institutes Action statement processing is stated to complete.
- A kind of 6. data bank management device, it is characterised in that including:Definition unit, include increase, the action statement for deleting, changing, search and storing for defining database;Unit is established in mapping, for establishing defined action statement and correspondence database API mapping relations;Split cells, for the action statement to be split as into multiple parameters and database manipulation class according to the mapping relations Type;Call unit, for inputting the value of multiple parameters respectively, value and the database manipulation according to the parameter Type calls database API.
- 7. data bank management device according to claim 6, it is characterised in that unit is established in the mapping to be included:Module is established in mapping, for establishing defined action statement and correspondence database API mapping relations;Script acquisition module, for according to the mapping relations, obtaining the script corresponding with database management tasks item;Script execution module, for performing the script to the database with dynamic operation database.
- 8. data bank management device according to claim 6, it is characterised in that the split cells includes:Character string splits module, for splitting the character string to be parsed according to the mapping relations, so as to obtain database behaviour Make sentence array;Array spider module, for traveling through the data base manipulation statement array so that the action statement is split as into multiple parameters And database manipulation type.
- 9. data bank management device according to claim 6, it is characterised in that the call unit is additionally operable to:Database API inquiry databases are called, and database returning result is deposited to a variable.
- 10. data bank management device according to claim 8, it is characterised in that the array spider module includes:Sentence detection sub-module, for detecting whether untreated action statement be present, if in the presence of taking next operation language Sentence, wherein, the data base manipulation statement array includes multiple action statement;Submodule is split, for the action statement to be split as into multiple parameters and database manipulation type.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610560942.4A CN107622070B (en) | 2016-07-15 | 2016-07-15 | A database management method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610560942.4A CN107622070B (en) | 2016-07-15 | 2016-07-15 | A database management method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107622070A true CN107622070A (en) | 2018-01-23 |
| CN107622070B CN107622070B (en) | 2021-05-14 |
Family
ID=61087046
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610560942.4A Active CN107622070B (en) | 2016-07-15 | 2016-07-15 | A database management method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107622070B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108920566A (en) * | 2018-06-21 | 2018-11-30 | 吉林亿联银行股份有限公司 | Operating method, device and the equipment of a kind of pair of SQLite database |
| CN109063070A (en) * | 2018-07-23 | 2018-12-21 | 郑州云海信息技术有限公司 | A kind of operating method and database server of database |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040220956A1 (en) * | 2003-04-30 | 2004-11-04 | Dillon Software Services, Llc | Software framework that facilitates design and implementation of database applications |
| CN103699620A (en) * | 2013-12-19 | 2014-04-02 | 珠海世纪鼎利通信科技股份有限公司 | Method and system for achieving database operation by utilizing object relational mapping (ORM) frame in object orientation |
| CN104267932A (en) * | 2014-08-12 | 2015-01-07 | 广州华多网络科技有限公司 | Method, device and server for operating databases |
| CN105069142A (en) * | 2015-08-18 | 2015-11-18 | 山大地纬软件股份有限公司 | System and method for extraction, transformation and distribution of data increments |
| CN105117233A (en) * | 2015-09-14 | 2015-12-02 | 百度在线网络技术(北京)有限公司 | API calling method and device |
-
2016
- 2016-07-15 CN CN201610560942.4A patent/CN107622070B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040220956A1 (en) * | 2003-04-30 | 2004-11-04 | Dillon Software Services, Llc | Software framework that facilitates design and implementation of database applications |
| CN103699620A (en) * | 2013-12-19 | 2014-04-02 | 珠海世纪鼎利通信科技股份有限公司 | Method and system for achieving database operation by utilizing object relational mapping (ORM) frame in object orientation |
| CN104267932A (en) * | 2014-08-12 | 2015-01-07 | 广州华多网络科技有限公司 | Method, device and server for operating databases |
| CN105069142A (en) * | 2015-08-18 | 2015-11-18 | 山大地纬软件股份有限公司 | System and method for extraction, transformation and distribution of data increments |
| CN105117233A (en) * | 2015-09-14 | 2015-12-02 | 百度在线网络技术(北京)有限公司 | API calling method and device |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108920566A (en) * | 2018-06-21 | 2018-11-30 | 吉林亿联银行股份有限公司 | Operating method, device and the equipment of a kind of pair of SQLite database |
| CN108920566B (en) * | 2018-06-21 | 2020-10-20 | 吉林亿联银行股份有限公司 | Method, device and equipment for operating SQLite database |
| CN109063070A (en) * | 2018-07-23 | 2018-12-21 | 郑州云海信息技术有限公司 | A kind of operating method and database server of database |
| CN109063070B (en) * | 2018-07-23 | 2022-03-25 | 郑州云海信息技术有限公司 | Database operation method and database server |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107622070B (en) | 2021-05-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107402992B (en) | Distributed NewSQL database system and full-text retrieval establishing method | |
| US20190188308A1 (en) | Computing data lineage across a network of heterogeneous systems | |
| US11580251B1 (en) | Query-based database redaction | |
| US11176133B2 (en) | Filter evaluation for table fragments | |
| US11132366B2 (en) | Transforming directed acyclic graph shaped sub plans to enable late materialization | |
| US9740713B1 (en) | Dynamic modeling of data in relational databases | |
| CN104423982B (en) | The processing method and processing equipment of request | |
| CN109710220B (en) | Relational database query method, relational database query device, relational database query equipment and storage medium | |
| US12204539B2 (en) | Automatic selection of precompiled or code-generated operator variants | |
| US10558661B2 (en) | Query plan generation based on table adapter | |
| US8667010B2 (en) | Database table partitioning allowing overlaps used in full text query | |
| US20180150518A1 (en) | Query plan execution engine | |
| CN115809304A (en) | Method and device for analyzing field-level blood margin, computer equipment and storage medium | |
| CN110647535B (en) | Method, terminal and storage medium for updating service data to Hive | |
| CN112416966A (en) | Ad hoc query method, apparatus, computer device and storage medium | |
| US11163766B2 (en) | Unique key lookup with additional filter | |
| CN113254470A (en) | Data change method and device, computer equipment and storage medium | |
| US10324933B2 (en) | Technique for processing query in database management system | |
| CN107622070A (en) | A kind of data base management method and device | |
| CN115934161A (en) | Method, device and equipment for impact analysis of code changes | |
| EP4546154A1 (en) | Relational subtree matching for improved query performance | |
| CN111125090B (en) | Data access method and device | |
| CN107203387A (en) | Target database access method and system | |
| CN119201885A (en) | Metadata migration method and device between databases, storage medium, and equipment | |
| US20200311044A1 (en) | Take over table opening for operators |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |