[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN1282111C - Across-platform data base researching method - Google Patents

Across-platform data base researching method Download PDF

Info

Publication number
CN1282111C
CN1282111C CN 03113491 CN03113491A CN1282111C CN 1282111 C CN1282111 C CN 1282111C CN 03113491 CN03113491 CN 03113491 CN 03113491 A CN03113491 A CN 03113491A CN 1282111 C CN1282111 C CN 1282111C
Authority
CN
China
Prior art keywords
query
database
file
user
processing unit
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.)
Expired - Fee Related
Application number
CN 03113491
Other languages
Chinese (zh)
Other versions
CN1549163A (en
Inventor
郜艳琴
李征鹤
李晓鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinjiang High And New Technology Development Office
Original Assignee
ZTE Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN 03113491 priority Critical patent/CN1282111C/en
Publication of CN1549163A publication Critical patent/CN1549163A/en
Application granted granted Critical
Publication of CN1282111C publication Critical patent/CN1282111C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention discloses a cross-platform database query method. The method comprises the steps that a query file of a uniform format is constructed; a user input query information in the query file; the user sends out a query request to a database processing unit in a file mode; the database processing unit allocates a database subprocessing unit to each query request; the database subprocessing unit constructs database SQL query statements according to the allocated query file; a database query is carried out; the database subprocessing unit processes a query result and returns a query result file to the user. The present invention shields the difference between different platforms and the network transmission bottleneck of large data quantity queries by using file transmission, uses a uniform file structure to reduces the complexity of the users, effectively enhances the mobility of the users, reduces the processing complexity of the users, enhancing the operating compatibility of different platforms and raises the access speed of database queries.

Description

一种跨平台数据库查询方法A cross-platform database query method

技术领域technical field

本发明涉及一种对数据库的操作方法,具体而言涉及一种数据库的查询方法。The present invention relates to a database operation method, in particular to a database query method.

背景技术Background technique

对于任何一种跨平台操作的系统来讲,屏蔽各操作平台之间的差异性都是其中的一个关键组成部分。而对于任何一个需要利用数据库存储和访问的系统来讲,对数据库访问的方便快捷要求也是必不可少的,尤其涉及到大数据量或者查询条件异常复杂的数据库访问,则更是如此。一个好的数据库查询,应当做到无需用户关心数据库的实际位置,同时在用户的查询地点发生变化时,也无需修改任何访问接口,仍然能正确方便快速地访问数据库中的数据。For any cross-platform operating system, shielding the differences between operating platforms is a key component. For any system that needs to use database storage and access, the requirement for convenient and quick database access is also essential, especially when it involves database access with large data volume or extremely complex query conditions. A good database query should not require the user to care about the actual location of the database, and at the same time, when the user's query location changes, there is no need to modify any access interface, and the data in the database can still be accessed correctly, conveniently and quickly.

目前的跨平台的数据库查询大多采用数据库提供的网络配置方法和工具,或者以ODBC或JDBC连接数据库,输入查询要求和查询请求进行查询。比如ORACLE数据库提供的NET8配置以及WORKSHEET等工具就是如此。采用这几种方式,存在以下几点不足:1、每次查询都需要重复输入查询条件;2、大数据量查询请求时,会发生网络传输瓶颈的问题;3、不同用户或者用户在不同平台移动时需要对数据库的连接进行重新配置;4、查询结果返回方式千差万别,用户无法统一处理,加大了用户的复杂度。Most of the current cross-platform database queries use the network configuration methods and tools provided by the database, or connect to the database with ODBC or JDBC, and input query requirements and query requests for query. Such as the NET8 configuration and WORKSHEET tools provided by the ORACLE database. Using these methods, there are the following disadvantages: 1. Each query requires repeated input of query conditions; 2. When a large amount of data is requested, network transmission bottlenecks will occur; 3. Different users or users on different platforms The connection to the database needs to be reconfigured when moving; 4. The return methods of query results vary greatly, and users cannot handle them uniformly, which increases the complexity of users.

发明内容Contents of the invention

本发明的目的就是克服目前对于跨平台的数据库查询需要利用网络配置和工具进行的缺点,提出一种可以屏蔽平台之间的差异性,减少用户查询处理复杂程度,并可以解决大数据量查询请求时网络传输瓶颈问题的跨平台数据库查询方法。The purpose of the present invention is to overcome the current shortcomings of using network configuration and tools for cross-platform database query, and propose a method that can shield the differences between platforms, reduce the complexity of user query processing, and can solve large data volume query requests A cross-platform database query method for the network transmission bottleneck problem.

本发明的核心思想是:定义一种统一的文件结构,用于存储用户的查询条件和查询结果,服务器端数据库处理单元根据文件结构中定义的查询条件在数据库中进行查询,并将查询结果存储在统一的文件结构中。The core idea of the present invention is: define a kind of unified file structure, be used for storing user's query condition and query result, server-side database processing unit carries out query in database according to the query condition defined in file structure, and query result is stored in a unified file structure.

本发明的技术方案如下:一种跨平台数据库查询方法,包括下列步骤:The technical scheme of the present invention is as follows: a cross-platform database query method, comprising the following steps:

(1)构造统一格式的查询文件,所述查询文件包括信息控制区和信息数据区,信息控制区用于存储用户的查询条件及用户自身信息,信息数据区用于存储查询的返回结果;(1) Construct the query file of unified format, described query file comprises information control area and information data area, and information control area is used for storing user's inquiry condition and user's own information, and information data area is used for the return result of storage inquiry;

(2)用户在查询文件中输入查询信息;(2) The user inputs query information in the query file;

(3)用户将查询请求以文件的方式发送到数据库处理单元;(3) The user sends the query request to the database processing unit in the form of a file;

(4)数据库处理单元为每个查询请求分配数据库子处理单元,所述数据库子处理单元为可供调用的数据库连接;(4) The database processing unit allocates a database sub-processing unit for each query request, and the database sub-processing unit is a database connection available for calling;

(5)数据库子处理单元根据分配的查询文件构造数据库SQL查询语句;(5) The database sub-processing unit constructs a database SQL query statement according to the distributed query file;

(6)进行数据库查询;(6) Perform database query;

(7)数据库字处理单元处理查询结果并向用户返回查询结果文件。(7) The database word processing unit processes the query result and returns the query result file to the user.

所述信息控制区的内容包括:是否为联合查询,查询表名,查询字段列表,查询条件,生成的文件名,用户标识信息。所述信息数据区的内容包括:数据头,用以记录查询的字段数目及记录数;数据类型描述,用以记录字段类型及字段长度;数据记录,用以记录查询得到的具体内容。The content of the information control area includes: whether it is a joint query, the name of the query table, the list of query fields, query conditions, the name of the generated file, and user identification information. The content of the information data area includes: data header, used to record the number of fields and records queried; data type description, used to record the field type and field length; data record, used to record the specific content obtained by the query.

上述步骤(5)具体包括下列步骤:Above-mentioned step (5) specifically comprises the following steps:

(1)数据库子处理单元根据查询请求中的用户标识信息调用文件结构,获取文件结构和信息控制区用户给定的文件名,并在给定目录下以读写方式打开这个文件,如果该文件已存在,则覆盖,如果不存在,则生成一个新文件;(1) The database sub-processing unit invokes the file structure according to the user identification information in the query request, obtains the file structure and the file name given by the user in the information control area, and opens the file in a read-write mode in the given directory, if the file If it exists, it will be overwritten, if it does not exist, a new file will be generated;

(2)数据库子处理单元判断查询请求中用户输入查询信息的正确性,如果用户填写信息不完全,则向用户返回失败信息,否则执行下一步;(2) The database sub-processing unit judges the correctness of the user input query information in the query request, if the user fills in the information incompletely, returns failure information to the user, otherwise executes the next step;

(3)数据库子处理单元根据用户填写的查询信息构造出数据库SQL查询语句;(3) The database sub-processing unit constructs a database SQL query statement according to the query information filled in by the user;

(4)数据库子处理单元验证查询语句是否正确,如果不正确,则向用户返回失败信息,否则执行下一步查询。(4) The database sub-processing unit verifies whether the query statement is correct, and if not, returns failure information to the user, otherwise executes the next query.

数据库查询是指将查询语句一次传入数据库,逐条获取查询结果。处理查询结果是指数据库子处理单元将查询结果以网络字节序的方式写入查询结果文件的信息数据区,查询完成后,数据库子处理单元关闭查询结果文件。Database query refers to passing query statements to the database at one time, and obtaining query results one by one. Processing query results means that the database sub-processing unit writes the query results into the information data area of the query result file in network byte order, and after the query is completed, the database sub-processing unit closes the query result file.

所述方法还包括提供一系列文件存取接口,所述存取接口是在文件系统本身的存取接口上封装一层,使得用户在对文件进行存取时无需关心文件的结构和来源。所述存取接口包括文件创建、文件打开、文件写入、文件读取、文件关闭、文件定位、文件移动、文件指针当前位置和文件删除。The method also includes providing a series of file access interfaces, the access interface is a layer encapsulated on the access interface of the file system itself, so that the user does not need to care about the structure and source of the file when accessing the file. The access interface includes file creation, file opening, file writing, file reading, file closing, file positioning, file moving, current position of file pointer and file deletion.

本发明与现有的跨平台数据库查询方法相比,特别考虑了用户相对于数据库平台的移动对查询带来的影响,以及大数据量的查询在网络传输上的瓶颈,原有方法在这种情况下,一般都需要重新配置与数据库的连接,或者调整用户对查询条件以减少查询结果的数据量。本发明利用文件的传输屏蔽不同平台之间的差异和大数据量查询的网络传输瓶颈,并利用统一的文件结构减少了用户的复杂度。采用此方法:1、有效提高了用户的迁移性;2、可以解决大数据量查询的网络传输速度问题;3、降低了用户的处理复杂度;4、用户无需关心对数据库的配置情况,提高了平台之间操作的兼容性;5、减少用户对数据库查询条件的频繁输入,提高了对数据库查询的访问速度。Compared with the existing cross-platform database query method, the present invention especially considers the impact of the user's movement relative to the database platform on the query, and the bottleneck of the large amount of data query on the network transmission. In most cases, it is generally necessary to reconfigure the connection to the database, or adjust the user's query conditions to reduce the amount of data in the query results. The invention utilizes the transmission of files to shield the differences between different platforms and the network transmission bottleneck of querying large amounts of data, and reduces the complexity of users by utilizing a unified file structure. Adopting this method: 1. Effectively improves the mobility of users; 2. Can solve the problem of network transmission speed for large data volume queries; 3. Reduces the processing complexity of users; 4. Users do not need to care about the configuration of the database, which improves Improve the compatibility of operations between platforms; 5. Reduce users' frequent input of database query conditions and improve the access speed of database queries.

附图说明Description of drawings

图1是本发明所述查询方法的主流程图。Fig. 1 is the main flow chart of the query method of the present invention.

图2是查询文件的结构示意图。Fig. 2 is a schematic diagram of the structure of the query file.

图3是图1中“子处理单元构造查询SQL语句”步骤的详细流程图。Fig. 3 is a detailed flowchart of the step of "constructing query SQL statement by the sub-processing unit" in Fig. 1 .

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.

图1是本发明所述查询方法的主流程图。如图1所示,本发明提出的查询方法包括下列步骤:1、构造统一格式的查询文件。所述查询文件包括信息控制区和信息数据区,信息控制区用于存储用户的查询条件及用户自身信息,信息数据区用于存储查询的返回结果。查询文件的结构将在图2的说明中作进一步描述。2、用户在查询文件中输入查询信息。文件结构以初始模板呈现给用户,用户根据自己的查询需求填写初始模板,用户填写的信息被记录在文件结构的信息控制区。3、用户将查询请求以文件的方式发送到数据库处理单元。当用户确认自己的填写时,填写好的文件结构就被传送到数据库处理单元保留,在系统运行过程中,用户可以随时修改查询信息,修改的查询信息会立刻被记录,并保留在以后的使用中。4、数据库处理单元为每个查询请求分配数据库子处理单元,所述数据库子处理单元为可供调用的数据库连接。用户可以将查询请求发送到服务器数据库处理单元进行查询,数据库处理单元对查询请求进行调度,为每个请求分配可供调用的数据库连接,这个单独的数据库连接可以称为数据库子处理单元。数据库处理单元对查询请求进行调度,根据各子处理单元的空闲程度进行分配,找到无负载的数据库处理子单元,并将该请求分配给此数据库处理子单元。5、数据库子处理单元根据分配的查询文件构造数据库SQL查询语句。对于数据库的查询主要通过一定的SQL查询语句完成,这一步的详细描述将在图3中进行。6、进行数据库查询,将查询语句一次传入数据库,逐条获取查询结果。7、数据库字处理单元处理查询结果并向用户返回查询结果文件。数据库子处理单元将查询结果以网络字节序的方式写入查询结果文件的信息数据区,查询完成后,数据库子处理单元关闭查询结果文件。用户对数据库查询的请求,可以是同步的,也可以是异步的,这取决于用户对返回结果是否立刻关心。Fig. 1 is the main flow chart of the query method of the present invention. As shown in FIG. 1 , the query method proposed by the present invention includes the following steps: 1. Construct a query file in a unified format. The query file includes an information control area and an information data area. The information control area is used to store the user's query conditions and the user's own information, and the information data area is used to store the returned result of the query. The structure of the query file is further described in the description of FIG. 2 . 2. The user inputs query information in the query file. The file structure is presented to the user as an initial template, and the user fills in the initial template according to his own query requirements, and the information filled in by the user is recorded in the information control area of the file structure. 3. The user sends the query request to the database processing unit in the form of a file. When the user confirms his filling, the completed file structure will be sent to the database processing unit for storage. During the operation of the system, the user can modify the query information at any time, and the modified query information will be recorded immediately and reserved for future use. middle. 4. The database processing unit allocates a database sub-processing unit for each query request, and the database sub-processing unit is a database connection that can be called. The user can send the query request to the server database processing unit for query, and the database processing unit schedules the query request and allocates an available database connection for each request. This individual database connection can be called a database sub-processing unit. The database processing unit schedules query requests, allocates them according to the idleness of each sub-processing unit, finds an unloaded database processing sub-unit, and allocates the request to this database processing sub-unit. 5. The database sub-processing unit constructs a database SQL query statement according to the allocated query file. The query of the database is mainly completed through a certain SQL query statement, and the detailed description of this step will be carried out in Figure 3. 6. Perform database query, pass the query statement into the database at one time, and obtain the query results one by one. 7. The database word processing unit processes the query result and returns the query result file to the user. The database sub-processing unit writes the query result into the information data area of the query result file in network byte order, and after the query is completed, the database sub-processing unit closes the query result file. The user's request for database query can be synchronous or asynchronous, depending on whether the user cares about the returned result immediately.

图2是查询文件的结构示意图。如图2所示,本发明定义了一种统一的文件结构,该文件结构可以适应各种用户的查询需求。用户可以根据自己的需求对查询信息进行定义,用于后面的SQL语句获取依据和查询结果的写文件依据。统一结构的查询文件包括信息控制区和信息数据区,信息控制区用于存储用户的查询条件及用户自身信息,信息数据区用于存储查询的返回结果。信息控制区的定义不同系统可以有不同的定义,但基本信息是相同的:信息控制区的查询信息定义部分可以定义查询对象,查询条件等;信息控制区的用户信息定义部分可以定义用户的标识信息,如:Fig. 2 is a schematic diagram of the structure of the query file. As shown in Fig. 2, the present invention defines a unified file structure, which can adapt to the query requirements of various users. Users can define the query information according to their own needs, which will be used as the basis for obtaining the following SQL statements and writing the query results. The query file with a unified structure includes an information control area and an information data area. The information control area is used to store the user's query conditions and the user's own information, and the information data area is used to store the returned results of the query. Definition of information control area Different systems may have different definitions, but the basic information is the same: the query information definition part of the information control area can define query objects, query conditions, etc.; the user information definition part of the information control area can define user identification information, such as:

是否为联合查询Is it a joint query

查询表名query table name

查询字段列表(缺省为表中全部字段)Query field list (default is all fields in the table)

查询条件(缺省为全部记录)Query conditions (the default is all records)

生成的文件名generated filename

用户标识信息user identification information

文件结构的信息数据区一般可以由以下几部分组成:The information data area of the file structure can generally be composed of the following parts:

信息数据区的数据头部分用以记录查询的字段数目及记录数等;The data header part of the information data area is used to record the number of fields and records to be queried;

信息数据区的数据类型描述部分用以记录字段类型及字段长度等;The data type description part of the information data area is used to record the field type and field length, etc.;

信息数据区的数据记录部分用以记录查询得到的具体结果;The data record part of the information data area is used to record the specific results of the query;

当然,不同的系统可以对信息控制区和信息数据区的内容有不同的定义。Of course, different systems may have different definitions for the contents of the information control area and the information data area.

图3是图1中“子处理单元构造查询SQL语句”步骤的详细流程图。如图3所示,具体包括下列步骤:1、数据库子处理单元根据查询请求中的用户标识信息调用文件结构,获取文件结构和信息控制区用户给定的文件名,并在给定目录下以读写方式打开这个文件,如果该文件已存在,则覆盖,如果不存在,则生成一个新文件;2、数据库子处理单元判断查询请求中用户输入查询信息的正确性,如果用户填写信息不完全,则向用户返回失败信息,否则执行下一步;3、数据库子处理单元根据用户填写的查询信息构造出数据库SQL查询语句;4、数据库子处理单元验证查询语句是否正确,如果不正确,则向用户返回失败信息,否则执行下一步查询。用户发送查询请求到数据库处理单元,数据库子处理单元分析该项请求,并判断用户填入信息的正确性(比如验证表名是否填入等),如果填写信息不完全,则向用户返回失败,否则数据库子处理单元在接到数据库处理单元分配的查询请求后,首先在信息控制区进行查找,获取相关的查询信息,并根据得到的查询信息构成用以查询的SQL语句,并简单检查语句的正确性(比如验证语句中是否有表名等)如果验证正确,则进行下一步查询,否则,向用户返回错误号。数据库子处理单元一旦验证了查询语句的正确性,就将查询语句传入数据库,在数据库中执行相应的查询操作。查询语句一次传入数据库,查询结果逐条获取,为了屏蔽不同平台之间的差异,子处理单元对查询结果进行初步的分析,将查询结果以网络字节序的方式写入文件的信息数据区,当查询完成后,数据库子处理单元关闭文件,并准备向用户返回。Fig. 3 is a detailed flowchart of the step of "constructing query SQL statement by the sub-processing unit" in Fig. 1 . As shown in Figure 3, it specifically includes the following steps: 1. The database sub-processing unit invokes the file structure according to the user identification information in the query request, obtains the file structure and the file name given by the user in the information control area, and in the given directory with Open this file in read-write mode, if the file already exists, overwrite it, if it does not exist, generate a new file; 2. The database sub-processing unit judges the correctness of the query information entered by the user in the query request, if the user fills in the information is incomplete , then return failure information to the user, otherwise execute the next step; 3. The database sub-processing unit constructs a database SQL query statement according to the query information filled in by the user; 4. The database sub-processing unit verifies whether the query statement is correct. The user returns a failure message, otherwise executes the next query. The user sends a query request to the database processing unit, and the database sub-processing unit analyzes the request and judges the correctness of the information entered by the user (such as verifying whether the table name is filled in, etc.). If the information is incomplete, it will return failure to the user. Otherwise, after receiving the query request assigned by the database processing unit, the database sub-processing unit first searches in the information control area to obtain relevant query information, and forms an SQL statement for query according to the obtained query information, and simply checks the statement Correctness (such as whether there is a table name in the verification statement, etc.) If the verification is correct, the next query is performed, otherwise, an error number is returned to the user. Once the database sub-processing unit verifies the correctness of the query statement, it will pass the query statement into the database, and execute the corresponding query operation in the database. The query statement is sent to the database at one time, and the query results are obtained one by one. In order to shield the differences between different platforms, the sub-processing unit conducts a preliminary analysis on the query results, and writes the query results into the information data area of the file in network byte order. When the query is complete, the database subprocessing unit closes the file and prepares to return to the user.

为了方便用户对查询结果文件的存取,该方法提供了一系列的文件存取接口,这些存取接口利用了文件系统本身的存取接口,在原有接口上封装了一层,封装层提供了对查询信息的分析以及对网络中不同平台的判断处理,使得用户在对文件进行存取时无需关心文件的来源和结构。这些存取接口包括文件创建、文件打开、文件写入、文件读取、文件关闭、文件定位、文件移动、文件指针当前位置和文件删除。对这些存取接口的简单说明如下:In order to facilitate the user's access to the query result file, this method provides a series of file access interfaces. These access interfaces use the access interface of the file system itself, and encapsulate a layer on the original interface. The encapsulation layer provides The analysis of query information and the judgment and processing of different platforms in the network make it unnecessary for users to care about the source and structure of files when accessing files. These access interfaces include file creation, file opening, file writing, file reading, file closing, file positioning, file moving, current position of the file pointer, and file deletion. A brief description of these access interfaces is as follows:

·文件创建·File Creation

判断文件是否存在,如果存在,则判断是否需要覆盖,如果是,则覆盖原有文件;Determine whether the file exists, if it exists, determine whether it needs to be overwritten, and if so, overwrite the original file;

如果文件不存在,直接创建;If the file does not exist, create it directly;

·文件打开·File open

判断文件以何种方式打开,根据要求打开文件;Determine how the file is opened, and open the file as required;

·文件写入·File writing

判断是对查询信息的写入还是对查询结果的写入,根据不同的写入请求写文件;Determine whether to write query information or query results, and write files according to different write requests;

·文件读取·File reading

判断是对查询信息的读取还是对查询结果的读取,数据库处理子单元调用对查询信息的读取,用户调用对查询结果的读取;Judging whether to read the query information or the query result, the database processing subunit calls to read the query information, and the user calls to read the query result;

·文件关闭· File close

将打开的文件关闭;close the open file;

·文件定位·File location

将文件的指针定位到某个位置;Locate the pointer of the file to a certain position;

·文件移动·File movement

将文件从一个地方移动到另一个地方,可以是同一平台之间的移动,也可以是不同平台之间的移动;Move files from one place to another, either between the same platform or between different platforms;

·文件指针当前位置·The current position of the file pointer

返回文件指针当前的位置;Return the current position of the file pointer;

·文件删除·File deletion

将文件从某个地方删除,如果没有权限,则返回失败并告诉无权限删除,如果有权限,则直接删除。Delete the file from somewhere, if there is no permission, return failure and tell no permission to delete, if there is permission, delete directly.

在本发明的一个优选实施例——电信网管系统(客户端/服务器模式)中,采用本发明所述的方法实现对数据库查询,主要实施步骤如下:In a preferred embodiment of the present invention---telecom network management system (client/server mode), adopt method described in the present invention to realize to database inquiry, main implementation steps are as follows:

1.查询条件定义1. Definition of query conditions

根据上述方法中提供的统一文件结构,对信息控制区和信息数据区分别进行了定义,信息控制区部分模板结构定义如下:According to the unified file structure provided in the above method, the information control area and the information data area are respectively defined, and part of the template structure of the information control area is defined as follows:

信息控制区头Information Control Area Header

是否为联合查询(可以缺省,缺省为单表查询)Whether it is a joint query (can be defaulted, the default is a single table query)

生成的文件名generated filename

用户标识信息user identification information

信息控制区内容Information Control Area Contents

查询表名query table name

查询字段列表(可以缺省,缺省为全部字段)Query field list (can be defaulted, the default is all fields)

查询条件(可以缺省,缺省为全部记录)Query conditions (can be defaulted, the default is all records)

信息数据区部分模板结构定义如下:The partial template structure of the information data area is defined as follows:

数据头:记录查询的字段数目及记录数等Data header: the number of fields and records for record query, etc.

数据类型描述:记录字段类型及字段长度,整个结构长度为字段数目Data type description: record field type and field length, the length of the entire structure is the number of fields

数据记录:记录查询得到的具体内容Data record: record the specific content obtained by query

客户端根据自己的查询需求填写初始摸板,当客户端确认自己的填写时,填写好的文件结构就被传送到数据库处理单元保留。在系统运行过程中,客户端可以通过接口随时修改查询信息,修改的查询信息会立刻被记录,并保留在以后的使用中。The client fills in the initial template according to its own query requirements. When the client confirms its filling, the filled file structure is sent to the database processing unit for storage. During the operation of the system, the client can modify the query information at any time through the interface, and the modified query information will be recorded immediately and retained for future use.

2.查询请求处理2. Query request processing

客户端将查询请求发送到服务器数据库处理单元进行查询,数据库处理单元对查询请求进行调度,找到无负载的数据库处理子单元,并将该请求分配给此数据库处理子单元,当数据库子处理单元收到查询请求时,根据用户标识信息调用文件结构,获取文件结构信息控制区用户给定的文件名,并在服务器给定目录下以读写方式打开这个文件,如果该文件已存在,则覆盖,如果不存在,则生成一个新文件。The client sends the query request to the server database processing unit for query, the database processing unit schedules the query request, finds the database processing subunit without load, and assigns the request to the database processing subunit, when the database subprocessing unit receives When the query request arrives, call the file structure according to the user identification information, obtain the file name given by the user in the file structure information control area, and open the file in read-write mode in the given directory of the server. If the file already exists, overwrite it. Generates a new file if it does not exist.

已分配的子处理单元实施具体的查询请求,并将查询的的结果存储在文件的信息数据区,当一次查询完全结束后,子处理单元将文件返回给客户端。客户端对数据库查询的请求,可以是同步的,也可以是异步的,这取决于它对返回结果是否立刻关心。The assigned sub-processing unit implements a specific query request, and stores the query result in the information data area of the file. When a query is completely completed, the sub-processing unit returns the file to the client. The client's request for database query can be synchronous or asynchronous, depending on whether it cares about the returned result immediately.

我们提供一系列API函数来进行数据库的操作。为了在数据库连接数目有限的情况下可以使尽可能多的数据库操作能够并发操作,对于简单查询的操作首先将查询结果放入结果缓存,取数据时再逐条取出各个结果。We provide a series of API functions to perform database operations. In order to enable as many database operations as possible to operate concurrently when the number of database connections is limited, for simple query operations, first put the query results into the result cache, and then fetch each result one by one when fetching data.

3.查询语句获取3. Query statement acquisition

数据库子处理单元在接到数据库处理单元分配的查询请求后,则首先在信息控制区进行查找,获取相关的查询信息,并根据得到的查询信息构成用以查询的SQL语句,并简单检查语句的正确性(比如验证语句中是否有表名等)如果验证正确,则进行下一步查询,否则,向客户端返回错误号。After receiving the query request assigned by the database processing unit, the database sub-processing unit first searches in the information control area to obtain relevant query information, and forms an SQL statement for query according to the obtained query information, and simply checks the statement. Correctness (such as whether there is a table name in the verification statement, etc.) If the verification is correct, the next query is performed; otherwise, an error number is returned to the client.

4.进行查询4. Make an inquiry

数据库子处理单元一旦验证了查询语句的正确性,就将查询语句传入数据库,在数据库中执行相应的查询操作。Once the database sub-processing unit verifies the correctness of the query statement, it will pass the query statement into the database, and execute the corresponding query operation in the database.

查询语句一次传入数据库,查询结果逐条获取,为了屏蔽不同平台之间的差异,子处理单元对查询结果进行初步的分析,将查询结果以网络字节序的方式写入文件的信息数据区,当查询完成后,数据库子处理单元关闭文件,并准备向客户端返回。The query statement is sent to the database at one time, and the query results are obtained one by one. In order to shield the differences between different platforms, the sub-processing unit conducts a preliminary analysis on the query results, and writes the query results into the information data area of the file in network byte order. When the query is complete, the database sub-processing unit closes the file and prepares to return to the client.

本发明所提出的查询方法适用于任何客户端/服务器模式。采用本发明提出的方法,使得在有限的数据库连接数目下,能够完成各个模块对于数据库的访问,屏蔽了各个用户模块对数据库的访问;同时它也提供了对数据库的监测功能,解决了移动对查询带来的影响,以及大数据量的查询在网络传输上的瓶颈问题,并减少了用户进行查询处理的复杂度。The query method proposed by the present invention is applicable to any client/server mode. Adopting the method proposed by the present invention makes it possible to complete the access of each module to the database under the limited number of database connections, shielding the access of each user module to the database; it also provides the monitoring function of the database at the same time, and solves the problem of mobile access to the database. The impact of queries, as well as the bottleneck problem of large data volume queries in network transmission, and reduce the complexity of query processing for users.

Claims (6)

1, a kind of platform database querying method is characterized in that comprising the following steps:
(1) inquiry file of structure consolidation form, described inquiry file comprises information Control district and information data district, and the information Control district is used to store user's querying condition and user's self information, and the information data district is used for the return results of storing queries;
(2) user's input inquiry information in inquiry file;
(3) user sends to database processing unit with query requests in the mode of file;
(4) database processing unit is the sub-processing unit of each query requests allocation database, and the sub-processing unit of described database connects for the database that can Gong call;
(5) the sub-processing unit of database is according to the inquiry file constructs database SQL query statement that distributes; Specifically comprise the following steps:
5.1 the sub-processing unit of database calls file structure according to the user totem information in the query requests, obtain file structure and the given filename of information Control district user, and under given catalogue, open this file with read-write mode, if this document exists, then cover, if there is no, then generate a new file;
5.2 the sub-processing unit of database is judged the correctness of user input query information in the query requests, if user's fill message is incomplete, then returns failure information to the user, otherwise carries out next step;
5.3 the Query Information that the sub-processing unit of database is filled in according to the user constructs the database SQL query statement;
5.4 whether the sub-processing unit checking of database query statement is correct, if incorrect, then returns failure information to the user, otherwise carries out next step inquiry;
(6) carry out data base querying, once import query statement into database, obtain Query Result one by one;
(7) database word processing cell processing Query Result and return the Query Result file to the user; Described processing Query Result is meant that the sub-processing unit of database writes the information data district of Query Result file with Query Result in the mode of network bytes preface, and after inquiry was finished, the sub-processing unit of database was closed the Query Result file.
2, platform database querying method according to claim 1 is characterized in that the content in described information Control district comprises: whether be conjunctive query, and inquiry table name, inquiry list of fields, querying condition, the filename of generation, user totem information.
3, platform database querying method according to claim 1 is characterized in that the content in described information data district comprises: data head, in order to the field number and the record number of record queries; Data type is described, in order to record field type and field length; Data recording, the particular content that obtains in order to record queries.
4, platform database querying method according to claim 1 is characterized in that the request of user to the data library inquiry, is synchronous or asynchronous request.
5, platform database querying method according to claim 1, it is characterized in that described method also comprises provides a series of file access interfaces, described access interface is to encapsulate one deck on the access interface of file system itself, makes the user need not to be concerned about the structure and the source of file when file is carried out access.
6, platform database querying method according to claim 5 is characterized in that described access interface comprises that document creation, File Open, file write, file reads, closing of a file, document alignment, file movement, file pointer current location and file delete.
CN 03113491 2003-05-15 2003-05-15 Across-platform data base researching method Expired - Fee Related CN1282111C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 03113491 CN1282111C (en) 2003-05-15 2003-05-15 Across-platform data base researching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 03113491 CN1282111C (en) 2003-05-15 2003-05-15 Across-platform data base researching method

Publications (2)

Publication Number Publication Date
CN1549163A CN1549163A (en) 2004-11-24
CN1282111C true CN1282111C (en) 2006-10-25

Family

ID=34320102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 03113491 Expired - Fee Related CN1282111C (en) 2003-05-15 2003-05-15 Across-platform data base researching method

Country Status (1)

Country Link
CN (1) CN1282111C (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7640237B2 (en) * 2005-01-11 2009-12-29 International Business Machines Corporation System and method for database query with on demand database query reduction
CN100464329C (en) * 2005-06-14 2009-02-25 联想(北京)有限公司 Construction method for dynamic structured query language statement
US8195649B2 (en) * 2005-11-08 2012-06-05 International Business Machines Corporation Apparatus, system, and method for accessing a database
CN101145150B (en) * 2006-09-15 2011-11-02 中国银联股份有限公司 Batch file processing method and system
CN101640696A (en) * 2008-08-01 2010-02-03 华为技术有限公司 Method, device and system for managing elements
US8688649B2 (en) 2010-10-12 2014-04-01 Clinicomp International, Inc. Scalable computer arrangement and method
US8549026B2 (en) * 2010-10-12 2013-10-01 Clinicomp International, Inc. Standardized database access system and method
CN103514185B (en) * 2012-06-20 2017-09-29 北京四维图新科技股份有限公司 The database file access management method and device of the multiple update area of navigation map
CN102890712A (en) * 2012-09-07 2013-01-23 佳都新太科技股份有限公司 Method for converting data protocols of database query interface based on multi-stage protocol stack structure
CN103532959A (en) * 2013-10-21 2014-01-22 济南政和科技有限公司 Cross-platform network communication method
CN103902677B (en) * 2014-03-21 2017-07-28 西安理工大学 A kind of cross-platform data bank access method
CN108600330A (en) * 2018-03-29 2018-09-28 努比亚技术有限公司 Deferred information method for pushing, equipment and computer readable storage medium
CN108984623B (en) * 2018-06-14 2020-11-03 东软集团股份有限公司 Data query condition generation method and device, storage medium and electronic equipment
CN109492138A (en) * 2018-10-22 2019-03-19 中国银行股份有限公司 A kind of data query processing method and system
CN109710220B (en) * 2018-12-12 2023-08-22 平安科技(深圳)有限公司 Relational database query method, relational database query device, relational database query equipment and storage medium
CN109857762B (en) * 2019-01-29 2021-08-17 腾讯科技(深圳)有限公司 User data processing method, sharing message processing method and computer equipment
CN114138714B (en) * 2022-02-08 2022-05-24 上海金仕达软件科技有限公司 Data migration method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN1549163A (en) 2004-11-24

Similar Documents

Publication Publication Date Title
CN1282111C (en) Across-platform data base researching method
CN106202452B (en) Unified data resource management system and method for big data platform
CN107247808B (en) Distributed NewSQL database system and picture data query method
US9223817B2 (en) Virtual repository management
US8370910B2 (en) File server for translating user identifier
CN111198901B (en) Unified data service opening method and system based on multiple data sources
CN1877523A (en) Method for unified management of component library supporting heterogeneous component
CN1629826A (en) Method and apparatus for data retention in a storage system
US20210200714A1 (en) Apparatus for Accessing Data from a Database as a File
WO1999011018A1 (en) Distributed computing architecture
CN1477518A (en) System for handling file name of file system filter driver and its method
US7548939B2 (en) Generating storage reports using volume snapshots
CN1329308A (en) Method for distributing application program data into dissimilar format distributed data base and its system
CN1945578A (en) Method for forming and applying high speed Wcb electronic map based on space data base and SVG
CN102073633A (en) Method and device for storing and accessing resource file
CN1728665A (en) A scalable object-based storage system and its control method
CN1949216A (en) Information searching method
CN1691679A (en) Method for heterogeneous system configuration
CN1904885A (en) Database adapter
CN113761040A (en) Database and application program bidirectional mapping method, device, medium and program product
CN1266603C (en) Method for transparent extending document system function
CN112487075A (en) Operator for integrating data conversion of relational database and non-relational database
CN101080715A (en) System and method for managing binary large objects
CN1125991A (en) A method of attaining data access in a primary memory based database
US20150199373A1 (en) Methods and systems for data storage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: JINJIANG HIGH-TECH DEVELOPMENT OFFICE

Free format text: FORMER OWNER: ZTE CORPORATION

Effective date: 20131107

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 518057 SHENZHEN, GUANGDONG PROVINCE TO: 362200 QUANZHOU, FUJIAN PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20131107

Address after: Jinjiang City, Fujian province 362200 Chongde road Quanzhou City No. 283 friends Jade Technology Building

Patentee after: Jinjiang high and new technology development office

Address before: 518057 Department of law, Zhongxing building, South Science and technology road, Nanshan District hi tech Industrial Park, Shenzhen

Patentee before: ZTE Corporation

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20061025

Termination date: 20170515

CF01 Termination of patent right due to non-payment of annual fee