CN109471869A - A kind of method and system that local data base upgrades automatically - Google Patents
A kind of method and system that local data base upgrades automatically Download PDFInfo
- Publication number
- CN109471869A CN109471869A CN201811611996.4A CN201811611996A CN109471869A CN 109471869 A CN109471869 A CN 109471869A CN 201811611996 A CN201811611996 A CN 201811611996A CN 109471869 A CN109471869 A CN 109471869A
- Authority
- CN
- China
- Prior art keywords
- data base
- local data
- automatically
- local
- upgrades
- 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
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of method and system that local data base upgrades automatically, belong to mobile application development technique field.The method that local data base of the invention upgrades automatically, the code object data list structure of local data base being mapped as in mobile client, mobile client upgrades the data structure of local data base according to code object in version updating or hot renewal process automatically.The method that the local data base of the invention upgrades automatically, developer only need to update mobile terminal code object, and local data base structure updating can be realized, it is simple to operate, and working efficiency can be effectively improved, it cuts operating costs, there is good application value.
Description
Technical field
The present invention relates to mobile application development technique field, specifically provide a kind of method that local data base upgrades automatically and
System.
Background technique
With being constantly progressive for society, social economy's rapid development, while also driving being constantly progressive for every science and technology.
Computer has many advantages, such as that information memory capacity is big, and user's acquisition information is convenient and efficient, is widely applied.Especially in recent years
Come, as society and economic further development, computer application field gradually extend, computer is all obtained in every field
It is widely applied, while the performance requirements of computer is gradually increased in user, therefore the performance of computer needs accordingly
Improvement.The performance of computer is the index for measuring computer system performance, and determine computer performance mainly includes
CPU, video card, memory and hard disk.Any one performance is weak, and computer operation can all be caused to slow down.It is constantly sent out in computer
During exhibition, computer development personnel need continuous exploitation new technology, to meet the update of computer and the need of client
It asks.Computer technician develops new technology and needs to be upgraded in computer systems, can just run.But it is existing
In technology, after computer development staff development new technology, the process that computer is upgraded is cumbersome, needs to increase a large amount of volume
Outer work increases the workload of staff, reduces working efficiency, and will increase entreprise cost accordingly.
By taking tobacco business customer manager's mobile oa platform APP as an example, tobacco customer manager needs to visit retail customer on the spot,
And constrained by network condition, need to realize a large amount of offline functionalities in APP, i.e., in the local database by data blotter,
Data are uploaded to Cloud Server in the case that network condition allows.Demand change iteration and code upgrade can be related to frequently
And in the local data base of mobile terminal data structure update.And this operates and needs biggish cost of labor, reduces developer
Working efficiency, improve company operation cost.
Summary of the invention
Technical assignment of the invention is that in view of the above problems, providing a kind of developer only needs to update mobile terminal generation
Code object, can be realized local data base structure updating, simple to operate, and can effectively improve working efficiency, reduce fortune
The method that the local data base of battalion's cost upgrades automatically.
The further technical assignment of the present invention is to provide a kind of system that local data base upgrades automatically.
To achieve the above object, the present invention provides the following technical scheme that
The data list structure of local data base is mapped as moving by a kind of method that local data base upgrades automatically, the method
Code object in dynamic client, mobile client upgrade automatically in version updating or hot renewal process, according to code object
The data structure of local data base.
The mobile client includes the mobile terminal Android or ios app.
Object Relation Mapping is carried out using typescript/JavaScript language.
The method of the invention passes through JavaScript reality using mixing class app development technique, main code logic
It is existing.
The method upgraded automatically by the local data base, developer only need to update mobile client code object,
The automatic upgrading of local data library structure can be realized.
Preferably, the method specifically includes the following steps:
S1: local data base table structure is subjected to Object Relation Mapping, i.e., local data base table structure is used into js object
It indicates;
S2: js object described in step S1 is converted to local by the automatically scanning in mobile client app start-up course
Database builds table statement or update field statement;
S3: after mobile client obtains new version app code, it is again started up automatic execution step S2, realizes local data
The data list structure in library automatically updates.
Preferably, this method is further comprising the steps of:
S4: upgrading the quantity that runs succeeded of sentence according to local data base, and the upgrading of local data base data structure is added
Schedule monitoring is shown.
Preferably, in step S1, Object Relation Mapping includes:
1) name for, giving expression to tables of data in local data base is embodied by explaining form;
2) major key for, giving expression to local data base tables of data is embodied by explaining form;
3) field name and field type for, giving expression to local data base tables of data are embodied by explaining form.
The reference example of the process is as follows:
@Table({name:'todos'})
export class Todo extends DbHelperModel{
@PrimaryKey({autoIncremented:true})
public id:number;
@Column()
public name:string;
@Column(type:'number')
public dueDate:number;
@Column(type:'boolean')
public isDone:boolean;
@ForeignModel(Category)
public category:Category;
}
Preferably, if table is not present in local data base, directly building predicative according to what js object generated in step S2
Sentence, which executes, builds table statement operation, if having existed table in local data base, to the data type and length attribute of field in table
Judged one by one, generate corresponding update sentence, that is, executed and update sentence operation.
A kind of system that local data base upgrades automatically, the system comprise the following modules:
Object Relation Mapping module: for local data base table structure to be carried out Object Relation Mapping;
Object converting module: for by js object be converted to local data base build table statement or update field statement;
It automatically updates module: after obtaining new version app code for mobile client, being again started up automatic execution, realize
The data list structure of local data base automatically updates;
Schedule monitoring display module: upgrading the quantity that runs succeeded of sentence according to local data base, and local data base is added
The Schedule monitoring of data structure upgrading is shown.
Preferably, the Object Relation Mapping that the Object Relation Mapping module is used for includes:
1) name for, giving expression to tables of data in local data base is embodied by explaining form;
2) major key for, giving expression to local data base tables of data is embodied by explaining form;
3) field name and field type for, giving expression to local data base tables of data are embodied by explaining form.
Preferably, in the object converting module, it is directly raw according to js object if table is not present in local data base
At build table statement execution build table statement operation, if having existed table in local data base, to the data type of field in table
And length attribute is judged one by one, generates corresponding update sentence, that is, is executed and updated sentence operation.
It is supplemented preferably, the Schedule monitoring display module is visualized as mobile client, according to local data base
Upgrade the quantity that runs succeeded of sentence, the Schedule monitoring that the upgrading of local data base data structure is added is shown.
Compared with prior art, the method that local data base of the invention upgrades automatically has beneficial effect following prominent
Fruit: the method that the local data base upgrades automatically is by the way that the data list structure of local data base to be mapped as in mobile client
Code object, mobile client in version updating or hot renewal process automatically according to code object upgrade local data base
Data list structure, developer only need update mobile client code object, the automatic liter of local data structure can be realized
Grade has good application value.
Specific embodiment
Below in conjunction with embodiment, the method and system that local data base of the invention upgrades automatically are made further detailed
Explanation.
Embodiment
The data list structure of local data base is mapped as by the method that local data base of the invention upgrades automatically, this method
Code object in mobile client, mobile client rise automatically in version updating or hot renewal process, according to code object
The data structure of grade local data base.Specifically includes the following steps:
S1: local data base table structure is subjected to Object Relation Mapping, i.e., local data base table structure is used into js object
It indicates.
Object Relation Mapping includes:
1) name for, giving expression to tables of data in local data base is embodied by explaining form;
2) major key for, giving expression to local data base tables of data is embodied by explaining form;
3) field name and field type for, giving expression to local data base tables of data are embodied by explaining form.
The reference example of the process is as follows:
@Table({name:'todos'})
export class Todo extends DbHelperModel{
@PrimaryKey({autoIncremented:true})
public id:number;
@Column()
public name:string;
@Column(type:'number')
public dueDate:number;
@Column(type:'boolean')
public isDone:boolean;
@ForeignModel(Category)
public category:Category;
}
S2: js object described in step S1 is converted to local by the automatically scanning in mobile client app start-up course
Database builds table statement or update field statement.
In the step, if table is not present in local data base, directly built according to the table statement execution of building that js object generates
Table statement operation, if having existed table in local data base, data type and length attribute to field in table are carried out one by one
Judgement, generates corresponding update sentence, that is, executes and update sentence operation.
S3: after mobile client obtains new version app code, it is again started up automatic execution step S2, realizes local data
The data list structure in library automatically updates.
S4: upgrading the quantity that runs succeeded of sentence according to local data base, and the upgrading of local data base data structure is added
Schedule monitoring is shown.
The step is visualized as mobile client and is supplemented, and can upgrade the number that runs succeeded of sentence according to local data base
The Schedule monitoring displaying of data structure upgrading is added in amount, such as: " upgrading, current schedules 98% ", if upgrading is because of network
Or the failure of program code problem, then it prompts " to upgrade failure, please retry!" etc..
The system that local data base of the invention upgrades automatically, the system comprise the following modules:
Object Relation Mapping module: for local data base table structure to be carried out Object Relation Mapping.
The Object Relation Mapping that Object Relation Mapping module is used for includes:
1) name for, giving expression to tables of data in local data base is embodied by explaining form;
2) major key for, giving expression to local data base tables of data is embodied by explaining form;
3) field name and field type for, giving expression to local data base tables of data are embodied by explaining form.
Object converting module: for by js object be converted to local data base build table statement or update field statement.
If table is not present in local data base, table statement behaviour is directly built according to the table statement execution of building that js object generates
Make, if having existed table in local data base, data type and length attribute to field in table are judged one by one, are generated
Corresponding update sentence executes and updates sentence operation.
It automatically updates module: after obtaining new version app code for mobile client, being again started up automatic execution, realize
The data list structure of local data base automatically updates.
Schedule monitoring display module: upgrading the quantity that runs succeeded of sentence according to local data base, and local data base is added
The Schedule monitoring of data structure upgrading is shown.Schedule monitoring display module is visualized as mobile client and is supplemented, according to local
The quantity that runs succeeded of database upgrade sentence, the Schedule monitoring that the upgrading of local data base data structure is added are shown.
Embodiment described above, the only present invention more preferably specific embodiment, those skilled in the art is at this
The usual variations and alternatives carried out within the scope of inventive technique scheme should be all included within the scope of the present invention.
Claims (9)
1. a kind of method that local data base upgrades automatically, it is characterised in that: the method is by the tables of data knot of local data base
Structure is mapped as the code object in mobile client, and mobile client is in version updating or hot renewal process, according to code pair
Data structure as upgrading local data base automatically.
2. the method that local data base according to claim 1 upgrades automatically, it is characterised in that: the method specifically includes
Following steps:
S1: local data base table structure is subjected to Object Relation Mapping, i.e., is indicated local data base table structure using js object;
S2: js object described in step S1 is converted to local data by the automatically scanning in mobile client app start-up course
Table statement or update field statement are built in library;
S3: after mobile client obtains new version app code, it is again started up automatic execution step S2, realizes local data base
Data list structure automatically updates.
3. the method that local data base according to claim 2 upgrades automatically, it is characterised in that: this method further includes following
Step:
S4: upgrading the quantity that runs succeeded of sentence according to local data base, and the progress of local data base data structure upgrading is added
Monitoring is shown.
4. the method that local data base according to claim 3 upgrades automatically, it is characterised in that: in step S1, object is closed
System maps
1) name for, giving expression to tables of data in local data base is embodied by explaining form;
2) major key for, giving expression to local data base tables of data is embodied by explaining form;
3) field name and field type for, giving expression to local data base tables of data are embodied by explaining form.
5. the method that local data base according to claim 4 upgrades automatically, it is characterised in that: in step S2, if local
Table is not present in database, then table statement operation is directly built according to the table statement execution of building that js object generates, if local data base
In have existed table, then the data type to field in table and length attribute are judged one by one, generate corresponding update sentence,
It executes and updates sentence operation.
6. a kind of system that local data base upgrades automatically, it is characterised in that: the system comprises the following modules:
Object Relation Mapping module: for local data base table structure to be carried out Object Relation Mapping;
Object converting module: for by js object be converted to local data base build table statement or update field statement;
It automatically updates module: after obtaining new version app code for mobile client, being again started up automatic execution, realize local
The data list structure of database automatically updates;
Schedule monitoring display module: upgrading the quantity that runs succeeded of sentence according to local data base, and local data base data are added
The Schedule monitoring of structure updating is shown.
7. the system that local data base according to claim 6 upgrades automatically, it is characterised in that: the Object Relation Mapping
The Object Relation Mapping that module is used for includes:
1) name for, giving expression to tables of data in local data base is embodied by explaining form;
2) major key for, giving expression to local data base tables of data is embodied by explaining form;
3) field name and field type for, giving expression to local data base tables of data are embodied by explaining form.
8. the system that local data base according to claim 6 or 7 upgrades automatically, it is characterised in that: the object conversion
In module, if table is not present in local data base, table statement operation is directly built according to the table statement execution of building that js object generates,
If having existed table in local data base, data type and length attribute to field in table are judged one by one, generation pair
The update sentence answered executes and updates sentence operation.
9. the system that local data base according to claim 8 upgrades automatically, it is characterised in that: the Schedule monitoring is shown
Module is visualized as mobile client and is supplemented, and upgrades the quantity that runs succeeded of sentence according to local data base, and local number is added
It is shown according to the Schedule monitoring of library data structure upgrading.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811611996.4A CN109471869A (en) | 2018-12-27 | 2018-12-27 | A kind of method and system that local data base upgrades automatically |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811611996.4A CN109471869A (en) | 2018-12-27 | 2018-12-27 | A kind of method and system that local data base upgrades automatically |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109471869A true CN109471869A (en) | 2019-03-15 |
Family
ID=65677072
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811611996.4A Pending CN109471869A (en) | 2018-12-27 | 2018-12-27 | A kind of method and system that local data base upgrades automatically |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109471869A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110377610A (en) * | 2019-06-27 | 2019-10-25 | 腾讯科技(深圳)有限公司 | A kind of database update method, apparatus, equipment and medium based on cloud platform |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100287208A1 (en) * | 2009-05-05 | 2010-11-11 | International Business Machines Corporation | Object-Relational Based Data Access for Nested Relational and Hierarchical Databases |
CN101980213A (en) * | 2010-11-23 | 2011-02-23 | 中国科学院软件研究所 | J2EE-based data persistence method and system |
CN102945156A (en) * | 2012-10-23 | 2013-02-27 | 深圳市融创天下科技股份有限公司 | Data caching method and device based on Java object |
CN103942281A (en) * | 2014-04-02 | 2014-07-23 | 北京中交兴路车联网科技有限公司 | Method and device for operating object persistently stored |
US9037614B1 (en) * | 2012-02-24 | 2015-05-19 | Amazon Technologies, Inc. | Secondary mappings to enable code changes without schema updates |
CN104679903A (en) * | 2015-03-20 | 2015-06-03 | 亚信科技(南京)有限公司 | Method and device for operating data sheets |
CN104881461A (en) * | 2015-05-22 | 2015-09-02 | 国云科技股份有限公司 | Rapid data storage method |
CN104899225A (en) * | 2014-03-07 | 2015-09-09 | 北京四达时代软件技术股份有限公司 | Object relational mapping method and device as well as processor |
CN108710504A (en) * | 2017-04-10 | 2018-10-26 | 北大方正集团有限公司 | Database operation method and device |
-
2018
- 2018-12-27 CN CN201811611996.4A patent/CN109471869A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100287208A1 (en) * | 2009-05-05 | 2010-11-11 | International Business Machines Corporation | Object-Relational Based Data Access for Nested Relational and Hierarchical Databases |
CN101980213A (en) * | 2010-11-23 | 2011-02-23 | 中国科学院软件研究所 | J2EE-based data persistence method and system |
US9037614B1 (en) * | 2012-02-24 | 2015-05-19 | Amazon Technologies, Inc. | Secondary mappings to enable code changes without schema updates |
US9558214B1 (en) * | 2012-02-24 | 2017-01-31 | Amazon Technologies, Inc. | Secondary mappings to enable code changes without schema updates |
CN102945156A (en) * | 2012-10-23 | 2013-02-27 | 深圳市融创天下科技股份有限公司 | Data caching method and device based on Java object |
CN104899225A (en) * | 2014-03-07 | 2015-09-09 | 北京四达时代软件技术股份有限公司 | Object relational mapping method and device as well as processor |
CN103942281A (en) * | 2014-04-02 | 2014-07-23 | 北京中交兴路车联网科技有限公司 | Method and device for operating object persistently stored |
CN104679903A (en) * | 2015-03-20 | 2015-06-03 | 亚信科技(南京)有限公司 | Method and device for operating data sheets |
CN104881461A (en) * | 2015-05-22 | 2015-09-02 | 国云科技股份有限公司 | Rapid data storage method |
CN108710504A (en) * | 2017-04-10 | 2018-10-26 | 北大方正集团有限公司 | Database operation method and device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110377610A (en) * | 2019-06-27 | 2019-10-25 | 腾讯科技(深圳)有限公司 | A kind of database update method, apparatus, equipment and medium based on cloud platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111813963B (en) | Knowledge graph construction method and device, electronic equipment and storage medium | |
CN111061817B (en) | Adaptive business construction system, method and computer readable medium | |
CN104133772A (en) | Automatic test data generation method | |
CN112182359B (en) | Feature management method and system of recommendation model | |
CN113282795B (en) | Data structure diagram generation and updating method and device, electronic equipment and storage medium | |
US20120191831A1 (en) | System and method for cataloging assets in a network | |
US20240061695A1 (en) | System and methods for improved adoption of cloud container profiles | |
CN105338045A (en) | Cloud computing resource processing device, method and cloud computing system | |
CN110795478A (en) | Data warehouse updating method and device applied to financial business and electronic equipment | |
CN102331937A (en) | Cloud platform installing system | |
CN111125064A (en) | Method and device for generating database mode definition statement | |
CN113807062A (en) | Online drawing method and device for combined density map and electronic equipment | |
CN117454278A (en) | Method and system for realizing digital rule engine of standard enterprise | |
US9596654B2 (en) | Association of applications to clusters mapped to logical battery partitions | |
CN106856441A (en) | VIM systems of selection and device in NFVO | |
CN109471869A (en) | A kind of method and system that local data base upgrades automatically | |
CN106789236B (en) | A method of the FOTA remote online upgrading of fusion WiFiP2P | |
CN112764874A (en) | CMDB configuration management system-based virtual machine server information acquisition method | |
CN113204425A (en) | Method and device for process management internal thread, electronic equipment and storage medium | |
CN116450723A (en) | Data extraction method, device, computer equipment and storage medium | |
CN103809915A (en) | Read-write method and device of magnetic disk files | |
CN115860877A (en) | Product marketing method, device, equipment and medium | |
US20230259994A1 (en) | Reference-based software application blueprint creation | |
CN115543428A (en) | Simulated data generation method and device based on strategy template | |
US20130103724A1 (en) | Network and method for managing models |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190315 |
|
RJ01 | Rejection of invention patent application after publication |