CN103995854A - Equipment cross-version upgrading method and device - Google Patents

Equipment cross-version upgrading method and device Download PDF

Info

Publication number
CN103995854A
CN103995854A CN201410201310.XA CN201410201310A CN103995854A CN 103995854 A CN103995854 A CN 103995854A CN 201410201310 A CN201410201310 A CN 201410201310A CN 103995854 A CN103995854 A CN 103995854A
Authority
CN
China
Prior art keywords
data
tables
redaction
database file
list structure
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
CN201410201310.XA
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.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201410201310.XA priority Critical patent/CN103995854A/en
Publication of CN103995854A publication Critical patent/CN103995854A/en
Pending legal-status Critical Current

Links

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an equipment cross-version upgrading method and device. The method comprises the following steps that a first database file corresponding to an older-version data table in a database is generated; new-version software runs, a new-version data table corresponding to the new-version software is established in the database, and operation on the new-version data table is received in real time; a second database file corresponding to the new-version data table is generated; table structural information stored in the first database file and table structural information stored in the second database file are compared to obtain table structural difference information; data in the new-version data table are generated according to the table structural difference information and data in the older-version data table in the first database file; the data in the generated new-version data table are imported into the new-version data table. According to the equipment cross-version upgrading method and device, the data generated in the upgrading process can be inherited in real time, version upgrading in equipment is further achieved, and the redundant version upgrading processing procedure is avoided.

Description

A kind of equipment cross-version upgrade method and device
Technical field
The present invention relates to communication technical field, particularly relate to a kind of equipment cross-version upgrade method and device.
Background technology
Telecommunication apparatus cross-version upgrading based on embedded Mysql database, is divided into version download, upgrading task structure and three processes of edition upgrading substantially.Wherein, edition upgrading process is divided into software release upgrade and two parts of data upgrading.When cross-version is upgraded, data list structure in Mysql database can change before and after upgrading, and as large databases such as Oracle, there is auto-update function because Mysql database does not possess, therefore, embedded device carries out to data in Mysql database the difficult point that cross-version upgrading is data upgrading.
The cross-version data updating method of existing two kinds of telecommunication apparatus based on embedded Mysql database is as follows:
A kind of is manual manufacture data method, the artificial Mysql database client that uses is derived edition data file to be upgraded, according to the data list structure of redaction, the data file to be upgraded deriving is modified, be made into the data file that meets redaction data list structure.Amended data file is bundled in final upgraded version bag, and now, final upgraded version bag comprises software version and data file.Then, according to basic upgrading flow process, telecommunication apparatus is upgraded.
Another kind is temporary table transition method, even by the data list structure difference before and after tool analysis upgrading, the tables of data difference of analyzing out is partly generated to difference temporary table and import in database as transition; The instrument that re-uses is finally combined as data list structure and the data after upgrading tables of data and the relevant data of the unconverted tables of data of list structure and list structure variation.
Existing manual manufacture data method, on the one hand, due to needs manually to data list structure in Mysql database according to upgrading after data list structure carry out off-line modification, so efficiency low, easily make mistakes.On the other hand, owing to being that off-line carries out to the modification of data list structure, and now, telecommunication apparatus is still in operation, will cause so the dynamic data of the generation in telecommunication apparatus operational process to hold at the data relay of revising, thereby cause dynamic data loss.
Although and temporary table transition method has been liberated manpower by use instrument, make moderate progress than manual manufacture data efficiency, because difference temporary table is to be got by tool analysis, so software version does not support difference temporary table to carry out associative operation.Before this just makes redaction data upgrade, new software version cannot dynamically be controlled the tables of data information in database, and the data that generate so during this period just cannot be inherited, and equally also can cause dynamic data loss.Besides, temporary table transition method needs artificially data message to be derived, and by the data importing after combination, can not complete in telecommunication apparatus inside, brings unnecessary treatment scheme.
Summary of the invention
The invention provides a kind of device version upgrade method and device, to solve in existing edition upgrading process, the dynamic data loss of existence and can not complete at device interior the problem of edition upgrading.
In order to address the above problem, the invention discloses a kind of equipment cross-version upgrade method, comprise: generate first database file corresponding with legacy data table in database, wherein, described legacy data table is the tables of data corresponding to legacy version software, described the first database file comprises: the list structure information of described legacy data table, and the data in described legacy data table; Operation new version software, and in described database, create the redaction tables of data corresponding with described new version software, receive in real time the operation to described redaction tables of data; Generate second database file corresponding with described redaction tables of data, wherein, described the second database file comprises: the list structure information of described redaction tables of data; The list structure information of storing in described the first database file and described the second database file is compared, obtain list structure different information; Data according in the described legacy data table in described list structure different information and described the first database file, generate the data in described redaction tables of data; By redaction tables of data described in the data importing in the described redaction tables of data generating.
Preferably, described the list structure information of storing in described the first database file and described the second database file is compared, obtaining list structure different information step comprises: line by line the list structure information of each corresponding tables of data of storing in described the first database file and described the second database file is compared, obtain the list structure difference of each tables of data.
Preferably, data in described legacy data table in the described list structure different information of described foundation and described the first database file, the data step generating in described redaction tables of data comprises: according to the list structure difference of described each tables of data obtaining, in described the first database file, data corresponding to list structure part that do not change in each legacy data table, with set, default data corresponding to the generation list structure changing unit of described each tables of data, in described the second database file, generate the data in described redaction tables of data.
Preferably, described redaction tables of data step described in data importing in the described redaction tables of data generating is comprised: the data in the described redaction tables of data in using described the second database file, when importing data in described redaction tables of data, word for word section judges under field to be imported in described redaction tables of data, whether to have stored data one by one; If store, abandon the importing of this field; If not storage, by redaction tables of data described in the data importing of this Related fields.
Preferably, described the first database file and described the second database file are SQL file; List structure information and date unpack storage in described the first database file and described the second database file.
In order to address the above problem, the invention also discloses a kind of equipment cross-version update device, comprise: the first file generating module, for generating first database file corresponding with the legacy data table of database, wherein, described legacy data table is the tables of data corresponding to legacy version software, and described the first database file comprises: the list structure information of described legacy data table, and the data in described legacy data table; Creation module for moving new version software, and creates the redaction tables of data corresponding with described new version software in described database, receives in real time the operation to described redaction tables of data; The second file generating module, for generating second database file corresponding with described redaction tables of data, wherein, described the second database file comprises: the list structure information of described redaction tables of data; Comparing module, compares for the list structure information that described the first database file and described the second database file are stored, and obtains list structure different information; Data generation module, the data in the described legacy data table according to described list structure different information and described the first database file, generate the data in described redaction tables of data; Data importing module, for by redaction tables of data described in the data importing of the described redaction tables of data generating.
Preferably, described comparing module is compared to the list structure information of storing in described the first database file and described the second database file, while obtaining list structure different information, line by line the list structure information of each corresponding tables of data of storing in described the first database file and described the second database file is compared, obtain the list structure difference of each tables of data.
Preferably, described data generation module is according to the data in the described legacy data table in described list structure different information and described the first database file, while generating the data in described redaction tables of data: according to the list structure difference of described each tables of data obtaining, in described the first database file, data corresponding to list structure part that do not change in each legacy data table, with set, default data corresponding to the generation list structure changing unit of described each tables of data, in described the second database file, generate the data in described redaction tables of data.
Preferably, described data importing module is by described in the data importing in the described redaction tables of data generating during redaction tables of data: the data in the described redaction tables of data in using described the second database file, when importing data in described redaction tables of data, word for word section judges under field to be imported in described redaction tables of data, whether to have stored data one by one; If store, abandon the importing of this field; If not storage, by redaction tables of data described in the data importing of this Related fields.
Preferably, described the first database file and described the second database file are SQL file; List structure information and date unpack storage in described the first database file and described the second database file.
Compared with prior art, the present invention has the following advantages:
Equipment cross-version upgrading scheme provided by the invention, in the process of the data in generating redaction tables of data, new version software just can operate redaction tables of data, and the data that in real time software systems of equipment in escalation process produced are written in tables of data.Therefore, by equipment cross-version upgrading scheme provided by the invention, can effectively avoid existing equipment cross-version upgrading scheme in redaction data escalation process, to tables of data, to control, thereby the data that generate during the data of bringing upgrading cannot be inherited the problem that causes dynamic loss.Simultaneously, equipment cross-version upgrading scheme provided by the invention generates the data in redaction tables of data at device interior according to two database files, without picture upgrading scheme of the prior art, need manually by data importing, derivation, realize the edition upgrading of device interior, avoided unnecessary edition upgrading treatment scheme.
Accompanying drawing explanation
Fig. 1 is according to the flow chart of steps of a kind of equipment cross-version upgrade method of the embodiment of the present invention one;
Fig. 2 is according to the flow chart of steps of a kind of equipment cross-version upgrade method of the embodiment of the present invention two;
Fig. 3 is according to the flow chart of steps of a kind of equipment cross-version upgrade method of the embodiment of the present invention three;
Fig. 4 is according to the structured flowchart of a kind of equipment cross-version update device of the embodiment of the present invention four.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
Embodiment mono-
With reference to Fig. 1, show according to the flow chart of steps of a kind of equipment cross-version upgrade method of the embodiment of the present invention one.
The step of the equipment cross-version upgrade method of the present embodiment comprises:
Step S102: server generates first database file corresponding with legacy data table in database.
Wherein, legacy data table is the tables of data corresponding to legacy version software, and the first database file comprises: the list structure information of legacy data table, and the data in legacy data table.As, the pass key table that legacy version software is corresponding, and some non-key tables.Wherein, close key table as facility information allocation list, alarm configurations table etc., these close key tables for storing the attribute information of legacy version, and non-key table is for some related datas of memory device user.The first database file can be the file of the form that database is supported arbitrarily.For example: server can generate SQL (Structured Query Language, Structured Query Language (SQL)) file by Linux Shell script, can also be the database file of the extended formatting that generates by instrument.
Step S104: server operation new version software, and in database, create the redaction tables of data corresponding with new version software, receive in real time the operation to redaction tables of data.
After the legacy data table in database is generated to the first database file, database is emptied, then move new version software.And then call new version software and in database, create redaction tables of data.It should be noted that, in the present embodiment, database is emptied, is only a kind of feasible program so that establishment redaction tables of data space to be provided.When concrete operations, be not limited to this, those skilled in the art can set corresponding alternate manner according to the actual requirements, as, the legacy data table in database and data are moved and deposited, so that the space that creates redaction tables of data to be provided; For another example, use the redaction tables of data creating that the legacy data table in database is directly covered etc.
Once now redaction tables of data creates successfully, new version software just can operate redaction tables of data, the data that in real time software systems of equipment in escalation process produced are written in tables of data, for example: the warning information that software systems in escalation process are reported writes in redaction tables of data.
Step S106: server generates second database file corresponding with redaction tables of data.
Wherein, the second database file comprises: the list structure information of redaction tables of data, the second database file is identical with the first database file form, as is .sql file.
Step S108: server is compared to the list structure information of storing in the first database file and the second database file, obtains list structure different information.
For example: in the first data file, storing table name is the list structure information of three Geju City tables of data of A, B and C, in the second database file, containing table name is the list structure information of three new data tables of A, B and C.So when two database files are compared, old Table A and the list structure information of new Table A are compared, compare out the list structure difference of new and old Table A, same principle is compared out the new and old table list structure difference of B and the list structure difference of new and old table C, finally obtains the list structure difference of all tables of data.
Step S110: server, according to the data in the legacy data table in list structure different information and the first database file, generates the data in redaction tables of data.
Owing to having there is variation in the list structure of tables of data, for example tables of data A equally, new and old tables of data is compared new data table and on the basis of legacy data table, has been deleted a field, so when generating data corresponding to new data Table A, just the data of this Related fields of deleting need to be deleted, other is revised as increases field etc. also similarly, thereby generates data corresponding to all redaction tables of data.
Step S112: server is by the data importing redaction tables of data in the redaction tables of data generating.
It should be noted that, above-mentioned steps S202 all can adopt arbitrarily suitable implementation to realize by those skilled in the art to step S112, as, by server, by calling Linux Shell script, realized.But be not limited to this, other Languages script and implementation are applicable too.
The equipment cross-version upgrade method providing by the present embodiment, in the process of the data in generating redaction tables of data, new version software just can operate redaction tables of data, and the data that in real time software systems of equipment in escalation process produced are written in tables of data.Therefore, the equipment cross-version upgrade method providing by the present embodiment, can effectively avoid existing equipment cross-version upgrade method in redaction data escalation process, to tables of data, to control, thereby the data that generate during the data of bringing upgrading cannot be inherited the problem that causes dynamic loss.Simultaneously, the equipment cross-version upgrade method that the present embodiment provides generates the data in redaction tables of data at device interior according to two database files, without picture upgrade method of the prior art, need manually by data importing, derivation, realize the edition upgrading of device interior, avoided unnecessary edition upgrading treatment scheme.
Embodiment bis-
With reference to Fig. 2, show according to the flow chart of steps of a kind of equipment cross-version upgrade method of the embodiment of the present invention two.
The equipment cross-version upgrade method concrete steps of the present embodiment comprise:
Step S202: server calls shell script generates first database file corresponding with legacy data table in database.
Wherein, legacy data table is the tables of data corresponding to legacy version software, and the first database file comprises: the list structure information of legacy data table, and the data in legacy data table.
The first database file in the present embodiment is SQL file, in the present embodiment this SQL file is designated as to a SQL file, and in the present embodiment, server generates the first SQL file by calling Linux Shell script by the legacy data table of storing in database.
While converting the legacy data table information in database to a SQL file, the unpack of list structure information and date can be stored, the i.e. list structure information of each tables of data in first stored data base in a SQL file, after the list structure information of all tables of data has all been stored, store again data message corresponding to each tables of data, the list structure information that the SQL file first half content generating is like this tables of data, the data message that latter half content is tables of data.Adopt such file layout, be more convenient for the list structure difference of tables of data to compare.
In addition, while converting the legacy data table information in database to a SQL file, can also be by list structure information and date information interleaved, stored after the list structure information of A tables of data, and then store the data of A tables of data, after the data of complete A tables of data to be stored, store again the list structure information of B tables of data.Adopt such file layout, can obtain more intuitively the list structure of data message corresponding to each tables of data and tables of data.It should be noted that, except the above-mentioned file layout of enumerating, those skilled in the art can also arrange the file layout of list structure information and date information in a SQL file according to the actual requirements, and the application does not do concrete restriction to this.
The list structure information and date unpack storage of the legacy data table of storing in the SQL file in the present embodiment.Suppose that legacy data table is A, B and C, what in a SQL file, first half was stored so is the list structure information of legacy data Table A, B and C, and in a SQL file, latter half storage is the data message of legacy data Table A, B and C.
Step S204: server calls script program operation new version software, and in database, create the redaction tables of data corresponding with new version software, receive in real time the operation to redaction tables of data.
Server calls script program operation new version software, now new version software receives in real time and to the operation of redaction tables of data can be: in database, generate after redaction tables of data, new version software just can operate redaction tables of data, for example: in redaction tables of data, record a warning information, and operate again after needn't waiting for the data importing of legacy data table, thereby avoided the dynamic loss of data.
Step S206: server calls shell script generates second database file corresponding with redaction tables of data.
Wherein, the second database file comprises: the list structure information of redaction tables of data, preferably, the second database file can also comprise the default data that each tables of data is corresponding.In the present embodiment, the second database file is still a SQL file, be designated as the 2nd SQL file, data message in data list structure information and date table in the 2nd SQL file, also separately storage as the data message in the data list structure information and date table of storing in the SQL file generating in step S202.Suppose that redaction tables of data comprises tables of data A, B, C and D, in the 2nd SQL file generating so, first half stores the list structure information of redaction tables of data A, B, C and D, and in the 2nd SQL file, latter half stores redaction tables of data A, B, C and default data corresponding to D.
Take new field as example, when calling new version software create the redaction tables of data corresponding with new version software in database by shell script, both generated the list structure of redaction tables of data, generate again the default data that each tables of data new field is corresponding.Wherein, default data can be the data of example, for example: in tables of data, have a field for " geographic position ", so under this field to there being a default data " Beijing ", when user just can understand that by this default data the required geographical location information of filling in is city title when filling in this field information.Certainly, also can only generate the list structure of redaction tables of data, and tables of data new field is put sky.
Step S208: server calls shell script is compared to the list structure information of each corresponding tables of data of storing in the first database file and the second database file line by line, obtains the list structure difference of each tables of data.
In the present embodiment, server calls shell script is after all generating legacy data table, redaction tables of data corresponding a SQL file and the 2nd SQL file, information in two SQL files that generate is compared, to obtain the list structure difference of each tables of data.In when comparison, by the list structure information of the legacy data Table A of storing in a SQL file, with the 2nd SQL file in the list structure information of the redaction tables of data A that stores compare.When comparison this partial information is compared line by line, when comparison, if find the list structure information of list structure information older version tables of data A of redaction tables of data A many row, the list structure information of this row correspondence so just this being had more is as the list structure difference of tables of data A.In same comparison mode, obtain the list structure difference of each tables of data.
In the present embodiment, owing to being that information in two SQL files is compared line by line, therefore can directly at device interior, by Shell script, realize.Compare in existing scheme, need to compare list structure difference new, legacy data table in device external, data corresponding to regeneration new data table after complete difference to be compared, then by new data table and data importing database, more save manpower, also avoided the treatment scheme of importing, derived data simultaneously.
It should be noted that, above-mentioned cited be only certain field structure in tables of data situation while changing, when redaction tables of data older version tables of data has increased tables of data D newly, owing to there not being tables of data D in legacy data table, the whole data list structure information of so newly-increased tables of data D is just as the list structure difference of this tables of data.For example: the new version software starting by shell script has generated an AIT that is directed to new software version, as alarm configurations table, and this tables of data does not exist in legacy data table, has now just increased new tables of data.Except increasing the situation of table, the same situation of tables of data or the situation that the field information in tables of data changes of deleting that exist also, no matter above-mentioned which kind of situation, all can compare out by comparing two SQL files the list structure difference of each tables of data.Wherein, delete tables of data and refer to that redaction tables of data older version tables of data has lacked a data Table A, now, record lacks tables of data A, so when generating redaction tables of data information, can be in the 2nd SQL file the data of generated data Table A.And the situation that field information changes, be equal to and delete an a field information newly-increased field information simultaneously, field information for example changes: the field information that first row is corresponding in tables of data A is " name ", and the field information of these row is " age " in newly-generated tables of data A, that is to say that so newly-generated tables of data A compares the variation that field information has occurred old tables of data A, when processing, can think that newly-generated tables of data A has deleted field information " name " and increased field information " age " newly with respect to legacy data Table A.
Step S210: server calls shell script is according to the list structure difference of each tables of data obtaining, in conjunction with in the first database file, data corresponding to the list structure that do not change in each legacy data table part, with set, corresponding to the default data of the generation list structure changing unit of each tables of data, in the second database file, generate the data in redaction tables of data.
For example: in step S208, compared the edition data table B older version tables of data B that makes new advances and increased the field that field information is " geographic position " newly, other field information does not change.When generating data corresponding to redaction tables of data B, only a data message corresponding to legacy data table B for a SQL file kind storage need be copied to the relevant position in the 2nd SQL file so.Like this in the 2nd SQL file, just generated data corresponding to list structure part that do not change, with set, corresponding to the default data of the generation list structure changing unit of each tables of data, as the default data of " geographic position " Related fields newly-increased in tables of data B, data corresponding to combination producing redaction tables of data B.Adopt in the same way, in the 2nd SQL file, generate data corresponding to other redaction tables of data, after combination, generate the data in redaction tables of data.
Step S212: server calls shell script is used the data in the redaction tables of data in the second database file, imports data in redaction tables of data.
Preferably, in the present embodiment, server is used the data in the redaction tables of data in the second database file in invoke script program, when importing data in redaction tables of data, word for word section judges under field to be imported in redaction tables of data, whether to have stored data one by one; If store, abandon the importing of this field; If not storage, by the data importing redaction tables of data of this Related fields.
For example: a SQL statement in the redaction data that comprise generation in the 2nd SQL file in tables of data A, the data message of the 3rd record in tables of data A recorded in this statement.When the data message in this statement is imported to the redaction tables of data A in database, to judge successively in redaction tables of data A and whether store data under each field in the 3rd record, if do not store data in first three cell, and in the 4th cell, store data, so just, by first three field of the corresponding importing of the first three data in this record, abandon the importing of the 4th field data in this record.
It should be noted that, the data in the redaction tables of data in the present embodiment in using the second database file, what adopt when importing data in redaction tables of data is a kind of preferred lead-in mode.When importing data, be not limited to the description in the present embodiment, in the time of can also distinguishing cross-version upgrading, can there is the tables of data of list structure variation and the tables of data that list structure changes can not occur, only when import there are data corresponding to tables of data that list structure changes, just one by one word for word section judge in database, whether to have stored this data message.Certainly, also have other set-up mode, at this, will not enumerate.
The equipment cross-version upgrade method providing by the present embodiment, server calls shell script starts new version software, in the process of the data in generating redaction tables of data, new version software just can operate redaction tables of data, and the data that in real time software systems of equipment in escalation process produced are written in tables of data.Therefore, the equipment cross-version upgrade method providing by the present embodiment, can effectively avoid existing equipment cross-version upgrade method in redaction data escalation process, to tables of data, to control, thereby the data that generate during the data of bringing upgrading cannot be inherited the problem that causes dynamic loss.Simultaneously, the equipment cross-version upgrade method that the present embodiment provides generates the data in redaction tables of data at device interior according to two database files, without picture upgrade method of the prior art, need manually by data importing, derivation, realize the edition upgrading of device interior, avoided unnecessary edition upgrading treatment scheme.
Embodiment tri-
With reference to Fig. 3, show according to the flow chart of steps of a kind of equipment cross-version upgrade method of the embodiment of the present invention three.
The telecommunication apparatus of take in the present embodiment based on embedded Mysql database is example, and equipment cross-version upgrade method of the present invention is introduced.The upgrade method of the present embodiment is used in Embedded (SuSE) Linux OS, in software release upgrade process, Sql order in ROMPaq and Shell order and the Mysql database co-ordination that cooperatively interacts, changes the accessible upgrading of cross-version thereby realize Mysql database incremental.
Wherein, the data list structure that cross-version mainly refers to new and old edition changes to some extent, and legacy data is able to real-time succession after redaction data list structure changes.Accessiblely mainly refer to all data upgrading processing flow processs in the inner encapsulation of whole edition upgrading flow process, externally do not present because version changes and bring unnecessary treatment scheme.The variation of database incremental refers to increase tables of data in database, deletes tables of data; Data list structure increases field, deletes field and the change of original field type, and wherein the change of field type is equivalent to and deletes old type field, simultaneously a newly-increased new type field.
The idiographic flow of the accessible cross-version upgrading of the telecommunication apparatus based on embedded Mysql database in the present embodiment when data list structure changes is as follows:
Step S302: after the edition upgrading of ROMPaq starting outfit, the tables of data information of unloading legacy version.
ROMPaq in the present embodiment is the software operating in telecommunication apparatus, is stored in the server of telecommunication apparatus.Before carrying out device version upgrading, first to download new software version to the hard disk of telecommunication apparatus, the new software version of download comprises: the Shell script calling for ROMPaq and software version bag to be upgraded.
In this step, ROMPaq is called Shell script the tables of data information unloading of legacy version is SQL file, is kept at local hard drive called after OldDate.sql.The file of this document OldDate.sql by name comprises the list structure information of legacy data table and the data message in legacy data table.
Step S304: ROMPaq upgrading new version software generates redaction tables of data in database.
ROMPaq is called Shell script and is emptied the tables of data in database, and moves new version software, by new version software, generates the list structure of redaction tables of data and relevant default data.
In this step, once the list structure of redaction tables of data generates, just at once allow new software version to carry out associative operation to newly-established redaction table, without waiting pending data to upgrade.Because the software systems of telecommunication apparatus are huger, any module is all producing data at any time, and every data of generation all need to be recorded in timely database, such as: report a warning information just need and be recorded in database.And in existing device updating method owing to cannot database be carried out to associative operation before data have been upgraded, therefore the data that the modules of the software systems of telecommunication apparatus produces in escalation process cannot be recorded in database, so data cannot be inherited in real time.
Step S306: the redaction tables of data information in ROMPaq unloading database.
ROMPaq is called the database information of Shell script unloading redaction, and the tables of data information unloading of redaction is SQL file, is also kept in local hard drive, called after NewDate.sql.The file of this document NewDate.sql by name comprises list structure information and the default data information of redaction.
Step S308: ROMPaq is called Shell script NewDate.sql and Old Date.sql file are compared, the list structure difference of acquisition tables of data; According to list structure difference, the data message based in legacy data table directly generates the data that meet redaction data list structure.
In the present embodiment, ROMPaq is called Shell script the OldDate.sql in local hard drive and NewData.sql is compared, and according to list structure difference, based on legacy data, revises NewData.sql file generated redaction data.Wherein, list structure difference comprises: in database, increase tables of data, delete tables of data; Data list structure increases field, deletes field and the change of original field type.
The form of the SQL file in the present embodiment is that first half is the list structure information of tables of data, and latter half is data message corresponding to tables of data.The support of Shell script is searched, is extracted row operation, extracts the functions such as line operate, and therefore the textural difference in the tables of data by two SQL files of Shell script comparison is easy to realize.Find after difference, in NewData.sql, inherit the data message of the part list structure that do not change in OldDate.sql, to the part changing, use default data to insert, the basic data that generation meets redaction data list structure is the data in redaction tables of data simultaneously.
What the present embodiment provided generates two SQL files by new and old edition data, by Shell script, compare the list structure difference of each tables of data, more existing equipment cross-version upgrade method is according to the new list structure of list structure difference combination producing and then according to the list structure of information, generate the method for corresponding data, reduced SQL table handling frequently, upgrading efficiency is higher, more reliable.
Step S310: ROMPaq is called Shell script the basic data generating is imported in the tables of data of the redaction in database, and the data message of storing in database when importing basic data is as the criterion.
ROMPaq is called Shell script and is used Mysql order the basic data in amended NewData.sql file to be inserted in the database of redaction; the data that dynamically generate for redaction during protected data upgrading, the data message that data message has been stored in database when importing basic data is as the criterion.While importing basic data, with the data message of having stored in database, be as the criterion and refer to: import in data procedures, run into the data message under the field being stored in tables of data, with the data message under the field of having stored in database, be as the criterion, abandon data message corresponding in amended NewData.sql.
So far the data of telecommunication apparatus have been upgraded, and the Shell script that in the present embodiment, in escalation process, all processing are called by ROMPaq is realized, and all treatment schemees also can concentrate in a Shell script and realize.In the present embodiment, software version calls Linux Shell script and controls data escalation process, and software version is separate, and exploitation is compared with software code, and the Linux Shell script construction cycle is shorter, more convenient, more easily safeguards.
The equipment cross-version upgrade method providing by the present embodiment, the derivation of database information that ROMPaq realizes the front legacy version of upgrading by invoke script is, the foundation of new edition tables of data, the derivation of redaction tables of data information, the comparison of list structure difference, the generation of data that meets redaction data list structure and this series of flow process of the importing of data, escalation process full automation in visible the present embodiment, without preparation and manual intervention before; And owing to being the upgrading of carrying out in equipment content, therefore not because version changes the extra updating operation producing.Simultaneously, after the dynamic data that the device version upgrade method providing in the present embodiment produces during legacy version artificial data is made and redaction upgrading, the redaction dynamic data of data list structure during setting up and being accomplished to data and having upgraded can well be inherited in redaction tables of data, so the succession that the data that produce in escalation process can be good.To sum up, the method of the telecommunication apparatus based on embedded Mysql database that the present embodiment provides accessible cross-version upgrading when data list structure changes, solved that the workload existing in existing upgrade technique is large, before upgrading version dynamic data can not inherit, upgrade after the problem such as dynamic data loss.
Embodiment tetra-
With reference to Fig. 4, show according to the structured flowchart of a kind of equipment cross-version update device of the embodiment of the present invention four.
The equipment cross-version update device of the present embodiment comprises: the first file generating module 402, for generating first database file corresponding with the legacy data table of database, wherein, legacy data table is the tables of data corresponding to legacy version software, the first database file comprises: the list structure information of legacy data table, and the data in legacy data table; Creation module 404 for moving new version software, and creates the redaction tables of data corresponding with new version software in database, receives in real time the operation to redaction tables of data; The second file generating module 406, for generating second database file corresponding with redaction tables of data, wherein, the second database file comprises: the list structure information of redaction tables of data; Comparing module 408, compares for the list structure information that the first database file and the second database file are stored, and obtains list structure different information; Data generation module 410, for the data in the legacy data table according to list structure different information and the first database file, generates the data in redaction tables of data; Data importing module 412, for by redaction tables of data described in the data importing of the redaction tables of data generating.
Preferably, the list structure information of storing in 408 pairs of the first database files of comparing module and the second database file is compared, while obtaining list structure different information, line by line the list structure information of each corresponding tables of data of storing in the first database file and the second database file is compared, obtain the list structure difference of each tables of data.
Preferably, data generation module 410 is according to the data in the legacy data table in list structure different information and the first database file, while generating the data in redaction tables of data: according to the list structure difference of each tables of data obtaining, in conjunction with in the first database file, data corresponding to the list structure that do not change in each legacy data table part, with set, corresponding to the default data of the generation list structure changing unit of each tables of data, in the second database file, generate the data in redaction tables of data.
Preferably, data importing module 412 is during by data importing redaction tables of data in the redaction tables of data generating: the data in the redaction tables of data in using the second database file, when importing data in redaction tables of data, word for word section judges under field to be imported in redaction tables of data, whether to have stored data one by one; If store, abandon the importing of this field; If not storage, by redaction tables of data described in the data importing of this Related fields.
Preferably, the first database file and the second database file are SQL file; List structure information and date unpack storage in the first database file and the second database file.
The equipment cross-version update device of the present embodiment is used for realizing the corresponding equipment cross-version upgrade method of aforementioned a plurality of embodiment of the method, and has the beneficial effect that corresponding method is implemented, and does not repeat them here.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
Above equipment cross-version upgrade method provided by the present invention and device are described in detail, applied specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.

Claims (10)

1. an equipment cross-version upgrade method, is characterized in that, comprising:
Generate first database file corresponding with legacy data table in database, wherein, described legacy data table is the tables of data corresponding to legacy version software, described the first database file comprises: the list structure information of described legacy data table, and the data in described legacy data table;
Operation new version software, and in described database, create the redaction tables of data corresponding with described new version software, receive in real time the operation to described redaction tables of data;
Generate second database file corresponding with described redaction tables of data, wherein, described the second database file comprises: the list structure information of described redaction tables of data;
The list structure information of storing in described the first database file and described the second database file is compared, obtain list structure different information;
Data according in the described legacy data table in described list structure different information and described the first database file, generate the data in described redaction tables of data;
By redaction tables of data described in the data importing in the described redaction tables of data generating.
2. method according to claim 1, is characterized in that, described the list structure information of storing in described the first database file and described the second database file is compared, and obtains list structure different information step and comprises:
Line by line the list structure information of each corresponding tables of data of storing in described the first database file and described the second database file is compared, obtain the list structure difference of each tables of data.
3. method according to claim 2, is characterized in that, the data in the described legacy data table in the described list structure different information of described foundation and described the first database file, and the data step generating in described redaction tables of data comprises:
List structure difference according to described each tables of data obtaining, in conjunction with in described the first database file, data corresponding to the list structure that do not change in each legacy data table part, with set, corresponding to the default data of the generation list structure changing unit of described each tables of data, in described the second database file, generate the data in described redaction tables of data.
4. according to the method described in claims 1 to 3 any one, it is characterized in that, described redaction tables of data step described in data importing in the described redaction tables of data generating comprised:
Data in described redaction tables of data in using described the second database file, when importing data in described redaction tables of data, word for word section judges under field to be imported in described redaction tables of data, whether to have stored data one by one; If store, abandon the importing of this field; If not storage, by redaction tables of data described in the data importing of this Related fields.
5. method according to claim 1, is characterized in that, described the first database file and described the second database file are SQL file; List structure information and date unpack storage in described the first database file and described the second database file.
6. an equipment cross-version update device, is characterized in that, comprising:
The first file generating module, for generating first database file corresponding with the legacy data table of database, wherein, described legacy data table is the tables of data corresponding to legacy version software, described the first database file comprises: the list structure information of described legacy data table, and the data in described legacy data table;
Creation module for moving new version software, and creates the redaction tables of data corresponding with described new version software in described database, receives in real time the operation to described redaction tables of data;
The second file generating module, for generating second database file corresponding with described redaction tables of data, wherein, described the second database file comprises: the list structure information of described redaction tables of data;
Comparing module, compares for the list structure information that described the first database file and described the second database file are stored, and obtains list structure different information;
Data generation module, the data in the described legacy data table according to described list structure different information and described the first database file, generate the data in described redaction tables of data;
Data importing module, for by redaction tables of data described in the data importing of the described redaction tables of data generating.
7. device according to claim 6, it is characterized in that, described comparing module is compared to the list structure information of storing in described the first database file and described the second database file, while obtaining list structure different information, line by line the list structure information of each corresponding tables of data of storing in described the first database file and described the second database file is compared, obtain the list structure difference of each tables of data.
8. device according to claim 7, is characterized in that, described data generation module is according to the data in the described legacy data table in described list structure different information and described the first database file, while generating the data in described redaction tables of data:
List structure difference according to described each tables of data obtaining, in conjunction with in described the first database file, data corresponding to the list structure that do not change in each legacy data table part, with set, corresponding to the default data of the generation list structure changing unit of described each tables of data, in described the second database file, generate the data in described redaction tables of data.
9. according to the device described in claim 6 to 8 any one, it is characterized in that, described data importing module is by described in the data importing in the described redaction tables of data generating during redaction tables of data:
Data in described redaction tables of data in using described the second database file, when importing data in described redaction tables of data, word for word section judges under field to be imported in described redaction tables of data, whether to have stored data one by one; If store, abandon the importing of this field; If not storage, by redaction tables of data described in the data importing of this Related fields.
10. device according to claim 6, is characterized in that, described the first database file and described the second database file are SQL file; List structure information and date unpack storage in described the first database file and described the second database file.
CN201410201310.XA 2014-05-13 2014-05-13 Equipment cross-version upgrading method and device Pending CN103995854A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410201310.XA CN103995854A (en) 2014-05-13 2014-05-13 Equipment cross-version upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410201310.XA CN103995854A (en) 2014-05-13 2014-05-13 Equipment cross-version upgrading method and device

Publications (1)

Publication Number Publication Date
CN103995854A true CN103995854A (en) 2014-08-20

Family

ID=51310019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410201310.XA Pending CN103995854A (en) 2014-05-13 2014-05-13 Equipment cross-version upgrading method and device

Country Status (1)

Country Link
CN (1) CN103995854A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182344A (en) * 2014-08-25 2014-12-03 腾讯科技(深圳)有限公司 Overwrite installation testing method and overwrite installation testing device
CN104572420A (en) * 2015-02-02 2015-04-29 南车株洲电力机车有限公司 Information processing method and system
CN104750774A (en) * 2014-12-15 2015-07-01 北京星网锐捷网络技术有限公司 Database upgrading method and device
CN104965735A (en) * 2015-06-18 2015-10-07 北京京东尚科信息技术有限公司 Apparatus for generating upgrade SQL script
CN105117470A (en) * 2015-08-28 2015-12-02 广州酷狗计算机科技有限公司 Method and device for data storage
CN105450464A (en) * 2014-08-27 2016-03-30 阿里巴巴集团控股有限公司 Test method and test device for service interfaces
CN105740443A (en) * 2016-02-01 2016-07-06 深圳市盛弘电气股份有限公司 Android database-based data management method and device
CN105989194A (en) * 2015-03-20 2016-10-05 国际商业机器公司 Method and system of table data comparison
WO2017036211A1 (en) * 2015-09-01 2017-03-09 中兴通讯股份有限公司 Structure comparison method and apparatus for databases
CN106502685A (en) * 2016-11-01 2017-03-15 Tcl集团股份有限公司 A kind of upgrade method of data base and system
WO2017045491A1 (en) * 2015-09-15 2017-03-23 华讯方舟科技有限公司 Method and system for upgrading sqlite3 embedded database
CN106776824A (en) * 2016-11-21 2017-05-31 武汉斗鱼网络科技有限公司 The level method and system of Android databases
WO2017088547A1 (en) * 2015-11-27 2017-06-01 中兴通讯股份有限公司 Data upgrading method and apparatus
CN106850800A (en) * 2017-01-24 2017-06-13 腾讯科技(深圳)有限公司 Method and client that a kind of download path determines
CN106897103A (en) * 2017-03-03 2017-06-27 广州四三九九信息科技有限公司 A kind of method that fast speed heat of mobile terminal online game version updates
CN107688618A (en) * 2017-08-08 2018-02-13 平安科技(深圳)有限公司 Data comparison method, apparatus, computer equipment and storage medium
CN107798120A (en) * 2017-11-10 2018-03-13 中国银行股份有限公司 A kind of data transfer device and device
CN107895018A (en) * 2017-11-15 2018-04-10 广州视睿电子科技有限公司 Database update SQL generation methods, system, storage medium and computer equipment
CN109558153A (en) * 2018-11-26 2019-04-02 中国银行股份有限公司 Version consistency determines method, apparatus and system
CN110865829A (en) * 2018-08-28 2020-03-06 北京京东金融科技控股有限公司 Database upgrading method, system, device and storage medium
CN111008028A (en) * 2019-11-22 2020-04-14 杭州数式网络科技有限公司 Software upgrading method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070192290A1 (en) * 2006-02-01 2007-08-16 Zaytsev Andrey A Difference-based database upgrade
CN101499069A (en) * 2008-02-02 2009-08-05 中兴通讯股份有限公司 Internal memory database file updating method and apparatus
CN102968357A (en) * 2012-11-01 2013-03-13 中兴通讯股份有限公司 Software upgrading method and system for distributed communication device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070192290A1 (en) * 2006-02-01 2007-08-16 Zaytsev Andrey A Difference-based database upgrade
CN101499069A (en) * 2008-02-02 2009-08-05 中兴通讯股份有限公司 Internal memory database file updating method and apparatus
CN102968357A (en) * 2012-11-01 2013-03-13 中兴通讯股份有限公司 Software upgrading method and system for distributed communication device

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182344A (en) * 2014-08-25 2014-12-03 腾讯科技(深圳)有限公司 Overwrite installation testing method and overwrite installation testing device
CN104182344B (en) * 2014-08-25 2017-02-15 腾讯科技(深圳)有限公司 Overwrite installation testing method and overwrite installation testing device
CN105450464A (en) * 2014-08-27 2016-03-30 阿里巴巴集团控股有限公司 Test method and test device for service interfaces
CN105450464B (en) * 2014-08-27 2018-11-27 阿里巴巴集团控股有限公司 Test method and device for service interface
CN104750774A (en) * 2014-12-15 2015-07-01 北京星网锐捷网络技术有限公司 Database upgrading method and device
CN104572420A (en) * 2015-02-02 2015-04-29 南车株洲电力机车有限公司 Information processing method and system
CN105989194A (en) * 2015-03-20 2016-10-05 国际商业机器公司 Method and system of table data comparison
CN105989194B (en) * 2015-03-20 2019-12-24 国际商业机器公司 Method and system for comparing table data
CN104965735A (en) * 2015-06-18 2015-10-07 北京京东尚科信息技术有限公司 Apparatus for generating upgrade SQL script
CN104965735B (en) * 2015-06-18 2018-10-19 北京京东尚科信息技术有限公司 Device for generating upgrading SQL scripts
CN105117470A (en) * 2015-08-28 2015-12-02 广州酷狗计算机科技有限公司 Method and device for data storage
WO2017036211A1 (en) * 2015-09-01 2017-03-09 中兴通讯股份有限公司 Structure comparison method and apparatus for databases
WO2017045491A1 (en) * 2015-09-15 2017-03-23 华讯方舟科技有限公司 Method and system for upgrading sqlite3 embedded database
WO2017088547A1 (en) * 2015-11-27 2017-06-01 中兴通讯股份有限公司 Data upgrading method and apparatus
CN105740443A (en) * 2016-02-01 2016-07-06 深圳市盛弘电气股份有限公司 Android database-based data management method and device
CN106502685A (en) * 2016-11-01 2017-03-15 Tcl集团股份有限公司 A kind of upgrade method of data base and system
CN106776824A (en) * 2016-11-21 2017-05-31 武汉斗鱼网络科技有限公司 The level method and system of Android databases
CN106776824B (en) * 2016-11-21 2020-10-16 武汉斗鱼网络科技有限公司 Android database upgrading method and system
CN106850800A (en) * 2017-01-24 2017-06-13 腾讯科技(深圳)有限公司 Method and client that a kind of download path determines
CN106897103A (en) * 2017-03-03 2017-06-27 广州四三九九信息科技有限公司 A kind of method that fast speed heat of mobile terminal online game version updates
CN106897103B (en) * 2017-03-03 2020-11-06 广州四三九九信息科技有限公司 Method for quickly and thermally updating version of mobile terminal network game
WO2019029155A1 (en) * 2017-08-08 2019-02-14 平安科技(深圳)有限公司 Data comparison method and device, computer device and storage medium
CN107688618A (en) * 2017-08-08 2018-02-13 平安科技(深圳)有限公司 Data comparison method, apparatus, computer equipment and storage medium
CN107798120A (en) * 2017-11-10 2018-03-13 中国银行股份有限公司 A kind of data transfer device and device
CN107895018A (en) * 2017-11-15 2018-04-10 广州视睿电子科技有限公司 Database update SQL generation methods, system, storage medium and computer equipment
CN110865829A (en) * 2018-08-28 2020-03-06 北京京东金融科技控股有限公司 Database upgrading method, system, device and storage medium
CN110865829B (en) * 2018-08-28 2024-04-16 京东科技控股股份有限公司 Database upgrading method, system, equipment and storage medium
CN109558153A (en) * 2018-11-26 2019-04-02 中国银行股份有限公司 Version consistency determines method, apparatus and system
CN109558153B (en) * 2018-11-26 2022-01-21 中国银行股份有限公司 Method, device and system for determining version consistency
CN111008028A (en) * 2019-11-22 2020-04-14 杭州数式网络科技有限公司 Software upgrading method, device and storage medium
CN111008028B (en) * 2019-11-22 2022-07-01 杭州数式网络科技有限公司 Software upgrading method, device and storage medium

Similar Documents

Publication Publication Date Title
CN103995854A (en) Equipment cross-version upgrading method and device
CN103440273B (en) A kind of data cross-platform migration method and device
US10216826B2 (en) Database query system
CN102254029B (en) View-based data access system and method
CN104965735A (en) Apparatus for generating upgrade SQL script
CN106649771A (en) Data model updating method and system for database
CN103488759A (en) Method and device for searching application programs according to key words
CN103810224A (en) Information persistence and query method and device
CN112130891B (en) Method and equipment for continuously deploying database
CN114780641B (en) Multi-library multi-table synchronization method, device, computer equipment and storage medium
US20140095550A1 (en) Converting source objects to target objects
CN113204571A (en) SQL execution method and device related to write-in operation and storage medium
CN110597821B (en) Method and device for changing database table structure
CN106951593B (en) Method and device for generating configuration file of protection measurement and control device
CN105677805A (en) Data storing and reading method and device using protobuf
CN103177046B (en) A kind of data processing method based on row storage data base and equipment
CN108416035B (en) Disconf-based unified management method for database mapping files
CN107239568B (en) Distributed index implementation method and device
CN102006156B (en) Method and system for synchronizing configuration data among boards
CN101000621A (en) Interdynamic access method and tool of IMS data base
CN104636471A (en) Procedure code finding method and device
CN111831696A (en) Asset information storage method and system based on graph theory
CN113722337B (en) Service data determination method, device, equipment and storage medium
CN110222105B (en) Data summarization processing method and device
CN107844639B (en) Project standard structure automatic generation method and 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140820