CN105207809B - A kind of data processing method, server, client and system - Google Patents

A kind of data processing method, server, client and system Download PDF

Info

Publication number
CN105207809B
CN105207809B CN201510528093.XA CN201510528093A CN105207809B CN 105207809 B CN105207809 B CN 105207809B CN 201510528093 A CN201510528093 A CN 201510528093A CN 105207809 B CN105207809 B CN 105207809B
Authority
CN
China
Prior art keywords
server
business
information
client
business processing
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
CN201510528093.XA
Other languages
Chinese (zh)
Other versions
CN105207809A (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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology 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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201510528093.XA priority Critical patent/CN105207809B/en
Publication of CN105207809A publication Critical patent/CN105207809A/en
Application granted granted Critical
Publication of CN105207809B publication Critical patent/CN105207809B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of servers, comprising: processing time recording module, for the temporal information that after the service request of client transmission that is disposed, record traffic is disposed;Packet generation module is returned to, for generating the return packet of the temporal information finished comprising business critical state information and business processing after the service request of client transmission that is disposed;Time synchronization module is recorded, the temporal information for finishing the business processing of record is synchronized to second server;Service request return module is sent to client for that will return to packet, so that the temporal information that client saves business critical state information and business processing finishes.Correspondingly, the invention also discloses client, another server and systems, using the present invention, solving the link when across computer room disaster tolerance synchrodata, time delay occur longer or breaking, so that data transformation is consistent and service switching is caused to handle slack technical problem when primary server is switched to standby server.

Description

A kind of data processing method, server, client and system
Technical field
The present invention relates to computer field more particularly to a kind of data processing method, server, client and systems.
Background technique
The server (robe) of private name server (referred to as private clothes, Private Server) i.e. unofficial erection, business is (such as Game) server that is set up of network operator or developer.In the case where the concept of game server private clothes is prevailing, taken for private For single machine, there are problems that single-point.If fruit server delay machine or Network Abnormal, the user player of whole region will lead to not Game can be continued playing.
Private clothes there are aiming at the problem that, need to construct the game services framework of High Availabitity to solve, it is as shown in Figure 1 existing The schematic diagram of High Availabitity framework in technology, High Availabitity framework in the prior art only carry out active and standby synchronization to status data, and Process monitoring is carried out by zookeeper, standby host is directly notified to provide service, however game in the case where exception occurs in host Status data synchronizes this link it is possible that abnormal conditions, for example, across computer room disaster tolerance synchrodata link occur time delay compared with In the case where long or open circuit, game state data may not be all synchronized to the machine of backup, not so as to cause state Unanimous circumstances affect the experience of user player.
In addition, identifying the business after primary server is disposed to each service request in the prior art in Redis and asking Done (processing) is asked, standby server traverses nearest 1 minute service request and weighs if the service request does not identify done Handle the service request.Active/standby server receives service request, and standby server just provides service processing in primary server on-hook, Delay for 30ms+, active/standby server may be not quite identical across the service request that computer room receives, and there is also packet loss, random orderings etc. Problem, therefore the prior art restores service condition data despite multiple duplication data are carried out by server side, also can only It ideally ensure that the consistency of data in server side;And user side is because of network problem or other performance issues, It not is latest edition that the data got, which can be encountered, or got latest edition and data backup without updating Situation.This influence finally still influences whether the final experience of user.
Summary of the invention
The technical problem to be solved by the embodiment of the invention is that providing a kind of data processing method, server, client And data processing system, it solves in the prior art when time delay occur longer or disconnected for the link of across computer room disaster tolerance synchrodata Road, so that data transformation unanimously causes service switching to handle slack technology and asks when primary server is switched to standby server Topic, by the consistency for guaranteeing data from client.
In order to solve the above-mentioned technical problem, first aspect of the embodiment of the present invention discloses a kind of server, comprising:
Time recording module is handled, for after the service request of client transmission that is disposed, record traffic have been handled Complete temporal information;
Packet generation module is returned to, for generating crucial comprising business after the service request of client transmission that is disposed The return packet for the temporal information that status information and the business processing finish;
Time synchronization module is recorded, the temporal information for finishing the business processing of record is synchronized to second service Device;Wherein the second server is the standby server of the first server, is cut when business occurs for the first server When changing, by the service switching to the second server;
Service request return module, for return packet to be sent to the client, so that the client saves The temporal information that the business critical state information and the business processing finish.
With reference to first aspect, in the first possible implementation, the business critical state information and the industry The temporal information for being engaged in being disposed is arranged in the public head information for returning to packet.
Second aspect of the embodiment of the present invention discloses a kind of server, and the server is second server, comprising:
Time receives preserving module, the time letter that the business processing for receiving and saving first server transmission finishes Breath;
Business receiving module, for receiving the business that client is sent when service switching occurs for the first server Request;
Temporal information sending module, for the time being received and is protected when service switching occurring for the first server The temporal information that the newest business processing saved in storing module finishes is sent to client;
Processing business and updates module, for working as the time letter for receiving the client and finishing according to the newest business processing After ceasing the business critical state information returned, service condition is updated according to the business critical state information, and finish in update Afterwards, triggering handles the service request that the business receiving module receives.
In conjunction with second aspect, in the first possible implementation, further includes:
Return information receiving module, for being sent when newest business processing finishes in the temporal information sending module Between information to the instruction information for after the client, receiving the client and returning;
Service Processing Module is used for when the instruction information includes the business critical state information, in the business After update module updates service condition, the service request that the business receiving module receives is handled;Or work as the instruction information Instruction is without handling the service request that the business receiving module receives when updating service condition.
The third aspect of the embodiment of the present invention discloses a kind of client, comprising:
Packet receiving module is returned to, for receiving the return packet of first server transmission;The return packet is crucial comprising business The temporal information that status information and the business processing finish;
Information preservation module is finished for saving the business critical state information received and the business processing Temporal information;
Temporal information receiving module, the temporal information that the business processing for receiving second server transmission finishes;
Time comparison module, the time letter finished for comparing the newest business processing saved in the information preservation module The temporal information that breath is finished with the received business processing of temporal information receiving module;
Business information return module, the time for being finished when the newest business processing saved in the information preservation module When being later than from the time that the received business processing of temporal information receiving module finishes, return to the second server described in The business critical state information saved in information preservation module.
In conjunction with the third aspect, in the first possible implementation, further includes:
Indicate information return module, the time for finishing when the newest business processing saved in the information preservation module When the time consistency finished with the received business processing of temporal information receiving module, sends and indicate to the second server Information, the instruction information are used to indicate without updating service condition.
In conjunction with the possible implementation of the first of the third aspect or the third aspect, second of possible realization side In formula, the temporal information that the business critical state information and the business processing finish, which is arranged in, described returns to the public of packet In head information;
It is complete that the business information return module is specifically used for the newest business processing saved in the information preservation module When the complete time was later than from the time that the received business processing of temporal information receiving module finishes, to the second server Return to the public head information.
Fourth aspect of the embodiment of the present invention discloses a kind of data processing system, including first server, second server And client, wherein
The first server after the service request that the client is sent that is disposed, what record traffic was disposed Temporal information, and generate the return packet of the temporal information finished comprising business critical state information and the business processing;It will The temporal information that the business processing of record finishes is synchronized to the second server;Return packet is sent to the visitor Family end, so that the temporal information that the client saves the business critical state information and the business processing finishes;
The second server receives and saves the temporal information that the business processing that the first server is sent finishes;When When service switching occurs for the first server, the service request that the client is sent is received, by the newest business of preservation The temporal information being disposed is sent to the client;
After the client receives the temporal information that the business processing that the second server is sent finishes, compares local terminal and protect The temporal information that the business processing that the temporal information and the second server that the newest business processing deposited finishes are sent finishes;And When time for finishing of newest business processing that local terminal saves be later than finished from the business processing that the second server is sent when Between when, to the second server return save business critical state information;
After the second server receives the business critical state information that the client returns, closed according to the business Bonded state information update service condition, and after update, triggering handles the service request received.
The 5th aspect of the embodiment of the present invention discloses a kind of data processing method, comprising:
After the service request of client transmission that is disposed, the temporal information that record traffic is disposed, and generate packet The return packet for the temporal information that critical state information containing business and the business processing finish;
The temporal information that the business processing of record finishes is synchronized to second server;The wherein second server For the standby server of the first server, when service switching occurs for the first server, extremely by the service switching The second server;
Return packet is sent to the client so that the client save the business critical state information with And the temporal information that the business processing finishes.
In conjunction with the 5th aspect, in the first possible implementation, the business critical state information and the industry The temporal information for being engaged in being disposed is arranged in the public head information for returning to packet.
The 6th aspect of the embodiment of the present invention discloses a kind of data processing method, comprising:
Receive and save the temporal information that the business processing of first server transmission finishes;
When service switching occurs for the first server, the service request that client is sent is received, by the newest of preservation The temporal information that finishes of business processing be sent to client;
When receiving, the business that the client is returned according to the temporal information that the newest business processing finishes is crucial After status information, service condition is updated according to the business critical state information, and after update, triggering processing receives Service request.
It is in the first possible implementation, complete in the newest business processing by preservation in conjunction with the 6th aspect Complete temporal information is sent to after client, further includes:
Receive the instruction information that the client returns;
When the instruction information includes the business critical state information, triggering executes described crucial according to the business The step of state information updating service condition;When instruction information instruction is without handling and receiving when updating service condition The service request.
The 7th aspect of the embodiment of the present invention discloses a kind of data processing method, comprising:
Receive the return packet that first server is sent;The return packet includes business critical state information and the business The temporal information being disposed;
The temporal information that the business critical state information and the business processing that preservation receives finish;
Receive the temporal information that the business processing that second server is sent finishes;
The temporal information that the newest business processing that comparison saves finishes and the business processing that the second server is sent are complete Complete temporal information;
It is finished when the time that the newest business processing of preservation finishes is later than from the business processing that the second server is sent Time when, to the second server return save business critical state information.
In conjunction with the 7th aspect, in the first possible implementation, further includes:
When time that the newest business processing of preservation finishes and the business processing that the second server is sent finish Between it is consistent when, to the second server send instruction information, the instruction information be used to indicate is not necessarily to update service condition.
In conjunction with the first possible implementation of the 7th aspect or the 7th aspect, second of possible realization side In formula, the temporal information that the business critical state information and the business processing finish, which is arranged in, described returns to the public of packet In head information;
The business critical state information that preservation is returned to the second server includes: to return to the second server Return the public head information.
Eighth aspect of the embodiment of the present invention discloses a kind of computer storage medium, and the computer storage medium is stored with Program, described program include the first possible realization side of the third aspect of the embodiment of the present invention or the third aspect when executing Formula perhaps fourth aspect perhaps fourth aspect the first possible implementation perhaps the 5th aspect or the 5th aspect The first possible implementation or the 5th aspect second of possible implementation disclosed in data processing method Overall Steps.
The implementation of the embodiments of the present invention has the following beneficial effects:
By implementing the embodiment of the present invention, the temporal information that first server record traffic is disposed, and generates and include The return packet for the temporal information that business critical state information and business processing finish;The temporal information that the business processing is finished It is synchronized to second server, and the return packet is sent to client;When service switching occurs for first server, second clothes The service request that device reception client of being engaged in is sent, is sent to the client for the temporal information that the newest business processing of preservation finishes End is later than the industry sent from the second server when the time that the newest business processing that the client compares out local terminal preservation finishes When the time that business is disposed, the business critical state information saved is returned to the second server;So that the second server Service condition is updated according to the business critical state information that client is sent, and after update, triggering processing is received Service request;It solves in the prior art when time delay occur longer or breaking for the link of across computer room disaster tolerance synchrodata, so that Data transformation unanimously causes service switching to handle slack technical problem when primary server is switched to standby server, passes through Guarantee the consistency of data from client, so that user, which does not feel as, to be appointed when active/standby server switching What data it is inconsistent, greatly reduce the complaint of user, save customer service resource, and improve the experience of user.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the schematic diagram of High Availabitity framework in the prior art;
Fig. 2 is the structural schematic diagram of data processing system provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of server provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of another embodiment of server provided by the invention;
Fig. 5 is the structural schematic diagram of another embodiment of server provided by the invention;
Fig. 6 is the structural schematic diagram of client provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another embodiment of client provided by the invention;
Fig. 8 is the flow diagram of data processing method provided in an embodiment of the present invention;
Fig. 9 is the flow diagram of another embodiment of data processing method provided by the invention;
Figure 10 is the flow diagram of another embodiment of data processing method provided by the invention;
Figure 11 is the flow diagram of another embodiment of data processing method provided by the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The structural schematic diagram of data processing system provided in an embodiment of the present invention as shown in Figure 2, first illustrates number of the present invention According to the scene framework of processing system 20, data processing system 20 may include first server 200, multiple second servers 202 With multiple client 204, wherein data processing system 20 is active and standby server architecture, and first server 200 is primary server, the Two servers 202 are standby server, and business datum has primary server to be synchronized to standby server, to include 1 second service in Fig. 2 It is illustrated for device 202 and 1 client 204:
First server 200 be disposed client 204 transmission service request after, record traffic be disposed when Between information, and generate the return packet of the temporal information finished comprising business critical state information and business processing;By record The temporal information that business processing finishes is synchronized to second server 202;And it is sent to client 204 by packet is returned, so that client The temporal information that 204 preservation business critical state information of end and business processing finish;
Second server 202 receives and saves the temporal information that the business processing of the transmission of first server 200 finishes;When When service switching occurs for one server 200, second server 202 receives the service request that client is sent, by the newest of preservation The temporal information that finishes of business processing be sent to client 204;
After client 204 receives the temporal information that the business processing that second server 202 is sent finishes, compares local terminal and save The temporal information that finishes of newest business processing and the temporal information that finishes of the business processing that sends of second server 202;And work as The time that the newest business processing that local terminal saves finishes is later than the time finished from the business processing that second server 202 is sent When, the business critical state information saved is returned to second server 202;
After second server 202 receives the business critical state information of the return of client 204, according to business key state Information update service condition, and after update, triggering handles the service request received.
Specifically, the business in the embodiment of the present invention includes but is not limited to game service;Client in the embodiment of the present invention End includes but is not limited to personal computer PC, mobile phone, removable computer, tablet computer, personal digital assistant (Personal Digital Assistant, PDA), media player, smart television, smartwatch, intelligent glasses, Intelligent bracelet etc. can be with Server interacts and the user equipment of finishing service.Business key shape by taking game service as an example, in the embodiment of the present invention State information may include the status information of game key, game user information.It is illustrated below by example of game service:
User establishes connection by client 204 and first server 200 (i.e. primary server), logs in into game, should First server 200 receives the game request of the client 204 transmission, and is handled, and records to the secondary game request The temporal information finished is managed, and generates the status information comprising game key, game user information and game request processing The return packet of the temporal information finished;The temporal information that the game request of above-mentioned record is disposed by the first server 200 It is synchronized in second server 202 (i.e. for server), and the return packet is sent to the client 204, which connects After receiving the return packet, status information, game user information and the game request of the game key in the return packet are saved The temporal information being disposed.When the first server 200 breaks down or service switching occurs on demand, again may be by Zookeeper carries out active-standby switch, and by service switching to the second server 202, second server 202 receives the client 204 game requests sent, but temporarily do not handle the game request, but first by the newest business processing of preservation finish when Between information be sent to the client 204, the client 204 receive the second server 202 send business processing finish when Between after information, compare at the temporal information that the newest business processing that local terminal saves finishes and the business that second server 202 is sent Manage the temporal information finished;And it is sent when the time that the newest business processing that local terminal saves finishes is later than from second server 202 Business processing finish time when, to second server 202 returns to the status information of game key saved, game user is believed Breath;Second server 202 is after the business critical state information for receiving the return of client 204, according to the shape of game key State information, game user information update service condition, and after update, triggering handles the game request received.If objective The time that the newest business processing that family end 204 compares out local terminal preservation finishes and the business processing that second server 202 is sent are complete When complete time consistency, then it can indicate that the second server 202 does not have to carry out service condition update, second server 202 can The game request received is handled with direct.
It can solve through the embodiment of the present invention in the prior art when time delay occurs in the link of across computer room disaster tolerance synchrodata It is longer or breaking, so that data transformation unanimously causes service switching processing not flowed when primary server is switched to standby server Smooth technical problem, by guaranteeing the consistency of data from client, so that being used when active/standby server switching Family does not feel as the inconsistent of any data, greatly reduces the complaint of user, saves customer service resource, and improve use The experience at family.
The structure of the first server of data processing system 20 during an embodiment of the present invention will be described in detail below, as Fig. 3 is shown Server provided in an embodiment of the present invention structural schematic diagram, server 30 be above-mentioned Fig. 2 embodiment in first service Device 200, server 30 may include: processing time recording module 300, return to packet generation module 302, record time synchronization module 304 and service request return module 306, wherein
Processing time recording module 300 is used for after the service request of client transmission that is disposed, record traffic processing The temporal information finished;
Specifically, after the game service that the main service processes of server 30 have handled client (i.e. game player) is requested, It can be in the game state data lab setting one newest temporal information Record Time being disposed.Server 30 can lead to Cross the temporal information that the newest business processing of separate threads 5~10ms time recording finishes.
It returns to packet generation module 302 to be used for after the service request of client transmission that is disposed, generates and closed comprising business The return packet for the temporal information that bonded state information and the business processing finish;
Specifically, the temporal information that the business critical state information of the generation and business processing finish, which can be set, to be returned It returns in the public head information of packet, that is to say, that public head information can be increased newly in returning to packet, business key state letter is arranged The temporal information that breath and business processing finish.
Record time synchronization module 304 is used to the temporal information that the business processing of record finishes being synchronized to the second clothes Business device;
Specifically, second server is the standby server (i.e. standby server) of the server 30, when first clothes When service switching occurs for business device, by the service switching to the second server;Server 30 will include newest handled The game state data of complete Record Time is synchronized to the second server.
Service request return module 306 is used to return packet being sent to the client, so that the client is protected Deposit the business critical state information and temporal information that the business processing finishes.
Further, the structural schematic diagram of another embodiment of server provided by the invention as shown in Figure 4, server 40 be the second server 202 in above-mentioned Fig. 2 embodiment, and server 40 may include: the time to receive preserving module 400, industry Business receiving module 402, temporal information sending module 404 and processing business and updates module 406, wherein
Time receives preserving module 400 and is used to receive and save the time letter that the business processing of first server transmission finishes Breath;
Specifically, the time receives preserving module 400 and receives the time letter that the business processing of first server transmission finishes It, can be by the information preservation in the game state data library of local terminal after breath.
Business receiving module 402 is used to receive the industry that client is sent when service switching occurs for the first server Business request;
Specifically, if first server heartbeat timeout or actively surrendering limit with sovereign right, can known standby server cut Sovereignty limit is changed to provide service, then primary server permission can be arranged in the second server 202 first, and is needed local terminal Game state data lab setting be main server state, receive client send service request.
Temporal information sending module 404 is used to receive the time when service switching occurs for the first server The temporal information that the newest business processing saved in preserving module finishes is sent to client;
Specifically, server 40 reads newest Record Time in local terminal game state data library, and can be by this most New Record Time is broadcast to all clients.
Processing business and updates module 406, which is used to work as, receives the time that the client is finished according to the newest business processing After the business critical state information that information returns, service condition is updated according to the business critical state information, and updating Bi Hou, the service request that triggering processing business receiving module 402 receives.
Specifically, after the temporal information that the business processing that client receives that second server is sent finishes, itself will be compared The temporal information that the newest business processing saved finishes and the temporal information finished from the received business processing of server 40, and work as When the time that finishes of newest business processing itself saved was later than from the time that the received business processing of server 40 finishes, to clothes Business device 40 returns to the newest business critical state information saved in itself, and processing business and updates module 406 receives the business key shape After state information, service condition is updated according to the business critical state information, and after update, triggering processing business receives mould The service request that block 402 receives.
Still further, the structural schematic diagram of another embodiment of server provided by the invention as shown in Figure 5, service Device 40 includes the time receiving preserving module 400, business receiving module 402, temporal information sending module 404 and processing business and updates module Outside 406, can also include return information receiving module 408 and Service Processing Module 4010, wherein
Return information receiving module 408 is used to send what newest business processing finished in temporal information sending module 404 After temporal information gives the client, the instruction information that the client returns is received;
Specifically, after the temporal information that the newest business processing that client receives the transmission of server 40 finishes, will compare The temporal information that the business processing that the temporal information and server 40 finish to the newest business processing that local terminal saves is sent finishes, And instruction information is returned to server 40;It is later than when the time that the newest business processing that client local terminal saves finishes from server When the time that 40 business processings sent finish, which includes the business critical state information that client local terminal saves, It is finished when the business processing of time and the transmission of server 40 that the newest business processing that client compares out local terminal preservation finishes When time consistency, which is used to indicate without updating service condition.
It will be appreciated that the business critical state information can be set in public head information, i.e., when client local terminal is protected The time that the newest business processing deposited finishes be later than from server 40 send business processing finish time when, can be the guarantor The time that the newest business processing deposited finishes, corresponding public head information was sent to server 40.
Service Processing Module 4010 is used for when the instruction information is comprising the business critical state information, business more After new module 406 updates service condition, service request that processing business receiving module 402 receives;Or work as the instruction information Instruction is without the service request that when updating service condition, processing business receiving module 402 is received.
Correspondingly, below with reference to the structural schematic diagram of the client provided in an embodiment of the present invention shown in Fig. 6, corresponding explanation The embodiment of client 60 in the embodiment of the present invention, client 60 may include returning to packet receiving module 600, information preservation mould Block 602, temporal information receiving module 604, time comparison module 606 and business information return module 608, wherein
Return to the return packet that packet receiving module 600 is used to receive first server transmission;The return packet is closed comprising business The temporal information that bonded state information and the business processing finish;
Specifically, the main service processes of first server have handled the game service request of client 60 (i.e. game player) It afterwards, can be in the game state data lab setting one newest temporal information Record Time being disposed.First server can With the temporal information finished by the newest business processing of separate threads 5~10ms time recording;First server is by the return Packet is sent to client 60, so that the time letter that client 60 saves the business critical state information and the business processing finishes Breath.The return packet receiving module 600 of client 60 receives the return packet of first server transmission.
Information preservation module 602 is used to save the business critical state information received and the business processing is complete Complete temporal information;
Specifically, information preservation module 602 the business critical state information and the business processing can be finished when Between information preservation in data mode database.
Temporal information receiving module 604 is used to receive the temporal information that the business processing of second server transmission finishes;
Specifically, if first server heartbeat timeout or actively surrendering limit with sovereign right, can known standby server cut Sovereignty limit is changed to provide service, then primary server permission can be arranged in the second server first, and is needed local terminal Game state data lab setting is main server state, receives the service request that client is sent.Second server reads local terminal Newest Record Time in game state data library, and the newest Record Time can be broadcast to all clients End.The temporal information that the business processing that so temporal information receiving module 604 receives that second server is sent finishes.
The time that newest business processing of the time comparison module 606 for saving in comparison information preserving module 602 finishes The temporal information that information and the received business processing of temporal information receiving module 604 finish;
Business information return module 608 is used for when the newest business processing saved in information preservation module 602 finishes Between when being later than from the time that the received business processing of temporal information receiving module 604 finishes, return and believe to the second server The business critical state information saved in breath preserving module 602.
Specifically, time comparison module 606 will compare the temporal information that finishes of newest business processing of itself preservation with from The temporal information that the received business processing of second server finishes, and work as evening time that the newest business processing that itself is saved finishes When the time finished from the received business processing of second server, business information return module 608 is returned to second server The newest business critical state information saved in itself, after second server receives the business critical state information, according to this Business critical state information updates service condition, and after update, and triggering handles the service request received.
Further, the structural schematic diagram of another embodiment of client provided by the invention as shown in Figure 7, client 60 include returning to packet receiving module 600, information preservation module 602, temporal information receiving module 604,606 and of time comparison module It can also include instruction information return module 6010, for when in information preservation module 602 outside business information return module 608 The time one that the time and the received business processing of temporal information receiving module that the newest business processing saved finishes finish When cause, instruction information is sent to the second server, the instruction information is used to indicate without updating service condition.
It will be appreciated that the temporal information that the business critical state information and the business processing finish can be set in institute It states in the public head information for returning to packet;
The newest business processing that business information return module 608 is specifically used for saving in information preservation module 602 finishes Time when being later than from the time that the received business processing of temporal information receiving module 604 finishes, returned to the second server The public head information.
By implementing the embodiment of the present invention, the temporal information that first server record traffic is disposed, and generates and include The return packet for the temporal information that business critical state information and business processing finish;The temporal information that the business processing is finished It is synchronized to second server, and the return packet is sent to client;When service switching occurs for first server, second clothes The service request that device reception client of being engaged in is sent, is sent to the client for the temporal information that the newest business processing of preservation finishes End is later than the industry sent from the second server when the time that the newest business processing that the client compares out local terminal preservation finishes When the time that business is disposed, the business critical state information saved is returned to the second server;So that the second server Service condition is updated according to the business critical state information that client is sent, and after update, triggering processing is received Service request;It solves in the prior art when time delay occur longer or breaking for the link of across computer room disaster tolerance synchrodata, so that Data transformation unanimously causes service switching to handle slack technical problem when primary server is switched to standby server, passes through Guarantee the consistency of data from client, so that user, which does not feel as, to be appointed when active/standby server switching What data it is inconsistent, greatly reduce the complaint of user, save customer service resource, and improve the experience of user.
For the ease of better implementing the above scheme of the embodiment of the present invention, the present invention is also corresponding to be provided at a kind of data Reason method, the flow diagram of data processing method provided in an embodiment of the present invention as shown in Figure 8, (i.e. from primary server first First server) side describes, comprising:
Step S800: after the service request of client transmission that is disposed, the temporal information that record traffic is disposed, And generate the return packet of the temporal information finished comprising business critical state information and the business processing;
Step S802: the temporal information that the business processing of record finishes is synchronized to second server;
Wherein the second server is the standby server of the first server, when industry occurs for the first server When business switching, by the service switching to the second server;
Step S804: being sent to the client for return packet, so that the client saves the business key The temporal information that status information and the business processing finish.
Specifically, the embodiment of the data processing method of Fig. 8 embodiment can be corresponded to reference to right in above-mentioned Fig. 3 embodiment The associated description of server 30, which is not described herein again.
Further, the flow diagram of another embodiment of data processing method provided by the invention as shown in Figure 9, It is described from standby server (i.e. second server) side, comprising:
Step S900: the temporal information that the business processing of first server transmission finishes is received and saved;
Step S902: when service switching occurs for the first server, the service request that client is sent is received, will be protected The temporal information that the newest business processing deposited finishes is sent to client;
Step S904: it is returned when the temporal information for receiving the client and being finished according to the newest business processing After business critical state information, service condition is updated according to the business critical state information, and after update, at triggering Manage the service request received.
It specifically, can also include: the instruction information for receiving the client and returning after step S902;When the finger When showing that information includes the business critical state information, triggering executes described according to the business critical state information more new business The step of state;When instruction information instruction is without handling the service request received when updating service condition.
Specifically, the embodiment of the data processing method of Fig. 9 embodiment can be corresponded to implements with reference to above-mentioned Fig. 4 and Fig. 5 To the associated description of server 40 in example, which is not described herein again.
Still further, the process signal of another embodiment of data processing method provided by the invention as shown in Figure 10 Figure, describes from client (i.e. user terminal) side, comprising:
Step S1000: the return packet that first server is sent is received;Return packet comprising business critical state information with And the temporal information that the business processing finishes;
The time that step S1002: saving the business critical state information received and the business processing finishes Information;
Step S1004: the temporal information that the business processing that second server is sent finishes is received;
Step S1006: temporal information and second server transmission that the newest business processing of preservation finishes are compared The temporal information that business processing finishes;
Step S1008: it is later than the industry sent from the second server when the time that the newest business processing of preservation finishes When the time that business is disposed, the business critical state information saved is returned to the second server.
Specifically, the data processing method of the embodiment of the present invention can also include: when the newest business processing saved finishes Time and the second server send business processing finish time consistency when, to the second server send indicate Information, the instruction information are used to indicate without updating service condition.
Further, the temporal information that the business critical state information and the business processing finish is arranged in the return packet Public head information in;
It includes: to return to the public affairs to the second server that this, which returns to the business critical state information saved to the second server, Head information altogether.
Specifically, the embodiment of the data processing method of Figure 10 embodiment can be corresponded to reference in above-mentioned Fig. 6 embodiment To the associated description of client 60, which is not described herein again.
Still further, the process signal of another embodiment of data processing method provided by the invention as shown in Figure 11 Figure, described from primary server (i.e. first server), standby server (second server) and three side of client, in figure with It is illustrated for 1 standby server and 1 client, comprising:
Step S1100: after the service request of client transmission that is disposed, record traffic is disposed first server Temporal information, and generate the return packet of the temporal information finished comprising business critical state information and the business processing;
Step S1102: the temporal information that the business processing of record finishes is synchronized to second service by first server Device;
Step S1104: second server receives and saves the temporal information that the business processing of first server transmission finishes;
Step S1106: return packet is sent to the client by first server, so that the client saves institute State business critical state information and temporal information that the business processing finishes;
Specifically, the execution sequence of step S1102 and step S1106 can successively be executed as any, or be performed simultaneously.
Step S1108: client receives the return packet that first server is sent;The return packet includes business key state The temporal information that information and the business processing finish;
Step S1110: client saves the business critical state information received and the business processing finishes Temporal information;
Step S1112: when service switching occurs for the first server, second server receives the industry that client is sent Business request, is sent to client for the temporal information that the newest business processing of preservation finishes;
Step S1114: client receives the temporal information that the business processing that second server is sent finishes;
Step S1116: client compares the temporal information and the second server that the newest business processing saved finishes The temporal information that the business processing of transmission finishes;
Step S1118: it is sent out when the time that the newest business processing that client saves finishes is later than from the second server When the time that the business processing sent finishes, client returns to the business critical state information saved to the second server;
Step S1120: when second server, which receives the client, to be finished according to the newest business processing Between after the business critical state information that returns of information, service condition is updated according to the business critical state information, and is being updated After, triggering handles the service request received.
It will be appreciated that step S1118 can also be time that the newest business processing saved when client finishes and institute When stating the time consistency that the business processing that second server is sent finishes, client sends instruction letter to the second server Breath, the instruction information are used to indicate without updating service condition;Second server will directly handle the business received Request.
In conclusion by the implementation embodiment of the present invention, the temporal information that first server record traffic is disposed, and Generate the return packet of the temporal information finished comprising business critical state information and business processing;The business processing is finished Temporal information is synchronized to second server, and the return packet is sent to client;When service switching occurs for first server, The second server receives the service request that client is sent, and the temporal information that the newest business processing of preservation is finished is sent The client is given, is later than when the time that the newest business processing that the client compares out local terminal preservation finishes from the second server When the time that the business processing of transmission finishes, the business critical state information saved is returned to the second server;So that this Two servers update service condition according to the business critical state information that client is sent, and after update, triggering processing The service request received;It solves in the prior art when time delay occur longer or disconnected for the link of across computer room disaster tolerance synchrodata Road, so that data transformation unanimously causes service switching to handle slack technology and asks when primary server is switched to standby server Topic, by guaranteeing the consistency of data from client, so that user can't feel when active/standby server switching Feel the inconsistent of any data, greatly reduce the complaint of user, save customer service resource, and improves the experience of user.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (16)

1. a kind of server, which is characterized in that the server is first server, comprising:
Handle time recording module, for be disposed client transmission service request after, what record traffic was disposed Temporal information;
Packet generation module is returned to, for after the service request of client transmission that is disposed, generating to include business key state The return packet for the temporal information that information and the business processing finish;
Time synchronization module is recorded, the temporal information for finishing the business processing of record is synchronized to second server; Wherein the second server is the standby server of the first server, when service switching occurs for the first server When, the second server receives the service request that the client is sent, by the newest business processing of preservation finish when Between information be sent to the client;
Service request return module, for return packet to be sent to the client;So that described in the client preservation The temporal information that business critical state information and the business processing finish, and when the first server cuts the business When shifting to the second server, the temporal information and the second server that the newest business processing that local terminal saves finishes are compared The temporal information that the business processing of transmission finishes;And when time for finishing of newest business processing that local terminal saves is later than from described the When the time that the business processing that two servers are sent finishes, the business key state letter saved is returned to the second server Breath;So that the second server updates service condition according to the business critical state information that the client returns, and more After new, triggering handles the service request received.
2. server as described in claim 1, which is characterized in that the business critical state information and the business processing The temporal information finished is arranged in the public head information for returning to packet.
3. a kind of server, which is characterized in that the server is second server, comprising:
Time receives preserving module, the temporal information that the business processing for receiving and saving first server transmission finishes;
Business receiving module, for receiving the service request that client is sent when service switching occurs for the first server;
Temporal information sending module, for the time being received and saves mould when service switching occurring for the first server The temporal information that the newest business processing saved in block finishes is sent to client;So that the client compares local terminal and saves The temporal information that finishes of newest business processing and the temporal information that finishes of the business processing that sends of the second server;And work as The time that the newest business processing that local terminal saves finishes is later than the time finished from the business processing that the second server is sent When, the business critical state information saved is returned to the second server;The business processing that the client is saved in local terminal The temporal information and business critical state information finished is the letter that the first server is sent after the service request that is disposed Breath;
Processing business and updates module is returned for that ought receive the client according to the temporal information that the newest business processing finishes After the business critical state information returned, service condition is updated according to the business critical state information, and after update, touching Hair handles the service request that the business receiving module receives.
4. server as claimed in claim 3, which is characterized in that further include:
Return information receiving module, for sending the time letter that newest business processing finishes in the temporal information sending module It ceases to the instruction information for after the client, receiving the client return;
Service Processing Module is used for when the instruction information includes the business critical state information, in the processing business and updates After module updates service condition, the service request that the business receiving module receives is handled;Or when the instruction information indicates When without updating service condition, the service request that the business receiving module receives is handled.
5. a kind of client characterized by comprising
Packet receiving module is returned to, for receiving the return packet of first server transmission;The return packet includes business key state The temporal information that information and business processing finish;
Information preservation module, for saving the business critical state information received and when the business processing finishes Between information;
Temporal information receiving module, the temporal information that the business processing for receiving second server transmission finishes;Wherein, described Second server is the standby server of the first server, and the temporal information that the business processing finishes is first clothes Business device is synchronized to the information of the second server after the service request that is disposed, and when business occurs for the first server When switching, the second server receives the service request that the client is sent, and sends the newest of preservation to the client The temporal information that finishes of business processing;
Time comparison module, for compare temporal information that the newest business processing saved in the information preservation module finishes with The temporal information that the received business processing of temporal information receiving module finishes;
Business information return module, the time for finishing when the newest business processing saved in the information preservation module are later than When from the time that the received business processing of temporal information receiving module finishes, the information is returned to the second server The business critical state information saved in preserving module;So that the second server is closed according to the business that the client returns Bonded state information update service condition, and after update, triggering handles the service request received.
6. client as claimed in claim 5, which is characterized in that further include:
Indicate information return module, time and institute for finishing when the newest business processing saved in the information preservation module When stating the time consistency that the received business processing of temporal information receiving module finishes, instruction letter is sent to the second server Breath, the instruction information are used to indicate without updating service condition.
7. such as client described in claim 5 or 6, which is characterized in that the business critical state information and the business The temporal information being disposed is arranged in the public head information for returning to packet;
What the newest business processing that the business information return module is specifically used for saving in the information preservation module finished When time was later than from the time that the received business processing of temporal information receiving module finishes, returned to the second server The public head information.
8. a kind of data processing system, which is characterized in that including first server, second server and client, wherein
The first server is after the service request that the client is sent that is disposed, time that record traffic is disposed Information, and generate the return packet of the temporal information finished comprising business critical state information and the business processing;It will record The temporal information that finishes of the business processing be synchronized to the second server;Return packet is sent to the client End, so that the temporal information that the client saves the business critical state information and the business processing finishes;
The second server receives and saves the temporal information that the business processing that the first server is sent finishes;When described When service switching occurs for first server, the service request that the client is sent is received, by the newest business processing of preservation The temporal information finished is sent to the client;
After the client receives the temporal information that the business processing that the second server is sent finishes, compare what local terminal saved The temporal information that the business processing that the temporal information and the second server that newest business processing finishes are sent finishes;And when this When time for finishing of newest business processing that end saves was later than from the time that the business processing that the second server is sent finishes, The business critical state information saved is returned to the second server;
After the second server receives the business critical state information that the client returns, according to the business key shape State information update service condition, and after update, triggering handles the service request received.
9. system as claimed in claim 8, which is characterized in that the first server is clothes as claimed in claim 1 or 2 Business device, the second server are server as described in claim 3 or 4, and the client is as claim 5-7 is any Client described in.
10. a kind of data processing method characterized by comprising
After the service request of client transmission that is disposed, the temporal information that record traffic is disposed, and generating includes industry The return packet for the temporal information that business critical state information and the business processing finish;
The temporal information that the business processing of record finishes is synchronized to second server;Wherein the second server is the The standby server of one server, when service switching occurs for the first server, the second server receives the visitor The service request that family end is sent, is sent to the client for the temporal information that the newest business processing of preservation finishes;
Return packet is sent to the client;So that the client saves the business critical state information and institute The temporal information that business processing finishes is stated, and when the first server is by the service switching to the second server, Compare what the business processing that the temporal information that the newest business processing that local terminal saves finishes is sent with the second server finished Temporal information;And when the time that the newest business processing that local terminal saves finishes is later than from the business that the second server is sent When managing the time finished, the business critical state information saved is returned to the second server;So that the second server Service condition is updated according to the business critical state information that the client returns, and after update, triggering processing is received The service request arrived.
11. method as claimed in claim 10, which is characterized in that the business critical state information and the business processing The temporal information finished is arranged in the public head information for returning to packet.
12. a kind of data processing method characterized by comprising
Receive and save the temporal information that the business processing of first server transmission finishes;
When service switching occurs for the first server, the service request that client is sent is received, by the newest industry of preservation The temporal information for being engaged in being disposed is sent to client;So that the client compares the newest business processing that local terminal saves and finishes Temporal information and the temporal information that finishes of business processing that sends of second server;And when the newest business processing of local terminal preservation The time finished be later than from the second server send business processing finish time when, to the second server return The business critical state information of preservation;The temporal information and business key that the client is finished in the business processing that local terminal saves Status information is the information that the first server is sent after the service request that is disposed;
When the business key state for receiving the temporal information return that the client is finished according to the newest business processing After information, service condition is updated according to the business critical state information, and after update, triggering handles the industry received Business request.
13. method as claimed in claim 12, which is characterized in that it is described by the newest business processing of preservation finish when Between information be sent to after client, further includes:
Receive the instruction information that the client returns;
When the instruction information includes the business critical state information, triggering executes described according to the business key state The step of information update service condition;When the instruction information instruction without update service condition when, handle receive it is described Service request.
14. a kind of data processing method characterized by comprising
Receive the return packet that first server is sent;The return packet is finished comprising business critical state information and business processing Temporal information;
The temporal information that the business critical state information and the business processing that preservation receives finish;
Receive the temporal information that the business processing that second server is sent finishes;Wherein, the second server is described first The standby server of server, the temporal information that the business processing finishes are that the first server is asked in the business of being disposed The information of the second server is synchronized to after asking, and when service switching occurs for the first server, the second service Device receives the service request that client is sent, and sends the time letter that the newest business processing saved finishes to the client Breath;
Compare what the business processing that the temporal information that the newest business processing saved finishes is sent with the second server finished Temporal information;
When the time that the newest business processing of preservation finishes be later than from the second server send business processing finish when Between when, to the second server return save business critical state information;So that the second server is according to the visitor The business critical state information that family end returns updates service condition, and after update, and triggering handles the industry received Business request.
15. method as claimed in claim 14, which is characterized in that further include:
When the time one that the business processing that time and the second server that the newest business processing of preservation finishes send finishes When cause, instruction information is sent to the second server, the instruction information is used to indicate without updating service condition.
16. the method as described in claims 14 or 15, which is characterized in that the business critical state information and the business The temporal information being disposed is arranged in the public head information for returning to packet;
The business critical state information for returning to preservation to the second server includes: to return to institute to the second server State public head information.
CN201510528093.XA 2015-08-25 2015-08-25 A kind of data processing method, server, client and system Active CN105207809B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510528093.XA CN105207809B (en) 2015-08-25 2015-08-25 A kind of data processing method, server, client and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510528093.XA CN105207809B (en) 2015-08-25 2015-08-25 A kind of data processing method, server, client and system

Publications (2)

Publication Number Publication Date
CN105207809A CN105207809A (en) 2015-12-30
CN105207809B true CN105207809B (en) 2019-01-15

Family

ID=54955262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510528093.XA Active CN105207809B (en) 2015-08-25 2015-08-25 A kind of data processing method, server, client and system

Country Status (1)

Country Link
CN (1) CN105207809B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308643B (en) * 2017-07-27 2022-04-08 阿里巴巴集团控股有限公司 Backing data generation method, data disaster tolerance method and related equipment
CN110019520B (en) * 2017-11-29 2022-09-23 财付通支付科技有限公司 Service execution method, system and device
CN109600430A (en) * 2018-11-29 2019-04-09 深圳市网心科技有限公司 A kind of data managing method, system and electronic equipment and storage medium
CN113452665B (en) * 2020-07-10 2022-09-16 北京新氧科技有限公司 Authority processing method, system and equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7188273B2 (en) * 2003-11-24 2007-03-06 Tsx Inc. System and method for failover
CN100499637C (en) * 2004-10-26 2009-06-10 华为技术有限公司 Method for obtaining information in communication system
CN100464308C (en) * 2007-04-20 2009-02-25 北京搜狗科技发展有限公司 Method and system for updating user vocabulary synchronouslly
CN102263663A (en) * 2011-08-09 2011-11-30 北京佳讯飞鸿电气股份有限公司 Double-network management server data maintenance method
CN104252500B (en) * 2013-06-29 2017-11-28 北京新媒传信科技有限公司 The fault repairing method and device of a kind of database management platform

Also Published As

Publication number Publication date
CN105207809A (en) 2015-12-30

Similar Documents

Publication Publication Date Title
CN105207809B (en) A kind of data processing method, server, client and system
US4949373A (en) Host load balancing
CN105335221B (en) Based on restructural distributed software bus
CN103338243B (en) The data cached update method and system of Web node
US20160196279A1 (en) Enterprise level data collection systems and methodologies
CN111090699A (en) Service data synchronization method and device, storage medium and electronic device
CN109753364A (en) A kind of implementation method, equipment and the medium of network-based distributed lock
CN101771723A (en) Data synchronization method
CN107544837B (en) Cloud service equipment performance data acquisition system, method and device
CN110855737B (en) Consistency level controllable self-adaptive data synchronization method and system
US20130191517A1 (en) System, server and method for reproducing topological change using device events
CN106712973B (en) A kind of method and system of binding session
CN111970304A (en) Message processing method and device
CN110392120A (en) The restoration methods and device of failure during a kind of push of message
CN103701653B (en) The processing method of a kind of interface hot plug configuration data and network configuration server
CN101778131A (en) Data synchronization system
CN106897288A (en) The service providing method and system of database
CN108650168B (en) Method and device for acquiring member data of multi-person session, storage medium and processor
CN110134541A (en) Switching method, system, equipment and the storage medium of the configuration information of storage cluster
EP2429142A1 (en) Seats processing method, exchange and call center
CN110502510A (en) A kind of real-time analysis of WIFI terminal equipment track data and De-weight method and system
CN101789963A (en) Data synchronization system
CN110297822A (en) Key management method, device, equipment and storage medium towards block chain
CN113849127A (en) SAN storage dual-active network-based arbitration method and device and electronic equipment
CN111522650A (en) Service request processing method and device of distributed system and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20151230

Assignee: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Contract record no.: X2021980000151

Denomination of invention: A data processing method, server, client and system

Granted publication date: 20190115

License type: Common License

Record date: 20210107