CN106682017B - Database updating method and device - Google Patents

Database updating method and device Download PDF

Info

Publication number
CN106682017B
CN106682017B CN201510756927.2A CN201510756927A CN106682017B CN 106682017 B CN106682017 B CN 106682017B CN 201510756927 A CN201510756927 A CN 201510756927A CN 106682017 B CN106682017 B CN 106682017B
Authority
CN
China
Prior art keywords
data
breakpoint
updating
database
data unit
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
CN201510756927.2A
Other languages
Chinese (zh)
Other versions
CN106682017A (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201510756927.2A priority Critical patent/CN106682017B/en
Publication of CN106682017A publication Critical patent/CN106682017A/en
Application granted granted Critical
Publication of CN106682017B publication Critical patent/CN106682017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (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 discloses a database updating method and a device, wherein the method comprises the steps of acquiring the breakpoint position of a data unit of which the updating progress is incomplete in a pre-generated breakpoint library; updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated; and updating the updating progress corresponding to the breakpoint position of the data unit in the breakpoint database according to the updating condition of the data unit corresponding to the breakpoint position of the data unit. By the technical scheme provided by the invention, the database can be updated at the breakpoint, and the updating efficiency of the database is improved.

Description

Database updating method and device
Technical Field
The present invention relates to the field of database updating technologies, and in particular, to a database updating method and apparatus.
Background
In the information-oriented society, various information resources are managed and utilized sufficiently and effectively, which is a precondition for scientific research and decision management. The database is the core part of various information systems such as a management information system, an office automation system, a decision support system and the like, and is an important technical means for scientific research and decision management. With the continuous increase of information, how to update data in the database in time becomes a concern in the industry.
In the related art, after new data is generated, the data in the database is updated with the new data. Two updating modes are available, one is full replacement, and the other is incremental updating, wherein the full replacement usually needs to send complete data to the database for updating, which inevitably results in waste of network traffic; incremental updates are, for example, sending only new data to the database update. The inventor finds that, in the process of researching the two updating modes, if an update process is abnormal, and the update is interrupted, the update needs to be restarted from the beginning, and the update efficiency of the database is reduced. Therefore, a new database updating method is needed.
Disclosure of Invention
The embodiment of the invention provides a database updating method and a database updating device, which are used for solving the problem that the database updating efficiency is low because the database is updated from the beginning due to the abnormality in the updating process.
The embodiment of the invention provides a database updating method, which comprises the following steps:
acquiring the breakpoint position of a data unit with an updating progress being incomplete in a pre-generated breakpoint library;
updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated;
and updating the updating progress corresponding to the breakpoint position of the data unit in the breakpoint database according to the updating condition of the data unit corresponding to the breakpoint position of the data unit.
Further, an embodiment of the present invention further provides a database updating apparatus, including:
the query module is used for acquiring the breakpoint position of the data unit of which the updating progress is incomplete in a pre-generated breakpoint library;
the database updating module is used for updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated;
and the data unit progress updating module is used for updating the updating progress corresponding to the breakpoint position of the data unit in the breakpoint database according to the updating condition of the data unit corresponding to the breakpoint position of the data unit.
The invention has the following beneficial effects: the technical scheme provided by the embodiment of the invention supports breakpoint updating, namely if the updating process is interrupted, only the data unit with the updating progress being incomplete is continuously updated, and the data which is successfully updated before is not required to be updated again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating a database updating method according to a first embodiment of the present invention;
FIG. 2a is a schematic diagram of the data area according to the second embodiment of the present invention;
FIG. 2b is a diagram illustrating the data block according to the second embodiment of the present invention;
FIG. 2c is a diagram illustrating a data unit according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of the database updating apparatus according to the second embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a database updating method, in the technical scheme of the embodiment of the invention, in a pre-generated breakpoint library, the updating progress is obtained as the position of a breakpoint of an unfinished data unit; updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated; and updating the updating progress of the breakpoint position of the data unit corresponding to the data unit recorded in the breakpoint library according to the updating condition of the data unit. Therefore, the technical scheme provided by the embodiment of the invention supports breakpoint updating, that is, if the updating process is interrupted, only the data unit whose updating progress is incomplete is updated continuously, and the data which is successfully updated before is not required to be updated again.
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
as shown in fig. 1, which is a schematic flow chart of the database updating method according to the first embodiment of the present invention, the database updating method may include the following steps:
step 101: and acquiring the breakpoint position of the data unit with the updating progress being incomplete in a pre-generated breakpoint library.
In one embodiment, the update progress may include an update not started state (which may be denoted by Init) indicating that an update is not started, an update in-progress state (which may be denoted by Pro) indicating that an update is being updated, and an update completed state (which may be denoted by Com) indicating that an update has been completed. Of course, according to actual needs, the update status may be increased and decreased in specific implementation, for example, the update status may only include an update completion status and an update non-update status, or the update status may include intermediate statuses according to the update flow, for example, the update status may include processes of reading data and synthesizing data, and the like, and then the update status may be subdivided into a read data status and a synthesized data status, and the like, so as to increase the update progress. In specific implementation, the setting may be according to actual needs, which is not described in detail in the embodiments of the present invention.
Step 102: and updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated.
Step 103: and updating the updating progress corresponding to the breakpoint position of the data unit in the breakpoint database according to the updating condition of the data unit corresponding to the breakpoint position of the data unit.
Wherein, in one embodiment, the data to be updated comprises at least one data area; for each data region, the data region comprising at least one data block; for each data block, the data block includes at least one data unit. And each data area in the data to be updated has its own data area identification. Similarly, each data block has its own data block identifier, and each data unit has its own data unit identifier. Thus, the data unit is attached to the data block, and the data block is attached to the data area. During specific implementation, a breakpoint library can be established according to the characteristics of the data to be updated. For example, each data area, each data block, and each data unit in the data to be updated may be identified according to a data area identifier, a data block identifier, and a data unit identifier. Wherein, a data region corresponds to a data region breakpoint position, a data block corresponds to a data block breakpoint position, and a data unit corresponds to a data unit breakpoint position. In specific implementation, the data region identifier can be used to represent the breakpoint position of the data region, the data block identifier can be used to represent the breakpoint position of the data block, and the data unit identifier can be used to represent the breakpoint position of the data unit. Thus, the breakpoint library may include three breakpoint tables, namely a data region breakpoint table, a data block breakpoint table, and a data unit breakpoint table, where:
the data region breakpoint table comprises breakpoint positions of the data regions and corresponding updating schedules; the data block breakpoint table comprises breakpoint positions of the data blocks and corresponding updating schedules; the data unit breakpoint table includes breakpoint positions and corresponding update schedules of the data units.
Of course, it should be noted that the breakpoint position of the data unit may not be limited to be represented by the data unit identifier, and the present invention is not limited thereto. For example, in specific implementation, each data unit may be numbered according to a preset numbering rule, and then the breakpoint position of the data unit is indicated by the number. Similarly, the present invention is not limited to the method for representing the breakpoint position of the data block and the breakpoint position of the data region.
Here, a method for establishing each breakpoint table in the breakpoint library is described with a specific embodiment: for example, in the Update mode based on the Update Region, the data to be updated may include at least one Update Region (i.e., a data Region), where one Update Region includes at least one Building Block (i.e., a data Block), and one Building Block includes at least one Table (i.e., a data unit), and the Table may be a minimum unit of database Update and a minimum unit of incremental Update. Therefore, the breakpoint library has three breakpoint tables, and one breakpoint table includes a breakpoint position of a data Region corresponding to at least one Update Region and a corresponding Update progress (the breakpoint table is hereinafter abbreviated as UrTable); one breakpoint table comprises a breakpoint position of a data Block corresponding to at least one Building Block and a corresponding update progress (the breakpoint table is hereinafter referred to as a BbTable); the last Table includes the breakpoint position of the data unit corresponding to at least one Table and the corresponding update progress (the breakpoint Table is hereinafter abbreviated as TbTable). At the beginning, the updating progress in each breakpoint table is in a state of not starting to update.
Of course, it should be noted that, if one Table includes at least one record, each record may also be used as a minimum unit for updating the database. If the Table can also continue to divide, then the data units can also be divided into smaller granularities than the Table. In specific implementation, the smaller the granularity of data to be updated is, the closer the database update can be to a non-backtracking form. However, the more breakpoint tables are maintained in the breakpoint library, the more data are maintained, and therefore, in specific implementation, the data to be updated may be divided according to actual needs, and the breakpoint library is established.
Therefore, the data to be updated is divided according to the levels (namely, the data area, the data block, the data unit and the like), so that the database updating process can be decomposed into sub-processes with the levels, and the database updating can be conveniently carried out according to each level.
In an embodiment, if the breakpoint database includes a data region breakpoint table, a data block breakpoint table, and a data unit breakpoint table, step 101 (that is, obtaining a breakpoint position of a data unit whose update progress is incomplete in a pre-generated breakpoint database) may specifically include the following steps:
step B1: and acquiring the breakpoint position of the data area with the updating progress being incomplete from the breakpoint table of the data area.
Step B2: and inquiring the data block breakpoint position corresponding to the data region breakpoint position in the data block breakpoint table, and acquiring the data block breakpoint position of which the updating progress is incomplete.
Step B3: and inquiring the breakpoint position of the data unit corresponding to the acquired breakpoint position of the data block in the breakpoint table of the data unit, and acquiring the breakpoint position of the data unit of which the updating progress is unfinished.
Continuing with the above example, assume that the data Block breakpoint positions corresponding to the Update Region of U1 are 4 Building blocks of B1, B2, B3, and B4, respectively, while the data unit breakpoint positions corresponding to the Building blocks of B1 are two tables of M1 and M2, respectively, and the data unit breakpoint positions corresponding to the Building blocks of B3 are three tables of T1, T2, and T3, respectively, and a Table is the minimum unit of database Update.
According to the above assumption, the process of searching for the breakpoint is:
firstly, the breakpoint position of the data region whose update progress is incomplete (i.e. the breakpoint position of the data region whose update progress is not in the Com state) is queried in the breakpoint table of the data region (i.e. UrTable). If the breakpoint position of the data region, whose update progress is found to be incomplete in the UrTable, is U1, and the update progress of the breakpoint position of the data region is Init, it indicates that the data region corresponding to the breakpoint position of the data region does not start updating, and the data unit corresponding to the breakpoint position of the data region is the breakpoint position (for example, M1 is the breakpoint position of the data unit). If the breakpoint position of the data region queried from the UrTable is U1 and the update progress of the data region is Pro, the breakpoint positions B1, B2, B3, and B4 of the data block corresponding to U1 are queried from the data block breakpoint table (i.e., BbTable) continuously, and the update progress is the incomplete breakpoint position of the data block. If the searched breakpoint position of the data block is B2 and the update progress of B2 is Init, it indicates that the data block corresponding to the breakpoint position of the data block does not start to be updated, and T1 may be selected as the breakpoint position of the data unit; if the update progress of B2 is Pro, then continue to query the data unit breakpoint position corresponding to B2 for the data unit breakpoint position with incomplete update progress from the data unit breakpoint table (i.e., TbTable).
Therefore, the breakpoint table is sequentially inquired from the data region breakpoint table to the data unit breakpoint table, and which data regions or data blocks have breakpoints can be quickly determined.
Of course, in specific implementation, the breakpoint table may also be sequentially queried according to the sequence from the data unit breakpoint table to the data region breakpoint table, which is not limited in the embodiment of the present invention.
In one embodiment, if the database includes the data block breakpoint table, the data block breakpoint table needs to be updated according to the update progress of the data block, so as to ensure the accuracy of the breakpoint database information. In this regard, the embodiment of the present invention may be implemented to determine whether the corresponding update schedules of all data unit breakpoint positions corresponding to the same data block breakpoint position in the data unit breakpoint table are all completed, and if yes, update the corresponding update schedules of the data block breakpoint positions in the data block breakpoint table to be completed.
In one embodiment, if the database includes the data region breakpoint table, the data region breakpoint table needs to be updated according to the update progress of the data region, so as to ensure the accuracy of the breakpoint database information. In this regard, the embodiment of the present invention may be implemented to determine whether the corresponding update schedules of all data block breakpoint positions corresponding to the same data region breakpoint position in the data block breakpoint table are all completed, and if yes, update the corresponding update schedules of the data region breakpoint positions in the data region breakpoint table to be completed.
In one embodiment, when storing, the data unit may be a minimum unit of storage, that is, one data unit may be an independent file. Of course, in practical implementation, the division of the data units may be a logical division, and when storing, one data unit does not correspond to one independent file, for example, one data block may be stored as one file. Continuing with the above example, an Update Region is a folder that includes at least one file, where a file is a Building Block. Then the tables are logical partitions, and at least one Table coexists in a Building Block (i.e., in a file). Therefore, the data to be updated may include at least one file, and the file may include at least one data block and at least one data unit.
If the database update process is interrupted, one or a combination of the following 2 operations may be performed to ensure the integrity and accuracy of the database update, and for convenience of description, the following operations are simply referred to as "database interruption post-processing operations":
1) if a data block is stored as a file, if the update is interrupted during the update of the database, the file that may have been updated into the database may have failed (i.e., the file is lost or damaged), which results in a portion of the update operation being invalid. In order to perform invalid updating operation again and ensure that database updating is completed well, the embodiment of the invention can execute the following operations: judging whether the updating progress is that the corresponding file of the breakpoint position of the unfinished data block in the database is valid or not; and if the breakpoint positions of the data blocks are invalid, marking the updating progress corresponding to the breakpoint positions of all the data units corresponding to the breakpoint positions of the data blocks in the breakpoint table of the data units as incomplete.
2) In an embodiment, if the database update process is interrupted, an operation transaction for the database may not be committed, and thus the operation transaction needs to be rolled back, for which, the embodiment of the present invention may be implemented as follows: judging whether an operation transaction aiming at the database is not submitted; and if so, performing rollback operation on the database.
In an embodiment, if the data unit is stored in a form of a data table, and the data table corresponding to the breakpoint position of the data unit may be invalid when the update process of the database is interrupted, so as to facilitate updating the database according to the breakpoint position of the data unit and ensure the integrity and accuracy of the update of the database, step 102 (i.e., updating the data unit corresponding to the breakpoint position of the data unit in the database using the data unit in the data to be updated that is downloaded in advance) may include the following steps:
step A1: and judging whether the data table corresponding to the breakpoint position of the data unit in the database is newly established during updating or the old data table is updated.
Step A2: and if the data table is newly established during updating, deleting the data table, and establishing the data table by using the data unit corresponding to the breakpoint position of the data unit in the pre-downloaded data to be updated.
Step A3: and if the data unit is updated by the old data table, replacing the data table in the database by using the backup of the old data table, and updating the old data table replaced in the database by using the data unit corresponding to the breakpoint position of the data unit in the data to be updated downloaded in advance.
In one embodiment, the database generally provides services for the user, and if the database that is providing services is updated, the database interrupts the services, so as to ensure that the service can be continuously provided for the user and also avoid that the database is damaged and cannot be repaired in the database updating process. And after the updating is finished, replacing the updated database with the database of the providing server, so that the updating process of the database is finished.
In one embodiment, when updating is started, a task list can be established according to the breakpoint library, and the task list includes data unit breakpoint positions corresponding to data units in the data to be updated and corresponding updating schedules. When the database is updated, the database can be updated according to the task list. When the database updating process is interrupted, the task at the breakpoint position can form a first sub-task list, and the task which does not start to be updated after the breakpoint position can form a second sub-task list. So as to perform database interruption post-processing operations, such as rolling back transactions, according to the first subtask list. At this time, in order to avoid updating the database according to the two subtask lists, a new task list may be reconstructed according to the data to be updated in the two subtask lists, and the database may be updated according to the reconstructed task list. For example:
in summary, in the embodiment of the present invention, the database can support breakpoint update by establishing the breakpoint library. Compared with the prior art that the updating of the database is interrupted and only started from the beginning, the updating efficiency of the database can be improved.
In addition, in the embodiment of the invention, the breakpoint table is established according to the data to be updated, and the database is updated according to the breakpoint table, so that the database updating process can be decomposed into a hierarchical process. The control of the database updating is conveniently realized according to the hierarchy.
In addition, in the embodiment of the invention, the integrity and the accuracy of the database updating can be improved by the database interruption post-processing operation.
Example two
Taking updating the electronic map database as an example, the database updating method in the embodiment of the invention is explained as follows:
for example, the data area is data divided according to administrative areas in the electronic map, and the data to be updated includes electronic map data of the beijing area and the shanghai area. And each data area is stored in the form of a folder. For example, the folder UR _11 shown in fig. 2a represents electronic map data of the beijing area; UR _12 indicates electronic map data of the shanghai region. As shown in fig. 2b, the suffix of the file included in the folder UR _11 is at least one file of NDS. Among them, one NDS represents one data block, and each NDS file is divided according to functions. For example, the NDS file named BMD represents map display related data; the NDS file named ROUTING represents road data related data. Each NDS file includes at least one data table (each data table is a data unit), for example, as shown in fig. 2c, each data table included in the NDS file named ROUTING.
Then, the data region breakpoint table can be as shown in table 1: wherein BJ represents the breakpoint position of Beijing area, SH represents the breakpoint position of Shanghai area; the update progress includes Init (not-started update state), Pro (in-update state), and Com (update-completed state). Wherein, Init and Pro both belong to incomplete updating progress.
Table 1 data region breakpoint table
Data region breakpoint location Update progress
BJ Pro
SH Com
The data block breakpoint table may be as shown in table 2: BMD represents the position of a breakpoint related to road data, POI represents the position of a breakpoint related to POI information, and TRAFFIC represents the position of a breakpoint related to real-time TRAFFIC information; the same characters in table 2 as those in table 1 have the same meanings, and are not described herein again.
Table 2 data block breakpoint table
Figure BDA0000842306210000101
The data unit breakpoint table can be as shown in table 3: T1-T4 represent different data unit breakpoint locations; and the same characters in table 3 have the same meanings as those in table 2, and are not described herein again.
Table 3 data unit breakpoint table
Figure BDA0000842306210000102
Figure BDA0000842306210000111
It should be noted that, the above tables 1, 2, and 3 are only used to illustrate the embodiments of the present invention, and are not limited to the embodiments of the present invention.
Then, according to the above conditions, the embodiment of the present invention may be implemented such that the breakpoint position of the data area whose update progress is incomplete is first found out as BJ in table 1, and then the breakpoint position of the data block whose update progress is incomplete may be determined as POI1 belonging to BJ in table 2, and thereafter, the breakpoint position of the data unit whose update progress is incomplete may be determined as T3(1) in the breakpoint position of the data unit corresponding to POI1 in table 3. And then, updating the data table corresponding to the T3(1) in the database by using the data unit in the data to be updated. And updating the updating progress of T3(1) in the table 3 according to the updating condition of the data unit corresponding to the T3 (1). Then, the step of finding the breakpoint position of the data region whose update progress is incomplete in table 1 may be returned, or the data unit corresponding to T4(1) whose update progress is incomplete after T3(1) may be updated continuously according to table 3 until the update progress of all the data units is completed.
After determining that the location of the data unit interrupt is T3(1), the database interrupt post-processing operation described in the first embodiment may be performed to ensure integrity and accuracy of database update, specifically including:
1) judging whether a file (namely a POI. NDS file under a file folder belonging to Beijing area) corresponding to a breakpoint position (namely the POI1) of the data block with an incomplete updating progress in the database is valid or not; if the breakpoint positions of the data units corresponding to the POI1 are invalid, the update schedules corresponding to the breakpoint positions of all the data units corresponding to the POI1 are marked as incomplete (i.e., the update schedules corresponding to T2(1) and T3(1) are marked as Init.
2) Judging whether operation transactions aiming at the database are not submitted; and if so, performing rollback operation on the database.
The embodiment of the invention realizes breakpoint update of the electronic map database, for example, after the A.NDS file is successfully updated, if the update interruption occurs when the B.NDS file is updated, the A.NDS file which is updated before is not influenced, if the B.NDS file is not invalid, only part of the data table in the B.NDS file needs to be updated during the update, and because the data amount of the data table is very small, the breakpoint update is close to a non-backtracking form, and compared with the prior art, once the update process is interrupted, the update is started from the beginning, the embodiment of the invention can improve the update efficiency of the electronic map database.
EXAMPLE III
Based on the same inventive concept, an embodiment of the present invention further provides a database updating apparatus, as shown in fig. 3, the apparatus includes:
the query module 301 is configured to obtain a breakpoint position of a data unit, where an update progress is incomplete, in a breakpoint library generated in advance;
a database updating module 302, configured to update a data unit corresponding to a breakpoint position of a data unit in a database by using a data unit in pre-downloaded data to be updated;
a data unit progress updating module 303, configured to update the update progress corresponding to the breakpoint position of the data unit in the breakpoint database according to an update condition of the data unit corresponding to the breakpoint position of the data unit.
In one embodiment, the data unit is subordinate to a data block, and the data block is subordinate to a data region, so that the breakpoint database includes a data region breakpoint table, a data block breakpoint table, and a data unit breakpoint table, and the query module specifically includes:
a data region breakpoint position obtaining unit, configured to obtain, from a data region breakpoint table, a data region breakpoint position whose update progress is incomplete;
a data block breakpoint position obtaining unit, configured to query, in a data block breakpoint table, a data block breakpoint position corresponding to the data region breakpoint position, and obtain a data block breakpoint position where an update progress is incomplete;
and the data unit breakpoint position acquisition unit is used for inquiring the data unit breakpoint position corresponding to the acquired data block breakpoint position in the data unit breakpoint table and acquiring the data unit breakpoint position of which the updating progress is unfinished.
Wherein, in one embodiment, the apparatus further comprises:
and the data block progress updating module is used for judging whether the corresponding updating progress of all the data unit breakpoint positions corresponding to the same data block breakpoint position in the data unit breakpoint table is completely updated, and if so, updating the corresponding updating progress of the data block breakpoint positions in the data block breakpoint table into updating completion.
Wherein, in one embodiment, the apparatus further comprises:
and the data area progress updating module is used for judging whether the corresponding updating progress of all the data block breakpoint positions corresponding to the same data area breakpoint position in the data block breakpoint table is completely updated, and if so, updating the corresponding updating progress of the data area breakpoint positions in the data area breakpoint table into updating completion.
Wherein, in one embodiment, a data block is stored as a file, the apparatus further comprising:
the file utility judging module is used for judging whether the file corresponding to the breakpoint position of the data block with the updating progress being incomplete in the database is valid or not;
and the progress modification module is used for marking the updating progress corresponding to the breakpoint positions of the data blocks in the breakpoint positions of all the data units corresponding to the breakpoint positions of the data units in the breakpoint table of the data units as incomplete if the judgment result of the file utility judgment module is invalid.
Wherein, in one embodiment, the apparatus further comprises:
the uncommitted transaction judging module is used for judging whether the operation transaction aiming at the database is uncommitted;
and the rollback module is used for performing rollback operation on the database if the judgment result of the uncommitted transaction judgment module is positive.
In one embodiment, the data unit is stored in a form of a data table, and the database update module specifically includes:
the judging unit is used for judging whether the data table corresponding to the breakpoint position of the data unit in the database is newly built during updating or the old data table is updated;
the data table newly-building unit is used for deleting the data table and newly building the data table by using a data unit corresponding to the breakpoint position of the data unit in the pre-downloaded data to be updated if the data table is newly built during updating;
and the old data table updating unit is used for replacing the data table in the database by using the backup of the old data table if the old data table is updated, and updating the old data table replaced in the database by using the data unit corresponding to the breakpoint position of the data unit in the data to be updated, which is downloaded in advance.
The database updating device provided by the embodiment of the invention supports breakpoint updating, namely if the updating process is interrupted, only the data unit with the updating progress being incomplete is updated continuously, and the data which is updated successfully before is not required to be updated again.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. A database update method, comprising:
acquiring the breakpoint position of a data unit with an updating progress being incomplete in a pre-generated breakpoint library;
updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated;
updating the updating progress corresponding to the breakpoint position of the data unit in the breakpoint database according to the updating condition of the data unit corresponding to the breakpoint position of the data unit;
the data unit is subordinate to the data block, the data block is subordinate to the data area, the data area is data divided according to an administrative area in the electronic map, the breakpoint database comprises a data area breakpoint table, a data block breakpoint table and a data unit breakpoint table, and the breakpoint position of the data unit with an updating progress being incomplete is obtained in a pre-generated breakpoint database, and the method specifically comprises the following steps:
acquiring the breakpoint position of the data area with the updating progress being incomplete from the breakpoint table of the data area;
inquiring the data block breakpoint position corresponding to the data region breakpoint position in a data block breakpoint table, and acquiring the data block breakpoint position of which the updating progress is unfinished;
and inquiring the breakpoint position of the data unit corresponding to the acquired breakpoint position of the data block in the breakpoint table of the data unit, and acquiring the breakpoint position of the data unit of which the updating progress is unfinished.
2. The method of claim 1, further comprising:
and judging whether the corresponding updating progress of all the data unit breakpoint positions corresponding to the same data block breakpoint position in the data unit breakpoint table is updated, if so, updating the corresponding updating progress of the data block breakpoint positions in the data block breakpoint table to be updated.
3. The method of claim 1, further comprising:
and judging whether the corresponding updating progress of all the data block breakpoint positions corresponding to the same data region breakpoint position in the data block breakpoint table is updated, if so, updating the corresponding updating progress of the data region breakpoint positions in the data region breakpoint table to be updated.
4. The method of claim 1, wherein a data block is stored as a file, the method further comprising:
judging whether the updating progress is that the corresponding file of the breakpoint position of the unfinished data block in the database is valid or not;
and if the breakpoint positions of the data blocks are invalid, marking the updating progress corresponding to the breakpoint positions of all the data units corresponding to the breakpoint positions of the data blocks in the breakpoint table of the data units as incomplete.
5. The method of claim 4, further comprising:
judging whether an operation transaction aiming at the database is not submitted;
and if so, performing rollback operation on the database.
6. The method according to any one of claims 1 to 5, wherein the data unit is stored in a form of a data table, and the data unit corresponding to the breakpoint position of the data unit in the database is updated by using a data unit in the data to be updated, which is downloaded in advance, specifically comprising:
judging whether the data table corresponding to the breakpoint position of the data unit in the database is newly established during updating or the old data table is updated;
if the data table is newly established during updating, deleting the data table, and establishing the data table by using a data unit corresponding to the breakpoint position of the data unit in the pre-downloaded data to be updated;
and if the data unit is updated by the old data table, replacing the data table in the database by using the backup of the old data table, and updating the old data table replaced in the database by using the data unit corresponding to the breakpoint position of the data unit in the data to be updated downloaded in advance.
7. A database update apparatus, comprising:
the query module is used for acquiring the breakpoint position of the data unit of which the updating progress is incomplete in a pre-generated breakpoint library;
the database updating module is used for updating the data unit corresponding to the breakpoint position of the data unit in the database by using the data unit in the pre-downloaded data to be updated;
the data unit progress updating module is used for updating the updating progress corresponding to the breakpoint position of the data unit in the breakpoint database according to the updating condition of the data unit corresponding to the breakpoint position of the data unit;
the data unit is subordinate to the data block, the data block is subordinate to the data area, the data area is data divided according to an administrative region in the electronic map, the breakpoint database comprises a data area breakpoint table, a data block breakpoint table and a data unit breakpoint table, and the query module specifically comprises:
a data region breakpoint position obtaining unit, configured to obtain, from a data region breakpoint table, a data region breakpoint position whose update progress is incomplete;
a data block breakpoint position obtaining unit, configured to query, in a data block breakpoint table, a data block breakpoint position corresponding to the data region breakpoint position, and obtain a data block breakpoint position where an update progress is incomplete;
and the data unit breakpoint position acquisition unit is used for inquiring the data unit breakpoint position corresponding to the acquired data block breakpoint position in the data unit breakpoint table and acquiring the data unit breakpoint position of which the updating progress is unfinished.
8. The apparatus of claim 7, further comprising:
and the data block progress updating module is used for judging whether the corresponding updating progress of all the data unit breakpoint positions corresponding to the same data block breakpoint position in the data unit breakpoint table is completely updated, and if so, updating the corresponding updating progress of the data block breakpoint positions in the data block breakpoint table into updating completion.
9. The apparatus of claim 7, further comprising:
and the data area progress updating module is used for judging whether the corresponding updating progress of all the data block breakpoint positions corresponding to the same data area breakpoint position in the data block breakpoint table is completely updated, and if so, updating the corresponding updating progress of the data area breakpoint positions in the data area breakpoint table into updating completion.
10. The apparatus of claim 7, wherein a data block is stored as a file, the apparatus further comprising:
the file utility judging module is used for judging whether the file corresponding to the breakpoint position of the data block with the updating progress being incomplete in the database is valid or not;
and the progress modification module is used for marking the updating progress corresponding to the breakpoint positions of the data blocks in the breakpoint positions of all the data units corresponding to the breakpoint positions of the data units in the breakpoint table of the data units as incomplete if the judgment result of the file utility judgment module is invalid.
11. The apparatus of claim 10, further comprising:
the uncommitted transaction judging module is used for judging whether the operation transaction aiming at the database is uncommitted;
and the rollback module is used for performing rollback operation on the database if the judgment result of the uncommitted transaction judgment module is positive.
12. The apparatus according to any one of claims 7-11, wherein the data unit is stored in a form of a data table, and the database update module specifically includes:
the judging unit is used for judging whether the data table corresponding to the breakpoint position of the data unit in the database is newly built during updating or the old data table is updated;
the data table newly-building unit is used for deleting the data table and newly building the data table by using a data unit corresponding to the breakpoint position of the data unit in the pre-downloaded data to be updated if the data table is newly built during updating;
and the old data table updating unit is used for replacing the data table in the database by using the backup of the old data table if the old data table is updated, and updating the old data table replaced in the database by using the data unit corresponding to the breakpoint position of the data unit in the data to be updated, which is downloaded in advance.
CN201510756927.2A 2015-11-09 2015-11-09 Database updating method and device Active CN106682017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510756927.2A CN106682017B (en) 2015-11-09 2015-11-09 Database updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510756927.2A CN106682017B (en) 2015-11-09 2015-11-09 Database updating method and device

Publications (2)

Publication Number Publication Date
CN106682017A CN106682017A (en) 2017-05-17
CN106682017B true CN106682017B (en) 2020-07-31

Family

ID=58864119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510756927.2A Active CN106682017B (en) 2015-11-09 2015-11-09 Database updating method and device

Country Status (1)

Country Link
CN (1) CN106682017B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304430B (en) * 2017-06-02 2021-09-07 深圳三诺信息科技有限公司 Method for modifying database
CN108255629B (en) * 2017-09-22 2020-09-22 平安科技(深圳)有限公司 Breakpoint data obtaining method and terminal equipment
CN109597819B (en) * 2018-12-07 2020-12-18 北京字节跳动网络技术有限公司 Method and apparatus for updating a database
CN113704277B (en) * 2021-07-14 2024-02-02 浪潮商用机器有限公司 Breakpoint continuous transmission method based on database and related device
CN115098537B (en) * 2021-10-19 2023-03-10 腾讯科技(深圳)有限公司 Transaction execution method and device, computing equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004745A (en) * 2009-09-02 2011-04-06 中国银联股份有限公司 Data transfer system and method
CN102495906A (en) * 2011-12-23 2012-06-13 天津神舟通用数据技术有限公司 Incremental data migration method capable of realizing breakpoint transmission
CN104317960A (en) * 2014-11-14 2015-01-28 中国建设银行股份有限公司 Method and device for processing batch job
CN105025106A (en) * 2015-07-28 2015-11-04 焦点科技股份有限公司 Breakpoint resuming method based on segmentation and meta-information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8959068B2 (en) * 2010-09-29 2015-02-17 International Business Machines Corporation Dynamic configuration of a persistence provider

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004745A (en) * 2009-09-02 2011-04-06 中国银联股份有限公司 Data transfer system and method
CN102495906A (en) * 2011-12-23 2012-06-13 天津神舟通用数据技术有限公司 Incremental data migration method capable of realizing breakpoint transmission
CN104317960A (en) * 2014-11-14 2015-01-28 中国建设银行股份有限公司 Method and device for processing batch job
CN105025106A (en) * 2015-07-28 2015-11-04 焦点科技股份有限公司 Breakpoint resuming method based on segmentation and meta-information

Also Published As

Publication number Publication date
CN106682017A (en) 2017-05-17

Similar Documents

Publication Publication Date Title
CN106682017B (en) Database updating method and device
CN108153784B (en) Synchronous data processing method and device
CN110471923B (en) Processing method and device for blockchain transaction records
CN109063005B (en) Data migration method and system, storage medium and electronic device
CN110442480B (en) Mirror image data cleaning method, device and system
CN106202123A (en) The method and apparatus that gray scale is issued
CN114416703A (en) Method, device, equipment and medium for automatically monitoring data integrity
CN111726249A (en) Configuration file processing method and device of network equipment
CN111143323A (en) MPP database management method, device and system
CN113672692A (en) Data processing method, data processing device, computer equipment and storage medium
CN110858123B (en) Method and device for calculating size of backup file
CN110908978A (en) Database data structure verification method and device
CN111046003B (en) Soil erosion factor data updating method and device and electronic equipment
CN115599793A (en) Method, device and storage medium for updating data
CN111049689B (en) Data center switching method and device
CN113448493B (en) Method, electronic device and computer readable medium for backing up data
CN113111072A (en) Business data file generation method and device
CN110363515B (en) Rights and interests card account information inquiry method, system, server and readable storage medium
CN114385188A (en) Code workload statistical method and device and electronic equipment
CN112150102A (en) Smart grid information system account updating method and device combining RPA and AI
CN114331135A (en) Process flow management method, device, equipment and storage medium
CN101819532B (en) Method and device for updating data
CN104965880A (en) Database splitting method and device
CN110399354A (en) The subregion of database exchanges method and device
CN114004663B (en) Rental rate calculation method, system, storage medium and server for vehicles

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200421

Address after: 310012 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 102200, No. 8, No., Changsheng Road, Changping District science and Technology Park, Beijing, China. 1-5

Applicant before: AUTONAVI SOFTWARE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant