CN102915305A - Data management system and data management method for embedded database of numerical control system - Google Patents

Data management system and data management method for embedded database of numerical control system Download PDF

Info

Publication number
CN102915305A
CN102915305A CN2011102193151A CN201110219315A CN102915305A CN 102915305 A CN102915305 A CN 102915305A CN 2011102193151 A CN2011102193151 A CN 2011102193151A CN 201110219315 A CN201110219315 A CN 201110219315A CN 102915305 A CN102915305 A CN 102915305A
Authority
CN
China
Prior art keywords
data
database
data management
control system
sqlite
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.)
Pending
Application number
CN2011102193151A
Other languages
Chinese (zh)
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.)
Shanghai Sany Precision Machinery Co Ltd
Original Assignee
Shanghai Sany Precision Machinery Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Sany Precision Machinery Co Ltd filed Critical Shanghai Sany Precision Machinery Co Ltd
Priority to CN2011102193151A priority Critical patent/CN102915305A/en
Publication of CN102915305A publication Critical patent/CN102915305A/en
Pending legal-status Critical Current

Links

Images

Abstract

Disclosed are a data management system and a data management method for an embedded database of a numerical control system. The data management system comprises an SQLite database and a data management module which exchanges data information with the SQLite database through interface functions. The data management method includes: building a system database containing fixed parameters, active data and programming files in the SQLite database; using a graphics library of GTK+ (GIMP toolkit) to build the data management module containing a data management operation interface; and using the interface functions to enable the data management module to exchange data information with the SQLite database. Data division is clear, management is convenient, instantaneity of the numerical control system is improved, and accuracy and safety of the numerical control system are guaranteed.

Description

The data management system of the embedded database of digital control system and method
Technical field
The present invention relates to data management system and method, relate to specifically a kind of data management system and method for embedded database of digital control system.
Background technology
Traditional digital control system adopts the form of text that numerically controlled data is carried out storage administration mostly.There are a lot of drawbacks in this storage administration mode, the maintenance of data with revise quite trouble, seriously affected the performance of digital control system and caused the waste of disk space.Problem may be summarized to be following several:
(1) traditional text mode lacks interaction mechanism:
In traditional text files memory way to manage, data directly are stored in the table.When the user need to obtain specific related data information, the information that does not provide a kind of mechanism to obtain showed.
(2) traditional text mode lacks perfect data organization and management system:
In traditional text files memory way to manage, data all are stored in the table, fail different data messages is divided.And the operation of carrying out for dissimilar data in digital control system is also different, and preset parameter need to be set different parameter values according to different requirements.Activity data then can be made real-time variation because of the process of processing, and these two kinds of data all are to need to constantly update to revise.If all be placed in the same table, revise with maintenance and can become very difficult and complicated.
(3) traditional text mode data sharing is poor:
In traditional text files memory way to manage, application program is opened database in the mode of monopolizing, and the sharing of data and the concurrency of application program are poor, thereby has affected the overall performance of system.
In the prior art, Chinese patent CN101667210A, a kind of " based on the authentication and authorization system of embedded database " is provided, this authentication and authorization system uses SQLite as the background database manager system, adopted modular design, formed by SQLite database and two primary modules of Certificate Authority.The Certificate Authority module is undertaken by application programming interfaces (API) and SQLite database and external application alternately.This authentication and authorization system belongs to the empowerment management in the industrial control system, be used for to solve that the empowerment management real-time is poor, the problem of extensibility and professional platform independence.Be not suitable for the data store and management for digital control system.
Summary of the invention
The objective of the invention is to solve effective storage and the organization and administration of data in the digital control system, solve the shortcoming that traditional digital control system real-time is poor and the disk space waste is serious, improve system speed and improve system performance.
The present invention provides a kind of data management system and method for embedded database of digital control system to achieve the above object.
The data management system of the embedded database of described digital control system comprises the SQLite database, interface function and data management module.Data management module is by interface function and the mutual exchange data information of SQLite database.
Comprise the data management operations interface of setting up with the shape library of GTK+ in the described data management module;
Comprise the system database that contains preset parameter, activity data and programming file in the described SQLite database;
Comprise the data form corresponding with above-mentioned data management operations interface phase in the described system database.
The data managing method of the embedded database of described digital control system is at first set up a system database that contains preset parameter, activity data and programming file in the SQLite database; Set up a data management module that comprises the data management operations interface with the shape library of GTK+; In system database, set up the data form corresponding with the data management operations interface phase; The employing interface function carries out the mutual exchange data information between service data administration module and the SQLite database.
Data management system of the present invention and method have significant progress.
(1) such as above-mentioned data management system of the present invention and method, because the present invention sets up the system database that contains preset parameter, activity data, programming file in the SQLite embedded database, that is to say, the present invention can easily store the data messages such as the involved various preset parameters of digital control system, activity data, programming file with the backstage of SQLite embedded database as digital control system.For every class data message designs detailed list, it is clear that data are divided, convenient management.
(2) such as above-mentioned data management system of the present invention and method, because the present invention comprises that with what the shape library of GTK+ was set up data management operations interface (referred to as operation interface) is mutually corresponding with data form in the system database in data management module.So the data variation on the operation interface of data management module can be carried out real-time update in system database, guaranteed the unification of data message in user interface and the database.When the user revised supplemental characteristic, the data in the database also correspondingly were modified simultaneously.Satisfied the requirement of people to the numerical control system real time.Improved the real-time of digital control system, the correctness of digital control system, security are guaranteed.
(3) such as above-mentioned data management system of the present invention and method, operate because the data management operations interface is corresponding with data form, so all operations to data all are to carry out with the form of affairs.Affairs are the individuals that in the database data operated, and database supports a plurality of things to carry out simultaneously, and the sharing characteristic of data is embodied like this.Improve the concurrency of system, improved the performance of system.
(4) such as above-mentioned data management system of the present invention and method, because with the backstage of SQLite embedded database as digital control system, all operations to data all are converted into SQL statement to be carried out, simple to operate, quick, like this maintenance of data is also seemed convenient.SQLite has a lot of good characteristics as a kind of outstanding database of increasing income, and it is convenient to transplant, and it is less to dispose simply, take up room, and is suitable for digital control system to simple, convenient, efficiently technical requirement.
Description of drawings
Fig. 1 is the structural representation of data management system one embodiment of the present invention;
Fig. 2 is the process flow diagram of data managing method one embodiment of the present invention;
Fig. 3 is the process flow diagram of one embodiment from the database to the operation interface;
Fig. 4 is the process flow diagram of one embodiment from the operation interface to the database;
Fig. 5 is the mutual synoptic diagram between operation interface and the database.
Embodiment
Further specify the technical characterictic of data management system of the present invention and method below in conjunction with accompanying drawing.
As shown in Figure 1, data management system of the present invention comprises SQLite database 1, interface function 2 and data management module 3.In the present embodiment, interface function 2 is the api interface function.Data management module is by api interface function and the mutual exchange data information of SQLite database.
Comprise the data management operations interface of setting up with the shape library of GTK+ in the described data management module;
Comprise the system database that contains preset parameter, activity data and programming file in the described SQLite database;
Comprise the data form corresponding with above-mentioned data management operations interface phase in the described system database.
As shown in Figure 2, the step of data managing method of the present invention is:
In the 1st step 01, at first in the SQLite database, create a system database.In the present embodiment, in the SQLite database, create the system database of a CNC.db by name, be used for all information tables that the storage administration digital control system is used.The data of its storage administration comprise preset parameter, activity data and programming file.For example, concrete operational order is:
$ sqlite3 CNC.db--enter the CNC system database, if this system database does not exist, then create this system database.Create data message table tab1 with SQL statement (create), for example:
sqlite3>create?table?tab1
(key?iht?primary?key,info2?varchar(20),info3?varchar(20));
If record record (tid1, tid2, tid3) will be inserted in this table, its value is (1, ' data2 ', ' data3 ').Available SQL statement (insert) is inserted these data in this table, if data volume also can adopt the mode of batch processing to carry out greatly.For example, operation is:
sqlite3>insert?into?tab1(key,info2,info3)values(1,‘data2’,‘data3’);
In the present embodiment,
Described preset parameter comprises (main):
The universal machine tools data are made as 16K; The lathe data are made as 4K; Servo data is made as 1.2K.
Described activity data comprises:
Configuration data: this is the data that arranged by producer (such as machine works) before lathe dispatches from the factory, and design is within 2K.Tune-up data: these data are final lathe user configuration datas before machine uses, and data volume designs within 2K.The outage save data: design is within 1K.
Described programming file comprises:
G code programming file, the PLC file of programming, backup data file, alert files, servo configuration file, CONFIG.SYS, tool file.
The 2nd step 02, set up a data administration module, set up the data management operations interface of data management module with the shape library of GTK+, comprise a plurality of data management operations interface (for the tree of GTK+);
In the 3rd step 03, in the said system database, set up the data form corresponding with data management operations interface phase on the above-mentioned data management module.It is corresponding with it namely to design corresponding data form according to different operation interfaces, and data form is used for the related data message in storage different operating interface; For different data management operations interfaces the different data form corresponding from it arranged in system database.That is to say what data bookkeeping interfaces are arranged in data management module, what data forms corresponding with it are just arranged in system database.
In the 4th step 04, set up the mutual interface function of (design) data management module and database.In the present embodiment, adopt the api interface function.In the api interface function, set up and comprise data inserting, delete data, search data and the basic operation interface function of new data more.
In the present embodiment, adopt the design and development of carrying out first system database, data management module and interface function at PC, and then it is transplanted on the hardware platform, as be transplanted on the CF card.
Fig. 3 is that the data message in the database is shown to the flow process on the operation interface.As shown in Figure 3, open the SQLite database by the interface function (api interface function) that calls SQLite, the correlation table information of system database in the query SQL ite database is called the table information that the function of GTK+ will inquire again and is write in the display member of GTK+.For example the table information that inquires to be presented among the tree type display member GtkTreeStore of GTK+.Idiographic flow as shown in Figure 3.At first the calling interface function is opened database; The query SQL statement that will carry out again is assigned to a string variable; Then this string variable is passed to statement handles, and the api interface function that calls SQLite is ready to all resources; Begin to carry out this query manipulation, be a do herein ... the cycling of while; In this loop structure, the api interface functional query result set with SQLite is inserted into the result set that inquires in the tree of data management module while inquiring about; Whether last judgment model changes, and again prepares resource if change to return, and begins to carry out the query manipulation of a new round; Otherwise the calling interface function is closed database.
Fig. 4 is with in the data message write into Databasce on the operation interface.Here the problem that relates to is when on operation interface data being made amendment, amended data to be kept in the database, to keep the coherence and continuity of two kinds of data messages.Relate generally to three kinds of operations: insert deletion, and modification (renewal).Here article upgrades (modification) function, because in digital control system, operating personnel need often the parameter of control to be made modification, just need to keep in real time the unitarity of the data message on database and the operation interface this moment.
For example during the data message write into Databasce in the GTK+ Input, can adopt following steps to realize on need to be with operation interface.As shown in Figure 4, at first the calling interface function is opened database; By the assignment function that calls GTK+ the data message in the text frame is assigned to a string variable again, the new value that this moment, this string variable representative was replaced; Update statement with SQL indicates the data field that will upgrade again, the old value in the data field, the information such as new value that replace; Call afterwards the GTK+ function this SQL statement is assigned to another string variable; Call at last the api interface function of SQLite and carry out this SQL statement.Operation as shown in Figure 4 particularly.
As shown in Figure 5, operation interface and database comprises alternately data inserting, deletes data, searches the basic operation of data and renewal (modification) data.That is to say, database is mainly carried out around " additions and deletions change look into " these four kinds of operations.The present invention realizes this four kinds of basic operations by encapsulating these four functional interface functions.In the api interface function, set up and comprise data inserting, delete data, search data and the basic operation interface function of new data more.Reach interactive function with database by the relevant control that cooperates GTK+ simultaneously.Other complicated interactive operation is carried out for the basis mainly with these four kinds of basic operations greatly.And the operation of each all is called affairs, finishes specific independent operation, can carry out side by side in data management module.
<1〉data inserting operation,
When the data message in the operation interface top box being inserted in the database, can finish this operation by clicking this operation interface (button_insert_cb) button at operation interface.First the data message in the text box is assigned to record variable (record), the data inserting interface function (insert_data_in_sqlite) by calling the present invention's designed (foundation) is with this variable write into Databasce again.Its concrete steps are:
Figure BDA0000080535840000061
<2〉deletion data operation
When needs are deleted certain data field and are the requiring of record of data.Can by calling interface function (delete_data_in_sqlite) in database with this record deletion.Concrete deletion action is:
Figure BDA0000080535840000062
Figure BDA0000080535840000071
<3〉search data manipulation
When having on the operation interface need to search certain data field and be requiring of data record the time, these recorded informations that can find out in the operation interface demonstration by calling interface function (select_data_in_sqlite function).
Figure BDA0000080535840000072
<4〉upgrade (modification) data manipulation
Need to upgrade certain data field be that the value of data is when being requiring of new_data when having on the operation interface.Can in database, should record renewal by calling the update_data_in_sqlite function.
Figure BDA0000080535840000081

Claims (3)

1. the data management system of the embedded database of a digital control system comprises SQLite database and interface function, it is characterized in that comprising:
Data management module, by interface function and the mutual exchange data information of SQLite database, it comprises the data management operations interface of setting up with the shape library of GTK+;
Comprise the system database that contains preset parameter, activity data and programming file in the described SQLite database;
Comprise the data form corresponding with above-mentioned data management operations interface phase in the described system database.
2. the data managing method of the embedded database of a digital control system is characterized in that: at first, set up a system database that contains preset parameter, activity data and programming file in the SQLite database; Set up a data management module that comprises the data management operations interface with the shape library of GTK+; In system database, set up the data form corresponding with the data management operations interface phase; The employing interface function carries out the mutual exchange data information between service data administration module and the SQLite database.
3. the data managing method of the embedded database of digital control system according to claim 2 is characterized in that, sets up to comprise data inserting, delete data, search data and the basic operation interface function of new data more in the interface function that adopts.
CN2011102193151A 2011-08-02 2011-08-02 Data management system and data management method for embedded database of numerical control system Pending CN102915305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011102193151A CN102915305A (en) 2011-08-02 2011-08-02 Data management system and data management method for embedded database of numerical control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011102193151A CN102915305A (en) 2011-08-02 2011-08-02 Data management system and data management method for embedded database of numerical control system

Publications (1)

Publication Number Publication Date
CN102915305A true CN102915305A (en) 2013-02-06

Family

ID=47613676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011102193151A Pending CN102915305A (en) 2011-08-02 2011-08-02 Data management system and data management method for embedded database of numerical control system

Country Status (1)

Country Link
CN (1) CN102915305A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136347A (en) * 2013-02-16 2013-06-05 上海斐讯数据通信技术有限公司 Embedded database system management method
CN104572725A (en) * 2013-10-22 2015-04-29 北京品众互动网络营销技术有限公司 Multi-conditional customization, segmentation and execution method of data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667210A (en) * 2009-10-15 2010-03-10 上海宝信软件股份有限公司 Authentication and authorization system based on embedded database

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667210A (en) * 2009-10-15 2010-03-10 上海宝信软件股份有限公司 Authentication and authorization system based on embedded database

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
INGMAR BERGMANN EL AT.: "《MobileTrade: A Maemo Client to Trading/Auction Web Services》", 《7TH CONFERENCE OF FINNISH-RUSSIAN UNIVERSITY COOPERATION IN TELECOMMUNICATIONS》, 31 December 2010 (2010-12-31) *
MERCIADRI LUCA: "《Using Linux on a Handheld Device: an Obstacle Course?》", 《WIKIPEDIA》, 31 December 2009 (2009-12-31), pages 1 - 14 *
赵鹏等: "《基于Linux2.6和SQLite的手机地址簿的设计与实现》", 《电子测量技术》, vol. 32, no. 6, 30 June 2009 (2009-06-30), pages 61 - 64 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136347A (en) * 2013-02-16 2013-06-05 上海斐讯数据通信技术有限公司 Embedded database system management method
CN103136347B (en) * 2013-02-16 2018-01-02 上海斐讯数据通信技术有限公司 A kind of embedded type database system management method
CN104572725A (en) * 2013-10-22 2015-04-29 北京品众互动网络营销技术有限公司 Multi-conditional customization, segmentation and execution method of data

Similar Documents

Publication Publication Date Title
CN105447122B (en) A kind of implementation method that archives economy can be independently created based on multilist association
CN100375047C (en) Management method for computer log
CN108052681A (en) The synchronous method and system of structural data between a kind of relevant database
CN102542007A (en) Method and system for synchronization of relational databases
JP2008533630A (en) Data management for mobile data systems
CN101727322B (en) Method and device for optimizing bill of material management interface
WO2000046700A1 (en) Method and apparatus for accessing data
CN103336813A (en) Data integrated management scheme for Internet of Things based on middleware framework
CN101145162A (en) Data base dynamic inquiry method and system
CN106682213A (en) Internet-of-things task customizing method and system based on Hadoop platform
CN103971036B (en) Page column authority control system and method
CN102254021A (en) Method for constructing database based on virtual machine management system
CN101566981A (en) Method for establishing dynamic virtual data base in analyzing and processing system
CN102054034A (en) Implementation method for business basic data persistence of enterprise information system
CN113849483A (en) Real-time database system architecture for intelligent factory
CN102306355A (en) Management system for IT (Information Technology) operation and maintenance configuration
CN108376065A (en) The system for building the avionics software development environment of model-driven
CN107977446A (en) A kind of memory grid data load method based on data partition
CN102110142A (en) Method for dynamically expanding personnel transaction in human resource management information system
WO2007044826A2 (en) Xml schema template builder
CN110442620A (en) A kind of big data is explored and cognitive approach, device, equipment and computer storage medium
CN104156640A (en) Data access right control method
CN109615554B (en) Synchronous data system based on intelligent manufacturing and operation method and synchronization method thereof
CN106780157B (en) Ceph-based power grid multi-temporal model storage and management system and method
CN102915305A (en) Data management system and data management method for embedded database of numerical control system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130206