CN105550206B - The edition control method and device of structured query sentence - Google Patents

The edition control method and device of structured query sentence Download PDF

Info

Publication number
CN105550206B
CN105550206B CN201510870519.XA CN201510870519A CN105550206B CN 105550206 B CN105550206 B CN 105550206B CN 201510870519 A CN201510870519 A CN 201510870519A CN 105550206 B CN105550206 B CN 105550206B
Authority
CN
China
Prior art keywords
version
sql statement
sentence
version number
description information
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.)
Active
Application number
CN201510870519.XA
Other languages
Chinese (zh)
Other versions
CN105550206A (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.)
ZHUHAI DUOWAN INFORMATION TECHNOLOGY Ltd
Original Assignee
ZHUHAI DUOWAN INFORMATION TECHNOLOGY 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 ZHUHAI DUOWAN INFORMATION TECHNOLOGY Ltd filed Critical ZHUHAI DUOWAN INFORMATION TECHNOLOGY Ltd
Priority to CN201510870519.XA priority Critical patent/CN105550206B/en
Publication of CN105550206A publication Critical patent/CN105550206A/en
Application granted granted Critical
Publication of CN105550206B publication Critical patent/CN105550206B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1873Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of edition control methods of structured query sentence, comprising: receives the storage request of structuralized query SQL statement, extracts SQL statement, Version Description information and corresponding sentence mark that the SQL statement storage request carries;For the incremental version number of sentence mark distribution, the sentence mark, SQL statement, Version Description information and the version number of the distribution are corresponded into storage into tables of data;The request of SQL statement version rollback is received, sentence mark and version number that the SQL statement version rollback request carries are extracted, inquiry SQL statement corresponding with sentence mark and version number and Version Description information in the tables of data.The invention also discloses a kind of Version Control devices of structured query sentence.The edition control method and device of structured query sentence can carry out Version Control to the SQL statement that list is submitted in the present invention, to improve execution efficiency.

Description

The edition control method and device of structured query sentence
Technical field
The present invention relates to the edition control method of image identification technical field more particularly to a kind of structured query sentence and Device.
Background technique
With the development of internet technology, more and more users' data are recorded in the record of server, therefore right The big data analysis platform of the user data of server record comes into being.And in big data platform in the conventional technology, it uses Family is used as retrieval type to big data platform usually using SQL (Structured Query Language, structured query language) In user data analyzed and handled.But as the subsequent change of the business demand upgrades, for same SQL, during which It may occur repeatedly to modify, and user's modification may be different in team collaboration, but subsequent modification is not necessarily It is correctly, at this time just to need to carry out this SQL old version and check, compare and rolling back action.
Version control tool in traditional technology is an open-source generation usually using SVN (abbreviation of Subversion) The Version Control of code.The target that it is directed to is file, after the file of user changes and is committed to the background service of SVN Device, the background server of SVN can be the unique version of each submission generation of user, such user when needed, just Old version inquiry, comparison and rolling back action can be carried out to corresponding file.
However, need to carry out Version Control is the structuring of user's input in big data platform in the conventional technology Query statement, SVN can only be acted on file, be managed to FileVersion, cannot implement the list submitted in webpage.Cause This, does not provide the method for carrying out Version Control to the list submitted by webpage in traditional technology, cannot be to big data platform The version of the structured query sentence of middle user's input controls.
Summary of the invention
Based on this, to solve not being available SVN tool to the SQL language submitted by list in traditional technology mentioned above Sentence carries out the technical issues of Version Control, and spy proposes a kind of edition control method of structured query sentence.
A kind of edition control method of structured query sentence, comprising:
The storage request of structuralized query SQL statement is received, SQL statement, version that the SQL statement storage request carries are extracted This description information and corresponding sentence mark;
For the incremental version number of sentence mark distribution, by the sentence mark, SQL statement, Version Description information with And the corresponding storage of version number of the distribution is into tables of data;
The request of SQL statement version rollback is received, sentence mark and version that the SQL statement version rollback request carries are extracted This number, inquiry SQL statement corresponding with sentence mark and version number and Version Description information in the tables of data.
The SQL statement that SQL statement storage request carries and corresponding of extracting in one of the embodiments, Sentence identify the step of include:
Obtain the page iden-tity and the corresponding page in the page that the corresponding page is requested in the SQL statement storage The object identity of object;
Page iden-tity and the object identity are stored into the corresponding language of SQL statement that request carries as the SQL statement Sentence mark.
It is described by the sentence mark, SQL statement, Version Description information and described point in one of the embodiments, Before step of the corresponding storage of the version number matched into tables of data further include:
The SQL statement of the extraction and Version Description information sequence are melted into json object.
It is described in one of the embodiments, to be melted into the SQL statement of the extraction and Version Description information sequence After the step of json object further include:
It is raw using the json object of sentence mark, version number and the chemical conversion of the SQL statement sequence of extraction as attribute value At corresponding Version Control object, in memory by the Version Control target cache.
It is described by the sentence mark, SQL statement, Version Description information and described point in one of the embodiments, Step of the corresponding storage of the version number matched into tables of data further include:
According to the mapping relations of preset Version Control object's property value and the attribute value of the tables of data, by the version The attribute value of this control object is stored into the tables of data in corresponding field.
It is described with sentence mark, version number and the chemical conversion of the SQL statement sequence of extraction in one of the embodiments, Json object corresponding as attribute value generation Version Control object the step of further include:
It obtains the SQL statement storage and requests corresponding submission user identifier and submission time, by the submission user Mark and submission time are added in the Version Control object as attribute value.
Before the step of reception SQL statement version rollback is requested in one of the embodiments, further include:
It receives SQL statement version and checks request, extract the SQL statement version and check the sentence mark that request carries, In It is searched in the tables of data and the sentence identifies corresponding version number and Version Description information corresponding with the version number, with The form of list shows the version number and Version Description information corresponding with the version number;
The step of reception SQL statement version rollback is requested are as follows:
It receives and is requested by the SQL statement version rollback for choosing version number to generate in the list, the SQL statement version The sentence that this rollback request carries is identified as the corresponding sentence mark of the list, and the SQL statement version rollback request carries Version number be the version number chosen.
In addition, to solve not being available SVN tool to the SQL statement submitted by list in traditional technology mentioned above The technical issues of carrying out Version Control, spy propose a kind of Version Control device of structured query sentence.
A kind of Version Control device of structured query sentence, comprising:
SQL statement receiving module extracts the SQL statement storage for receiving the storage request of structuralized query SQL statement Request the SQL statement carried, Version Description information and corresponding sentence mark;
SQL statement memory module, for the version number incremental for sentence mark distribution, by sentence mark, SQL The corresponding storage of the version number of sentence, Version Description information and the distribution is into tables of data;
SQL statement roll-back module is extracted the SQL statement version rollback and is asked for receiving the request of SQL statement version rollback Sentence mark and the version number for asking carrying, the inquiry SQL language corresponding with sentence mark and version number in the tables of data Sentence and Version Description information.
The SQL statement receiving module is also used to obtain the SQL statement storage request pair in one of the embodiments, The page iden-tity for the page answered and in the page corresponding page object object identity;By page iden-tity and described right The corresponding sentence mark of SQL statement that request carries is stored as the SQL statement as identifying.
The SQL statement memory module is also used to the SQL statement and version of the extraction in one of the embodiments, This description information sequence is melted into json object.
In one of the embodiments, the SQL statement memory module be also used to the sentence identify, version number and The json object of the SQL statement sequence chemical conversion of extraction is as the corresponding Version Control object of attribute value generation, by the version control Target cache processed is in memory.
The SQL statement memory module is also used to according to preset Version Control object in one of the embodiments, The mapping relations of attribute value and the attribute value of the tables of data, by Version Control object's property value storage to the data In table in corresponding field.
The SQL statement memory module is also used to obtain the SQL statement storage request pair in one of the embodiments, The submission user identifier and submission time answered are added to institute using the submission user identifier and submission time as attribute value It states in Version Control object.
The SQL statement receiving module is also used to receive SQL statement version and checks request in one of the embodiments, It extracts the SQL statement version and checks the sentence mark that request carries, searched in the tables of data and sentence mark pair The version number answered and Version Description information corresponding with the version number, show in the form of a list the version number and with this The corresponding Version Description information of version number;
It receives and is requested by the SQL statement version rollback for choosing version number to generate in the list, the SQL statement version The sentence that this rollback request carries is identified as the corresponding sentence mark of the list, and the SQL statement version rollback request carries Version number be the version number chosen.
Implement the embodiment of the present invention, will have the following beneficial effects:
After the edition control method and device of above structure query statement, user can be mentioned by page table list The multiple SQL statement inputted in the same SQL statement input position is handed over, and server can be each for the SQL statement of multiple version From corresponding version number is distributed, then the SQL statement of multiple version is stored in the database according to version number again.It is needing When carrying out rollback to SQL statement, then the SQL statement of respective version can be obtained according to corresponding version number.With traditional technology phase Than not needing using SVN tool, server does not need to generate file storage after first extracting form data yet, then passes through again The interface function of SVN tool carries out version management, to realize the version management for the SQL statement submitted to list, improves Execution efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Wherein:
Fig. 1 is a kind of flow chart of the edition control method of structured query sentence in one embodiment;
Fig. 2 is the interface schematic diagram that terminal inputs the page that SQL statement is saved in one embodiment;
Fig. 3 is the procedure chart for converting the SQL statement of input in one embodiment Version Control object;
Fig. 4 is the interface schematic diagram for selecting the page of certain version progress rollback in one embodiment in multi version;
Fig. 5 is a kind of schematic diagram of the Version Control device of structured query sentence in one embodiment;
Fig. 6 is the knot that the computer equipment of edition control method of aforementioned structure query statement is run in one embodiment Structure schematic diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
To solve not being available SQL statement progress of the SVN tool to submitting by list in traditional technology mentioned above The technical issues of Version Control, in the present embodiment, spy, propose a kind of edition control method of structured query sentence, the party Method can be dependent on computer realization, can run in the computer system based on von Neumann system.The computer program can be with Be data analysis tool, big data analysis platform, Internet application with a large number of users data weblication (B/S frame Structure) or server-side application (C/S framework),.It is flat that the computer system can be data analysis tool, big data analysis The server apparatus of platform, Internet application with a large number of users data.
Specifically, as shown in Figure 1, this method comprises:
Step S102: receiving the storage request of structuralized query SQL statement, extracts what the SQL statement storage request carried SQL statement, Version Description information and corresponding sentence mark.
The storage request of structuralized query SQL statement is user when using big data analysis platform, to the SQL language of input The request that sentence is stored.In big data platform, data analyze user to analyze the behavioural characteristic of certain class user, then can be SQL statement is inputted in big data platform to obtain retrieving data accordingly, to complete the analysis to user behavior characteristics, is being divided During analysis, it may be necessary to attempt the multiple SQL statements of input and be analyzed to obtain optimal retrieval data.
For example, data, which analyze user, to be attempted multiple age keywords when attempting to input SQL statement and examined Rope, attempting input keyword for the first time is retrieval type of the age less than 20, searches user of the age less than 20, attempts for the second time defeated Entry keyword is retrieval type of the age less than 21, searches user of the age less than 21, it is the age that third time, which attempts input keyword, Retrieval type less than 22 searches user of the age less than 22, if learning by retrieval, is carried out using the age less than 20 as keyword The behavioural characteristic analysis that obtained retrieval data are most suitable for user is retrieved, then needing to re-enter keyword is the age less than 20 SQL statement.
Therefore, as shown in Fig. 2, in the present embodiment, structuralized query SQL statement memory page is provided, on the page May include Version Description information input frame (such as in Fig. 2 for analyst input for distinguishing version and concrete analysis business Relevant task ID and task names) and SQL statement.Version Description information is user to distinguish input SQL statement every time Difference and input for user read description information, subsequent user can be known according to the Version Description information this benefit It is had changed when being retrieved with the SQL statement and which is perhaps performed in which kind of additional task, thus to the SQL inputted every time Sentence distinguishes.The SQL statement inputted when retrieving each time is added to structuralized query SQL statement memory page by user, Then it clicks storage and has submitted SQL statement storage request.
In another embodiment, the storage of SQL statement can also be automatically performed, that is to say, that can be in big data platform The data retrieval page in, if user have input SQL statement carry out in tables of data user data carry out additions and deletions change the operation looked into, After having submitted operation requests, server not only executes the SQL statement, also automatically generates SQL statement storage request, defeated to carrying out The SQL statement entered is stored, and the operation note for storing user is equivalent to.
Sentence mark is mark corresponding with the input input position of SQL statement.In the present embodiment, it can obtain described SQL statement storage request the page iden-tity of the corresponding page and in the page corresponding page object object identity; Page iden-tity and the object identity are stored into the corresponding sentence mark of SQL statement that request carries as the SQL statement.
That is, if some of user in some SQL statement memory page or some SQL statement retrieval page SQL statement is had input in SQL statement input frame to carry out changing the operation looked into user data progress additions and deletions in tables of data, is had submitted SQL statement storage request can then obtain SQL statement storage and request corresponding SQL statement memory page or SQL statement retrieval The mark of SQL statement input frame in the page iden-tity (can be url link) of the page and the page, then as input SQL statement sentence mark.If having input difference in the subsequent identical SQL statement input frame in the same page of user SQL statement, then the SQL statement of the SQL statement and previous input sentence having the same identifies.
Step S104: for the incremental version number of sentence mark distribution, the sentence mark, SQL statement, version are retouched The version number for stating information and the distribution stores into tables of data.
Version number is the identifier for being used to distinguish the SQL statement that user inputs every time.Using incremental version number, can use The batch of SQL statement formula is inputted in identical SQL statement input frame in differentiation user.For example, user is for the first time in input SQL language When sentence is stored, version number can be assigned as 1;For the second time when input SQL statement stores, version number can be assigned as user 2.In the present embodiment, version number can be distributed by weblication, can also pass through database interface function by weblication Call being allocated from increasing function for database itself.
It is assigned with after version number, then can be identified using sentence as major key, by SQL statement storage into database, wherein Sentence mark is the sentence identity property (Attribute) in corresponding data table, and SQL statement is then corresponding in corresponding data table Contents attribute, the Version Description information then description information attribute in corresponding data table, version number are then corresponding in corresponding data table Version number's attribute.
That is, user has input SQL statement A in the input frame of corresponding sentence mark S for the first time, and it is added to version An entry will be added when this description information A is stored, in tables of data, the sentence identity property of the entry is S, content Attribute is SQL statement A, and description information attribute is Version Description information A, and version number's attribute is 1;Second of user in corresponding sentence When identifying in the input frame of S and have input SQL statement B, and being added to Version Description information B and stored, it will add again in tables of data Add an entry, the sentence identity property of the entry is S, and contents attribute is SQL statement B, and description information attribute is version Description information B, version number's attribute are 2.
Preferably, it is also wrapped before the step by the storage of the version number of the SQL statement and the distribution into tables of data It includes:
The SQL statement of the extraction and Version Description information sequence are melted into json object.
As shown in Figures 2 and 3, if in Version Description information including two attributes of taskID and taskName, it produces Json object, wherein taskID is " DemoID " inputted in the page, and taskName is the " demonstration times inputted in the page Business " can store the character string in tables of data to produce the character string of the json object of key-value pair formula as a whole In contents attribute.
Further, by the SQL statement of the extraction and Version Description information sequence chemical conversion json object the step of it Afterwards further include:
It is raw using the json object of sentence mark, version number and the chemical conversion of the SQL statement sequence of extraction as attribute value At corresponding Version Control object, in memory by the Version Control target cache.
Preferably, it can also obtain the SQL statement storage and request corresponding submission user identifier and submission time, by institute It states and user identifier and submission time is submitted to be added in the Version Control object as attribute value.
For example, Version Control object may include multiple attribute Value Types in an application scenarios:
1) svnId: version number uniquely indicates a version, using increasing ID certainly
2) pageId: page iden-tity uniquely indicates a page
3) objectId: page object mark indicates the unique page object under a page
4) content: the SQL statement and Version Description information of sequence chemical conversion json string content
5) submitUser: submitting user, submits the user account of SQL statement storage request
6) submitTime: submission time receives the system time of SQL statement storage request
Again as shown in figure 3, page iden-tity pageId, the page object mark that can will be extracted according to SQL statement storage request Know the content of objectId, the SQL statement of sequence chemical conversion json string content and Version Description information, the version of distribution Number svnId and user submitUser, submission time submitTime is submitted to be encapsulated in an object svn.In version control It is added in object processed and user and submission time is submitted to may make the knowable SQL submitted every time of analyst in more people writing scene Sentence is submitted by which user, thus easy-to-look-up mistake and Cooperative Analysis.
It creates the svn object and is buffered in after memory, then it can be according to preset Object Relation Mapping (ORM, Object Relational Mapping) it is stored in tables of data.I.e. according to preset Version Control object's property value with it is described The mapping relations of the attribute value of tables of data respectively correspond to Version Control object's property value storage into the tables of data Field in.
For example, the mapping for the ORM that can be pre-created is configured to, the svnId of Version Control object svn object maps tables of data SvnId field (Attribute), Version Control object svn object pageId mapping tables of data pageId field (Attribute), Version Control object svn object objectId mapping tables of data objectId field (Attribute), The content field (Attribute) of the content mapping tables of data of Version Control object svn object, Version Control object Svn pairs of the submitUser field (Attribute) and Version Control object of the submitUser mapping tables of data of svn object The submitTime field (Attribute) of the submitTime mapping tables of data of elephant.It then can be according to the ORM's that this is pre-created Each attribute value of svn is mapped in field by mapping configuration, to complete the storage of persistence.
Step S106: receiving the request of SQL statement version rollback, extracts the language that the SQL statement version rollback request carries Sentence mark and version number, inquiry SQL statement corresponding with sentence mark and version number and version in the tables of data Description information.
Analysis user can also be identified by read statement and version number inputs to inquire the specific SQL statement in specific webpage The SQL statement inputted under some version in frame and corresponding Version Description information.As shown in figure 4, if user is in some SQL The SQL statement inputted in input by sentence region existing version 11 in tables of data, the wherein SQL statement of version 11 and version 5 SQL statement have any different, Version Description information is also different.If then user is when wishing to roll back to version 5, with version 5 and can be somebody's turn to do The corresponding sentence mark of SQL statement input area generates the request of SQL statement version rollback as input parameter.Server receives After SQL statement version rollback request, then can sentence mark and version 5 inquired as parameter, obtain corresponding Json character string, then by the json character string unserializing at json object, then extract wherein with SQL corresponding on the page Input by sentence frame and the corresponding content of Version Description information input frame, fill it into corresponding position, in Fig. 4, version letter Task names in breath are that " the demonstration task " of version 5, SQL statement have been rolled back to by " the demonstration task XXXXX " of version 11 Rollback is accordingly obtained.
Preferably, it receives SQL statement version and checks request, extract the SQL statement version and check the sentence that request carries Mark, is searched in the tables of data and the sentence identifies corresponding version number and Version Description corresponding with the version number Information shows the version number and Version Description information corresponding with the version number in the form of a list.
The step of receiving the request of SQL statement version rollback then may be used specifically: be received by choosing version in the list Number SQL statement version rollback generated request, the sentence that SQL statement version rollback request carries are identified as the list pair The sentence mark answered, the version number that the SQL statement version rollback request carries is the version number chosen.
That is, can show drop-down menu at some SQL statement input frame I of page P, be wrapped in the drop-down menu Containing version number's list corresponding with page P and SQL statement input frame I, which is passed through by server with pageID =P and objectID=I is that parameter query tables of data obtains, wherein containing corresponding with pageID=P and objectID=I The value of the version number field of all data item.User can by drop-down menu select version number come determine displaying or execute SQL statement version.If user has selected version number V, the terminal of user's operation is according to pageID=P, objectID=I The request of SQL statement version rollback is generated with svnID=V, server can be according to pageID=P, objectID=I and svnID =V is that search condition searches corresponding json character string, then by the json character string unserializing at json object after, by phase The SQL statement and Version Description information answered show in the position of the SQL statement input frame I of page P, thus facilitate user check or The user data in tables of data is handled again.
In addition, to solve not being available SVN tool to the SQL statement submitted by list in traditional technology mentioned above The technical issues of carrying out Version Control, in one embodiment, as shown in figure 5, special propose a kind of structured query sentence Version Control device, comprising: SQL statement receiving module 102, SQL statement memory module 104 and SQL statement roll-back module 106, Wherein:
SQL statement receiving module 102 extracts the SQL statement for receiving the storage request of structuralized query SQL statement SQL statement, Version Description information and the corresponding sentence mark that storage request carries.
SQL statement memory module 104, for the version number incremental for sentence mark distribution, the sentence is identified, The corresponding storage of the version number of SQL statement, Version Description information and the distribution is into tables of data.
SQL statement roll-back module 106 is extracted the SQL statement version and is returned for receiving the request of SQL statement version rollback The sentence mark and version number that rolling request carries, inquiry is corresponding with sentence mark and version number in the tables of data SQL statement and Version Description information.
In the present embodiment, SQL statement receiving module 102 is also used to obtain the SQL statement storage and requests corresponding page The page iden-tity in face and in the page corresponding page object object identity;By page iden-tity and the object identity The corresponding sentence mark of SQL statement that request carries is stored as the SQL statement.
In the present embodiment, SQL statement memory module 104 is also used to the SQL statement and Version Description of the extraction Information sequence is melted into json object.
In the present embodiment, SQL statement memory module 104 is also used to sentence mark, version number and extraction The json object of SQL statement sequence chemical conversion is as the corresponding Version Control object of attribute value generation, by the Version Control object Caching is in memory.
In the present embodiment, SQL statement memory module 104 be also used to according to preset Version Control object's property value with The mapping relations of the attribute value of the tables of data, respectively into the tables of data by Version Control object's property value storage In corresponding field.
In the present embodiment, SQL statement memory module 104 is also used to obtain the SQL statement storage and requests corresponding mention User identifier and submission time are handed over, is added to the version using the submission user identifier and submission time as attribute value In control object.
In the present embodiment, SQL statement receiving module 106 is also used to receive SQL statement version and checks request, described in extraction SQL statement version checks the sentence mark that request carries, and version corresponding with sentence mark is searched in the tables of data Number and Version Description information corresponding with the version number, show in the form of a list the version number and with the version number pair The Version Description information answered;It receives and is requested by the SQL statement version rollback for choosing version number to generate in the list, it is described The sentence that the request of SQL statement version rollback carries is identified as the corresponding sentence mark of the list, the SQL statement version rollback The version number that request carries is the version number chosen.
Implement the embodiment of the present invention, will have the following beneficial effects:
After the edition control method and device of above structure query statement, user can be mentioned by page table list The multiple SQL statement inputted in the same SQL statement input position is handed over, and server can be each for the SQL statement of multiple version From corresponding version number is distributed, then the SQL statement of multiple version is stored in the database according to version number again.It is needing When carrying out rollback to SQL statement, then the SQL statement of respective version can be obtained according to corresponding version number.With traditional technology phase Than not needing using SVN tool, server does not need to generate file storage after first extracting form data yet, then passes through again The interface function of SVN tool carries out version management, to realize the version management for the SQL statement submitted to list, improves Execution efficiency.
In one embodiment, as shown in fig. 6, Fig. 6 illustrates a kind of version control for running above structure query statement The computer system 10 based on von Neumann system of method processed.The computer system 10 can be smart phone, tablet computer, The terminal devices such as palm PC, laptop or PC.Specifically, may include defeated by the outside of system bus connection Incoming interface 1001, processor 1002, memory 1003 and output interface 1004.Wherein, outer input interface 1001 is optional extremely It less may include network interface 10012.Memory 1003 may include external memory 10032 (such as hard disk, CD or floppy disk etc.) and Built-in storage 10034.Output interface 1004 may include the equipment such as display screen 10042 and sound equipment/loudspeaker 10044.
In the present embodiment, the operation of this method is based on computer program, and the program file of the computer program is stored in In the external memory 10032 of the aforementioned computer system 10 based on von Neumann system, it is loaded into built-in storage at runtime It in 10034, is then compiled as being transferred in processor 1002 after machine code executing, so that being based on von Neumann system Computer system 10 in form SQL statement receiving module 102, SQL statement memory module 104 and SQL statement in logic and return Roll module 106.And in the edition control method implementation procedure of above structure query statement, the parameter of input passes through outside Input interface 1001 receives, and is transferred in memory 1003 and caches, and is then input in processor 1002 and is handled, and handles Result data or be cached in memory 1003 subsequently handled, or be passed to output interface 1004 and exported.
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (12)

1. a kind of edition control method of structured query sentence characterized by comprising
The storage request of structuralized query SQL statement is received, the page iden-tity that the corresponding page is requested in the SQL statement storage is obtained And in the page corresponding page object object identity;Using page iden-tity and the object identity as the SQL The corresponding sentence mark of the SQL statement that sentence storage request carries, when page iden-tity is identical with the object identity, institute's predicate Sentence mark is identical;
Incremental version number is distributed for sentence mark, by the sentence mark, SQL statement, Version Description information and institute The corresponding storage of version number of distribution is stated into tables of data, version number is for distinguishing the corresponding difference when sentence mark is identical SQL statement;
The request of SQL statement version rollback is received, sentence mark and version that the SQL statement version rollback request carries are extracted Number, inquiry SQL statement corresponding with sentence mark and version number and Version Description information in the tables of data.
2. the edition control method of structured query sentence according to claim 1, which is characterized in that described by institute's predicate Before the step of sentence mark, SQL statement, the corresponding storage of Version Description information and the version number of the distribution into tables of data also Include:
The SQL statement of the extraction and Version Description information sequence are melted into json object.
3. the edition control method of structured query sentence according to claim 2, which is characterized in that described to be mentioned described After the step of SQL statement and Version Description information sequence chemical conversion json object taken further include:
Using the json object of sentence mark, version number and the chemical conversion of the SQL statement sequence of extraction as attribute value generation phase The Version Control object answered, in memory by the Version Control target cache.
4. the edition control method of structured query sentence according to claim 3, which is characterized in that described by institute's predicate The step of sentence mark, SQL statement, the corresponding storage of Version Description information and the version number of the distribution into tables of data is also wrapped It includes:
According to the mapping relations of preset Version Control object's property value and the attribute value of the tables of data, by the version control Object's property value storage processed is into the tables of data in corresponding field.
5. the edition control method of structured query sentence according to claim 3, which is characterized in that described with institute's predicate The json object of sentence mark, version number and the chemical conversion of the SQL statement sequence of extraction is as the corresponding Version Control of attribute value generation The step of object further include:
It obtains the SQL statement storage and requests corresponding submission user identifier and submission time, by the submission user identifier And submission time is added in the Version Control object as attribute value.
6. the edition control method of structured query sentence according to any one of claims 1 to 5, which is characterized in that institute It states before receiving the step of SQL statement version rollback is requested further include:
It receives SQL statement version and checks request, extract the SQL statement version and check the sentence mark that request carries, described It is searched in tables of data and the sentence identifies corresponding version number and Version Description information corresponding with the version number, with list Form show the version number and Version Description information corresponding with the version number;
The step of reception SQL statement version rollback is requested are as follows:
It receives and is requested by the SQL statement version rollback for choosing version number to generate in the list, the SQL statement version is returned The sentence that rolling request carries is identified as the corresponding sentence mark of the list, the version that the SQL statement version rollback request carries This number is the version number chosen.
7. a kind of Version Control device of structured query sentence characterized by comprising
SQL statement receiving module extracts the SQL statement storage request for receiving the storage request of structuralized query SQL statement SQL statement, Version Description information and the corresponding sentence mark of carrying;
SQL statement memory module, for the version number incremental for sentence mark distribution, by sentence mark, SQL language Sentence, the corresponding storage of Version Description information and the version number of the distribution are into tables of data, and version number is for distinguishing in institute's predicate Sentence mark corresponding different SQL statements when identical;
SQL statement roll-back module is extracted the SQL statement version rollback request and is taken for receiving the request of SQL statement version rollback The sentence of band identifies and version number, in the tables of data inquiry identified with the sentence and the corresponding SQL statement of version number with And Version Description information;
The SQL statement receiving module be also used to obtain SQL statement storage request the corresponding page page iden-tity and The object identity of corresponding page object in the page;Using page iden-tity and the object identity as the SQL statement The corresponding sentence mark of the SQL statement that storage request carries, when page iden-tity is identical with the object identity, the sentence mark It is sensible same.
8. the Version Control device of structured query sentence according to claim 7, which is characterized in that the SQL statement Memory module is also used to the SQL statement of the extraction and Version Description information sequence chemical conversion json object.
9. the Version Control device of structured query sentence according to claim 8, which is characterized in that the SQL statement Memory module is also used to using the json object of sentence mark, version number and the chemical conversion of the SQL statement sequence of extraction as category Property value generate corresponding Version Control object, in memory by the Version Control target cache.
10. the Version Control device of structured query sentence according to claim 9, which is characterized in that the SQL statement Memory module is also used to the mapping relations of the attribute value according to preset Version Control object's property value Yu the tables of data, will The Version Control object's property value storage is into the tables of data in corresponding field.
11. the Version Control device of structured query sentence according to claim 9, which is characterized in that the SQL statement Memory module is also used to obtain the SQL statement storage and requests corresponding submission user identifier and submission time, mentions described User identifier and submission time is handed over to be added in the Version Control object as attribute value.
12. according to the Version Control device of the described in any item structured query sentences of claim 7 to 11, which is characterized in that The SQL statement receiving module is also used to receive SQL statement version and checks request, extracts the SQL statement version and checks request The sentence of carrying identifies, and version number corresponding with sentence mark and corresponding with the version number is searched in the tables of data Version Description information, show the version number and Version Description information corresponding with the version number in the form of a list;
It receives and is requested by the SQL statement version rollback for choosing version number to generate in the list, the SQL statement version is returned The sentence that rolling request carries is identified as the corresponding sentence mark of the list, the version that the SQL statement version rollback request carries This number is the version number chosen.
CN201510870519.XA 2015-12-01 2015-12-01 The edition control method and device of structured query sentence Active CN105550206B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510870519.XA CN105550206B (en) 2015-12-01 2015-12-01 The edition control method and device of structured query sentence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510870519.XA CN105550206B (en) 2015-12-01 2015-12-01 The edition control method and device of structured query sentence

Publications (2)

Publication Number Publication Date
CN105550206A CN105550206A (en) 2016-05-04
CN105550206B true CN105550206B (en) 2019-10-29

Family

ID=55829395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510870519.XA Active CN105550206B (en) 2015-12-01 2015-12-01 The edition control method and device of structured query sentence

Country Status (1)

Country Link
CN (1) CN105550206B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930506A (en) * 2016-05-10 2016-09-07 乐视控股(北京)有限公司 Object retrieval method and object storage system
CN107491454A (en) * 2016-06-13 2017-12-19 百度在线网络技术(北京)有限公司 Data query method and device
CN109240735B (en) * 2018-07-27 2021-09-24 平安科技(深圳)有限公司 Requirement rollback scheme filling method and device, terminal and readable storage medium
CN109033381A (en) * 2018-07-27 2018-12-18 郑州云海信息技术有限公司 A kind of execution method, device and equipment of service request
CN109299067B (en) * 2018-08-22 2021-04-20 北京百度网讯科技有限公司 Page access method, device and storage medium
CN109977026A (en) * 2019-04-04 2019-07-05 天津字节跳动科技有限公司 Test webpage rollback method and device
CN111651364B (en) * 2020-07-01 2023-04-28 中国银行股份有限公司 SQL (structured query language) checking method and device under parallel development
CN115344585B (en) * 2022-08-03 2024-03-19 盐城天眼察微科技有限公司 Data version management method and device, storage medium and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043648A (en) * 2007-03-09 2007-09-26 中国移动通信集团福建有限公司 Business service switching system
CN101127045A (en) * 2007-09-25 2008-02-20 中兴通讯股份有限公司 Database repeatable reading implement method, device and database management system
CN101136783A (en) * 2007-10-15 2008-03-05 中兴通讯股份有限公司 Backup, recovery method and apparatus for network management system to configure data
CN101692205A (en) * 2009-05-27 2010-04-07 上海文广新闻传媒集团 Three-dimensional financial analytic software
CN101923573A (en) * 2010-08-09 2010-12-22 哈尔滨工程大学 Rapid database data recovery method aiming at data loss
CN102193922A (en) * 2010-03-04 2011-09-21 杭州华三通信技术有限公司 Method and device for accessing database
CN102541884A (en) * 2010-12-10 2012-07-04 中国移动通信集团贵州有限公司 Method and device for database optimization
CN103198071A (en) * 2012-01-06 2013-07-10 中国移动通信集团山东有限公司 Data report generation method and device adopting same
CN103514166A (en) * 2012-06-15 2014-01-15 阿里巴巴集团控股有限公司 Method and device for SQL inspection
CN103842973A (en) * 2011-10-05 2014-06-04 国际商业机器公司 Monitoring stored procedure execution

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043648A (en) * 2007-03-09 2007-09-26 中国移动通信集团福建有限公司 Business service switching system
CN101127045A (en) * 2007-09-25 2008-02-20 中兴通讯股份有限公司 Database repeatable reading implement method, device and database management system
CN101136783A (en) * 2007-10-15 2008-03-05 中兴通讯股份有限公司 Backup, recovery method and apparatus for network management system to configure data
CN101692205A (en) * 2009-05-27 2010-04-07 上海文广新闻传媒集团 Three-dimensional financial analytic software
CN102193922A (en) * 2010-03-04 2011-09-21 杭州华三通信技术有限公司 Method and device for accessing database
CN101923573A (en) * 2010-08-09 2010-12-22 哈尔滨工程大学 Rapid database data recovery method aiming at data loss
CN102541884A (en) * 2010-12-10 2012-07-04 中国移动通信集团贵州有限公司 Method and device for database optimization
CN103842973A (en) * 2011-10-05 2014-06-04 国际商业机器公司 Monitoring stored procedure execution
CN103198071A (en) * 2012-01-06 2013-07-10 中国移动通信集团山东有限公司 Data report generation method and device adopting same
CN103514166A (en) * 2012-06-15 2014-01-15 阿里巴巴集团控股有限公司 Method and device for SQL inspection

Also Published As

Publication number Publication date
CN105550206A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN105550206B (en) The edition control method and device of structured query sentence
CN109145078B (en) The application page of the machine application is indexed
CA2684822C (en) Data transformation based on a technical design document
US8196039B2 (en) Relevant term extraction and classification for Wiki content
CA3088695C (en) Method and system for decoding user intent from natural language queries
US10216846B2 (en) Combinatorial business intelligence
CN109033406B (en) Method, apparatus and storage medium for searching blockchain data
JP2017157192A (en) Method of matching between image and content item based on key word
CN110537180A (en) System and method for the element in direct browser internal labeling internet content
US10423672B2 (en) Network resource-specific search assistance
US20200257679A1 (en) Natural language to structured query generation via paraphrasing
US20110289080A1 (en) Search Results Summarized with Tokens
US20240265053A1 (en) Indexing Access Limited Native Applications
CN106687949A (en) Search results for native applications
WO2013071305A2 (en) Systems and methods for manipulating data using natural language commands
CN108228743A (en) Real-time big data search engine system
US20210157861A1 (en) Systems, apparatuses, and method for document ingestion
JP2009037501A (en) Information retrieval apparatus, information retrieval method and program
CN112883030A (en) Data collection method and device, computer equipment and storage medium
US11314829B2 (en) Action recommendation engine
EP3238105B1 (en) Application partial deep link to a corresponding resource
US20150149497A1 (en) Determining problem resolutions within a networked computing environment
CN111403011B (en) Registration department pushing method, device and system, electronic equipment and storage medium
US20120284224A1 (en) Build of website knowledge tables
US11409959B2 (en) Representation learning for tax rule bootstrapping

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 High-tech Zone, Zhuhai City, Guangdong Province, Unit 1, Fourth Floor C, Building A, Headquarters Base No. 1, Qianwan Third Road, Tangjiawan Town

Applicant after: ZHUHAI DUOWAN INFORMATION TECHNOLOGY LIMITED

Address before: 511442 29 floors, B-1 Building, Wanda Commercial Square North District, Wanbo Business Center, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Applicant before: ZHUHAI DUOWAN INFORMATION TECHNOLOGY LIMITED

GR01 Patent grant
GR01 Patent grant