CN109726217A - A kind of database operation method, device, equipment and storage medium - Google Patents
A kind of database operation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109726217A CN109726217A CN201910023235.5A CN201910023235A CN109726217A CN 109726217 A CN109726217 A CN 109726217A CN 201910023235 A CN201910023235 A CN 201910023235A CN 109726217 A CN109726217 A CN 109726217A
- Authority
- CN
- China
- Prior art keywords
- application end
- database
- user operation
- operation instruction
- instruction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Abstract
The embodiment of the present disclosure discloses a kind of database operation method, device, equipment and storage medium, this method comprises: the first application end obtains user operation instruction, and identifies to the user operation instruction;First application end then identifies according to the database manipulation if it is determined that including database manipulation mark in the user operation instruction, the user operation instruction is converted to stsndard SQL sentence;The stsndard SQL sentence is sent to the second application end by first application end, so that second application end operates standard database according to the stsndard SQL sentence;First application end is isolated with the standard database.The technical solution of the embodiment of the present disclosure, user operation instruction is identified by the first application end, and generates stsndard SQL sentence, is avoided and is write cumbersome SQL statement, it specifically avoids character string to write mistake and program is caused to malfunction, in turn ensures the accurate of SQL statement while reducing program compiling amount.
Description
Technical field
The embodiment of the present disclosure is related to program technique of compiling more particularly to a kind of database operation method, device, electronic equipment
And storage medium.
Background technique
With the rapid development of computer technology, more and more softwares start to come into the sight of people, and in software
In compiling, a vital step is also become for the operation of database.
Database refer to store in a certain way together, can for multiple user sharings, have redundancy as small as possible,
With application program data acquisition system independent of each other, have the characteristics that globality and sharing.By taking SQLite database as an example, as
A Lightweight Database, SQLite database can be run in multiple mainstream operation systems, and can be with a variety of programming language phases
In conjunction with therefore, SQLite database is widely used in during software translating.In the prior art, for the increase of SQLite,
The operations such as deletion, modification or inquiry are completed often through SQL statement is write.For example, assigning data to object, and write SQL language
Sentence writes the data into SQLite in corresponding data table, records as a data;Alternatively, inquiring each number using SQL statement
According to table, the data inquired are parsed and are assigned to object.
In implementing the present disclosure, the discovery prior art has following defect: SQL statement writes complexity to inventor, together
When, when writing SQL statement, when especially writing character string, since character string is by a succession of random number or symbol
Composition, character string writes easy error, and this mistake can not be parsed by editing machine static state, and therefore, character string is write
Mistake is frequently found in SQL database, causes error in data.
Summary of the invention
The embodiment of the present disclosure provides a kind of database operation method, device, electronic equipment and storage medium, avoids volume
Program caused by cumbersome SQL statement and character string write mistake is write to malfunction.
In a first aspect, the embodiment of the present disclosure provides a kind of database operation method, comprising:
First application end obtains user operation instruction, and identifies to the user operation instruction;
First application end is if it is determined that include that database manipulation identifies in the user operation instruction, then according to
Database manipulation mark, is converted to stsndard SQL sentence for the user operation instruction;
The stsndard SQL sentence is sent to the second application end by first application end, so that the second application end root
Standard database is operated according to the stsndard SQL sentence;
Wherein, first application end is isolated with the standard database.
Second aspect, the embodiment of the present disclosure provide a kind of database manipulation device, are applied in the first application end, packet
It includes:
Instruction identification module is identified for obtaining user operation instruction, and to the user operation instruction;
Stsndard SQL statement converter modular, be used for if it is determined that in the user operation instruction include database manipulation identify,
It is then identified according to the database manipulation, the user operation instruction is converted into stsndard SQL sentence;
Stsndard SQL sentence sending module, for the stsndard SQL sentence to be sent to the second application end, so that described
Two application ends operate standard database according to the stsndard SQL sentence;
Wherein, first application end is isolated with the standard database.
The third aspect, the embodiment of the present disclosure provide a kind of electronic equipment, including memory, processing unit and are stored in
On reservoir and the computer program that can run in processing unit, the processing unit realize that the disclosure is appointed when executing described program
Database operation method described in embodiment of anticipating.
Fourth aspect, the embodiment of the present disclosure provide a kind of storage medium comprising computer executable instructions, the meter
Calculation machine executable instruction as computer processor when being executed for executing database manipulation described in disclosure any embodiment
Method.
The technical solution of the embodiment of the present disclosure generates stsndard SQL language according to the user operation instruction that the first application end identifies
Sentence, and standard database is operated according to stsndard SQL sentence by the second application end, it avoids and writes cumbersome SQL language
Sentence specifically avoids reducing program due to program error caused by can not being write mistake by the character string that static system parses
The accurate of SQL statement is in turn ensured while compiling amount.
Detailed description of the invention
Fig. 1 is the flow chart of one of the embodiment of the present disclosure one database operation method;
Fig. 2 is the flow chart of one of the embodiment of the present disclosure two database operation method;
Fig. 3 is the flow chart of one of the embodiment of the present disclosure three database operation method;
Fig. 4 is the structure chart of one of embodiment of the present disclosure four database manipulation device;
Fig. 5 is the structure chart of one of the real-time example five of disclosure database manipulation equipment.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the disclosure, rather than the restriction to the disclosure.It also should be noted that in order to just
Part relevant to the disclosure is illustrated only in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is the flow chart for the database operation method that the embodiment of the present disclosure one provides, and the present embodiment is applicable to logarithm
According to library carry out data manipulation the case where, this method can be executed by database manipulation device, the device can by software and/
Or hardware realization, and generally can integrate in one or more database manipulation equipment, this method specifically includes following step
It is rapid:
S110, the first application end obtain user operation instruction, and identify to the user operation instruction.
Objective-C language (referred to as " OC language "), it is not only completely simultaneous as a kind of very strong programming language of practicability
Hold C language, and increase the characteristic of speech sounds of Object-Oriented Programming on this basis, is write as the Runtime Library of very little with C language,
The size of application program increases very little, usually will not be more much larger than its source code.OC language be mainly used in Mac OS X and
In GNUstep system, developed for IOS.
In the embodiments of the present disclosure, optionally, the first application end is realized by OC language, for grasping to database
Make, supports the operations such as increase, deletion, modification, inquiry, batch increase data and the data model upgrading of object-oriented.
User operation instruction is one or more computer instructions that user issues, for executing increase, deletion, modification
Or the operation such as inquiry, in the embodiments of the present disclosure, optionally, user operation instruction is write by OC language.
S120, first application end are if it is determined that include that database manipulation identifies in the user operation instruction, then root
It is identified according to the database manipulation, the user operation instruction is converted into stsndard SQL sentence.
Optionally, when in user operation instruction including the title of the first application end, then it is considered that the user grasps
It include corresponding database manipulation mark in instructing.For example, the first application end is named as XQ_DAO module, then in user
In operational order, when there is the instruction with " XQ_ " for prefix, that is, think the instruction for database manipulation mark;For example, in user
When occurring " XQ_query " in operational order, then it is assumed that be data base querying mark, inquire one or more number in database
According to record;When occurring " XQ_delete " in user operation instruction, then it is assumed that be that database deletes mark, delete in database
One or more data record.First application end is thread-safe, arbitrarily " XQ_XXX " can be used to grasp in multithreading
Make.
In the embodiments of the present disclosure, optionally, the first application end for being write by OC language is received and is write by OC language
After user operation instruction, identified according to corresponding database manipulation, and the Runtime characteristic having using OC language, by user
Operational order is converted to stsndard SQL sentence.
When Runtime is operation, that is, the work that program is done at runtime, itself has the C language of a set of bottom
Say interface.OC language is just handled simultaneously when a few thing being placed on code operation by Runtime characteristic as dynamic language
It is handled when decomplier.For example, having many classes and member variable is ignorant in compiling, and at runtime, the code write
Code operation that is complete, determining can be just converted into.Runtime can be in program operation process, one class of dynamic creation, and
Attribute or method are added for class, is used to packaging frame;All member variables or all methods in a class can also be traversed.
In the embodiments of the present disclosure, optionally, user by OC language compilation operation instruct, Runtime can automatically by
OC sentence is converted into SQL statement.Structured query language (Structurei query language, abbreviation SQL) is a kind of
Data base querying and programming language, for accessing data and querying, updating, and managing corresponding Database Systems.
The stsndard SQL sentence is sent to the second application end by S130, first application end, so that second application
End operates standard database according to the stsndard SQL sentence;Wherein, first application end and the standard database
It is isolated.
Database can be regarded as the warehouse of a storage data, store electronic document according to certain data structure,
User such as can increase, update or delete to the data in electronic document at the operation.In the embodiments of the present disclosure, optionally,
Standard database is SQLite database.SQLite is a light-duty database, and being one realizes serverless backup and zero and match
The SQL database engine set, occupancy resource is very low, and especially in embedded device, size is within several hundred kb.Meanwhile
SQLite can UNIX (including Linux, Mac OS-X, Android and iOS) and Windows (including Win32, WinCE and
) etc. WinRT run in multiple mainstream operation systems, additionally it is possible to mutually be tied with multiple programs language such as C language, OC language and Java
It closes.
Second application end is used to receive the stsndard SQL sentence of the first application end transmission, and according to the stsndard SQL language received
Sentence pair database carries out corresponding operation, and the second application end isolates the first application end with standard database.In the disclosure
In embodiment, optionally, the second application end is FMDB module, and FMDB is a kind of encapsulation library, is encapsulated in a manner of OC language
The interface of SQLite database itself is the library of the object-oriented of lightweight.
The second application end is packaged in first application end in advance, is packaged with standard database in advance in the second application end;The
One application end is communicated by the first standard communication interface with the second application end, and the second application end is connect by the second standard traffic
Mouth is communicated with standard database.In the present embodiment, optionally, the XQ_DAO module that OC language is write is packaged in advance
FMDB module, FMDB module are packaged with standard database in advance;The interface and FMDB module that XQ_DAO module passes through FMDB module
It is communicated, FMDB module is communicated by the interface of SQLite with SQLite database.
First application end, second application end and the standard database are set in same software package.?
In the embodiment of the present disclosure, optionally, the first application end, FMDB module and SQLite database are set in the same SDK packet.The
One application end and FMDB are lightweight module, and the volume of increased software package is much smaller than 1MB.Meanwhile first application end it is integrated
It is very convenient, it does not need to integrate any class, it is small to the invasion of original business, it is very light.
The technical solution of the embodiment of the present disclosure generates stsndard SQL language according to the user operation instruction that the first application end identifies
Sentence, and standard database is operated according to stsndard SQL sentence by the second application end, it avoids and writes cumbersome SQL language
Sentence specifically avoids reducing program due to program error caused by can not being write mistake by the character string that static system parses
The accurate of SQL statement is in turn ensured while compiling amount.
Embodiment two
Fig. 2 is the flow chart of one of the embodiment of the present disclosure two database operation method, and the present embodiment is with above-mentioned implementation
It is embodied based on example, in the present embodiment, user operation instruction is to the assignment directive of target object, in assignment directive
Including database manipulation be identified as data base querying mark, the second application end be FMDB module, mark database SQLite
Database.Correspondingly, the method for the present embodiment specifically includes following operation:
S210, the first application end obtain the assignment directive to target object, and identify to the assignment directive.
Before the first application end is got to the store instruction of target object, programming personnel first have to define class,
And object is created according to class;Wherein, class is the data structure of description object, it can be understood as the template of object, and object is wound
It build data entity in memory in, data structure is determined by class.
The prior art is that the data inquired are parsed and are assigned to by writing SQL statement query SQL ite database
Object.However, such inquiry mode is cumbersome, especially writing for character string is easy to appear mistake, and this mistake
It is that can not be compiled the parsing of device static state.Therefore, such to write mode, it will also tend to cause program while increasing workload
Mistake.And in the embodiments of the present disclosure, simple assignment directive is write by OC language, does not need the SQL for writing very complicated
Sentence.
S220, first application end are if it is determined that include that data base querying identifies in the assignment directive, then according to institute
Data base querying mark is stated, the assignment directive is converted into stsndard SQL sentence.
With in above-described embodiment, the first application end is named as XQ_DAO module, when in assignment directive include database
When inquiry mark " XQ_query ", then the first application end identifies according to the data base querying and is converted to the assignment directive pair
The stsndard SQL sentence answered, i.e. standard SQL queries sentence.
The stsndard SQL sentence is sent to the second application end by S230, first application end, so that the FMDB module
Inquiry operation is carried out to standard database according to the stsndard SQL sentence;Wherein, first application end and the SQLite number
It is isolated according to library.
Stsndard SQL sentence is sent to FMDB module by XQ_DAO module, so that the FMDB module is according to the stsndard SQL
Sentence carries out inquiry operation to standard database.
S240, first application end receive the second application end feedback, for the inquiry of the stsndard SQL sentence
As a result;And the query result is assigned to the target object.
The data that FMDB module returns are no data structure, the field of hash, and XQ_DAO module is then by these data groups
It knits and automatic assignment is to new object.For example, that the return of FMDB module is { " name ", " xxx " }, and XQ_DAO module utilizes
Runtime characteristic, name is the member variable of " name " in the member variable of object search, gives the member variable assignment " xxx ".
Wherein, " name " is a character string, and the member variable of object, is a fixed name variable in code, it is only necessary to
A name variable is write, does not need to write the character string, the corresponding assignment of member variable of the object can be got.
The technical solution of the embodiment of the present disclosure, when user to target object issue assignment directive when, the first application end according to
Data base querying mark, generates stsndard SQL sentence, carries out inquiry operation to SQLite database, and receive second is answered
New object is assigned to after the data organization fed back with end.It avoids and writes interminable character string, also avoid due to can not be by
Program malfunctions caused by the character string of static system parsing writes mistake, in turn ensures SQL while reducing program compiling amount
Sentence it is accurate.
Embodiment three
Fig. 3 is the flow chart of one of the embodiment of the present disclosure three database operation method, and the present embodiment is with above-mentioned implementation
It is embodied based on example, in the present embodiment, user operation instruction is to the standard database store instruction, and storage refers to
The database manipulation for including in order is identified as database purchase mark, and the second application end is FMDB module, and mark database is
SQLite database.Correspondingly, the method for the present embodiment specifically includes following operation:
S310, the first application end obtain the store instruction to target object, and identify to the store instruction.
Before the first application end is got to the store instruction of target object, programming personnel first have to define class,
And object is created according to class, and to object value, assign data.It is that SQL statement is write according to class formation in the prior art, passes through
It is corresponding with the object in SQLite database, i.e., under the tables of data of the same name with class name, increase data record;Alternatively,
Data corresponding with the object are modified in SQLite database, that is, modify data record.And in the embodiments of the present disclosure,
Simple assignment directive and store instruction are write by OC language, does not need the SQL statement for writing very complicated.
S320, first application end are if it is determined that include that database purchase identifies in the store instruction, then according to institute
Database purchase mark is stated, the store instruction is converted into stsndard SQL sentence.
With in above-described embodiment, the first application end is named as XQ_DAO module, when in assignment directive include database
When storage mark " XQ_save ", then the first application end identifies according to the database purchase store instruction being converted to mark
Quasi- SQL statement, i.e. stsndard SQL store sentence.
The stsndard SQL sentence is sent to FMDB module by S330, first application end, so that the FMDB module root
Storage operation is carried out to standard database according to the stsndard SQL sentence;Wherein, first application end and the SQLite data
Library is isolated.
Stsndard SQL sentence is sent to FMDB module by XQ_DAO module, so that the FMDB module is according to the stsndard SQL
Sentence carries out storage operation to standard database.Particularly, if the member variable of target object is the variable not having in SQLite,
So in SQL database under tables of data corresponding with the object, i.e., under the tables of data of the same name with class name, according to the stsndard SQL
Sentence increases data record.If the member variable of target object is existing variable in SQLite, then according to the standard
SQL statement, by the corresponding each member variable of the target object again assignment.For example, being stored with object in SQLite database
User, wherein user.userName=@" Xiao Ming ", user.userID=@" 1 ";And store instruction is turned according to target object
Being changed to stsndard SQL sentence is user.userName=@" Xiao Ming ", user.userID=@" 2 ";It is so that the user is corresponding
Member variable is revised as user.userName=@" Xiao Ming ", user.userID=@" 2 ";New data record is not increased.
Particularly, when the user operation instruction is the deletion instruction to target object, include in the deletion instruction
Database manipulation is identified as database and deletes mark.
With in above-described embodiment, the first application end is named as XQ_DAO module, when in assignment directive include database
When deleting mark " XQ_delete ", then the first application end deletes mark to target pair in standard database according to the database
As corresponding data record carries out delete operation.
The technical solution of the embodiment of the present disclosure, when user issues storage or deletes instruction to target object, the first application
End identifies corresponding database manipulation mark, generates stsndard SQL sentence, is increased SQLite database, is deleted or modified
Operation, avoid and write cumbersome SQL statement, also avoid due to can not by static system parse character string write mistake and
Caused program error, in turn ensures the integrality and accuracy of standard database while reducing program compiling amount.
Example IV
Fig. 4 is a kind of executable disclosure any embodiment institute of database manipulation device provided by the embodiment of the present disclosure four
The database operation method of offer has the corresponding functional module of execution method and beneficial effect.The device can by software and/
Or hardware realization, it is applied in the first application end, comprising: instruction identification module 410, stsndard SQL statement converter modular 420 and mark
Quasi- SQL statement sending module 430.
Instruction identification module 410 is identified for obtaining user operation instruction, and to the user operation instruction;
Stsndard SQL statement converter modular 420 is used for if it is determined that including database manipulation mark in the user operation instruction
Know, is then identified according to the database manipulation, the user operation instruction is converted into stsndard SQL sentence;
Stsndard SQL sentence sending module 430, for the stsndard SQL sentence to be sent to the second application end, so that described
Second application end operates standard database according to the stsndard SQL sentence;
Wherein, first application end is isolated with the standard database.
The technical solution of the embodiment of the present disclosure generates stsndard SQL language according to the user operation instruction that the first application end identifies
Sentence, and standard database is operated according to stsndard SQL sentence by the second application end, it avoids and writes cumbersome SQL language
Sentence specifically avoids reducing journey due to program error caused by can not being write mistake by the character string that static system parses
The accurate of SQL statement is in turn ensured while sequence compiling amount.
It is packaged with second application end in advance on the basis of the various embodiments described above, in the first application end, described second
The standard database is packaged in application end in advance;First application end passes through the first standard communication interface and described second
Application end is communicated, and second application end is communicated by the second standard communication interface with the standard database.
On the basis of the various embodiments described above, standard database be can specifically include:
SQLite database.
On the basis of the various embodiments described above, the second application end be can specifically include:
FMDB module.
On the basis of the various embodiments described above, database manipulation device can be realized by Objective-C language, and
Based on Runtime technical operation.
On the basis of the various embodiments described above, if the user operation instruction that instruction identification module 410 obtains is to target pair
The assignment directive of elephant, the then database manipulation for including in the assignment directive are identified as data base querying mark;And the assignment
The numerical value for instructing assignment is to the data query result in the standard database.
On the basis of the various embodiments described above, stsndard SQL sentence sending module 430 specifically can be used for:
The second application end feedback is received, for the query result for stating stsndard SQL sentence;The inquiry is tied
Fruit is assigned to the target object.
On the basis of the various embodiments described above, if the user operation instruction that instruction identification module 410 obtains is to target pair
The store instruction of elephant, the then database manipulation for including in the store instruction are identified as database purchase mark.
On the basis of the various embodiments described above, if the user operation instruction that instruction identification module 410 obtains is to target pair
The deletion of elephant instructs, then the database manipulation for including in instruction of deleting is identified as database deletion mark.
On the basis of the various embodiments described above, first application end, second application end and the normal data
Lab setting is in same software package.
Method provided by disclosure any embodiment can be performed in above-mentioned apparatus, has the corresponding functional module of execution method
And beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to the method that disclosure any embodiment provides.
Embodiment five
Fig. 5 shows the structural schematic diagram for being suitable for the electronic equipment 500 for being used to realize the embodiment of the present disclosure.The disclosure is implemented
It is (personal that terminal device in example can include but is not limited to such as mobile phone, laptop, digit broadcasting receiver, PDA
Digital assistants), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle mounted guidance terminal) etc.
Deng mobile terminal and such as number TV, desktop computer etc. fixed terminal.Electronic equipment shown in Fig. 5 is only one
A example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in figure 5, electronic equipment 500 may include processing unit (such as central processing unit, graphics processor etc.)
501, random access can be loaded into according to the program being stored in read-only memory (ROM) 502 or from storage device 508
Program in memory (RAM) 503 and execute various movements appropriate and processing.In RAM 503, it is also stored with electronic equipment
Various programs and data needed for 500 operations.Processing unit 501, ROM 502 and RAM 503 pass through the phase each other of bus 504
Even.Input/output (I/O) interface 505 is also connected to bus 504.
In general, following device can connect to I/O interface 505: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph
As the input unit 506 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration
The output device 507 of dynamic device etc.;Storage device 508 including such as tape, hard disk etc.;And communication device 509.Communication device
509, which can permit electronic equipment 500, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 5 shows tool
There is the electronic equipment 500 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with
Alternatively implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it is soft that the process that each flow chart describes above may be implemented as computer
Part program.For example, embodiment of the disclosure includes a kind of computer program product comprising carrying is on a computer-readable medium
Computer program, which includes the program code for method shown in execution flow chart.In such implementation
In example, which can be downloaded and installed from network by communication device 509, or from 508 quilt of storage device
Installation, or be mounted from ROM 502.When the computer program is executed by processing unit 501, the embodiment of the present disclosure is executed
The above-mentioned function of being limited in method.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the embodiments of the present disclosure, computer readable storage medium can be it is any include or
The tangible medium of program is stored, which can be commanded execution system, device or device use or in connection.
And in embodiment of the disclosure, computer-readable signal media may include propagating in a base band or as carrier wave a part
Data-signal, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms,
Including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be
Any computer-readable medium other than computer readable storage medium, the computer-readable signal media can send, propagate
Either transmission is for by the use of instruction execution system, device or device or program in connection.It is computer-readable
The program code for including on medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency)
Etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not
It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity
Sub- equipment execute when so that the electronic equipment: the first application end obtain user operation instruction, and to the user operation instruction into
Row identification;First application end is if it is determined that include that database manipulation identifies in the user operation instruction, then according to
Database manipulation mark, is converted to stsndard SQL sentence for the user operation instruction;First application end is by the standard
SQL statement is sent to the second application end, so that second application end carries out standard database according to the stsndard SQL sentence
Operation;Wherein, first application end is isolated with the standard database.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof
Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+
+, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can
Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package,
Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part.
In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN)
Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service
Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard
The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the
One application end is also described as " obtaining user operation instruction, and to the module that the user operation instruction is identified ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art
Member it should be appreciated that embodiment of the disclosure involved in the open scope, however it is not limited to the specific combination of above-mentioned technical characteristic and
At technical solution, while should also cover in the case where not departing from design disclosed above, by above-mentioned technical characteristic or its be equal
Feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and embodiment of the disclosure (but
It is not limited to) technical characteristic with similar functions is replaced mutually and the technical solution that is formed.
Claims (10)
1. a kind of database operation method characterized by comprising
First application end obtains user operation instruction, and identifies to the user operation instruction;
First application end is if it is determined that include that database manipulation identifies in the user operation instruction, then according to the data
The user operation instruction is converted to stsndard SQL sentence by library operation mark;
The stsndard SQL sentence is sent to the second application end by first application end, so that second application end is according to institute
Stsndard SQL sentence is stated to operate standard database;
Wherein, first application end is isolated with the standard database.
2. according to the method described in claim 1, it is characterized by:
Second application end is packaged in first application end in advance, is packaged with the mark in advance in second application end
Quasi- database;
First application end is communicated by the first standard communication interface with second application end, second application end
It is communicated by the second standard communication interface with the standard database.
3. method according to claim 1 or 2, it is characterised in that:
The standard database is Sqlite database, and second application end is FMDB module, and first application end passes through
Objective-C language is realized, and is based on Runtime technical operation.
4. method according to claim 1-3, which is characterized in that the user operation instruction is to target object
Assignment directive, the database manipulation for including in the assignment directive is identified as data base querying mark;The assignment directive is assigned
The numerical value of value is to the data query result in the standard database;
After the stsndard SQL sentence is sent to the second application end by first application end, further includes:
The second application end feedback is received, for the query result for stating stsndard SQL sentence;
The query result is assigned to the target object.
5. method according to claim 1-3, which is characterized in that the user operation instruction is to target object
Store instruction, the database manipulation for including in the store instruction is identified as database purchase mark.
6. method according to claim 1-3, which is characterized in that the user operation instruction is to target object
Deletion instruction, it is described delete instruction in include database manipulation be identified as database delete mark.
7. method according to claim 1-3, it is characterised in that:
First application end, second application end and the standard database are set in same software package.
8. a kind of database manipulation device, which is characterized in that be applied in the first application end, comprising:
Instruction identification module is identified for obtaining user operation instruction, and to the user operation instruction;
Stsndard SQL statement converter modular is used for if it is determined that include that database manipulation identifies in the user operation instruction, then root
It is identified according to the database manipulation, the user operation instruction is converted into stsndard SQL sentence;
Stsndard SQL sentence sending module, for the stsndard SQL sentence to be sent to the second application end, so that described second answers
Standard database is operated according to the stsndard SQL sentence with end;
Wherein, first application end is isolated with the standard database.
9. a kind of electronic equipment, can run on a memory and in processing unit including memory, processing unit and storage
Computer program, which is characterized in that the processing unit is realized as described in any in claim 1-7 when executing described program
Database operation method.
10. a kind of storage medium comprising computer executable instructions, the computer executable instructions are by computer disposal
For executing the database operation method as described in any in claim 1-7 when device executes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910023235.5A CN109726217B (en) | 2019-01-10 | 2019-01-10 | Database operation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910023235.5A CN109726217B (en) | 2019-01-10 | 2019-01-10 | Database operation method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109726217A true CN109726217A (en) | 2019-05-07 |
CN109726217B CN109726217B (en) | 2021-06-18 |
Family
ID=66299729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910023235.5A Active CN109726217B (en) | 2019-01-10 | 2019-01-10 | Database operation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109726217B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111143464A (en) * | 2019-12-10 | 2020-05-12 | 北京字节跳动网络技术有限公司 | Data acquisition method and device and electronic equipment |
CN111563142A (en) * | 2020-07-14 | 2020-08-21 | 成都四方伟业软件股份有限公司 | SQL automatic benchmarking matching method and device |
CN111797073A (en) * | 2019-11-26 | 2020-10-20 | 北京京东尚科信息技术有限公司 | Database management method, electronic device, and computer-readable storage medium |
CN111901358A (en) * | 2020-08-07 | 2020-11-06 | 杭州安恒信息技术股份有限公司 | Intrusion detection rule updating method, device, equipment and readable storage medium |
WO2021218033A1 (en) * | 2020-04-29 | 2021-11-04 | 平安科技(深圳)有限公司 | Dictionary data operation method and apparatus, readable storage medium, and terminal device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000048069A (en) * | 1998-07-30 | 2000-02-18 | Nippon Telegr & Teleph Corp <Ntt> | Method for managing service order information and storage medium storing service order information management program |
KR20140083556A (en) * | 2012-12-26 | 2014-07-04 | 고려대학교 산학협력단 | Method and Apparatus for recovering deleted data for SQLite database |
CN106648641A (en) * | 2016-12-09 | 2017-05-10 | 武汉斗鱼网络科技有限公司 | Automatic management method and system for multi-level pop-up boxes on iOS system device |
CN107832387A (en) * | 2017-10-31 | 2018-03-23 | 北京酷我科技有限公司 | A kind of SQL statement analytic method based on FMDB |
CN107832448A (en) * | 2017-11-22 | 2018-03-23 | 泰康保险集团股份有限公司 | Database operation method, device and equipment |
CN108804573A (en) * | 2018-05-23 | 2018-11-13 | 北京五八信息技术有限公司 | A kind of cross-platform processing method, device, equipment and the storage medium of database |
CN108920566A (en) * | 2018-06-21 | 2018-11-30 | 吉林亿联银行股份有限公司 | Operating method, device and the equipment of a kind of pair of SQLite database |
-
2019
- 2019-01-10 CN CN201910023235.5A patent/CN109726217B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000048069A (en) * | 1998-07-30 | 2000-02-18 | Nippon Telegr & Teleph Corp <Ntt> | Method for managing service order information and storage medium storing service order information management program |
KR20140083556A (en) * | 2012-12-26 | 2014-07-04 | 고려대학교 산학협력단 | Method and Apparatus for recovering deleted data for SQLite database |
CN106648641A (en) * | 2016-12-09 | 2017-05-10 | 武汉斗鱼网络科技有限公司 | Automatic management method and system for multi-level pop-up boxes on iOS system device |
CN107832387A (en) * | 2017-10-31 | 2018-03-23 | 北京酷我科技有限公司 | A kind of SQL statement analytic method based on FMDB |
CN107832448A (en) * | 2017-11-22 | 2018-03-23 | 泰康保险集团股份有限公司 | Database operation method, device and equipment |
CN108804573A (en) * | 2018-05-23 | 2018-11-13 | 北京五八信息技术有限公司 | A kind of cross-platform processing method, device, equipment and the storage medium of database |
CN108920566A (en) * | 2018-06-21 | 2018-11-30 | 吉林亿联银行股份有限公司 | Operating method, device and the equipment of a kind of pair of SQLite database |
Non-Patent Citations (1)
Title |
---|
罗福: "无人机移动端地面站的设计和实现", 《中国优秀硕士学位论文全文数据库工程科技II辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797073A (en) * | 2019-11-26 | 2020-10-20 | 北京京东尚科信息技术有限公司 | Database management method, electronic device, and computer-readable storage medium |
CN111143464A (en) * | 2019-12-10 | 2020-05-12 | 北京字节跳动网络技术有限公司 | Data acquisition method and device and electronic equipment |
CN111143464B (en) * | 2019-12-10 | 2023-07-18 | 北京字节跳动网络技术有限公司 | Data acquisition method and device and electronic equipment |
WO2021218033A1 (en) * | 2020-04-29 | 2021-11-04 | 平安科技(深圳)有限公司 | Dictionary data operation method and apparatus, readable storage medium, and terminal device |
CN111563142A (en) * | 2020-07-14 | 2020-08-21 | 成都四方伟业软件股份有限公司 | SQL automatic benchmarking matching method and device |
CN111901358A (en) * | 2020-08-07 | 2020-11-06 | 杭州安恒信息技术股份有限公司 | Intrusion detection rule updating method, device, equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109726217B (en) | 2021-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109726217A (en) | A kind of database operation method, device, equipment and storage medium | |
WO2020119485A1 (en) | Page display method and device, apparatus, and storage medium | |
CN109062563B (en) | Method and device for generating page | |
CN110764748B (en) | Code calling method, device, terminal and storage medium | |
US8756407B2 (en) | Configuration rule prototyping tool | |
CN112395253B (en) | Index file generation method, terminal device, electronic device and medium | |
CN108595187A (en) | Method, device and the storage medium of Android installation kit integrated software development kit | |
CN109976793A (en) | A kind of operation method of application program, device, equipment and medium | |
CN114035805A (en) | Code conversion method, apparatus, medium, and device for pre-compiler | |
CN111338944B (en) | Remote Procedure Call (RPC) interface testing method, device, medium and equipment | |
CN111309304B (en) | Method, device, medium and electronic equipment for generating IDL file | |
CN110489106A (en) | A kind of generation method, device, medium and the electronic equipment of project initial code | |
CN108959294B (en) | Method and device for accessing search engine | |
CN113704291A (en) | Data query method and device, storage medium and electronic equipment | |
CN109815455A (en) | Item file treating method and apparatus | |
CN108710708A (en) | Report processing method, device, medium and electronic equipment | |
US11372627B2 (en) | System and method for providing integrated development environment (IDE) for programmable software system | |
CN114090124A (en) | Data processing method, data processing device, computer equipment and storage medium | |
CN114035804A (en) | Code conversion method, device, medium and electronic equipment | |
CN112328841A (en) | Document processing method and device, electronic equipment and storage medium | |
CN110489180A (en) | One kind burying a report method, device, medium and electronic equipment | |
US11888937B2 (en) | Domain specific provider contracts for core data services | |
WO2021254104A1 (en) | Database design method and apparatus, and related device | |
CN115878091A (en) | Data processing method, device, equipment and storage medium | |
CN110209591A (en) | Picture searching method, apparatus, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |