CN106708842B - Method for loading data by application system, database and application system - Google Patents

Method for loading data by application system, database and application system Download PDF

Info

Publication number
CN106708842B
CN106708842B CN201510772107.2A CN201510772107A CN106708842B CN 106708842 B CN106708842 B CN 106708842B CN 201510772107 A CN201510772107 A CN 201510772107A CN 106708842 B CN106708842 B CN 106708842B
Authority
CN
China
Prior art keywords
application system
database
serial number
backup database
notification message
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
CN201510772107.2A
Other languages
Chinese (zh)
Other versions
CN106708842A (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201510772107.2A priority Critical patent/CN106708842B/en
Publication of CN106708842A publication Critical patent/CN106708842A/en
Application granted granted Critical
Publication of CN106708842B publication Critical patent/CN106708842B/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

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)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a method for loading data by a node application system, a database and an application system embodiment. The method comprises the following steps: the method comprises the following steps that a first application system carries out write operation on a main database, and carries out self-increment operation on a value of a serial number in a serial number table increased in the main database; the first application system sends a notification message to the second application system; the second application system receives the notification message, reads the serial number from the notification message and notifies a local backup database to synchronize with the main database; the second application system verifies whether a synchronous serial number matched with the read serial number exists in a local backup database; if so, the second application system loads the data in the backup database. By using the embodiment, the data loaded by the second application system can be ensured to be consistent with the data loaded by the main application system, so that the normal operation of the service is ensured.

Description

Method for loading data by application system, database and application system
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method for loading data in an application system, a database, and an application system.
Background
Service providers in the internet need to respond to the requests of the terminal applications to provide corresponding services. As the size of the services increases, the service scope of the service provider may expand into a wide region.
For example, an internet e-commerce platform, a search platform, a payment platform, etc. in order to meet access requirements of different regions, an application system may be established in a plurality of regions. Therefore, when the terminals in different regions access the application systems, the local application systems can be selected for access, and network delay is reduced. Meanwhile, the application system provides services and needs to load data in the database. For example, a first application system and a main database are established in city A (e.g., Hangzhou); and establishing a second application system and a backup database in a city B (such as Shenzhen) separated by a certain distance. In this way, the terminal application in city B can initiate an access request to the second application system locally, without initiating an access request to the first application system in city a, which is far apart and has a large network delay.
Applications provide access thousands of times per hour (or even minute), and reading, writing, etc. data in a database often occurs. Thus, for the normal operation of the business system, it is necessary to keep the data in each backup database consistent with the data in the primary database. Generally, the main database is a read/write type database, which can provide read/write operations performed by the first application system; and the backup database synchronizes data from the primary database and provides read operations of the local second application system without providing write operations to avoid inconsistencies with data in the primary and other backup databases.
In the prior art, a method for loading data by an application system includes:
a1: the first application system carries out write operation on the main database;
a2: the first application system sends a broadcast message to the second application system;
a3: and the second application system receiving the broadcast message loads data from a local backup database.
In the above manner in the prior art, as described above, since the backup database and the primary database are located in different regions, the backup database cannot immediately update the data to be completely consistent with the data after the write operation is performed on the primary database. Thus, if the second application system loads the data in the local backup database immediately after receiving the broadcast message, the second application system loaded with the data may be inconsistent with the database in the first application system, which may cause a service error; or, a failure of loading the backup database by the second application system may occur, which may also affect the operation of the service.
Disclosure of Invention
The embodiment of the application aims to provide a method for loading data by an application system, a database and the application system, so that the loaded data in a local backup database is synchronized with a main database, and normal operation of a service is guaranteed.
In order to solve the above technical problem, an embodiment of the present application provides a method for loading data in an application system, and a database and an application system implemented as follows:
a method of updating data, comprising:
the first application system writes the main database and performs self-increment operation on the value of the serial number in the serial number table added in the main database;
and the first application system sends a notification message to the second application system, wherein the notification message comprises the sequence number after the self-increment operation.
A method for loading data by an application system, comprising:
the application system receives the notification message, reads the self-increased serial number from the received notification message, and notifies a local backup database to synchronize with the main database;
the application system verifies whether a synchronous serial number matched with the read serial number exists in a local backup database;
and if so, loading the data in the backup database by the second application system.
An application system, comprising:
the writing unit is used for writing the main database;
the operation unit is used for performing self-increment operation on the value of the serial number in the serial number table added in the main database;
and the notification unit is used for sending a notification message to the node application system, wherein the notification message comprises the sequence number after the self-increment operation.
An application system, comprising:
a receiving unit for receiving a notification message;
a reading unit, configured to read a self-incremented sequence number in the received notification message;
the notification unit is used for notifying the local backup database to synchronize with the main database;
the matching unit is used for systematically verifying whether a synchronous serial number matched with the read serial number exists in a local backup database;
and the loading unit loads the data in the backup database when the matching unit verifies that the data exists.
A method for loading data by an application system, comprising:
the method comprises the following steps that a first application system carries out write operation on a main database, and carries out self-increment operation on a value of a serial number in a serial number table increased in the main database;
the first application system sends a notification message to a second application system, wherein the notification message comprises the sequence number after the self-increment operation;
the second application system receives the notification message, reads the self-increased serial number from the notification message and notifies a local backup database to synchronize with the main database;
the second application system verifies whether a synchronous serial number matched with the read serial number exists in the backup database; and if so, loading the data in the backup database by the second application system.
According to the technical scheme provided by the embodiment of the application, whether the synchronous serial number matched with the read serial number exists or not is judged, and whether the backup database is synchronous to the latest data or not can be judged, so that the second application system can load the data in the backup database after the backup database is synchronous to the latest, the data loaded by the second application system can be ensured to be consistent with the data loaded by the first application system, and the normal operation of the service can be ensured.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a flowchart of an embodiment of a method for loading data in an application system of the present application;
FIG. 2 is a schematic diagram of messaging using message middleware techniques;
FIG. 3 is a schematic diagram of MOM message transmission and reception using a publish-subscribe model;
FIG. 4 is a flowchart of an embodiment of a method for updating data according to the present application;
FIG. 5 is a block diagram illustrating an embodiment of a method for loading data in an application system according to the present application;
FIG. 6 is a block diagram of an embodiment of a system according to the present application;
FIG. 7 is a block diagram of an embodiment of an application system according to the present application.
Detailed Description
The embodiment of the application provides a method for loading data by an application system, a database and the application system.
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and 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 application.
The following describes a method for loading data by an application system, and fig. 1 shows the steps of the method, as shown in fig. 1:
s110: the first application system writes a main database and performs self-increment operation on the value of the serial number in a serial number table increased in the main database.
The application system providing the access request of the wide area may be set as the first application system and the second application system, the third application system, and the like. Here, the first application system and the second system are described as an example. To provide access, each application system needs to load data in the database. In general, the database may be set up such that cross-regional access is not possible. Thus, the first application system typically loads a local master database; the second application system typically loads a local backup database. Of course, in some application scenarios, the third application system may also be set to access the backup database corresponding to the second application system across regions, which is not excluded in the present application. The former is mainly used as an example for the following description.
As previously mentioned, applications provide access thousands of times per hour, and reading, writing, etc. of data in a database often occurs. Generally, the main database is a read/write type database, which can provide read/write operations performed by the first application system; the backup database synchronizes data from the primary database and provides read operations for the second application system without providing write operations to avoid inconsistencies with data in the primary and other backup databases.
When data in the primary database is subjected to a write operation, for example, data is written, updated or deleted to the primary database according to the write operation of the first application system, after the operation is completed, the data needs to be synchronized to the backup database.
To identify the order in which data is written to the master database, a sequence number table may be provided in which a sequence number (Seq) identifying the write operation may be stored. The Seq in the sequence number table may be one or more. Taking the example of having a Seq in the serial number table, in the embodiment of the present application, after the first application system performs write operation on the master database, the serial number may be subjected to self-increment operation. For example, the initial value of the Seq value is 1000, and after a certain time of the first application system writing the main data, the value of the Seq is subjected to a self-increment operation, and for example, the value of the Seq after the self-increment operation is updated to 1001.
In the sequence number table added in the main database, a plurality of sequence numbers may also be set to respectively represent write operations to different data contents. In this way, the sequence number table added in the master database performs a self-increment operation on the value of the sequence number, and specifically, the sequence number table added in the master database performs a self-increment operation on the value of the sequence number with the maximum value. For example, there are 3 different sequence numbers in the sequence number table, Seq1 ═ 1100, Seq2 ═ 1101, and Seq3 ═ 1102. After the first application system performs a write operation on the main data, a self-increment operation is performed on the value of the sequence number Seq3 with the maximum value in the sequence number table, for example, the value of Seq3 after the self-increment operation is updated to 1103. Of course, after the first application system performs a write operation on the main data once, the values of other sequence numbers in the sequence number table may also be subjected to a self-increment operation, for example, the value of Seq1 is updated to 1101 and the value of Seq2 is updated to 1102 after the self-increment operation.
In addition, the first application system may perform a write operation on the master database after receiving a request from the second application system. For example, the second application system needs to write to the database. As described above, in this case, the backup database local to the second application system is a read database and does not have write permission. In this way, the second application system may send a request to the first application system, i.e. request a write operation. After receiving the request sent by the second application system, the first application system may further perform a write operation on the master database. The request may generally include specific content for writing to the database. Similarly, in the process of performing write operation on the master database by the first application system, as described above, the self-increment operation may be performed on the Seq value in the master database, and details are not repeated.
S120: and the first application system sends a notification message to the second application system, wherein the notification message comprises the sequence number after the self-increment operation.
After the first application system performs a write operation on the primary database, a notification message may be sent to the second application system to notify the second application system to update the local backup database. In general, there may be a third application system, a fourth application system, etc. in addition to the second application system, and thus, the first application system may transmit a notification message to other application systems in a broadcast manner.
The first application system may send notification messages to other application systems through message middleware techniques.
Message-Oriented Middleware (MOM), also known as Message-Oriented Middleware, provides a Middleware mechanism for Message passing in a loosely-coupled, flexible manner. Fig. 2 illustrates a schematic diagram of message delivery using message middleware techniques. As shown in fig. 2, Application a communicates with Application B by sending a message using an Application Programming Interface (API) of the MOM. In this way, MOM can implement communication between different platforms, and it is often used to mask features between various platforms and protocols to achieve collaboration between applications. The Message middleware products currently in the mainstream include MQSeries of International Business Machines Corporation (IBM), MessageQ of eastern asian Bank (Bank of East asian, BEA), and Java Message Service (JMS) of Sun Corporation (Sun), etc. MOM includes asynchronous messaging or synchronous messaging between store and forward based applications. In asynchronous messaging, applications do not communicate directly with each other, but rather with the MOM server as an intermediary. Asynchronous middleware technology includes both point-to-point and publish-subscribe approaches.
Taking a publish-subscribe approach as an example, as shown in fig. 3, MOM employing a publish-subscribe model accomplishes the sending and receiving of messages with content called topics (topic). The sending application (hereinafter referred to as the publisher) publishes its own message indicating that the message describes information about some topic (which generally corresponds to the publisher). Applications that wish to receive these messages (hereinafter referred to as subscribers) subscribe to this topic. A subscriber to the topic may receive a message about the topic. The MOM server acts as a proxy to route messages published by a topic to all subscribers to the topic.
In the embodiment of the present application, the first application system may be a publisher, and the second application system and other application systems may be subscribers, by using the MOM technology, for example, a publish-subscribe manner.
S130: and the second application system receives the notification message, reads the self-increased serial number from the notification message and notifies a local backup database to synchronize with the main database.
As previously described, the second application system typically reads the local backup database. After receiving the notification message, the second application system may notify the local backup database to synchronize with the primary database. The synchronization may include data synchronization and the sequence number table synchronization.
Similar to the primary database, the local backup database may be incremented by a synchronization sequence number (Copy _ Seq). The Copy _ Seq may identify the order in which the local backup databases are synchronized. For example, before this synchronization, the Copy _ Seq of the backup database is 1000. Likewise, after the local backup database completes synchronization with the primary database, the Seq in the primary database may be saved as a local Copy _ Seq. For example, if the sequence number table of the primary database has a Seq, and the Seq value after the self-increment operation is updated to 1001, the Seq value in the primary database may be saved as the value of local Copy _ Seq after the backup database completes the data synchronization with the primary database, and the saved value may be, for example, 1001.
The second application system (and the third application system, the fourth application system, etc.) that has received the notification message may read the self-incremented sequence number in the notification message, for example, Seq ═ 1000.
Similarly, the local backup database may be augmented with multiple Copy _ Seq, each representing a write operation to different data content. For example, there are 3 different sync sequence numbers in the sync sequence number table of the backup database, Copy _ Seq1 ═ 1100, Copy _ Seq2 ═ 1101, and Copy _ Seq3 ═ 1102. After a certain time the second application system receives the notification message, it may notify the local backup database to synchronize with the primary database. After the local backup database performs synchronization with the primary database, the maximum serial number in the primary database may be saved and used as the local synchronization serial number. The synchronization sequence number may be an existing synchronization sequence number, and the saving operation is, for example, to overwrite the existing synchronization sequence number, such as overwrite _ Seq3, where overwritten Copy _ Seq3 is 1103. Further, a new operation may be performed, for example, a new Copy _ Seq4 is created, the Copy _ Seq4 is 1103, and the value of Copy _ Seq3 may be maintained.
S140: the second application system verifies whether a synchronous serial number matched with the read serial number exists in the backup database; and if so, loading the data in the backup database by the second application system.
The second application system may verify whether a synchronization serial number matching the read serial number exists in the local backup database before loading data in the local score database.
As previously described, the local backup database may be augmented with multiple Copy _ Seq, each representing a write operation to different data content. After a certain time the second application system receives the notification message, it may notify the local backup database to synchronize with the primary database. After the local backup database performs synchronization with the primary database, the sequence number in the primary database may be saved and used as the local synchronization sequence number. Thus, in S140, it may be determined whether the backup database is synchronized with the primary database by verifying whether a synchronization serial number matching the read serial number exists in the local backup database.
As mentioned above, the second application system may notify the local backup database to synchronize with the primary database after receiving the notification message. While synchronizing the local backup database with the primary database typically takes some time. Before this time, that is, before the local backup database and the main database are synchronized, because the data is not synchronized yet, the data loaded in the backup database by the second application system may not be loaded successfully, and normal service access cannot be provided; or only partial data is loaded, but completely updated data is not loaded, so that correct service access cannot be guaranteed.
Business components can be utilized in application systems to load data. The business components have wider application in application systems. Business components are generally functional modules that comprise a series of indivisible business activities. The advantages of business components derive largely from their possessing two related but distinct characteristics: firstly, the components are linked in a loose coupling mode, and the method has the characteristics of flexibility, quick response and strong applicability; secondly, the cohesion of each activity in the subassembly is strong, can provide efficient, of high quality service outward.
The second application system loads the data in the backup database, and specifically, the data in the backup database may be loaded by a service component in the second application system.
By the embodiment of the application, whether the synchronous serial number matched with the read serial number exists or not is judged, and whether the backup database is synchronous to the latest data or not can be judged, so that the second application system can load the data in the backup database after the backup database is synchronous to the latest, the consistency of the data loaded by the second application system and the data loaded by the first application system can be ensured, and the normal operation of the service is ensured.
After S140, the following steps may be further included:
s150: and if not, the second application system verifies whether a synchronous serial number matched with the read serial number exists locally or not at intervals of preset time, and loads the data in the backup database after the synchronous serial number exists.
Considering that the backup database is synchronized with the primary database to complete the synchronization, which is approximately several tens milliseconds to several hundreds milliseconds, the preset time duration may be set to 5ms or 10ms or the like.
Therefore, whether the backup database is synchronized to the latest data can be judged by judging whether the synchronous serial number matched with the read serial number exists, whether the judgment result is that the synchronous serial number is the latest data is judged again after a certain time interval, and the synchronous serial number is loaded when the verification result is that the synchronous serial number exists, so that the second application system can load the data in the backup database after the synchronous data in the backup database is the latest, and the data loaded by the second application system can be ensured to be consistent with the data loaded by the first application system.
An embodiment of a method for updating data according to the present application is described below, and as shown in fig. 4, the method includes:
s410: the first application system writes the main database and performs self-increment operation on the value of the serial number in the serial number table added in the main database;
s420: and the first application system sends a notification message to the second application system, wherein the notification message comprises the sequence number after the self-increment operation.
The self-increment operation of the serial number value in the serial number table added in the main database comprises the following steps: and carrying out self-increment operation on the value of the sequence number with the maximum value in a sequence number table added in the main database.
The main application system sends a notification message to the node application system, and the notification message comprises:
the first application system sends a notification message to the second application system through the message middleware.
The first application system sends a notification message to a second application system, including:
the first application system sends a notification message to the second application system through the message middleware.
An embodiment of a method for loading data by an application system according to the present application is described below, and as shown in fig. 5, the method includes:
s510: the application system receives the notification message, reads the self-increased serial number from the received notification message, and notifies the local backup database to synchronize with the main database;
s520: the application system verifies whether a synchronous serial number matched with the read serial number exists in a local backup database;
s530: and if so, loading the data in the backup database by the application system.
The loading, by the application system, data in the backup database may specifically include:
and the business component in the application system loads the data in the backup database.
The method may further comprise:
and if not, the application system verifies whether a local backup database has a synchronous serial number matched with the read serial number or not at intervals of preset time, and loads data in the backup database after a verification result exists.
An embodiment of a system for application of the present application is described below, and fig. 6 shows a block diagram of the embodiment of the system, which includes:
a writing unit 61, configured to perform a writing operation on the master database;
an operation unit 62, configured to perform a self-increment operation on a value of the serial number in a serial number table added in the master database;
a notifying unit 63, configured to send a notification message to the second application system, where the notification message includes the sequence number after the self-increment operation.
Preferably, the operation unit 62 performs a self-increment operation on the value of the serial number in the master database, including: the operation unit 62 performs a self-increment operation of the value of the maximum-value serial number in the serial number table added in the master database.
Preferably, the notification unit 63 sends a notification message to the second application system through message middleware.
An embodiment of an application system of the present application is described below, and fig. 7 shows a block diagram of the embodiment of the application system, which includes:
a receiving unit 71, configured to receive a notification message;
a reading unit 72, configured to read a self-incremented sequence number in the received notification message;
a notification unit 73, configured to notify the local backup database to perform synchronization with the primary database;
a matching unit 74, configured to verify whether a synchronization serial number matching the read serial number exists in a local backup database;
the loading unit 75 loads the data in the backup database when the verification result of the matching unit 94 is present.
Preferably, the loading unit 75 may include a service component in the application system.
Preferably, when the verification result of the matching unit 74 is that the synchronization serial number matching the read serial number does not exist, it is verified whether a synchronization serial number matching the read serial number exists in a local backup database every preset time.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, 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 is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), 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.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A method of updating data, comprising:
the first application system writes the main database and performs self-increment operation on the value of the serial number in the serial number table added in the main database;
and the first application system sends a notification message to a second application system to notify the local backup database corresponding to the second application system of synchronization with the main database, wherein the notification message comprises the serial number after the self-increment operation, and the serial number after the self-increment operation is used for judging whether the local backup database corresponding to the second application system is synchronized into the latest data or not in the process of synchronization between the local backup database and the main database.
2. The method of claim 1, wherein the first application system sending a notification message to a second application system, comprising:
the first application system sends a notification message to the second application system in a broadcast manner.
3. The method of claim 1, wherein said incrementing the value of the sequence number in the sequence number table incremented in the master database comprises:
and carrying out self-increment operation on the value of the sequence number with the maximum value in a sequence number table added in the main database.
4. The method of claim 2, wherein the first application system sending a notification message to the second application system, comprising:
the first application system sends a notification message to the second application system through the message middleware.
5. A method for loading data by an application system is characterized by comprising the following steps:
the application system receives the notification message, reads the self-increased serial number from the received notification message, and notifies the local backup database to synchronize with the main database;
during the process that the local backup database is synchronized with the main database, the application system verifies whether a synchronization serial number matched with the read serial number exists in the local backup database;
if the local backup database exists, the application system judges that the local backup database is synchronized to be the latest data, and loads the data in the backup database.
6. The method of claim 5, wherein the application system loading the data in the backup database comprises:
and loading the data in the backup database by a service component in the application system.
7. The method of claim 5, wherein the method further comprises:
if not, the application system verifies whether a synchronous serial number matched with the read serial number exists in a local backup database every preset time length, and loads data in the backup database after the synchronous serial number exists.
8. An application system, comprising:
the writing unit is used for writing the main database;
the operation unit is used for performing self-increment operation on the value of the serial number in the serial number table added in the main database;
and the notification unit is used for sending a notification message to the node application system to notify a local backup database corresponding to the second application system to synchronize with the main database, wherein the notification message comprises the sequence number after the self-increment operation, and the sequence number after the self-increment operation is used for judging whether the local backup database corresponding to the second application system is synchronized into the latest data in the process of synchronizing with the main database by the local backup database.
9. The system of claim 8, wherein the operation unit performs a self-increment operation of the value of the serial number in the master database, comprising: the operation unit performs a self-increment operation on the value of the maximum serial number in a serial number table added in the main database.
10. The system of claim 8, wherein the notification unit sends the notification message to the node application through message middleware.
11. An application system, comprising:
a receiving unit for receiving a notification message;
a reading unit, configured to read a self-incremented sequence number in the received notification message;
the notification unit is used for notifying the local backup database to synchronize with the main database;
the matching unit is used for verifying whether a synchronous serial number matched with the read serial number exists in the local backup database or not in the process of synchronizing the local backup database with the main database;
and the loading unit loads the data in the backup database when the matching unit verifies that the local backup database exists and judges that the local backup database is synchronized to the latest data.
12. The application system of claim 11, wherein the load unit comprises a business component in the application system.
13. The application system according to claim 11, wherein when the verification result of the matching unit is non-existent, the matching unit verifies whether a synchronization serial number matching the read serial number exists in a local backup database every a preset time period.
14. A method for loading data by an application system is characterized by comprising the following steps:
the method comprises the following steps that a first application system carries out write operation on a main database, and carries out self-increment operation on a value of a serial number in a serial number table increased in the main database;
the first application system sends a notification message to a second application system to notify the local backup database corresponding to the second application system of synchronization with the main database, wherein the notification message comprises the serial number after the self-increment operation, and the serial number after the self-increment operation is used for judging whether the local backup database corresponding to the second application system is synchronized into the latest data or not in the process of synchronization between the local backup database and the main database;
the second application system receives the notification message, reads the self-increased serial number from the notification message and notifies a local backup database to synchronize with the main database;
in the process of synchronizing the local backup database with the main database, a second application system verifies whether a synchronous serial number matched with the read serial number exists in the backup database; and if so, the second application system judges that the local backup database is synchronized to be the latest data, and loads the data in the backup database.
CN201510772107.2A 2015-11-12 2015-11-12 Method for loading data by application system, database and application system Active CN106708842B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510772107.2A CN106708842B (en) 2015-11-12 2015-11-12 Method for loading data by application system, database and application system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510772107.2A CN106708842B (en) 2015-11-12 2015-11-12 Method for loading data by application system, database and application system

Publications (2)

Publication Number Publication Date
CN106708842A CN106708842A (en) 2017-05-24
CN106708842B true CN106708842B (en) 2021-02-09

Family

ID=58930119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510772107.2A Active CN106708842B (en) 2015-11-12 2015-11-12 Method for loading data by application system, database and application system

Country Status (1)

Country Link
CN (1) CN106708842B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033127B (en) * 2018-05-31 2021-10-29 创新先进技术有限公司 Synchronous data verification method, device and equipment
CN109298976B (en) * 2018-10-17 2022-04-12 成都索贝数码科技股份有限公司 Heterogeneous database cluster backup system and method
CN110300015A (en) * 2019-05-09 2019-10-01 网宿科技股份有限公司 Method of data synchronization and system
CN111522784B (en) * 2020-04-20 2023-11-21 支付宝(杭州)信息技术有限公司 Metadata synchronization method, device and equipment for unstructured data files
CN114531394B (en) * 2020-11-20 2023-11-17 华为技术有限公司 Data synchronization method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064630A (en) * 2006-04-24 2007-10-31 华为技术有限公司 Data synchronization method and system
CN101291342A (en) * 2008-06-18 2008-10-22 中兴通讯股份有限公司 Data synchronizing method and system in distributed system
CN103561095A (en) * 2013-11-04 2014-02-05 金蝶软件(中国)有限公司 Data synchronous method and node and storage service cluster
CN103997525A (en) * 2014-05-21 2014-08-20 北京紫光天禾软件系统技术有限公司 Distributed data synchronization method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064630A (en) * 2006-04-24 2007-10-31 华为技术有限公司 Data synchronization method and system
CN101291342A (en) * 2008-06-18 2008-10-22 中兴通讯股份有限公司 Data synchronizing method and system in distributed system
CN103561095A (en) * 2013-11-04 2014-02-05 金蝶软件(中国)有限公司 Data synchronous method and node and storage service cluster
CN103997525A (en) * 2014-05-21 2014-08-20 北京紫光天禾软件系统技术有限公司 Distributed data synchronization method and system

Also Published As

Publication number Publication date
CN106708842A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
CN106708842B (en) Method for loading data by application system, database and application system
CN107450979B (en) Block chain consensus method and device
US11403152B2 (en) Task orchestration method and system
CN108418851B (en) Policy issuing system, method, device and equipment
CN107368507B (en) Block chain-based consensus method and device
CN107392611B (en) Method and device for sending transaction information and consensus verification
CN108345977B (en) Service processing method and device
CN109032796B (en) Data processing method and device
CN109492013B (en) Data processing method, device and system applied to database cluster
CN107577420B (en) File processing method and device and server
CN111104069B (en) Multi-region data processing method and device of distributed storage system and electronic equipment
CN105262831A (en) Method, device, and synchronizing system for synchronizing data among memory systems
CN111784329A (en) Service data processing method and device, storage medium and electronic device
CN112597249A (en) Synchronous distribution and storage method and system for service data
CN114827165A (en) Method and block link point for grouping multiple transactions
CN111402058B (en) Data processing method, device, equipment and medium
CN111866169B (en) Service updating method, device and system
CN111666134A (en) Method and system for scheduling distributed tasks
CN110381150B (en) Data processing method and device on block chain, electronic equipment and storage medium
CN111666167A (en) Input event reading processing optimization method, nonvolatile memory and terminal equipment
CN114936092A (en) Method for executing transaction in block chain and main node of block chain
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN110022351B (en) Service request processing method and device
CN111796864A (en) Data verification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
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: 20200918

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200918

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant