Movatterモバイル変換


[0]ホーム

URL:


CN101477555B - Fast retrieval and generation display method for task tree based on SQL database - Google Patents

Fast retrieval and generation display method for task tree based on SQL database
Download PDF

Info

Publication number
CN101477555B
CN101477555BCN2009100281080ACN200910028108ACN101477555BCN 101477555 BCN101477555 BCN 101477555BCN 2009100281080 ACN2009100281080 ACN 2009100281080ACN 200910028108 ACN200910028108 ACN 200910028108ACN 101477555 BCN101477555 BCN 101477555B
Authority
CN
China
Prior art keywords
task
node
sql
tree
ordering
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
CN2009100281080A
Other languages
Chinese (zh)
Other versions
CN101477555A (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.)
NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd
Original Assignee
NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd
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 NANJING CITY LINKAGE SYSTEM INTEGRATION CO LtdfiledCriticalNANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd
Priority to CN2009100281080ApriorityCriticalpatent/CN101477555B/en
Publication of CN101477555ApublicationCriticalpatent/CN101477555A/en
Application grantedgrantedCritical
Publication of CN101477555BpublicationCriticalpatent/CN101477555B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The invention discloses a method for fast retrieving, generating and displaying a task tree based on an SQL database. The method is characterized in that the number of task nodes of the task tree is converted into information capable of ordering for SQL, particularly, the numerical value weighting process and the code conversion are performed to each group of number for the number of task nodes, so as to form ordering numerical values through which the database can judge the size, ordering of the task nodes is performed through SQL language according to the obtained ordering numerical values, so as to realize retrieval of the task tree, and the further generating display is performed. Wherein, the numerical value weighting process adopts the way that each group of number for the number of the task nodes is multiplied by weighting factors to achieve the weighting process; the code conversion adopts the way that each group of number for the number of task nodes after the weighting process is connected in the form of character strings in sequence in the number of task nodes, and final format conversion values or ordering numerical values of the number of task nodes are obtained.

Description

Based on the quick retrieval of the task of SQL database tree and generate the method that shows
Technical field
The present invention relates to Structured Query Language (SQL) SQL (Structured Query Language) retrieval technique, be specially the quick retrieval of a kind of task tree based on SQL database and generate the method that shows.
Background technology
In sql like language, provide a large amount of inquiry, sort methods.Foundation for ordering in the sql like language is that certain requirement is arranged, as simple numerical ordering, according to numerical values recited; The character ordering is according to its ASCII character size ordering; And time-sequencing, according to the time order and function order.
The statement of same realization purpose, different combinations, it is carried out efficient and differs greatly.In the actual utilization, if the sort by that the needs default sort rule of accord with SQL not, but its ordering rule that can't discern is generally handled this problem by following several modes:
1) data is extracted from database, in internal memory, judge ordering, draw ranking results according to specific regular program;
2) key word with ordering carries out format conversion, is converted to the ordering form that sql like language can be discerned, and the ranking function of utilizing sql like language again is at the data sorting after changing.
System is in handling above-mentioned sequencer procedure, and the implementation method of ordering is an one critical function, realizes that the speed of ordering also is an important performance reference target.Because in interactively mode of operation, the far-end operation person has certain tolerance for the response time of system.If the long-time not response of operation, system value can't be approved.Should in the system performance design, take into full account this demand.
In the project management, set the distribution situation that can understand task by the task of browsing project, being distributed on the logical topology of task is the structure of a binary tree, as Fig. 1.Because assigning of task be unordered in time, thereby the position that is kept in the database also is unordered arrangement, as table 1:
Table 1
Sequence number node number task names task definition is assigned start time time plan concluding time physical end time state
1 1.1 task A 2008-1-1
2 1.3 task B 2008-1-4
3 2.1 task C 2008-1-4
4 3.1 task D 2008-1-5
5 2.2 task E 2008-1-9
6 1.1.1 task F 2008-1-10
Unique foundation that can sort to task node is the node serial number of task, as: 1.1.1,2.1 etc.Multistage task node numbering is a required attribute in the task tree, but because be in the SQL statement to numerical value, time conventional among the SQL, or simply sorting operation is carried out in character combination, and the character of task node numbering form is relatively, SQL does not support at present.Therefore conventional SQL sorting operation can't obtain desired data at short notice.
The data of how unordered database space being preserved are output as orderly data, are the problems that the retrieval tasks tree will be considered in the project management system.In result's while of exporting, owing in program, need judgement, calculating, arrangement, processing to need the plenty of time, so the response time of system also should be considered.Therefore how fast and effectively the task node in the task tree being sorted, is the problem that needs reality to face in the design.
Summary of the invention
The problem to be solved in the present invention is: sql like language can not be retrieved fast to its ordering rule that can't discern, especially at the tree of the task in the project management, needs the method for task node information in the quick searching database table of a kind of energy.
Technical scheme of the present invention is: based on the quick retrieval of the task of SQL database tree and generate the method that shows, the task node numbering of task tree is converted to the information that SQL can sort, be specially each group numeral of task node numbering is carried out the numerical value weighted, carry out code conversion again, form database and can differentiate the ordering numerical value of size, the ordering numerical value according to obtaining sorts to task node by sql like language, realization is to the retrieval of task tree, and further generation shows; Wherein the numerical value weighted is: determine weighting factor f according to the maximum son node number that task is set under each node, weighting factor f is 10nIn greater than the minimum value of son node number, each group numeral of task node numbering be multiply by weighting factor, finish weighted; Code conversion is: with each group numeral of the numbering of the task node after the weighted, carry out the connection of character string by its order in the task node serial number, obtain the Final Format conversion value of task node numbering, numerical value promptly sorts.
Quick retrieval of task of the present invention tree and generation are presented in the system based on browser and server B/S framework to be carried out, and is convenient to operated from a distance, and SQL database is arranged on server end, and concrete steps are:
Step 1, the maximum node number under the layering of node that sets the tasks is determined the size of weighting factor f;
Step 2, the maximum number of plies of the tree that sets the tasks is determined the conversion value zero padding number of node level less than the maximum layer of node;
Step 3, carry out from task node number the ordering numerical value format conversion, format conversion is carried out at server end, the ordering numerical value that obtains deposits SQL database in, by sql like language ordering numerical value is differentiated size, realize ordering, obtain arranging orderly data set task node;
Step 4, after the browser of client obtains to arrange orderly data set, existing sequence according to data set presents net result by the Javascript language by tree-like structure, can reflect the distribution situation of current task tree, and the generation of realization task tree shows.
For avoiding server end with the frequent data interaction between the SQL database, in SQL database, utilize view to realize format conversion, database manipulation function by Java, the task node numbering is read out one by one, carry out format conversion, be inserted into again in the temporary table space of interim generation, at last temporary table is carried out the SQL data retrieval, sort according to the data that generate,, be and arrange orderly data set result's output.
The non-ordered data that can't directly sort with sql like language that the present invention can be fast, effectively database space is preserved is output as orderly data, retrieval of task tree and generation at project management shows especially, be shown as example with a normal task tree, the task node number is 1000, original query time is about 1 minute, and after employing the inventive method, query time shortens to 1~2 second, thereby realizes fast worktodo tree search function.
Description of drawings
Fig. 1 is project task tree synoptic diagram.
Embodiment
The form of task node numbering can't be discerned its magnitude relationship for the SQL basic statement.The inquiry ordering of SQL statement is to have utilized the size of the key word of ordering to sort, thereby enumerates the SQL query result.What need solution is how the task node numbering to be converted to the information that SQL can sort.
The present invention is converted to the information that SQL can sort with the task node numbering of task tree, be specially each group numeral of task node numbering is carried out the numerical value weighted, carry out code conversion again, form database and can differentiate the ordering numerical value of size, according to the ordering numerical value that obtains, by sql like language task node is sorted, realize retrieval, and further generate demonstration the task tree; Wherein the numerical value weighted is: determine weighting factor f according to the maximum son node number that task is set under each node, weighting factor f is 10nIn greater than the minimum value of son node number, each group numeral of task node numbering be multiply by weighting factor, finish weighted; Code conversion is: the maximum number of plies of determining the current task tree, determine node zero padding disposal route, with each group numeral of the numbering of the task node after the weighted, carry out the connection of character string by its order in the task node serial number, obtain the Final Format conversion value of task node numbering, numerical value promptly sorts.
Weighting factor f is 10nIn a value, if maximum son node number is 400 under the individual node of task tree, so, 102<400<103, the value of f is 1000; Maximum son node number is 99 under the individual node of task tree, so, and 101<99<102, the value of f is 100.
Determine the maximum number of plies of current task tree, determine that node conversion zero padding disposal route is meant, as: node serial number is a.b.c, this node layer is 3, and the maximum layer of task tree is 4, and the form that can represent is a.b.c.d, this moment, we thought that consideration at node a.b.c is need be according to 4 layers node processing, the three first layers value is according to the normal handling method, and last demand is handled according to zero padding, and the figure place of zero padding is a weighting factor f figure place.
If node serial number is a.b.c, the maximum layer of task tree is 4, carries out numerical value weighted and code conversion:
Value=a*f+b*f+c*f+f*0
Value is final format conversion value, the numerical value that promptly sorts, and what plus sige was represented in formula is the connection of character string.For example maximum son node number is 450 under the individual node of task tree, then the value of f is 1000, the maximum layer of task tree is 4, task node is numbered 1.1.1, then be divided into 1,1,1 three group of numeral, ordering numerical value Value=1*1000+1*1000+1*1000+1000*0=1000100010000000, in like manner task node is numbered 2.1, ordering numerical value Value=2*1000+1*1000+0*1000+0*1000=2000100000000000, SQL database is carried out retrieval ordering to ordering numerical value, realization is to the orderly output of project management task tree, as table 2:
Table 2
Sequence number node number task names task definition is assigned start time time plan concluding time physical end time state
1 1.1 task A 2008-1-1
6 1.1.1 task F 2008-1-10
2 1.3 task B 2008-1-4
3 2.1 task C 2008-1-4
5 2.2 task E 2008-1-9
4 3.1 task D 2008-1-5
Compare with table 1, effectively realized task node being sorted by the task node numbering.
During specific implementation of the present invention, quick retrieval of task tree and generation are presented in the system based on browser and server B/S framework to be carried out, and is convenient to operated from a distance, and SQL database is arranged on server end, and concrete steps are:
Step 1, maximum node number under layering of node sets the tasks, determine the size of weighting factor f, for example, according to daily task statistics, according to the expression of this task node form of a.b.c, a, b, the span of these three numerical value of c is more than or equal to 0, smaller or equal to 1000, then determine a task tree down the maximum node tree of one deck be 1000;
Step 2, the maximum number of plies of the tree that sets the tasks, by determining the clear and definite value of maximum layer space, for example the node form of a.b.c represents that the task node number of plies is 3 layers;
Step 3, carry out numbering the format conversion of ordering numerical value from task node, because system is the design architecture of B/S, format conversion is carried out at server end, the ordering numerical value that obtains deposits SQL database in, by sql like language ordering numerical value is differentiated size, realize ordering, obtain arranging orderly data set task node;
Step 4, after the browser of client obtains to arrange orderly data set, existing sequence according to data set presents net result by the Javascript language by tree-like structure, can reflect the distribution situation of current task tree, and the generation of realization task tree shows.
For avoiding server end with the frequent data interaction between the SQL database, in SQL database, utilize view to realize format conversion, database manipulation function by Java, the task node numbering is read out one by one, carry out format conversion, be inserted into again in the temporary table space of interim generation, at last temporary table is carried out the SQL data retrieval, sort according to the data that generate,, be and arrange orderly data set result's output.

Claims (1)

1. based on the quick retrieval of the task of SQL database tree and generate the method that shows, it is characterized in that the task node numbering of task tree is converted to the information that SQL can sort, be specially each group numeral of task node numbering is carried out the numerical value weighted, carry out code conversion again, form database and can differentiate the ordering numerical value of size, the ordering numerical value according to obtaining sorts to task node by sql like language, realization is to the retrieval of task tree, and further generation shows; Wherein the numerical value weighted is: determine weighting factor f according to the maximum son node number that task is set under each node, weighting factor f is 10nIn greater than the minimum value of son node number, each group numeral of task node numbering be multiply by weighting factor, finish weighted; Code conversion is: with each group numeral of the numbering of the task node after the weighted, carry out the connection of character string by its order in the task node serial number, obtain the Final Format conversion value of task node numbering, numerical value promptly sorts;
CN2009100281080A2009-01-092009-01-09Fast retrieval and generation display method for task tree based on SQL databaseExpired - Fee RelatedCN101477555B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN2009100281080ACN101477555B (en)2009-01-092009-01-09Fast retrieval and generation display method for task tree based on SQL database

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN2009100281080ACN101477555B (en)2009-01-092009-01-09Fast retrieval and generation display method for task tree based on SQL database

Publications (2)

Publication NumberPublication Date
CN101477555A CN101477555A (en)2009-07-08
CN101477555Btrue CN101477555B (en)2010-09-08

Family

ID=40838271

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN2009100281080AExpired - Fee RelatedCN101477555B (en)2009-01-092009-01-09Fast retrieval and generation display method for task tree based on SQL database

Country Status (1)

CountryLink
CN (1)CN101477555B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102063329B (en)*2010-12-222012-12-12北京邮电大学Multi-agent coordination based management task dynamic decomposition method and system
CN102841891B (en)*2011-06-212017-02-15金蝶软件(中国)有限公司Method and device for ordering tree structure nodes, and enquiry system
CN102332030A (en)*2011-10-172012-01-25中国科学院计算技术研究所 Data storage, management and query method and system for distributed key-value storage system
CN102867059A (en)*2012-09-192013-01-09浪潮(北京)电子信息产业有限公司Method and system for processing data in treelike structures
CN103699648A (en)*2013-12-262014-04-02成都市卓睿科技有限公司Tree-form data structure used for quick retrieval and implementation method of tree-form data structure
CN107194608B (en)*2017-06-132021-09-17复旦大学Crowd-sourcing labeling task allocation method for disabled person community
CN110928667B (en)*2019-12-062022-03-01北京明略软件系统有限公司Task scheduling method and device, electronic equipment and storage medium
CN114443922A (en)*2020-11-042022-05-06上海宽带技术及应用工程研究中心IoT (Internet of things) data perception-oriented sensor data packet retrieval method, system and device
CN113378008B (en)*2021-04-292022-10-11上海工程技术大学 An Operation Recall Method Supporting Tree Model

Also Published As

Publication numberPublication date
CN101477555A (en)2009-07-08

Similar Documents

PublicationPublication DateTitle
CN101477555B (en)Fast retrieval and generation display method for task tree based on SQL database
US6738759B1 (en)System and method for performing similarity searching using pointer optimization
CN102541529B (en)A kind of query page generating device and method
US6618727B1 (en)System and method for performing similarity searching
CN104375992B (en)A kind of method and apparatus of address matching
CA2388515C (en)System for managing rdbm fragmentations
CN111506621B (en)Data statistical method and device
CN101840432B (en)Data mining device based on Deep Web deep dynamic data and method thereof
US5933796A (en)Data extracting system based on characteristic quantities of data distribution
CN103177094B (en)Cleaning method of data of internet of things
CN104021198A (en)Relational database information retrieval method and device based on ontology semantic index
CN107943952A (en)A kind of implementation method that full-text search is carried out based on Spark frames
CN111984673B (en)Fuzzy retrieval method and device for tree structure of power grid electric energy metering system
Georgiadis et al.Efficient rewriting algorithms for preference queries
CN101957860A (en)Method and device for releasing and searching information
CN112540987A (en)Big data management system of distribution and utilization electricity based on data mart
Sheng et al.Dynamic top-k range reporting in external memory
CN103500222A (en)Method and device for searching for chat object through communication software
CN105740374B (en) Data Fuzzy Query Method of 3D Platform Based on Distributed Memory
US20060218154A1 (en)Data processing method and data processing program
CN107357919A (en)User behaviors log inquiry system and method
CN101996246B (en)Method and system for instant indexing
CN101297290B (en)Method for controlling relational database system
CN102339284B (en)Establishing method of database index and computer system thereof
QianDevelopment and Research of Computer Information Management System Based on MongoDB

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20100908

Termination date:20220109

CF01Termination of patent right due to non-payment of annual fee

[8]ページ先頭

©2009-2025 Movatter.jp