CN105915572A - Mobile terminal data conflict processing method and device - Google Patents

Mobile terminal data conflict processing method and device Download PDF

Info

Publication number
CN105915572A
CN105915572A CN201510921272.XA CN201510921272A CN105915572A CN 105915572 A CN105915572 A CN 105915572A CN 201510921272 A CN201510921272 A CN 201510921272A CN 105915572 A CN105915572 A CN 105915572A
Authority
CN
China
Prior art keywords
data
request
request data
sourceid
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510921272.XA
Other languages
Chinese (zh)
Inventor
江丹
杨丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Original Assignee
LeTV Mobile Intelligent Information Technology Beijing 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 LeTV Mobile Intelligent Information Technology Beijing Co Ltd filed Critical LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Priority to CN201510921272.XA priority Critical patent/CN105915572A/en
Publication of CN105915572A publication Critical patent/CN105915572A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/08Protocols specially adapted for terminal emulation, e.g. Telnet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W74/00Wireless channel access
    • H04W74/08Non-scheduled access, e.g. ALOHA
    • H04W74/0833Random access procedures, e.g. with 4-step access
    • H04W74/0841Random access procedures, e.g. with 4-step access with collision treatment
    • H04W74/085Random access procedures, e.g. with 4-step access with collision treatment collision avoidance

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a mobile terminal data conflict processing method and device. The method comprises the steps that different client sides logging in the same account number respectively transmit an adding, modifying and deleting request to a server, wherein the adding, modifying and deleting request includes request data; if a data conflict of the request data exists, the client sides delete sourceid of the request data and generate new sourceid for the request data; and the client sides upload the request data having new sourceid to the server. The problem of loss caused by the fact that multiple client sides modify the same note in the prior art can be solved through a conflict event processing mechanism by the mobile terminal data conflict processing method and device.

Description

A kind of method and apparatus of mobile terminal processing data collision
Technical field
The present embodiments relate to technical field of mobile terminals, particularly relate to a kind of mobile terminal and process The method and apparatus of data collision.
Background technology
In recent years, developing rapidly and mobile terminal Intellectualized Tendency along with mobile communication technology Accelerating, people are just entering into new mobile Internet epoch.Varied possess network connection The mobile terminal of ability, the appearance of such as mobile phone, panel computer, electricity paper book etc., bring people Access the convenient of the Internet whenever and wherever possible.The appearance of Android, pushes to mobile terminal especially The epoch taken as the leading factor with application and data.The mobile-terminal platform of today has possessed office, joy The several functions such as happy, social, data of its storage also become more to enrich, such as picture, sound Pleasure, video, animation etc..
User enjoy dissimilar mobile terminal bring convenient time, also encounter multiple terminals and deposit The problem of the data uniformity management of storage.One of existing scheme of multiple terminals data syn-chronization can be with base Carry out in SyncML (Synchronization Markup Language) agreement, SyncML It is general mobile data synchronization agreement, can carry out at compatible equipment, program and network Data syn-chronization.
Additionally, the original synchronous architecture on mobile terminal can process synchronous event, make login The mobile terminal of one account can keep the synchronization of data.
Such as:
In the case of two mobile terminals of A, B log in same account,
When A increases a note newly, after synchronization, B also can obtain the note that this is newly-increased;
When A changes the content of a note, and after synchronization, B also can change this note;
When A deletes a note, and after synchronization, B also can delete this note.
But there is a kind of occasion, when A, B revise a note, and how that situation can be simultaneously ??
Fig. 1 is the schematic flow sheet that in prior art, client data synchronizes, and specifically comprises the following steps that
Newly-built data A of client are to server, and now the etag of A is null;
Retain the etag of A and A after server process success at server, pass to the etag of A To client;
Client amendment A, passes to server the etag of A and customer end A;
The etag that server transmits client compares with the etag of server.Repair if identical Change successful server and can update etag, and new etag is passed to client.Return if different Error code 412, it is believed that there occurs conflict.
It can be seen that after data synchronize each time, server all can give these data one special Character string etag, this etag represents the current data version at server.
The when of synchrodata, data may represent in multiple clients, and different data are used Sourceid uniquely indicates.Sourceid is increasing data newly to server when, to data The unique character string generated.Server also represents data with sourceid, and data exist After server inserts successfully, sourceid corresponding for data is updated in data base simultaneously.
If same edition data such as note N1 is modified by two clients, mobile Terminal A is revised as N11, mobile terminal B N1 and N1 is revised as N12.
If A request first arrives server, according to the logic of etag, the etag of N1 and service Etag on device is identical, then the N1 on server has just been modified to N11, and Server and client side A will update the etag of these data.
Then, when the request of second customer end B comes when, server finds the etag of B Different, will be it is thought that a kind of conflict request, the request of that second customer end B can be lost Lose.
According to the logic of original synchronization framework, after B asks unsuccessfully, will be the N11 on server It is synchronized to B client so that the N12 on B becomes again N11.
So, this amendment of N12 is just lost.
If two clients revise same note simultaneously, the amendment of a client can be lost Data, this is unacceptable for user.
Summary of the invention
The embodiment of the present invention provides the method and apparatus of a kind of mobile terminal processing data collision, passes through Collision event treatment mechanism solves the same note of multiple clients amendment in prior art and can lose Problem.
The embodiment of the present invention provides a kind of method of mobile terminal processing data collision, including:
The different clients logging in same account number sends newly-increased amendment removal request to server respectively, Described newly-increased amendment removal request comprises request data;
If described request data exists data collision, client is by the sourceid of described request data Delete, and be that described request data generates new sourceid;
On the request data with described new sourceid is uploaded onto the server by client.
The embodiment of the present invention provides a kind of mobile terminal for processing collision event, including:
First processing module, for sending newly-increased amendment removal request to server, described increasing newly is repaiied Change and removal request comprises request data;
, if there is data collision, by described request for described request data in the second processing module The sourceid of data deletes, and is that described request data generates new sourceid;
3rd processing module, for uploading to service by the request data with described new sourceid On device.
Compared to the prior art, the side of the mobile terminal processing data collision that the embodiment of the present invention provides Method and device, by regenerating new sourceid for there is the request data of data collision, have new The request data of sourceid is exactly a new request data, thus without there is data punching again Prominent, thus solve the same note of multiple clients amendment in prior art and can lose amendment data Problem.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will The accompanying drawing used required in embodiment or description of the prior art is briefly described, aobvious and easy Insight, the accompanying drawing in describing below is some embodiments of the present invention, for ordinary skill From the point of view of personnel, on the premise of not paying creative work, it is also possible to obtain it according to these accompanying drawings His accompanying drawing.
Fig. 1 is the schematic flow sheet that in prior art, client data synchronizes;
Fig. 2 be the present invention a specific embodiment in the method for mobile terminal processing data collision Schematic flow sheet;
Fig. 3 be the present invention a specific embodiment in the method for mobile terminal processing data collision Detailed process schematic diagram;
Fig. 4 be the present invention a specific embodiment in for processing the frame of the device of collision event Structure schematic diagram.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with Accompanying drawing in the embodiment of the present invention, carries out clear, complete to the technical scheme in the embodiment of the present invention Ground describes, it is clear that described embodiment is a part of embodiment of the present invention rather than whole Embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Embodiment one:
Fig. 2 be the present invention a specific embodiment in the method for mobile terminal processing data collision Schematic flow sheet.
As in figure 2 it is shown, the method is applied on mobile terminal, including:
Step S21, the different clients logging in same account number is deleted to the newly-increased amendment of server transmission respectively Except request, described newly-increased amendment removal request comprises request data;
Step S22, if request data exists data collision, client is by the sourceid of request data Delete, and generate new sourceid for request data;
Step S23, on the request data with new sourceid is uploaded onto the server by client.
Embodiment two:
Fig. 3 be the present invention a specific embodiment in the method for mobile terminal processing data collision Detailed process schematic diagram.
As it is shown on figure 3, the method is applied on mobile terminal, including:
Step S31, the different clients logging in same account number is deleted to the newly-increased amendment of server transmission respectively Except request, described newly-increased amendment removal request comprises request data.
In this step, the different clients logging in same account number uploads newly-increased repairing to server respectively Changing the request of deletion, this can be the process that a batch performs operation, and such as, client is to clothes Business device is newly-increased or revises 100 data, and these 100 data are put into can delete in a newly-increased amendment Except request.
Wherein newly-increased amendment removal request can be httpPut request, and concrete operations are: definition data Form, according to 100 data of data layout sequenceization of definition, and by 100 after serializing Data are put in httpPut request.
Step S32, after server receives request data, it is judged that whether request data exists data punching Prominent, if it is, carry out step S33;If it does not, carry out step S35.
In this step, increase data newly to server will not clash.Conflict occurs repairing In the request changed and delete, add that the sequencing conflict operation of synchronization is divided into three kinds:
1. amendment-amendment conflict;
2. amendment-delete conflict, this is that the request revised first arrives server.
3. deleting-amendment conflict, the request of deletion first arrives server.
After data synchronize each time, server all can give client one special string of these data Etag, this etag represent the current data version at server.
Such as, if mobile terminal A and mobile terminal B the two client are to same version number Being modified according to N1, mobile terminal A is revised as N11, mobile terminal B N1 revises N1 For N12.
If the request of A first arrives server, according to the logic of etag, the etag of N1 and service Etag on device is identical, then the N1 on server has just been modified to N11, and services Device and customer end A all will update the etag of these data.
Then, when the request of B comes when, server finds that the etag of B is different, will recognize Colliding data is included for this request.
In the prior art, the request of B can be failed, then the N11 on server can be synchronized to B, The N12 that B is revised becomes again N11.So, this amendment of N12 is just lost.
In the specific embodiment of the invention, if server receives the different visitors logging in same account number After the request data of family end, judge that this request data exists data punching according to the etag of request data Time prominent, can't be directly to the failure of B feedback request.
Step S33, server returns newly-increased amendment to client and deletes response, and this newly-increased amendment is deleted Respond the conditional code including request data.
In this step, if server receives the request of the different clients logging in same account number After data, when judging that this request data exists data collision according to the etag of request data, can be to visitor Family end returns newly-increased amendment and deletes response, and this newly-increased amendment is deleted and responded the state including request data Code, such as conditional code is 412 to represent this request data and there is data collision.
Step S34, client receives the newly-increased amendment deletion response that server returns, repaiies according to newly-increased Change the conditional code of request data during deletion is responded and determine when request data exists data collision, will request The sourceid of data deletes, and generates new sourceid for request data.
In this step, sourceid is deleting data to the newly-increased amendment of server when, gives number According to the unique character string generated.
Client receives the newly-increased amendment deletion response that server returns, if newly-increased amendment is deleted back In should, the conditional code of request data be 412, then it represents that request data exists data collision.
The sourceid of request data can be deleted by client, and generate new for request data Sourceid, removes the etag of this request data.
Because sourceid is one data of unique mark, owing to there is the number of request of data collision According to sourceid have changed to new sourceid, thus there is the request data of new sourceid just It it is a new request data.
Step S35, client is by the number of request with new sourceid in newly-increased amendment removal request On uploading onto the server.
In this step, sourceid is one data of unique mark, for server, tool The request data having new sourceid is exactly a new request data, thus without there is number again According to conflict.
Step S36, server is modified according to request data and is synchronized to client.
In this step, if the request of data that server receives does not exists data collision, then take Business device process according to existing mode, i.e. according to the logic of etag, the etag of request data and Etag on server is identical, then the data on server have just been modified to request data, And server and client side will update the etag of these data.
Embodiment three:
Fig. 4 be the present invention a specific embodiment in for processing the mobile terminal of collision event Structural representation.
As shown in Figure 4, the inventive system comprises:
First processing module 41, for sending newly-increased amendment removal request to server, described newly-increased Amendment removal request comprises request data;
, if there is data collision, by request data for request data in the second processing module 42 Sourceid deletes, and generates new sourceid for request data;
3rd processing module 43, for uploading onto the server the request data with new sourceid On.
Specifically,
Described first processing module, specifically for:
Definition data form;
Described Data Serialization request data according to definition;
Request data after serializing is put in httpPut request;
HttpPut request is sent to server.
Described second processing module, specifically for:
Receive the newly-increased amendment deletion response that server returns;
If delete the conditional code getting data collision responding from described newly-increased amendment, it is determined that There is data collision;
The sourceid of described request data is deleted, generates new sourceid for described request data, And remove the etag of described request data.
The method and apparatus of mobile terminal processing data collision that the embodiment of the present invention provides, by for The request data that there is data collision regenerates new sourceid, has the number of request of new sourceid According to being exactly a new request data, thus without there is data collision again, thus solve existing Multiple clients in technology are had to revise the problem that same note can lose amendment data.
Device embodiment described above is only schematically, wherein said as separating component The unit illustrated can be or may not be physically separate, the parts shown as unit Can be or may not be physical location, i.e. may be located at a place, or can also divide Cloth is on multiple NEs.Some or all of mould therein can be selected according to the actual needs Block realizes the purpose of the present embodiment scheme.Those of ordinary skill in the art are not paying creativeness In the case of work, i.e. it is appreciated that and implements.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive Each embodiment can add the mode of required general hardware platform by software and realize, and the most also may be used To pass through hardware.Based on such understanding, technique scheme is the most in other words to prior art The part contributed can embody with the form of software product, and this computer software product can With storage in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., including Some instructions with so that computer equipment (can be personal computer, server, or The network equipment etc.) perform the method described in some part of each embodiment or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, rather than It is limited;Although the present invention being described in detail with reference to previous embodiment, this area Those of ordinary skill is it is understood that it still can be to the technical scheme described in foregoing embodiments Modify, or wherein portion of techniques feature is carried out equivalent;And these are revised or replace Change, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (8)

1. the method for a mobile terminal processing data collision, it is characterised in that including:
The different clients logging in same account number sends newly-increased amendment removal request to server respectively, Described newly-increased amendment removal request comprises request data;
If described request data exists data collision, client is by the sourceid of described request data Delete, and be that described request data generates new sourceid;
On the request data with described new sourceid is uploaded onto the server by client.
The method of mobile terminal processing data collision the most according to claim 1, its feature exists In, the different clients of the same account number of described login sends newly-increased amendment deletion to server respectively please Asking, the step comprising request data in described newly-increased amendment removal request includes:
Definition data form;
Described Data Serialization request data according to definition;
Request data after serializing is put in httpPut request;
The different clients logging in same account number sends httpPut request to server respectively.
The method of mobile terminal processing data collision the most according to claim 1, its feature exists In, described method also includes:
After server receives the request data of the different clients logging in same account number, according to described The etag of request data judges whether data collision;
If the etag of request data is different with the etag on server, then there is data collision, clothes Business device returns newly-increased amendment deletion to client and responds, and described newly-increased amendment is deleted response and included request The conditional code of data.
The method of mobile terminal processing data collision the most according to claim 3, its feature exists In, described method also includes:
Pre-set the conditional code of data collision;
If client is deleted from the newly-increased amendment that server returns responding and is got data collision Conditional code, it is determined that there is data collision.
The method of mobile terminal processing data collision the most according to claim 1, its feature exists In, the sourceid of described request data is deleted by described client, and is that described request data is raw The step becoming new sourceid includes:
The sourceid of described request data is deleted by client, generates new for described request data Sourceid, and remove the etag of described request data.
6. the mobile terminal being used for processing collision event, it is characterised in that including:
First processing module, for sending newly-increased amendment removal request to server, described increasing newly is repaiied Change and removal request comprises request data;
, if there is data collision, by described request for described request data in the second processing module The sourceid of data deletes, and is that described request data generates new sourceid;
3rd processing module, for uploading to service by the request data with described new sourceid On device.
Mobile terminal for processing collision event the most according to claim 6, its feature exists In, described first processing module, specifically for:
Definition data form;
Described Data Serialization request data according to definition;
Request data after serializing is put in httpPut request;
HttpPut request is sent to server.
The method of mobile terminal processing data collision the most according to claim 7, its feature exists In, described second processing module, specifically for:
Receive the newly-increased amendment deletion response that server returns;
If delete the conditional code getting data collision responding from described newly-increased amendment, it is determined that There is data collision;
The sourceid of described request data is deleted, generates new sourceid for described request data, And remove the etag of described request data.
CN201510921272.XA 2015-12-12 2015-12-12 Mobile terminal data conflict processing method and device Pending CN105915572A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510921272.XA CN105915572A (en) 2015-12-12 2015-12-12 Mobile terminal data conflict processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510921272.XA CN105915572A (en) 2015-12-12 2015-12-12 Mobile terminal data conflict processing method and device

Publications (1)

Publication Number Publication Date
CN105915572A true CN105915572A (en) 2016-08-31

Family

ID=56744073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510921272.XA Pending CN105915572A (en) 2015-12-12 2015-12-12 Mobile terminal data conflict processing method and device

Country Status (1)

Country Link
CN (1) CN105915572A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070067373A1 (en) * 2003-11-03 2007-03-22 Steven Higgins Methods and apparatuses to provide mobile applications
CN102664932A (en) * 2012-04-09 2012-09-12 青岛百灵信息科技有限公司 Cross-terminal network browser tag page synchronizing method based on cloud computing
CN103152398A (en) * 2013-02-07 2013-06-12 中国科学院计算技术研究所 Method and system for file synchronization among multiple terminal files
CN103220358A (en) * 2013-04-19 2013-07-24 李晶 Multi-terminal on-line file synchronizing method, system, server, and terminal device
US8504519B1 (en) * 2012-06-27 2013-08-06 Dropbox, Inc. Determining a preferred modified version from among multiple modified versions for synchronized files
CN103546435A (en) * 2012-07-13 2014-01-29 中兴通讯股份有限公司 Data synchronizing method and server
CN104065752A (en) * 2014-07-11 2014-09-24 上海百步电子科技股份有限公司 Synchronization method of data between terminals
CN104113571A (en) * 2013-04-18 2014-10-22 北京恒华伟业科技股份有限公司 Data collision processing method and device
CN104243429A (en) * 2013-06-20 2014-12-24 腾讯科技(深圳)有限公司 Method, device and system for achieving browser bookmark synchronization

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070067373A1 (en) * 2003-11-03 2007-03-22 Steven Higgins Methods and apparatuses to provide mobile applications
CN102664932A (en) * 2012-04-09 2012-09-12 青岛百灵信息科技有限公司 Cross-terminal network browser tag page synchronizing method based on cloud computing
US8504519B1 (en) * 2012-06-27 2013-08-06 Dropbox, Inc. Determining a preferred modified version from among multiple modified versions for synchronized files
CN103546435A (en) * 2012-07-13 2014-01-29 中兴通讯股份有限公司 Data synchronizing method and server
CN103152398A (en) * 2013-02-07 2013-06-12 中国科学院计算技术研究所 Method and system for file synchronization among multiple terminal files
CN104113571A (en) * 2013-04-18 2014-10-22 北京恒华伟业科技股份有限公司 Data collision processing method and device
CN103220358A (en) * 2013-04-19 2013-07-24 李晶 Multi-terminal on-line file synchronizing method, system, server, and terminal device
CN104243429A (en) * 2013-06-20 2014-12-24 腾讯科技(深圳)有限公司 Method, device and system for achieving browser bookmark synchronization
CN104065752A (en) * 2014-07-11 2014-09-24 上海百步电子科技股份有限公司 Synchronization method of data between terminals

Similar Documents

Publication Publication Date Title
CN110516007A (en) A kind of deployment control method, device, equipment and the medium of block chain network
CN103491055A (en) Method for synchronizing information among clients, clients and server
CN105407117A (en) Distributed data backup method, device and system
CN112069154B (en) etcd distributed database automatic operation and maintenance method and related device
WO2021136233A1 (en) Service upgrading method, device and system
US11265182B2 (en) Messaging to enforce operation serialization for consistency of a distributed data structure
CN110912893B (en) Account number merging method
CN113626002A (en) Service execution method and device
CN101515935A (en) Data synchronization method and server
CN114127690A (en) Merging trees for collaboration
CN115334025B (en) Decentralized instant messaging method, decentralized instant messaging device, decentralized instant messaging equipment and storage medium
CN104301428A (en) Data synchronization method and server
WO2016180156A1 (en) Router cluster upgrade system, method and apparatus
CN103888502A (en) Projection method, projection file providing method and projection terminal
CN104022896B (en) A kind of configuring management method, device and the network equipment
CN104104701A (en) Online service configuration updating method and system
CN111241200B (en) Master-slave synchronous processing method and device based on SQLite database
CN109104472B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN105915572A (en) Mobile terminal data conflict processing method and device
CN103036989B (en) Socket server and sockets services method
CN111240933B (en) Method, system, device and medium for monitoring performance data of multiple data centers
CN110768811A (en) Method, device and system for updating YANG model file library
CN110198325A (en) Communication means, device and system, network server and storage medium
CN112000816A (en) Data processing method and device
KR101792331B1 (en) Method and System for Transaction in the M2M/IoT Platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160831