CN108347476A - Across computer room method of data synchronization, device and server - Google Patents
Across computer room method of data synchronization, device and server Download PDFInfo
- Publication number
- CN108347476A CN108347476A CN201810065978.4A CN201810065978A CN108347476A CN 108347476 A CN108347476 A CN 108347476A CN 201810065978 A CN201810065978 A CN 201810065978A CN 108347476 A CN108347476 A CN 108347476A
- Authority
- CN
- China
- Prior art keywords
- server
- data packet
- target data
- message queue
- data
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000001514 detection method Methods 0.000 claims abstract description 31
- 238000003860 storage Methods 0.000 claims description 41
- 230000015654 memory Effects 0.000 claims description 40
- 230000001360 synchronised effect Effects 0.000 claims description 22
- 238000013500 data storage Methods 0.000 claims description 11
- 210000000352 storage cell Anatomy 0.000 claims description 10
- 238000005538 encapsulation Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 abstract description 16
- 230000002093 peripheral effect Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 10
- 230000005012 migration Effects 0.000 description 9
- 238000013508 migration Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 241001269238 Data Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000003733 optic disk Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Abstract
The embodiment of the present application discloses across the computer room method of data synchronization of one kind, device and server.The method includes:After the server executes write operation failure to the message queue device, at the time of detection can execute write operation to the message queue device again;When server detection can execute write operation to the message queue device, the target data packet for being stored in the server is obtained, the target data packet for being stored in the server is written to the message queue device.This method passes through before executing write-in target data packet to message queue device, the target data packet is stored in the mode of server, it realizes after executing write operation failure, can successful target data packet not be written before to the write-in of message queue device again, improve the data reliability in data synchronization process.
Description
Technical field
This application involves data field of synchronization, more particularly, to across the computer room method of data synchronization of one kind, device and clothes
Business device.
Background technology
The purpose of for data safety backup or improving the access speed of various regions user, some internet sites can be differently
Point disposes multiple websites.Wherein, each website is by a server or the cluster being made of multiple servers.These websites
Between data can be kept to synchronize so that the partial data content or total data content that are wherein stored are consistent.But
During the data synchronize, the reliability that data synchronize is also to be hoisted.
Invention content
In view of the above problems, present applicant proposes across the computer room method of data synchronization of one kind, device and servers, to be promoted
Reliability in data synchronization process.
In a first aspect, this application provides across the computer room method of data synchronization of one kind, it is applied to across computer room data synchronous system,
Across the computer room data synchronous system includes message queue device and server;The server is used for ordered by what is received
The data read are encapsulated as data packet and are written in the message queue device;The method includes:When the server is to institute
After stating the execution write-in target data package operation failure of message queue device, detection can be write to message queue device execution again
At the time of entering to operate;When server detection can execute write operation to the message queue device, acquisition is held described
Row write is stored in the target data packet of the server before entering the target data packet;The target data packet is written
To the message queue device.
Second aspect, this application provides across the computer room data synchronization units of one kind, run on across computer room data synchronous system
Server, across the computer room data synchronous system further includes message queue device;The institute that the server is used to receive
The data of subscription are encapsulated as data packet and are written in the message queue device;Described device includes:Data storage cell is used
In the data packet of encapsulation is stored in local;Data synchronous detection unit, for executing write-in mesh to the message queue device
After marking data packet operation failure, at the time of detection can execute write operation to the message queue device again;Digital independent list
Member, for when detection can execute write operation to the message queue device, obtaining and the number of targets being written in the execution
The target data packet of the server is stored according to packet foregoing description data storage cell;Data write unit, being used for will
The target data packet is written to the message queue device.
The third aspect, this application provides a kind of servers, including one or more processors and memory;One or
Multiple programs, wherein one or more of programs are stored in the memory and are configured as by one or more of
Processor executes, and one or more of programs are configured to carry out above-mentioned method.
Fourth aspect, this application provides a kind of computer-readable storage mediums for the program code that can perform with processor
Matter, said program code make the processor execute above-mentioned method.
Across the computer room method of data synchronization of one kind provided by the present application, device and server, when the server is to described
After message queue device executes write-in target data package operation failure, detection can execute write-in behaviour to the message queue device again
When making, obtains and have stored in the target data packet of server local before executing said write operation, then institute is stored in by described
The target data packet for stating server is written to the message queue device.To by executing write-in mesh to message queue device
Before marking data packet, which is stored in the mode of server, is realized after executing write operation failure, it can be with
Successful target data packet is not written before to the write-in of message queue device again, the data improved in data synchronization process can
By property.
These aspects or other aspects of the application can more straightforward in the following description.
Description of the drawings
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present application, for
For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 shows a kind of environment schematic across computer room data synchronous system that the application proposes;
Fig. 2 shows a kind of structure diagrams across computer room data synchronous system that the application proposes;
Fig. 3 shows a kind of flow chart across computer room method of data synchronization that the application proposes;
Fig. 4 shows another flow chart across computer room method of data synchronization that the application proposes;
Fig. 5 shows a kind of flow chart for storage data packet that the application proposes;
Fig. 6 shows a kind of structure diagram across computer room data synchronization unit that the application proposes;
Fig. 7 shows another structure diagram across computer room data synchronization unit that the application proposes;
Fig. 8 shows a kind of structure diagram of server of the application.
Specific implementation mode
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, those of ordinary skill in the art are obtained every other without creative efforts
Embodiment shall fall in the protection scope of this application.
Usual Internet company can dispose it is multiple be distributed in different zones website, sometimes for ensureing disposed different stand
The partial data during data are identical or website between point is identical, and data synchronization can be carried out between different websites.For example,
User's login can be carried out when being linked into each website for the ease of user, and all users can be synchronized between different websites
The log-on messages such as username and password.
A usual website is built among a computer room, so when carrying out data synchronization between different websites
When, it can also regard the progress data synchronization between different computer rooms as.Inventor has found, during during data synchronize, number
It is also to be hoisted according to synchronous reliability.
Therefore, across the computer room data side of synchronization that the reliability in data synchronization process is promoted in the application is inventors herein proposed
Method, device and server.
Across the computer room data of one kind first run below to across computer room method of data synchronization provided by the present application, device are same
The environment of step system is introduced.
As shown in Figure 1, across computer room data synchronous system 100 shown in FIG. 1 includes the first computer room 110 and the second computer room
120.First computer room 110 and the second computer room 120 carry out data interaction by network 130.It is deployed with service in the first computer room 110
Message queue device 112 in device 111 and the first computer room 110.Be deployed in the second computer room 120 Data Migration equipment 121,
Message queue device 122 and server 123.Wherein, it should be noted that as shown in Fig. 2, message queue device 112 and
Message queue device 122 may each comprise multiple message queues in data synchronization process.
Wherein, message queue is the channel that a kind of application program transmits message between application program.Application program is by writing
It is communicated with the data (message) for application program into lining up are retrieved, them is linked without special connection.It is common
Message queue has rabbitmq, rocketmq, kafka etc..
Please in conjunction with shown in Fig. 2, being run in the first computer room 110, in server 111 has SDK (Software
Development Kit) component, which can subscribe to business datum caused by data producer, by the business datum
The message queue device 112 being written in the first computer room 110.In the second computer room 120, Data Migration equipment 121 can be by
The Data Migration of message queue device 112 in one computer room 110 is to message queue device 122, and server 123 can be from message
Data are read in array device 122 to be handled.Wherein, as a kind of mode, there are one management sections for operation in server 123
Point and multiple processing nodes, for example, the mater node in Fig. 2 are management node, receive node are processing node.And
ETCD is responsible for electing management node as processing node and coordinates multiple data handled in node processing message queues.
Below again to illustrate to descend the data during synchronizing for from 110 synchrodata of the first computer room to the second computer room 120
Transfer process.In this case, the first computer room 110 is then the source computer room of business datum sender, and the second computer room 120 is then industry
The target computer room of business data receiver.The SDK components that server 111 is run in first computer room 110 synchronize the need received
Business datum is encapsulated as data packet, and the data packet of encapsulation is written to message queue device 112 in a manner of asynchronous thread
In message queue in.And the Data Migration equipment 121 of target computer room subscribes to the data having in message queue device 112 in advance,
When Data Migration equipment 121 detects that the message queue in message queue device 112 has data packet write-in, then by the message team
Data packet in row moves in the message queue in the message queue device 122 of the second computer room 120.Then second computer room 120
Server 123 reads pending data packet from the message queue in message queue device 122 and is handled again, with realize by
Data packaged by data packet are written to local, to complete synchronization of the data from first the 110 to the second computer room of computer room 120.
It should be noted that message queue device 112 can be carried by a physical equipment, such as a server,
There can also be the more physical equipments to carry, for example, multiple servers carry.It is also such for message queue device 122.
Furthermore when Data Migration equipment 121 by a server come when realizing, and message queue device 122 is also by a physical equipment
When carrying, message queue device 122 can be deployed in Data Migration equipment 121, i.e., number be realized by a server
According to the function of migration equipment 121 and message queue device 122.
Present embodiments are specifically described below in conjunction with attached drawing.
Referring to Fig. 3, across the computer room method of data synchronization of one kind provided by the present application, is applied to across computer room data and synchronizes system
System, across the computer room data synchronous system includes message queue device and server;What the server was used to receive
Ordered data are encapsulated as data packet and are written in the message queue device;The method includes:
Step S110:After the server executes write-in target data package operation failure to the message queue device,
At the time of detection can execute write operation to the message queue device again.
Step S120:When server detection can execute write operation to the message queue device, obtain in institute
It states to execute and the target data packet that the target data packet is stored in the server before is written.
Step S130:The target data packet is written to the message queue device.
Across the computer room method of data synchronization of one kind provided by the present application, by executing write-in number of targets to message queue device
Before packet, which is stored in the mode of server, is realized after executing write operation failure, it can be again
Successful target data packet is not written before to the write-in of message queue device, the data improved in data synchronization process are reliable
Property.
Referring to Fig. 4, across the computer room method of data synchronization of one kind provided by the present application, is applied to across computer room data and synchronizes system
System, across the computer room data synchronous system includes message queue device and server;What the server was used to receive
Ordered data are encapsulated as data packet and are written in the message queue device;The method includes:
Step S210:The server storage target data packet.
When the producer of business datum is after producing business datum, the business datum of production can be sent to server.Clothes
Device be engaged in after the business datum that the producer of the business datum received is sent, which is encapsulated as data packet.Also,
For the ease of being lifted in synchronizing process, the data packet after encapsulation can be stored in local by the reliability of data packet, server.Make
For a kind of mode, server is using the data packet that newest encapsulation is completed in time sequencing as target data packet.For example, server is first
It data A is had received, then has received data B, has first carried out the encapsulation to data A later, then will be obtained packaged by data A
Data packet is as target data packet.
As a kind of mode, server can store number of targets with the corresponding storage mode of data packaged by target data packet
According to packet.Wherein, the corresponding storage mode of data packaged by target data packet can be configured by the business producer of packaged data.
It is understood that in this case, server can also get the corresponding storage of the data when getting data
Mode, so as to the target data packet obtained according to corresponding storage mode storage enclosure.
As a kind of mode, as shown in figure 5, server can execute following step in storage:
Step S211:Judge data storage method packaged by target data packet.
Step S212:When it is memorymodel to get the corresponding storage mode of data packaged by the target data packet,
It will be in target data packet storage to memory queue.
Step S213:When it is file mode to get the corresponding storage mode of data packaged by the target data packet,
It will be in target data packet storage to document queue.
Step S214:When it is mixed mode to get the corresponding storage mode of data packaged by the target data packet,
Judge whether memory also has memory space.
Step S215:If so, by target data packet storage to memory queue.
Step S216:If not provided, by target data packet storage to document queue.
Step S220:The server executes the operation that the target data packet is written to message queue device, and judges
Whether the operation succeeds.
Server in the computer room of source and in the operational process of message queue device, can be because of server or message team
Array apparatus operation troubles or network failure etc. cause server that data failure is written to message queue device.Then server is being held
When data are written to message queue device in row, some mark datas that can be returned based on message queue device judge whether successfully to write
Enter target data packet to message queue device.
Step S230:After the server executes write-in target data package operation failure to the message queue device,
At the time of detection can execute write operation to the message queue device again.
Wherein, when target data packet is written without normal direction message queue device in server, or to message queue device
When there is data exception during write-in target data packet, server is judged as executing write-in to the message queue device
Operation failure.Wherein, server, which without normal direction message queue device write-in target data packet includes server itself, can not execute and write
Enter action, for example, the write-in process in server is killed.Furthermore, it is also possible to there is equipment fault in message queue device,
It causes server that can not establish with message queue device to communicate to connect.
It should be noted that server when bringing into operation, is understood to business datum producer subscribing service data.It is servicing
This period of data is written without normal direction message queue device for device, and server can still receive business datum producer and be sent out
The business datum sent, i.e. server can still receive the new data subscribed in advance, then are used as a kind of promotion data reliability
Mode, in this case, when server receives the new data subscribed in advance, by the new data subscribed in advance
It is encapsulated as in data packet storage to memory queue, when can data be written in message queue device so as to subsequent server, will go out
The data packet stored in this period that can not be now written is also written in message queue device.
Step S240:When server detection can execute write operation to the message queue device, obtain in institute
State the target data packet that the server is stored in before executing write-in target data packet.
Wherein, when the primary failure for causing write-in to fail is eliminated before server detects, then judging can be to the message
Array device executes write operation.For example, executing the write-in that abovementioned steps judge execution write operation in server in server
Process killed cause server to the message queue device execute write operation failure after, server start detection be written into
The recovery moment of journey when detecting that write-in process resumption starts then judges that write-in behaviour can be executed to the message queue device
Make.For another example because detecting that message queue device breaks down, and cause server that can not be established with message queue device and communicate
Connection, cause server to the message queue device execute write operation failure after, server interval preset time attempt with
Message queue device establishes communication connection, when connection setup success, then judges that write-in can be executed to the message queue device
Operation.
It should be noted that server stores data packet A before executing data packet A write-in message queues
In server local.When then server again attempts to that data are written to message queue device, directly data can be obtained from local
A is wrapped, to realize after the business datum that service generation side is generated received by server, you can there is higher reliability to be sent out
It is sent to target computer room, improves the reliability of data synchronization.
As a kind of mode, after the server is executed to the message queue device after write operation fails, clothes
Whether the also detectable target data packet of business device is stored in disk in document queue, if so, then by the text in the disk
The target data packet stored in part queue moves in memory queue.Usual document queue operates in disk, and memory queue
It runs in memory, then memory queue has higher processing speed for comparing document queue.
When server is when storing data packet, some data packets can be stored in document queue, and some data packets can exist
In memory queue.Then when server moves to the target data packet stored in the document queue in the disk in memory queue
Afterwards, number of targets can be directly obtained from memory queue to when message queue device execution write operation detecting
According to packet, to which with faster speed, target data packet be written in message queue device.
It is understood that server obtain store the target data packet in the server when, acquisition in addition to it
Outside the target data packet of preceding transmission, can also obtain can be to detection after executing write operation failure to the message queue device
Between when the message queue device execution write operation, it is stored in the data packet of server.For example, when server is write in execution
Fail when entering target data packet A, is then detecting and can received again to before when message queue device execution write operation
And store new data packet B, then when detection can execute write operation to the message queue device, acquisition is stored in described
When the target data packet of server, then target data packet A and data packet B can be obtained simultaneously.
Step S250:The target data packet is written to the message queue device.
Across the computer room method of data synchronization of one kind provided by the present application, when the server is executed to the message queue device
After write operation failure, when detection can execute write operation to the message queue device, obtains execution said write operation and lose
The target data packet stored before losing, then the target data packet for being stored in the server is written to the message queue and is filled
It sets.To by the way that before executing write-in target data packet to message queue device, which is stored in server
Mode, realize execute write operation failure after, can again to message queue device write-in before not be written successfully
Target data packet improves the data reliability in data synchronization process.
Referring to Fig. 6, across the computer room data synchronization unit 300 of one kind provided by the present application, runs on across computer room data and synchronizes
The server of system, across the computer room data synchronous system further include message queue device;The server will be for that will receive
Ordered data be encapsulated as data packet and be written in the message queue device;Described device 300 includes:Data store
Unit 310, data synchronous detection unit 320, data-reading unit 330 and data write unit 340.
Wherein, data storage cell 310, for the data packet of encapsulation to be stored in local;
Data synchronous detection unit 320, for executing write-in target data package operation failure to the message queue device
Afterwards, at the time of detection can execute write operation to the message queue device again.
Data-reading unit 330, for when detection can execute write operation to the message queue device, obtaining in institute
It states to execute and the target data that the target data packet foregoing description data storage cell 310 is stored in the server is written
Packet.
Data write unit 340, for the target data packet to be written to the message queue device.
Referring to Fig. 7, across the computer room data synchronization unit 400 of one kind provided by the present application, runs on across computer room data and synchronizes
The server of system, across the computer room data synchronous system further include message queue device;The server will be for that will receive
Ordered data be encapsulated as data packet and be written in the message queue device.Described device 400 includes:Data store
Unit 410, data write unit 420, data synchronous detection unit 430 and data-reading unit 440.
Wherein, data storage cell 410, for storing target data packet.
Data write unit 420 for executing the operation that the target data packet is written to message queue device, and judges
Whether the operation succeeds.
Data synchronous detection unit 430 executes write operation for data write unit 420 to the message queue device
After failure, at the time of detection can execute write operation to the message queue device again.
Data-reading unit 440, for when detection can execute write operation to the message queue device, obtaining in institute
It states to execute and the target data that the target data packet foregoing description data storage cell 410 is stored in the server is written
Packet.
Data write unit 420, for the target data packet for being stored in the server to be written to the message
Array device.
In conclusion across the computer room method of data synchronization of one kind provided by the present application, device and server, when the service
After device executes write operation failure to the message queue device, detection can execute write operation to the message queue device
When, obtain the target data packet that stores before executing said write operation failure, then by the target for being stored in the server
Data packet is written to the message queue device.Thus by before executing write-in target data packet to message queue device,
The target data packet is stored in the mode of server, is realized after executing write operation failure, it can be again to message team
Successful target data packet is not written before array apparatus write-in, improves the data reliability in data synchronization process.
Referring to Fig. 8, based on above-mentioned data synchronization control method, device, the application also provides a kind of server 140,
The server 140 can be as the server 111 or server 123 of system shown in Fig. 1, or bearer messages team
The physical equipment of array apparatus 122 or message queue device 112, also to be used as the Data Migration equipment in the application.
It should be noted that when message queue device 112 or message queue device 122 are set up on one device
When, message queue device 112 operates in a server 140, and message queue device 122 is also to operate in a server
In 140.And when message queue device 112 or message queue device 122 are distributed across multiple physical equipments, then message queue
Device 112 is distributed across in multiple servers 140, and message queue device 122 is also distributed across in multiple servers 140.
The server 140 includes one or more (one is only shown in figure) processors 222, memory 224, network module
228 and Peripheral Interface 230.
It will appreciated by the skilled person that for the processor 222, every other component belongs to
It is coupled by multiple Peripheral Interfaces 230 between peripheral hardware, the processor 222 and these peripheral hardwares.The Peripheral Interface 230 can
Based on following standard implementation:Universal Asynchronous Receive/sending device (UniversalAsynchronous Receiver/
Transmitter, UART), universal input/output (General Purpose Input Output, GPIO), serial peripheral connect
Mouthful (Serial Peripheral Interface, SPI), internal integrated circuit (Inter-Integrated Circuit,
I2C), but it is not limited to above-mentioned standard.In some instances, the Peripheral Interface 230 can only include bus.In addition, these are controlled
Device processed can also be detached from the Peripheral Interface 230, and be integrated in the processor 222 or corresponding peripheral hardware
It is interior.
The memory 224 can be used for storing software program and module, and the processor 222 is stored in institute by operation
The software program and module in memory 224 are stated, to perform various functions application and data processing.The memory
224 may include high speed random access memory, may also include nonvolatile memory, and such as one or more magnetic storage device dodges
It deposits or other non-volatile solid state memories.In some instances, the memory 224 can further comprise relative to institute
State the remotely located memory of processor 222.In addition, memory 224 can also store some pending data.For example, working as
Message queue device 112 or message queue device 122 are by server 140 come when carrying, memory 224 can store message
Data in queue.
The network module 228 is for receiving and transmitting network data, to pass through network between realization and other equipment
Carry out data interaction.
Peripheral Interface 230 is communicated with external equipment by wired mode for server 140.The Peripheral Interface can
To be USB interface or RS232 interface etc..
The example of above-mentioned network includes but not limited to internet, intranet, LAN, mobile radio communication and its group
It closes.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is contained at least one embodiment or example of the application.In the present specification, schematic expression of the above terms are not
It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office
It can be combined in any suitable manner in one or more embodiments or example.In addition, without conflicting with each other, the skill of this field
Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples
It closes and combines.
In addition, term " first ", " second " are used for description purposes only, it is not understood to indicate or imply relative importance
Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the present application, the meaning of " plurality " is at least two, such as two, three
It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the application includes other realization, wherein can not press shown or discuss suitable
Sequence, include according to involved function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be by the application
Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (system of such as computer based system including processor or other can be held from instruction
The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicating, propagating or passing
Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment
It sets.The more specific example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring
Interconnecting piece (server), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM),
Erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk read-only storage
(CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other suitable Jie
Matter, because can be for example by carrying out optical scanner to paper or other media, then into edlin, interpretation or when necessary with other
Suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the application can be realized with hardware, software, firmware or combination thereof.Above-mentioned
In embodiment, software that multiple steps or method can in memory and by suitable instruction execution system be executed with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit application-specific integrated circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that realize all or part of step that above-described embodiment method carries
Suddenly it is that relevant hardware can be instructed to complete by program, the program can be stored in a kind of computer-readable storage medium
In matter, which includes the steps that one or a combination set of embodiment of the method when being executed.For example, the program is when being executed, execute
Content be foregoing teachings in step S110 to step S130 content.In addition, each function in each embodiment of the application
Unit can be integrated in a processing module, can also be that each unit physically exists alone, can also two or two with
Upper unit is integrated in a module.The form that hardware had both may be used in above-mentioned integrated module is realized, software can also be used
The form of function module is realized.If the integrated module is realized in the form of software function module and as independent product
Sale in use, can also be stored in a computer read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above
Embodiments herein is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as the limit to the application
System, those skilled in the art can be changed above-described embodiment, change, replace and become within the scope of application
Type.
Finally it should be noted that:Above example is only to illustrate the technical solution of the application, rather than its limitations;Although
The application is described in detail with reference to the foregoing embodiments, those skilled in the art are when understanding:It still can be with
Technical scheme described in the above embodiments is modified or equivalent replacement of some of the technical features;And
These modifications or replacements, do not drive corresponding technical solution essence be detached from each embodiment technical solution of the application spirit and
Range.
Claims (10)
1. a kind of across computer room method of data synchronization, which is characterized in that be applied to across computer room data synchronous system, across the computer room number
Include message queue device and server according to synchronization system;The ordered data that the server is used to receive encapsulate
For data packet and it is written in the message queue device;The method includes:
After the server executes write-in target data package operation failure to the message queue device, detection can be again to institute
At the time of stating the execution write operation of message queue device;
When server detection can execute write operation to the message queue device, obtain described in execution write-in
The target data packet of the server is stored in before target data packet;
The target data packet is written to the message queue device.
2. according to the method described in claim 1, it is characterized in that, the server is with data packaged by the target data packet
Corresponding storage mode stores the target data packet.
3. according to the method described in claim 2, it is characterized in that, the target data packet is is sealed with the target data packet
The corresponding storage mode of dress data is stored in the server and includes:
When it is memorymodel to get the corresponding storage mode of data packaged by the target data packet, the server is by institute
It states in the storage to memory queue of target data packet;
When it is file mode to get the corresponding storage mode of data packaged by the target data packet, the server is by institute
It states in the storage to document queue of target data packet;
When it is mixed mode to get the corresponding storage mode of data packaged by the target data packet, the server judges
Whether memory also has memory space,
If so, the server stores the target data packet to memory queue,
If not provided, the server stores the target data packet to document queue.
4. according to the method described in claim 1, it is characterized in that, described when the server is held to the message queue device
Row write further includes after entering after operation failure:
The server detects whether the target data packet is stored in the document queue in the server disk;
If so, the server moves to the target data packet in memory queue from the document queue.
5. according to any methods of claim 1-4, which is characterized in that when the server is to the message queue device
Further include after executing write-in target data package operation failure:
The server is encapsulated as data packet by the data subscribed in advance are received, by data packet storage to the server
It is local;
When server detection can execute write operation to the message queue device, acquisition is stored in the server
The data packet;
The data packet is written to the message queue device.
6. a kind of across computer room data synchronization unit, which is characterized in that the server across computer room data synchronous system is run on, it is described
Across computer room data synchronous system further includes message queue device;The ordered data that the server is used to receive encapsulate
For data packet and it is written in the message queue device;Described device includes:
Data storage cell, for the data packet of encapsulation to be stored in local;
Data synchronous detection unit, after executing write-in target data package operation failure to the message queue device, detection
At the time of can write operation being executed to the message queue device again;
Data-reading unit, for when detection can execute write operation to the message queue device, obtaining in the execution
The target data packet that the target data packet foregoing description data storage cell is stored in the server is written;
Data write unit, for the target data packet to be written to the message queue device.
7. device according to claim 6, which is characterized in that the data storage cell is specifically used for the target
The corresponding storage mode of data packaged by data packet stores the target data packet.
8. device according to claim 6, which is characterized in that the data storage cell gets institute specifically for working as
When to state the corresponding storage mode of data packaged by target data packet be memorymodel, by target data packet storage to memory team
In row;
When it is file mode to get the corresponding storage mode of data packaged by the target data packet, by the target data
In packet storage to document queue;
When it is mixed mode to get the corresponding storage mode of data packaged by the target data packet, judge memory whether also
There is memory space,
If so, by target data packet storage to memory queue,
If not provided, by target data packet storage to document queue.
9. a kind of server, which is characterized in that including one or more processors and memory;
One or more programs, wherein one or more of programs are stored in the memory and are configured as by described
One or more processors execute, and one or more of programs are configured to carry out any methods of claim 1-5.
10. a kind of computer readable storage medium for the program code that can perform with processor, which is characterized in that described program
Code makes the processor perform claim require any methods of 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810065978.4A CN108347476B (en) | 2018-01-22 | 2018-01-22 | Cross-machine-room data synchronization method and device and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810065978.4A CN108347476B (en) | 2018-01-22 | 2018-01-22 | Cross-machine-room data synchronization method and device and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108347476A true CN108347476A (en) | 2018-07-31 |
CN108347476B CN108347476B (en) | 2020-01-14 |
Family
ID=62960650
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810065978.4A Expired - Fee Related CN108347476B (en) | 2018-01-22 | 2018-01-22 | Cross-machine-room data synchronization method and device and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108347476B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684406A (en) * | 2018-11-13 | 2019-04-26 | 北京达佳互联信息技术有限公司 | Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room |
CN111767296A (en) * | 2020-06-30 | 2020-10-13 | 北京百度网讯科技有限公司 | Method, device, electronic equipment and readable storage medium for synchronizing data |
CN111984198A (en) * | 2020-08-25 | 2020-11-24 | 北京一起教育信息咨询有限责任公司 | Message queue implementation method and device and electronic equipment |
WO2020259438A1 (en) * | 2019-06-26 | 2020-12-30 | 深圳前海微众银行股份有限公司 | Service expansion and migration method, device, system, apparatus and readable storage medium |
CN112187916A (en) * | 2020-09-27 | 2021-01-05 | 中国银联股份有限公司 | Cross-system data synchronization method and device |
CN113377863A (en) * | 2020-03-10 | 2021-09-10 | 阿里巴巴集团控股有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
CN116627681A (en) * | 2023-07-25 | 2023-08-22 | 太平金融科技服务(上海)有限公司 | Service request processing method, device, computer equipment, medium and program product |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140195480A1 (en) * | 2010-12-13 | 2014-07-10 | Fusion-Io, Inc. | Persistent memory management |
CN103973530A (en) * | 2014-01-14 | 2014-08-06 | 国家电网公司 | Catching technology based information interaction bus data reliable-transmission method |
CN105045531A (en) * | 2015-07-01 | 2015-11-11 | 山东超越数控电子有限公司 | Buffer synchronization mechanism between double storage controllers |
CN105471714A (en) * | 2015-12-09 | 2016-04-06 | 百度在线网络技术(北京)有限公司 | Message processing method and device |
CN105630869A (en) * | 2015-12-15 | 2016-06-01 | 北京奇虎科技有限公司 | Voice data storage method and device |
-
2018
- 2018-01-22 CN CN201810065978.4A patent/CN108347476B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140195480A1 (en) * | 2010-12-13 | 2014-07-10 | Fusion-Io, Inc. | Persistent memory management |
CN103973530A (en) * | 2014-01-14 | 2014-08-06 | 国家电网公司 | Catching technology based information interaction bus data reliable-transmission method |
CN105045531A (en) * | 2015-07-01 | 2015-11-11 | 山东超越数控电子有限公司 | Buffer synchronization mechanism between double storage controllers |
CN105471714A (en) * | 2015-12-09 | 2016-04-06 | 百度在线网络技术(北京)有限公司 | Message processing method and device |
CN105630869A (en) * | 2015-12-15 | 2016-06-01 | 北京奇虎科技有限公司 | Voice data storage method and device |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684406A (en) * | 2018-11-13 | 2019-04-26 | 北京达佳互联信息技术有限公司 | Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room |
WO2020259438A1 (en) * | 2019-06-26 | 2020-12-30 | 深圳前海微众银行股份有限公司 | Service expansion and migration method, device, system, apparatus and readable storage medium |
CN113377863A (en) * | 2020-03-10 | 2021-09-10 | 阿里巴巴集团控股有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
CN113377863B (en) * | 2020-03-10 | 2022-04-29 | 阿里巴巴集团控股有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
CN111767296A (en) * | 2020-06-30 | 2020-10-13 | 北京百度网讯科技有限公司 | Method, device, electronic equipment and readable storage medium for synchronizing data |
CN111984198A (en) * | 2020-08-25 | 2020-11-24 | 北京一起教育信息咨询有限责任公司 | Message queue implementation method and device and electronic equipment |
CN111984198B (en) * | 2020-08-25 | 2024-02-27 | 北京一起教育信息咨询有限责任公司 | Message queue implementation method and device and electronic equipment |
CN112187916A (en) * | 2020-09-27 | 2021-01-05 | 中国银联股份有限公司 | Cross-system data synchronization method and device |
CN112187916B (en) * | 2020-09-27 | 2023-12-05 | 中国银联股份有限公司 | Cross-system data synchronization method and device |
CN116627681A (en) * | 2023-07-25 | 2023-08-22 | 太平金融科技服务(上海)有限公司 | Service request processing method, device, computer equipment, medium and program product |
CN116627681B (en) * | 2023-07-25 | 2023-10-17 | 太平金融科技服务(上海)有限公司 | Service request processing method, device, computer equipment, medium and program product |
Also Published As
Publication number | Publication date |
---|---|
CN108347476B (en) | 2020-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108347476A (en) | Across computer room method of data synchronization, device and server | |
CN108256002B (en) | Cross-machine-room data synchronization method, device, system and server | |
JP5872731B2 (en) | Computer implemented method, non-transitory computer readable medium and computer system for communicating detection of link failure to each of a plurality of nodes of a cluster | |
CN108347477A (en) | Data transmission method for uplink, device and server | |
CN112448858B (en) | Network communication control method and device, electronic equipment and readable storage medium | |
FR2485227A1 (en) | INPUT / OUTPUT SYSTEM FOR A MULTIPROCESSOR PROCESSING SYSTEM | |
CN102420805B (en) | Method, system and device for communication by virtue of socket connection | |
CN103152390A (en) | Method and device and nodes and system for node configuration of distributed storage system | |
CN109327428A (en) | A kind of message transmitting method, device, network side equipment and storage medium | |
EP4030314A1 (en) | Blockchain-based data processing method, apparatus and device, and readable storage medium | |
CN105808374A (en) | Snapshot processing method and associated equipment | |
CN108093077B (en) | Abnormality eliminating method, device and server | |
CN107920136B (en) | Data synchronization control method, device and server | |
SE500940C2 (en) | Methods and systems for dismantling a chain of linked processes in a distributed operating system | |
CN112114939A (en) | Distributed system deployment equipment and method | |
CN113254274A (en) | Message processing method, device, storage medium and server | |
CN107395765B (en) | Distributed file system, network communication method, platform and creation method thereof | |
CN113901374A (en) | Webpage refreshing method and device, electronic equipment and storage medium | |
CN112732495A (en) | Information interaction method and device and storage medium | |
CN113992650B (en) | File processing method, device, electronic equipment and computer readable storage medium | |
CN113138717B (en) | Node deployment method, device and storage medium | |
CN114301927B (en) | Main node selection method, device and medium in distributed system | |
CN108847980A (en) | A kind of method and device of CTDB node failure virtual IP address migration | |
CN112596925B (en) | Transaction data transmission method and device | |
CN114666348B (en) | Method for quickly constructing distributed system based on python language |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200114 |