CN107608703B - Method for locally upgrading database - Google Patents
Method for locally upgrading database Download PDFInfo
- Publication number
- CN107608703B CN107608703B CN201711047623.4A CN201711047623A CN107608703B CN 107608703 B CN107608703 B CN 107608703B CN 201711047623 A CN201711047623 A CN 201711047623A CN 107608703 B CN107608703 B CN 107608703B
- Authority
- CN
- China
- Prior art keywords
- database
- app
- upgrading
- version number
- table version
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Abstract
The invention relates to a method for locally upgrading a database, which comprises the following steps: when App is started, calling a DBVersionManger class, and executing the following database local upgrade detection step in an init method of the DBVersionManger class. According to the invention, the APP can automatically detect whether local upgrading of the database is needed during operation, the use is simple, the development efficiency is improved, developers can independently manage and control the upgrading of the database, and the data security is effectively guaranteed.
Description
Technical Field
The invention relates to the technical field of databases, in particular to a method for locally upgrading a database.
Background
The existing App mostly needs to be supported by a database during running, and along with the upgrading of the version of the App, the database also needs to be correspondingly upgraded to support the running of the new version App.
In the existing IOS system, although corresponding functions, interfaces and the like for upgrading the database are provided, the use is complicated, the maintenance of the App is inconvenient, and the development efficiency of the new version App is restricted.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method for locally upgrading a database, wherein an APP can automatically detect whether the database needs to be locally upgraded during operation, the method is simple to use, the development efficiency is improved, a developer can autonomously manage and control the database upgrading, and the data security is effectively guaranteed.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows:
a method for local upgrading of a database is characterized by comprising the following steps:
when App is started, the DBVersionManger class is called first,
in the init method of the dbverishmanger class, the following database local upgrade detection steps are performed,
firstly, calling a checkUpdide method, detecting whether local upgrade of a database is needed or not,
if so, a recursive upgrade operation is performed,
if not, the subsequent normal use step of the database is carried out.
On the basis of the technical scheme, the specific steps for detecting whether the local upgrade of the database is needed or not are as follows:
the current table version number of each table in the database is obtained,
acquiring the table version number required by the App to run the App recorded by the App,
when the table version number required by running App is larger than the current table version number, the local upgrade of the database is required,
and when the table version number required by the running App is equal to or less than the current table version number, the local upgrade of the database is not required.
On the basis of the technical scheme, the current table Version number of each table in the database is stored in a Version database.
On the basis of the technical scheme, the table version number recorded by the App and required by the running of the App is encapsulated in the App when the App is compiled.
On the basis of the technical scheme, the recursive upgrade refers to: when more than one upgrade is performed between the table version number recorded by the App and required for running the App and the current table version number of each table in the database,
and upgrading is carried out in sequence according to the upgrading times, and the specific step of detecting whether the local upgrading of the database is needed or not is repeated after the upgrading is completed once.
On the basis of the technical scheme, when upgrading is carried out in sequence, the corresponding upgrading algorithm is packaged in the App when the App is compiled, or is provided by an upgrading algorithm package or an upgrading module or an upgrading server acquired from the outside.
On the basis of the technical scheme, the table version number is represented by a positive integer, and the table version number is increased by one once per liter.
On the basis of the above technical solution, the database includes but is not limited to: MySQL, SQLite.
According to the method for locally upgrading the database, the APP can automatically detect whether the local upgrading of the database is needed or not during running, the use is simple, the development efficiency is improved, developers can independently manage and control the local upgrading of the database, and the data security is effectively guaranteed.
Drawings
The invention has the following drawings:
FIG. 1 is a flow chart of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, the method for locally upgrading a database according to the present invention includes the following steps:
when App is started, the DBVersionManger class is called first,
in the init method of the dbverishmanger class, the following database local upgrade detection steps are performed,
firstly, calling a checkUpdide method, detecting whether local upgrade of a database is needed or not,
if so, a recursive upgrade operation is performed,
if not, the subsequent normal use step of the database is carried out.
On the basis of the technical scheme, the specific steps for detecting whether the local upgrade of the database is needed or not are as follows:
the current table version number of each table in the database is obtained,
acquiring the table version number required by the App to run the App recorded by the App,
when the table version number required by running App is larger than the current table version number, the local upgrade of the database is required,
and when the table version number required by the running App is equal to or less than the current table version number, the local upgrade of the database is not required.
On the basis of the technical scheme, the current table Version number of each table in the database is stored in a Version database.
On the basis of the technical scheme, the table version number recorded by the App and required by the running of the App is encapsulated in the App when the App is compiled.
On the basis of the technical scheme, the recursive upgrade refers to: when more than one upgrade is performed between the table version number recorded by the App and required for running the App and the current table version number of each table in the database,
and upgrading is carried out in sequence according to the upgrading times, and the specific step of detecting whether the local upgrading of the database is needed or not is repeated after the upgrading is completed once.
On the basis of the technical scheme, when upgrading is carried out in sequence, the corresponding upgrading algorithm is packaged in the App when the App is compiled, or is provided by an upgrading algorithm package or an upgrading module or an upgrading server acquired from the outside.
On the basis of the technical scheme, the table version number is represented by a positive integer, and the table version number is increased by one once per liter.
On the basis of the above technical solution, the database includes but is not limited to: MySQL, SQLite.
Those not described in detail in this specification are within the skill of the art.
Claims (5)
1. A method for local upgrading of a database is characterized by comprising the following steps:
when App in the IOS system is started, the DBVersionManger class is called first,
in the init method of the dbverishmanger class, the following database local upgrade detection steps are performed,
firstly, calling a checkUpdide method, detecting whether local upgrade of a database is needed or not,
if so, a recursive upgrade operation is performed,
if not, transferring to the subsequent normal use step of the database;
the specific steps for detecting whether the local upgrade of the database is needed are as follows:
the current table version number of each table in the database is obtained,
acquiring the table version number required by the App to run the App recorded by the App,
when the table version number required by running App is larger than the current table version number, the local upgrade of the database is required,
when the table version number required by running the App is equal to or less than the current table version number, local upgrading of the database is not required;
the recursive upgrade is as follows: when more than one upgrade is performed between the table version number recorded by the App and required for running the App and the current table version number of each table in the database,
upgrading is carried out in sequence according to the upgrading times, and the specific step of detecting whether local upgrading of the database is needed or not is repeated after upgrading is completed once;
when upgrading is carried out in sequence, the corresponding upgrading algorithm is packaged in the App when the App is compiled, or the upgrading algorithm is provided by an upgrading algorithm package or an upgrading module or an upgrading server acquired from the outside.
2. The method for local upgrade of a database according to claim 1, wherein: the current table Version number of each table in the database is stored in a Version database.
3. The method for local upgrade of a database according to claim 1, wherein: and the table version number recorded by the App and required for running the App is packaged in the App when the App is compiled.
4. The method for local upgrade of a database according to claim 1, wherein: the table version number is represented by a positive integer, once per liter of level, the table version number is incremented by one.
5. The method for local upgrade of a database according to claim 1, wherein: the database includes, but is not limited to: MySQL, SQLite.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711047623.4A CN107608703B (en) | 2017-10-31 | 2017-10-31 | Method for locally upgrading database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711047623.4A CN107608703B (en) | 2017-10-31 | 2017-10-31 | Method for locally upgrading database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107608703A CN107608703A (en) | 2018-01-19 |
CN107608703B true CN107608703B (en) | 2020-11-03 |
Family
ID=61083956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711047623.4A Active CN107608703B (en) | 2017-10-31 | 2017-10-31 | Method for locally upgrading database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107608703B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102495733A (en) * | 2011-12-08 | 2012-06-13 | 方正国际软件有限公司 | Methods for detecting compatibility of application program and relevant database script and performing upgrading maintenance on application program and relevant database script |
CN106445618A (en) * | 2016-10-17 | 2017-02-22 | 成都知道创宇信息技术有限公司 | Automatic database updating method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9779126B2 (en) * | 2014-06-15 | 2017-10-03 | Sap Se | Hybrid database upgrade migration |
-
2017
- 2017-10-31 CN CN201711047623.4A patent/CN107608703B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102495733A (en) * | 2011-12-08 | 2012-06-13 | 方正国际软件有限公司 | Methods for detecting compatibility of application program and relevant database script and performing upgrading maintenance on application program and relevant database script |
CN106445618A (en) * | 2016-10-17 | 2017-02-22 | 成都知道创宇信息技术有限公司 | Automatic database updating method |
Also Published As
Publication number | Publication date |
---|---|
CN107608703A (en) | 2018-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107168841B (en) | Remote testing method and device for mobile equipment | |
CN104461786B (en) | The restoration methods of android system and the recovery system of android system | |
CN109871213A (en) | OpenStack containerization system and method based on Domestic Platform | |
CN103067445B (en) | Method and device of software upgrading of distributed system | |
CN103902480A (en) | Android phone driving method and system | |
CN104008060A (en) | Method for detecting compatibility of plug-in and host, and detection server | |
CN104102527A (en) | Method for updating software of virtual machine | |
CN105912340A (en) | Primary device, remote control and overhead upgrading method of remote control | |
CN105589697A (en) | Method and device for upgrading cloud platform | |
CN104077401A (en) | Database data migration device and method | |
CN103440337A (en) | API (application program interface) compatibility scanning method and API compatibility scanning device | |
CN108037941B (en) | Based on the application program update method of public plug-in unit, electronic equipment, storage medium | |
CN107678875A (en) | A kind of fault detect and self-repairing method, device, terminal and storage medium | |
CN106445618A (en) | Automatic database updating method | |
US20170031662A1 (en) | Distributed compilation of statically typed languages | |
CN105739964A (en) | Implementation method for supporting version compatibility control based on Android platform | |
CN107608703B (en) | Method for locally upgrading database | |
CN111158743A (en) | Big data operation and maintenance management platform | |
CN103699485A (en) | Application program debugging method and device | |
CN103793231A (en) | Processing method and system for mobile terminal parameters | |
CN105335432A (en) | Oracle database access method | |
CN110991614A (en) | GPU neural network deep learning test method and system under Linux | |
CN105446767A (en) | Method and system for upgrading terminal software in production test of rear installation of intelligent platform | |
CN102750167B (en) | Application program launching method, device and computer system | |
CN106843994A (en) | A kind of client software operation method based on on-the-flier compiler |
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 |