CN106502685B - Method and system for upgrading database - Google Patents

Method and system for upgrading database Download PDF

Info

Publication number
CN106502685B
CN106502685B CN201610934780.6A CN201610934780A CN106502685B CN 106502685 B CN106502685 B CN 106502685B CN 201610934780 A CN201610934780 A CN 201610934780A CN 106502685 B CN106502685 B CN 106502685B
Authority
CN
China
Prior art keywords
data
file
bundle
database
data bundle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610934780.6A
Other languages
Chinese (zh)
Other versions
CN106502685A (en
Inventor
孙向作
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Technology Group Co Ltd
Original Assignee
TCL Technology Group 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 TCL Technology Group Co Ltd filed Critical TCL Technology Group Co Ltd
Priority to CN201610934780.6A priority Critical patent/CN106502685B/en
Publication of CN106502685A publication Critical patent/CN106502685A/en
Application granted granted Critical
Publication of CN106502685B publication Critical patent/CN106502685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2329Optimistic concurrency control using versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a system for upgrading a database, which are characterized in that the version number of a configuration file of a data bundle file is obtained from a cloud end, whether the version number of the configuration file of the data bundle file in a local database is lower than the version number of a cloud end configuration file is judged, if yes, the data bundle file and the configuration file thereof are downloaded from the cloud end, data updating information is analyzed from the configuration file downloaded from the cloud end, and the local database is upgraded according to the downloaded data bundle file and the data updating information. The method and the system provided by the invention can realize the upgrading and updating of the database under the condition of not influencing the service because the application is divided into the data part and the service part and the coupling of the data part and the service part is reduced, thereby bringing convenience to the work of personnel.

Description

Method and system for upgrading database
Technical Field
The invention relates to the technical field of databases, in particular to a method and a system for upgrading a database.
Background
In the prior art, when the database is upgraded, when the requirements of adding a new table, updating fields in an old table and the like exist, the method can be realized only by modifying the original code database, recompiling and finally updating the apk, so that the method has the advantages of complex process, large workload, long manufacturing process and no contribution to long-term development of applications and software platforms.
Therefore, the prior art is subject to further improvement.
Disclosure of Invention
In view of the defects in the prior art, the invention aims to provide a method and a system for upgrading a database for a user, and overcomes the defects of complex operation process, large workload and low efficiency in the upgrading of the database in the prior art.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a method for upgrading a database is applied to an OSGI framework of an Android system, and comprises the following steps:
a, acquiring a configuration file version number of a data bundle file from a cloud;
b, judging whether the version number of the configuration file of the data bundle file in the local database is lower than the version number of the cloud configuration file, if so, executing the step C, and otherwise, finishing the operation;
c, downloading the data bundle file and the configuration file thereof from the cloud, and analyzing data updating information from the configuration file downloaded from the cloud;
and D, upgrading the local database according to the downloaded data bundle file and the data updating information.
The method for upgrading the database further comprises the following steps before the step A:
step A01, dividing the application into a data class and a service class according to logic, and compiling java files corresponding to the data class and java files corresponding to the service class into data bundle files and service bundle files respectively;
step A02, acquiring a BundleContext from an OSGI frame by the data bundle file and the service bundle file, and installing the data bundle file and the service bundle file by calling a BundleContext installation instruction;
and A03, acquiring the information of the installed data bundle file and the service bundle file, and simultaneously establishing a local database for the started data bundle file according to the name of the data bundle application package and the bundle ID returned by the installation of the data bundle file.
The method for upgrading the database, wherein the step D further comprises:
d1, unloading the bundle file with the same name as the data bundle file downloaded from the cloud in the local database, installing the data bundle file downloaded from the cloud and starting.
The method for upgrading the database, wherein the starting of the data bundle file in the step D1 includes the steps of:
step D11, judging whether the operation corresponding to the data updating information includes adding tables or/and updating table fields, if yes, executing step D12, and if yes, executing step D13;
step D12, obtaining the table name of the added table in the data updating information, obtaining the table field name according to the table name, and creating the table according to the table field name and the table name;
step D13, obtaining the table name of the added table field in the updated data information, obtaining the updated field name according to the table name, and updating the field in the table according to the table name;
and D14, executing the local database upgrading operation and updating the local database version number.
The method for upgrading the database, wherein the step a03 includes the steps of:
step A031, the business bundle inputs the preset parameter to the data bundle, starts the data bundle file and executes the function of the module corresponding to the data bundle file.
A system for upgrading a database, comprising:
the cloud data acquisition module is used for acquiring the configuration file version number of the data bundle file from a cloud; (ii) a
The version judgment module is used for judging whether the version number of the configuration file of the data bundle file in the local database is lower than the version number of the cloud configuration file;
the configuration analysis module is used for downloading the data bundle file and the configuration file thereof from the cloud end when the configuration file version number of the data bundle file in the local database is lower than the configuration file version number of the cloud end data bundle file, and analyzing data updating information from the configuration file downloaded from the cloud end;
and the database upgrading module is used for upgrading the local database according to the downloaded data bundle file and the data updating information.
The upgrading system of the database, wherein, the system also includes:
the application dividing module is used for dividing the application into a data class and a service class according to logic, and compiling java files corresponding to the data class and java files corresponding to the service class into data bundle files and service bundle files respectively;
the file installation module is used for acquiring the BundleContext from the OSGI frame by the data bundle file and the service bundle file, and installing the data bundle file and the service bundle file by calling a BundleContext installation instruction;
and establishing a database module for acquiring the information of the installed data bundle file and the service bundle file, and establishing a local database by the started data bundle file according to the name of the data bundle application package and the bundle ID returned by the installation of the data bundle file.
The system for upgrading the database, wherein the database upgrading module is further configured to: and unloading the bundle file with the same name as the data bundle file downloaded from the cloud in the local database, installing the data bundle file downloaded from the cloud and starting.
The upgrading system of the database, wherein, the database upgrading module includes:
the judging action unit is used for judging whether the operation corresponding to the data updating information comprises an addition table or/and an updating table field;
the table creating unit is used for acquiring the table name of the added table in the data updating information, acquiring the table field name according to the table name and creating the table according to the table field name and the table name;
the updating table field unit is used for acquiring the table name of the added table field in the updating data information, acquiring the updated field name according to the table name and updating the field in the table according to the table name;
and the updating database unit is used for executing the upgrading operation of the local database and updating the version number of the local database.
The system for upgrading the database comprises a file installation module and a file installation module, wherein the file installation module comprises a data bundle starting unit, and the data bundle starting unit is used for inputting preset parameters into a data bundle by a service bundle and starting the data bundle file to execute the function of a module corresponding to the data bundle file.
The method and the system for upgrading the database have the advantages that the version number of the configuration file of the data bundle file is obtained from the cloud end, whether the version number of the configuration file of the data bundle file in the local database is lower than the version number of the cloud end configuration file or not is judged, if yes, the data bundle file and the configuration file thereof are downloaded from the cloud end, data updating information is analyzed from the configuration file downloaded from the cloud end, and the local database is upgraded according to the downloaded data bundle file and the data updating information. The method and the system provided by the invention can realize the upgrading and updating of the database under the condition of not influencing the service because the application is divided into the data part and the service part and the coupling of the data part and the service part is reduced, thereby bringing convenience to the work of personnel.
Drawings
FIG. 1 is a flow chart of steps of a method for upgrading a database provided by the present invention.
FIG. 2 is a schematic diagram illustrating a principle of constructing a local database according to an embodiment of the method of the present invention.
Fig. 3 is a flow chart of the steps of an embodiment of the method of the present invention.
Fig. 4 is a schematic structural diagram of an upgrade system of a database provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The OSGI (open Service Gateway initiative) technology is a set of specifications for Java dynamic modular systems. OSGI refers on the one hand to the OSGI official alliance that maintains OSGI specifications and on the other hand to Java language based service (business) specifications maintained by the organization. In short, OSGi can be thought of as a modular layer of the Java platform.
The OSGI service platform provides Java with services that make Java the preferred environment for software integration and software development. Java provides portability to support products across multiple platforms. OSGI technology provides standardized primitives that allow applications to be built using refined, reusable, and collaboratable components. These components can be assembled into an application and deployment.
The OSGI service platform consists of two parts: OSGI framework and OSGI standard services. The OSGI framework is a runtime environment that implements and provides OSGI functionality, and OSGI standard services define many reusable APIs for performing common tasks. The specification of the OSGI framework and standard services is managed by the OSGI alliance. bundle is a module model in OSGi. The class file and the corresponding resource file are contained in the jar package of the standard Java platform, and the bundle can be simply understood as the jar package added with metadata. A bundle contains java class and some other data resources, such as HTML files, help documents, icons, etc.
The bundle can be understood as a function module from the user layer. A bundle can import and export from a project and can share jar files with other bundles in the project. The bundle provides services for the OSGi framework and is the only entity needing to be deployed in the OSGi service framework. Once a bundle starts running, it will provide functions and services to other bundles in the framework through the OSGi framework.
For convenience of description, the bundle is defined as: a modular physical unit contains code, resources and metadata in the form of jar files, where the boundaries of jar files also serve as encapsulation boundaries for the logical modules at execution time.
The method comprises the steps of dividing an application into a data bundle file and a service bundle file, starting the data bundle file through the service bundle file, and acquiring a configuration file of an upgraded version from a cloud end, thereby realizing the upgrading of the database.
As shown in fig. 1, the method for upgrading a database provided by the present invention is applied to an OSGI framework of an Android system, and includes the following steps:
and step S1, acquiring the configuration file version number of the data bundle file from the cloud.
When the system starts to upgrade the database, the data bundle file is started, the configuration file version number of the data bundle file stored in the cloud database is acquired from the cloud, and whether the upgrade operation is performed or not is judged by comparing the acquired version number with the configuration file version number of the data bundle file in the local database.
Specifically, in order to reduce the coupling between the data portion and the service portion in the local database, before this step, the local database is established through the following steps, which are described in conjunction with fig. 2 and include:
and step S01, dividing the application into a data class and a service class according to logic, and compiling the java file corresponding to the data class and the java file corresponding to the service class into a data bundle file and a service bundle file respectively.
Firstly, dividing the application into a data part and a service part according to logic, and compiling java files corresponding to the two parts respectively to obtain a data bundle file and a service bundle file corresponding to the data part.
Step S02, the data bundle file and the service bundle file acquire a bundle context in an OSGI frame, and the data bundle file and the service bundle file are installed by calling an installation instruction of the bundle context, wherein the installation instruction of the bundle context is realized by a function bundle context.
And step S03, acquiring the information of the installed data bundle file and the service bundle file, and simultaneously establishing a local database by the started data bundle file according to the name of the data bundle application package and the bundle ID returned by the installation of the data bundle file.
Because the established local database divides the application into a data part and a service part and calls each other through the bundle, the database can be upgraded according to the obtained update information of the data bundle file, and the condition that the database is upgraded by a method of revising codes and recompiling the last update apk is avoided.
And S2, judging whether the version number of the configuration file of the data bundle file in the local database is lower than that of the cloud configuration file, if so, executing the step S3, and otherwise, finishing the operation.
And comparing the version number of the configuration file acquired from the cloud with the version number of the local configuration file, and if the version number of the local configuration file is lower than that of the cloud, judging that the data bundle file in the local database is not the latest version, and performing further upgrading operation on the data bundle file. If the version numbers are the same, the upgrading operation is finished.
Step S3, downloading the data bundle file and the configuration file thereof from the cloud, and analyzing the data update information from the configuration file downloaded from the cloud.
If the upgrading operation is needed, downloading the latest version of the data bundle file and the configuration file thereof from the cloud, and analyzing whether the updated part in the new version of the data bundle file is added with a table or the table field in the old table from the configuration file.
And step S4, upgrading the local database according to the downloaded data bundle file and the data updating information.
And upgrading the database according to the data updating information analyzed from the downloaded data bundle file and the configuration file.
Specifically, the step S4 further includes:
and S41, unloading the bundle file with the same name as the data bundle file downloaded from the cloud in the local database, installing the data bundle file downloaded from the cloud and starting.
Since the latest version is downloaded, it is conceivable to delete the old version and perform the installation operation on the latest version.
In order to realize fast acquisition of data update information and database upgrade according to the acquired information, the starting of the data bundle file in step S41 includes the steps of:
step S411, determining whether the operation corresponding to the data update information includes adding a table or/and updating a table field, if the operation includes adding a table, performing step S412, and if the operation includes updating a table field, performing step S413;
step S412, acquiring a table name of an addition table in the data updating information, acquiring a table field name according to the table name, and creating a table according to the table field name and the table name;
step S413, acquiring a table name of an added table field in the updated data information, acquiring an updated field name according to the table name, and updating a field in the table according to the table name;
and step S414, executing the upgrading operation of the local database, and updating the version number of the local database.
Specifically, the protocol for mutual calling between the service bundle file and the data bundle file is as follows:
the data bundle file provides four interfaces for the service bundle file to access data in the database, wherein the service bundle inputs preset parameters to the data bundle, and the data bundle is started to execute a function corresponding to the bundle module. And after the data bundle file is started, establishing a database according to the table name and the table structure. Here, the interface protocol includes an input section and an output section. The input part defines parameters to be input into the data bundle module by the service bundle, such as input parameters uri, query conditions, query result data sorting mode and the like. The output part defines the result of the data bundle returned to the business part.
The add data interface can be defined as follows:
boolean insert(Uri uri, ContentValues values)
the method is used for the business part to add data to the database. If successful, return true, otherwise, return false. Values are data that needs to be added.
The delete data interface may be defined as follows:
boolean delete (Uri, String selection, String [ ] SelectionArgs) this method is used by the business segment to delete data from the database. If successful, return true, otherwise, return false. The selection and selectorArgs parameters are set conditions.
The update data interface may be defined as follows:
boolean update(Uri uri, ContentValues values, String selection,String[]selectionArgs)
the method is used for updating data in the database by the business part. If successful, return true, otherwise, return false. Values are data that needs to be updated. The selection and selectorArgs parameters are set conditions.
The query data interface may be defined as follows:
cursor query (Uri, String [ ] project, String selection, String [ ] selection arms, String sortOrder) this method is used for the business part to get data from the database. If the query is successful, returning the data to be queried, otherwise, returning null. The uri parameter is in the uri. parse ("content://" + AUTHORITY + "/items") format, AUTHORITY and items being available from the data bundle configuration file. The selection parameter is a setting condition. The project parameter is the column to be returned by the numeric control of the database query. The selection and selectorArgs parameters are set conditions. The sortOrder parameter is the manner in which results are returned in order.
The method comprises the following steps of starting an application in an Android system embedded with an OSGI framework:
1. and acquiring the OSGI frame example through a proxy GetFrameworkServiceProxy of the GetFrameworkService service. Such as the getframeworklnstance () method.
2. Getboundlecontext () method obtains the BundleContext by calling framework.
3. Install the bundle file by calling the bundle context (String location) method until all the bundle files are installed. Wherein the parameter location is the bundle file storage path. When the installation is successful, the Bundle ID (Bundle Identifier) of the installed Bundle is returned. Bundle ID is the most common identifier used at runtime. It is a long integer number automatically assigned by the OSGI framework that does not change throughout the Bundle lifecycle (including after Bundle update, uninstall) and even remains after the OSGI framework is restarted. The Bundle ID is distributed from small to large by the OSGI framework in the Bundle installation process according to the sequence of Bundle installation time. The ID of the current Bundle can be obtained through the getBundleId () method of the Bundle interface.
And 4, acquiring the ID of the current Bundle by calling a getBundleid () method of the Bundle successfully returned by installation. And respectively acquiring the symbol name and the version number of the Bundle by calling the getSymbolincName () method and getVersion () method of the Bundle
5. And establishing a database to store each bundle ID, the bundle file packet name, the symbolic name version number of the bundle, the Import-Package and the Export-Package attributes.
6. Start () method starts the bundle file.
7. And if the version number of the local configuration file is not lower than the version number of the configuration file acquired by the cloud end, the application is normally carried out, otherwise, the function of the updating module is executed.
After the above setting, as shown in fig. 3, when the upgrade operation of the database is implemented, the method includes the following steps:
step H1, obtaining a cloud configuration file, where a specific configuration file format of the data bundle file is as follows:
data bundle configuration file:
configuration file version number:
action:
adding a new table add _ newTableName:
new table 1: table field 1, table field 2, …, table field n,
new table 2: table field 1, table field 2, …, table field n,
new table n: table field 1, table field 2, …, table field n,
add table field add _ tableName _ newSeg:
old table 1: table field 1, table field 2, …, table field n,
old table 2: table field 1, table field 2, …, table field n,
old table n: table field 1, table field 2, …, table field n,
step H2, judging whether the version number of the local configuration file is lower than the version number of the cloud configuration file, if so, executing step H3, otherwise, ending;
step H3, updating the version number of the local configuration file;
step H4, downloading a new data bundle file according to the url address in the configuration file;
step H5, analyzing the configuration file;
step H6, determine if the action is to add a table or add a table field, if the action in the configuration file is to add a table: if add _ newTableName, go to step H7, if the action in the configuration file is to add table field add _ tableName _ newSeg, go to step 12, otherwise end;
step H7, acquiring the added table name from the configuration file;
step H8, obtaining the table field name from the configuration file according to the added table name;
step H9, creating the table according to the table field name and the table name;
step H10, performing database upgrading operation;
step H11, updating the database version number, and jumping to step 16;
step H12, obtaining the table name of the updated table field from the configuration file;
step H13, acquiring the field name to be updated of the table according to the table name in the step;
step H14, updating the fields in the table according to the table name, and jumping to step H10;
and H15, ending.
The method is applied to Android intelligent equipment, and the coupling between the data part and the service part is reduced by dividing the application into the data part and the service part, so that the upgrading and updating of the database can be easily realized only by acquiring the data bundle file and the configuration file thereof from the cloud, and convenience is brought to the work of personnel.
On the premise of the above method, the present invention further provides a system for upgrading a database, as shown in fig. 4, including:
the cloud data acquisition module 100 is configured to acquire a configuration file version number of a data bundle file from a cloud; the function of which is as described in step S1.
The version judgment module 200 is used for judging whether the version number of the configuration file of the data bundle file in the local database is lower than the version number of the cloud configuration file; the function of which is as described in step S2.
The configuration analysis module 300 is configured to download the data bundle file and the configuration file thereof from the cloud when the configuration file version number of the data bundle file in the local database is lower than the configuration file version number of the cloud data bundle file, and analyze data update information from the configuration file downloaded from the cloud; the function of which is as described in step S3.
And the database upgrading module 400 is configured to upgrade the local database according to the downloaded data bundle file and the data updating information. The function of which is as described in step S4.
The system further comprises:
the application dividing module is used for dividing the application into a data class and a service class according to logic, and compiling java files corresponding to the data class and java files corresponding to the service class into data bundle files and service bundle files respectively;
the file installation module is used for acquiring the BundleContext from the OSGI frame by the data bundle file and the service bundle file, and installing the data bundle file and the service bundle file by calling a BundleContext installation instruction;
and establishing a database module for acquiring the information of the installed data bundle file and the service bundle file, and establishing a local database by the started data bundle file according to the name of the data bundle application package and the bundle ID returned by the installation of the data bundle file.
The database upgrade module is further configured to: and unloading the bundle file with the same name as the data bundle file downloaded from the cloud in the local database, installing the data bundle file downloaded from the cloud and starting.
The database upgrading module comprises:
the judging action unit is used for judging whether the operation corresponding to the data updating information comprises an addition table or/and an updating table field;
the table creating unit is used for acquiring the table name of the added table in the data updating information, acquiring the table field name according to the table name and creating the table according to the table field name and the table name;
the updating table field unit is used for acquiring the table name of the added table field in the updating data information, acquiring the updated field name according to the table name and updating the field in the table according to the table name;
and the updating database unit is used for executing the upgrading operation of the local database and updating the version number of the local database.
The file installation module comprises a data bundle starting unit, wherein the data bundle starting unit is used for inputting preset parameters to a data bundle by a service bundle and starting the data bundle file to execute the function of a module corresponding to the data bundle file.
The invention provides a method and a system for upgrading a database, which are characterized in that the version number of a configuration file of a data bundle file is obtained from a cloud end, whether the version number of the configuration file of the data bundle file in a local database is lower than the version number of a cloud end configuration file is judged, if yes, the data bundle file and the configuration file thereof are downloaded from the cloud end, data updating information is analyzed from the configuration file downloaded from the cloud end, and the local database is upgraded according to the downloaded data bundle file and the data updating information. The method and the system provided by the invention can realize the upgrading and updating of the database under the condition of not influencing the service because the application is divided into the data part and the service part and the coupling of the data part and the service part is reduced, thereby bringing convenience to the work of personnel.
It should be understood that equivalents and modifications of the technical solution and inventive concept thereof may occur to those skilled in the art, and all such modifications and alterations should fall within the scope of the appended claims.

Claims (8)

1. The method for upgrading the database is applied to an OSGI framework of an Android system, and comprises the following steps of:
a, acquiring a configuration file version number of a data bundle file from a cloud;
b, judging whether the version number of the configuration file of the data bundle file in the local database is lower than the version number of the cloud configuration file, if so, executing the step C, and otherwise, finishing the operation;
c, downloading the data bundle file and the configuration file thereof from the cloud, and analyzing data updating information from the configuration file downloaded from the cloud;
d, upgrading the local database according to the downloaded data bundle file and the data updating information;
the step A is also preceded by:
step A01, dividing the application into a data class and a service class according to logic, and compiling java files corresponding to the data class and java files corresponding to the service class into data bundle files and service bundle files respectively;
step A02, acquiring a BundleContext from an OSGI frame by the data bundle file and the service bundle file, and installing the data bundle file and the service bundle file by calling a BundleContext installation instruction;
step A03, acquiring information of the installed data bundle file and the service bundle file, and simultaneously establishing a local database for the started data bundle file according to the name of the data bundle application package and the bundle ID returned by the installation of the data bundle file;
and after the data bundle file is started, establishing a local database according to the table name and the table structure.
2. The method for upgrading a database according to claim 1, wherein the step D further comprises:
d1, unloading the bundle file with the same name as the data bundle file downloaded from the cloud in the local database, installing the data bundle file downloaded from the cloud and starting.
3. The method for upgrading a database according to claim 2, wherein the step D1 of starting the data bundle file includes the steps of:
step D11, judging whether the operation corresponding to the data updating information includes adding tables or/and updating table fields, if yes, executing step D12, and if yes, executing step D13;
step D12, obtaining the table name of the added table in the data updating information, obtaining the table field name according to the table name, and creating the table according to the table field name and the table name;
step D13, obtaining the table name of the added table field in the updated data information, obtaining the updated field name according to the table name, and updating the field in the table according to the table name;
and D14, executing the local database upgrading operation and updating the local database version number.
4. The method for upgrading a database according to claim 1, wherein the step a03 includes the steps of:
step A031, the business bundle inputs the preset parameter to the data bundle, starts the data bundle file and executes the function of the module corresponding to the data bundle file.
5. A system for upgrading a database, comprising:
the cloud data acquisition module is used for acquiring the configuration file version number of the data bundle file from a cloud;
the version judgment module is used for judging whether the version number of the configuration file of the data bundle file in the local database is lower than the version number of the cloud configuration file;
the configuration analysis module is used for downloading the data bundle file and the configuration file thereof from the cloud end when the configuration file version number of the data bundle file in the local database is lower than the configuration file version number of the cloud end data bundle file, and analyzing data updating information from the configuration file downloaded from the cloud end;
the database upgrading module is used for upgrading a local database according to the downloaded data bundle file and the data updating information;
the system further comprises:
the application dividing module is used for dividing the application into a data class and a service class according to logic, and compiling java files corresponding to the data class and java files corresponding to the service class into data bundle files and service bundle files respectively;
the file installation module is used for acquiring the BundleContext from the OSGI frame by the data bundle file and the service bundle file, and installing the data bundle file and the service bundle file by calling a BundleContext installation instruction;
establishing a database module for acquiring information of the installed data bundle file and the service bundle file, and establishing a local database for the started data bundle file according to the name of the data bundle application package and the bundle ID returned by the installation of the data bundle file;
and after the data bundle file is started, establishing a local database according to the table name and the table structure.
6. The system for upgrading a database according to claim 5, wherein the database upgrading module is further configured to: and unloading the bundle file with the same name as the data bundle file downloaded from the cloud in the local database, installing the data bundle file downloaded from the cloud and starting.
7. The system for upgrading a database according to claim 6, wherein the database upgrading module comprises:
the judging action unit is used for judging whether the operation corresponding to the data updating information comprises an addition table or/and an updating table field;
the table creating unit is used for acquiring the table name of the added table in the data updating information, acquiring the table field name according to the table name and creating the table according to the table field name and the table name;
the updating table field unit is used for acquiring the table name of the added table field in the updating data information, acquiring the updated field name according to the table name and updating the field in the table according to the table name;
and the updating database unit is used for executing the upgrading operation of the local database and updating the version number of the local database.
8. The system for upgrading a database according to claim 6, wherein the installing the file module comprises:
and the data bundle starting unit is used for inputting preset parameters to the data bundle by the service bundle and starting the data bundle file to execute the function of the module corresponding to the data bundle file.
CN201610934780.6A 2016-11-01 2016-11-01 Method and system for upgrading database Active CN106502685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610934780.6A CN106502685B (en) 2016-11-01 2016-11-01 Method and system for upgrading database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610934780.6A CN106502685B (en) 2016-11-01 2016-11-01 Method and system for upgrading database

Publications (2)

Publication Number Publication Date
CN106502685A CN106502685A (en) 2017-03-15
CN106502685B true CN106502685B (en) 2020-10-27

Family

ID=58320029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610934780.6A Active CN106502685B (en) 2016-11-01 2016-11-01 Method and system for upgrading database

Country Status (1)

Country Link
CN (1) CN106502685B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240733A (en) * 2017-07-03 2019-01-18 Tcl集团股份有限公司 A kind of method and terminal updating advertisement SDK based on Android system
CN107391216A (en) * 2017-09-26 2017-11-24 郑州云海信息技术有限公司 A kind of method for upgrading software and device
CN108614868B (en) * 2018-04-16 2021-09-17 北京酷我科技有限公司 Automatic database upgrading method
CN111399940A (en) * 2020-03-12 2020-07-10 深圳创维-Rgb电子有限公司 Data processing method of intelligent system, storage medium and intelligent terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6553391B1 (en) * 2000-06-08 2003-04-22 International Business Machines Corporation System and method for replicating external files and database metadata pertaining thereto
CN105511902A (en) * 2015-11-09 2016-04-20 Tcl集团股份有限公司 Android platform module dynamic loading method and system
CN105657191A (en) * 2016-03-29 2016-06-08 Tcl集团股份有限公司 Application increment upgrading method and system based on Android system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329685B (en) * 2008-07-30 2011-05-04 烽火通信科技股份有限公司 Implementing method of memory database on household gateway
CN103577474B (en) * 2012-08-03 2017-06-09 阿里巴巴集团控股有限公司 The update method and system of a kind of database
CN103995854A (en) * 2014-05-13 2014-08-20 大唐移动通信设备有限公司 Equipment cross-version upgrading method and device
CN105867947B (en) * 2016-04-25 2019-03-26 青岛海信电器股份有限公司 Data processing method and device after preset application program updating

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6553391B1 (en) * 2000-06-08 2003-04-22 International Business Machines Corporation System and method for replicating external files and database metadata pertaining thereto
CN105511902A (en) * 2015-11-09 2016-04-20 Tcl集团股份有限公司 Android platform module dynamic loading method and system
CN105657191A (en) * 2016-03-29 2016-06-08 Tcl集团股份有限公司 Application increment upgrading method and system based on Android system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"sql 创建表、删除表 增加字段 删除字段操作;碎碎念岁岁恋;《https://www.cnblogs.com/wuchaofan1993/p/5833526.html》;20160902;第1-3页 *

Also Published As

Publication number Publication date
CN106502685A (en) 2017-03-15

Similar Documents

Publication Publication Date Title
CN105657191B (en) Application increment upgrading method and system based on Android system
CN110912724B (en) Parameter-driven automatic service arrangement method and device
CN106502685B (en) Method and system for upgrading database
KR101831430B1 (en) Apparatus and method for infrastructure automation
CN108388445B (en) Continuous integration method based on 'platform + application' mode
US9535663B2 (en) Pattern-based construction and extension of enterprise applications in a cloud computing environment
US9652214B1 (en) Pluggable extension of software applications
US7069553B2 (en) Universal deployment tool
CN106569880B (en) Method and system for dynamically sharing resources between Android applications
KR100903999B1 (en) System and method for operating domain profile using database in a core framework for SDR mobile terminals
US20040205709A1 (en) Method,system, and program for providing patch expressions used in determining whether to install a patch
JP5542796B2 (en) Method and apparatus for managing mobile device software
CN105516154B (en) Security policy configuration method and device applied to SEAndroid system
CN111857801B (en) Construction method of mobile application
CN105373406B (en) Application layout dynamic switching method and system based on Android platform
CN111068328A (en) Game advertisement configuration table generation method, terminal device and medium
CN110795139A (en) Client batch packaging method and device, computer equipment and storage medium
CN106484452B (en) unified configuration management method and device for software platform
CN109240733A (en) A kind of method and terminal updating advertisement SDK based on Android system
WO2017185883A1 (en) Dynamic expansion software-process method and system
CN115794214A (en) Application module metadata management method, device, storage medium and device
CN116680003A (en) Front-end plug-in system
CN115857898A (en) Application system construction and operation method and device
US20220164207A1 (en) System for providing an adaptable plugin framework for application transformation to cloud
CN109697076A (en) A kind of dynamic updating method of application software resources, device and equipment

Legal Events

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

Address after: 516006 TCL technology building, No.17, Huifeng Third Road, Zhongkai high tech Zone, Huizhou City, Guangdong Province

Applicant after: TCL Technology Group Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. nineteen District

Applicant before: TCL RESEARCH AMERICA Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant