CN110502573A - A kind of gate method of data synchronization and server - Google Patents

A kind of gate method of data synchronization and server Download PDF

Info

Publication number
CN110502573A
CN110502573A CN201910610268.XA CN201910610268A CN110502573A CN 110502573 A CN110502573 A CN 110502573A CN 201910610268 A CN201910610268 A CN 201910610268A CN 110502573 A CN110502573 A CN 110502573A
Authority
CN
China
Prior art keywords
gate
data
synchrodata
server
equipment
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
CN201910610268.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.)
Weifutong Technology Co Ltd
Original Assignee
Weifutong 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 Weifutong Technology Co Ltd filed Critical Weifutong Technology Co Ltd
Priority to CN201910610268.XA priority Critical patent/CN110502573A/en
Publication of CN110502573A publication Critical patent/CN110502573A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07BTICKET-ISSUING APPARATUS; FARE-REGISTERING APPARATUS; FRANKING APPARATUS
    • G07B11/00Apparatus for validating or cancelling issued tickets

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Devices For Checking Fares Or Tickets At Control Points (AREA)

Abstract

The present invention relates to data field of synchronization, discloses a kind of gate method of data synchronization and server, the synchronization request that this method is sent by receiving gate equipment, the synchronization request carry gate identification number;Further according to the synchronization request, gate data corresponding with gate identification number and batch number are made into encapsulation process, obtain synchrodata;Then the synchrodata is sent to gate equipment, so that gate equipment returns to response request, response request carries batch number;It is finally requested according to the response, marks gate data corresponding with batch number for synchronous regime.Therefore, the gate data for having been labeled as synchronous regime would not be subsynchronous again, can prevent from repeating to synchronize.

Description

A kind of gate method of data synchronization and server
Technical field
The invention mainly relates to data field of synchronization, more particularly to a kind of gate method of data synchronization and service Device.
Background technique
With the development of technology, user can use the direct booking of client when buying ticket, and server-side can will be used The information at family is transmitted to corresponding gate equipment, and then user passes through gate equipment according to the ticket information of oneself.If server-side There is mistake in transmission user information, or repeatedly transmits user information, will result in the wasting of resources, and server operation generates pressure Power, the phenomenon that even causing some users can not be by gate equipment.
Summary of the invention
The embodiment of the present invention is intended to provide a kind of gate method of data synchronization and server, prevents Data duplication synchronous.
In order to solve the above technical problem, the present invention provides following technical schemes:
In a first aspect, the embodiment of the present invention provides a kind of gate method of data synchronization, applied to server, the method Include:
The synchronization request that gate equipment is sent is received, the synchronization request carries gate identification number;
According to the synchronization request, gate data corresponding with the gate identification number and batch number are made into encapsulation process, Obtain synchrodata;
The synchrodata is sent to the gate equipment, so that the gate equipment returns to response request, the response Request carries the batch number;
It is requested according to the response, marks gate data corresponding with the batch number for synchronous regime.
Optionally, the gate data are storable in the first relational database table, are sent to the gate equipment Before the synchrodata, the method also includes:
The synchrodata is mapped in default storage system from first relational database table.
Optionally, described to be requested according to the response, mark gate data corresponding with the batch number for synchronous shape State includes:
Judge whether the response request meets default response condition;
If satisfied, judging that the corresponding key assignments of batch number described in the default storage system whether there is;
If so, the synchrodata is transferred to second relational database table from the default storage system, use In the synchrodata that storage has synchronized;
If it is not, the synchrodata is cancelled.
Optionally, the default response condition includes default effective time, described to judge whether the response request meets Default response condition, comprising:
Judge whether the response duration of the response request is less than or equal to the default effective time.
Optionally, before the synchronization request that the reception gate equipment is sent, which comprises
The new gate data are judged whether there is to need to synchronize;
If so, updating first relational database table.
Optionally, the synchronization request is sent by the gate equipment according to predeterminated frequency.
Optionally, the gate data include Customer information and ticket information, wherein the Customer information includes being based on The passenger image of base64 coding mode.
Optionally, Xiang Suoshu gate equipment sends the synchrodata, comprising:
Json form is encrypted into the synchrodata, obtains encrypted synchrodata;
Encrypted synchrodata is sent to the gate equipment.
In second aspect, the embodiment of the present invention provides a kind of server, and the server includes:
At least one processor;And
With the memory of at least one processing communication connection;Wherein, the memory be stored with can by it is described at least The instruction repertorie that one processor executes, described instruction program is executed by least one described processor, so that described at least one A processor executes above-mentioned method.
In the third aspect, the embodiment of the present invention provides a kind of gate data synchronous system, comprising: several gate equipment;With Above-mentioned server, the server is based on WebSocket mode and each gate equipment communicates to connect.
Based on the above-mentioned technical proposal, the embodiment of the invention provides a kind of gate method of data synchronization, are applied to server, The synchronization request sent by receiving gate equipment, the synchronization request carry gate identification number;It, will be with further according to the synchronization request The corresponding gate data of gate identification number and batch number make encapsulation process, obtain synchrodata;Then sending to gate equipment should Synchrodata, so that gate equipment returns to response request, response request carries batch number;It is finally requested according to the response, mark Remember gate data corresponding with batch number for synchronous regime.Therefore, the gate data for having been labeled as synchronous regime would not be again It is subsynchronous, it can prevent from repeating to synchronize.
Detailed description of the invention
One or more embodiments are illustrated by the picture in corresponding attached drawing, these exemplary theorys The bright restriction not constituted to embodiment, the element in attached drawing with same reference numbers label are expressed as similar element, remove Non- to have special statement, composition does not limit the figure in attached drawing.
Fig. 1 is that the embodiment of the present invention provides a kind of schematic diagram of gate data synchronization applications scene;
Fig. 2 is a kind of structural schematic diagram of gate data synchronous system provided in an embodiment of the present invention;
Fig. 3 a is a kind of workflow schematic diagram that gate data are synchronous provided in an embodiment of the present invention with Fig. 3 b;
Fig. 4 is a kind of flow diagram for gate method of data synchronization that embodiment of the present invention method provides;
Fig. 5 is step 304 flow diagram in Fig. 4;
Fig. 6 be another embodiment of the present invention provides a kind of gate method of data synchronization flow diagram;
Fig. 7 is step 405 flow diagram in Fig. 6;
Fig. 8 is a kind of structural schematic diagram of gate data synchronization unit provided in an embodiment of the present invention;
Fig. 9 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.
Gate method of data synchronization provided in an embodiment of the present invention, can in any suitable type, with operational capability It is executed in electronic equipment, such as video camera, human face scanning equipment, Air conduct measurement equipment, server, desktop computer, intelligent hand In machine, tablet computer and other electronic products.
In some embodiments, electronic equipment can be configured to any desired configuration, and apply in any suitable business Place, for example, electronic equipment can be the ticketing apparatus with face identification functions, ticketing apparatus can execute set forth below Gate method of data synchronization, when user by face core body buy the electronic tickets such as steamer ticket or air ticket when, the electronic equipment will Ticket information and Customer information are synchronized to gate equipment, when user passes through gate, if gate successfully identifies user's face, Open gate, if gate identification user's face is incorrect or people's ticket is different, gate is not opened.
Referring to Fig. 1, Fig. 1 is a kind of schematic diagram of gate data synchronization applications scene provided in an embodiment of the present invention.Such as Shown in Fig. 1, gate data synchronization applications scene 100 includes public domain 10, counseling platform region 20, elevator region 30, rest area Domain 40 and entrance area 50, each region interconnects.
Wherein entrance area 50 is provided with three gate equipment 51, and every gate device configuration has corresponding lock column 52, lock Machine equipment 51 can control the open or close on lock column 52, and the device identification of every gate equipment 51 is different, and every gate is set Standby 51 can by route information may be identical, it is also possible to different, user selects corresponding lock according to oneself route information Machine equipment 51 enters public domain 10, and when lock column 52 is opened, user can enter, and when lock column 52 is closed, user then be cannot be introduced into.
In the present embodiment, every gate equipment 51 is each equipped with the processor 53 of face identification functions, and processor 53 is used In each user progress Image Acquisition, verifying identity and verifying ticketing service to needing into entrance area 50, wherein image is adopted Collection function can be completed by camera 54, and when user enters entrance area 50, camera 54 shoots the user, and will The image information of shooting is transferred to processor 53.
Before user enters entrance area 50, user passes through the electronic equipment booking with face identification functions, the electricity Sub- equipment also needs to acquire the image information of user, and then, which receives the synchronization request that processor 53 is sent, according to The ticket information of user and image information are synchronized to the processor 53 in gate equipment 51, and will synchronized by the synchronization request Data markers be synchronous regime.
Referring to Fig. 2, Fig. 2 is a kind of structural schematic diagram of gate data synchronous system provided in an embodiment of the present invention.Such as Shown in Fig. 2, gate data synchronous system includes at least one gate equipment 51, server 55 and at least one client 56.
Server 55 is located at network side to provide the service equipment of service for user,
Server herein can be a physical server or multiple physical servers it is virtual made of a logic Server.Server be also possible to it is multiple can interconnected communication server composition server zone, and each functional module can divide It is not distributed on each server in server zone.
Client 56 can be the user equipmenies such as tablet computer, laptop, smart phone.In practical application of the present invention In, it is communicated to connect by being established with server 55, user can access server 55 by client 56, realize client 56 Various functions.
In some embodiments, client 56 can be mounted in the application program in equipment as described above,
For server 55 respectively with gate equipment 51, client 56 by network communication, client 56 can be to server 55 Ticketing data and user image data are transmitted, which is synchronized to gate equipment 51 again by server 55, for example, user passes through visitor Steamer ticket is bought at family end 56, and the course line of each user purchase may be different, every gate equipment 51 can by course line may phase Together, it is also possible to it is different, therefore, every gate equipment 51 can by user it is also different, then client 56 is by same day user All ticketing datas and image data be synchronized to corresponding gate equipment 51, user pass through again the detection of gate equipment 51 into Enter.
Wherein, when synchrodata, if repeating synchrodata will cause the pressure of the wasting of resources and server, even Detection failure.For example, server 55 synchronizes a certain number of data to gate equipment 51 every time, if repeating synchrodata, Will cause follow-up data can not synchronize, and in turn resulting in some users can not be by gate equipment 51.Therefore, the embodiment of the present invention mentions For a kind of gate method of data synchronization, it is applied to server.It is of the invention real also referring to Fig. 3 a and Fig. 3 b, Fig. 3 a and Fig. 3 b A kind of synchronous work flow diagram of gate data of example offer is provided:
As shown in Figure 3a and Figure 3b shows, the gate method of data synchronization 200, comprising:
Step 201: gate equipment is established persistence with server and is connect;
Gate equipment has multiple, and every gate equipment is established persistence by webscoket with server and connect, Webscoket is full-duplex communication, solves multiple gate equipment and has to by the poll for a long time with connection of repeatedly shaking hands To server request data, it may be implemented to multiplex, and can make the part that need not have head in information again The long linking communications of information and http can not only reduce the pressure of server using webscoket, and in data transmission Reduce the extra information in part.Gate equipment and server-side disconnect in order to prevent, can be spaced at regular intervals, just by lock A heartbeat detection is carried out between machine equipment and server-side, this time interval can be set to 2 minutes.
Step 202: gate equipment sends synchronization request to server;
Gate equipment can have more, and the mark of every gate equipment is all different, can by user may be also different, Therefore, when gate equipment sends synchronization request, which carries the identification number of the gate equipment, also, gate is set Standby just to send a synchronization request to server at regular intervals, this time interval can be set to 10 minutes.
Step 203: server obtains synchrodata;
The synchronization request carries the gate identification number of the gate equipment, and server just responds the request after receiving, and locates Reason is located at the gate data in the first relational database table, wherein and the gate data can be ranked up according to certain principle, It usually sorts according to the front and back of time of departure, the data of time of departure morning come before in database table.
Server finds gate data corresponding with gate identification number and not synchronous in the first relational database table When, in order to guarantee that is taken out is not synchronous gate data, the gate data synchronize can be marked to either general The gate data synchronized are put into the second relational database table and are labeled as having synchronized.Server is according to the synchronization request When carrying out obtaining gate data, the data are matched first with gate identification number, judges whether the data belong to gate mark Number corresponding gate data, if so, again match the data with the gate data in the second relational database table, if Successful match then represents the gate data and is present in the second relational database table, is synchronous gate data, then services Device gives up the gate data, if matching is unsuccessful, representing the gate data is not synchronous gate data, then server takes The gate data out.The gate data for ensuring that server takes out in this way are not synchronous and corresponding with gate identification number Gate data.
Server, which takes out, to be somebody's turn to do after gate data corresponding with gate identification number, corresponding with this batch of gate data by generating Batch number, the gate data that each synchronization request obtains all correspond to a batch number, will gate number corresponding with gate identification number According to and batch number make encapsulation process, obtain the batch and need synchronous synchrodata.
Step 204: server maps to the synchrodata in default storage system;
Server maps to the synchrodata in default storage system from the first relational database table, the default storage System is a key-value storage system, and the storage system inquiry velocity is fast, store data volume is big, supports high concurrent, synchronous Data are stored in default storage system in the form of key-value.Synchrodata is stored in default storage system having time limit System, storage time is identical to the server transmission time interval of synchronization request as gate equipment, in the present embodiment, can be set It is 10 minutes, synchrodata is stored in default storage system and is stored 10 minutes, more than 10 minutes, is just made the synchrodata It is useless.
Step 205: server sends the synchrodata to gate equipment;
It is the transmission in the form of json that server, which sends synchrodata, also, for the safety of data, can be by data encryption It is transmitted to gate equipment again later
Step 206: gate equipment returns to response request;
Gate equipment will be handled the synchrodata, processing knot after receiving the synchrodata by its internal processor Shu Yihou, gate equipment send a response request to server, and response request includes the batch number of this batch of synchrodata,
Step 207: server corresponding key assignments of inquiry batch number in default storage system;
Server inquires corresponding key assignments in default storage system according to the batch number, if not inquiring key assignments, Prove that the batch number mistake or gate equipment response duration already exceed the storage that synchrodata is stored in default storage system Duration, then just cancelling the synchrodata in default storage system.
Step 208: server removes synchrodata to the second relational database table;
If inquiring key assignments corresponding with the batch number in default storage system, then default storage is just by server Synchrodata in system is inserted into the second relational database table, and the data stored in the second relational database table are Synchronous data.
After above-mentioned steps terminate, gate equipment can carry out synchronization request next time.
Referring to Fig. 4, Fig. 4 is a kind of flow diagram of gate method of data synchronization provided in an embodiment of the present invention,
As shown in figure 4, the gate method of data synchronization 300 may comprise steps of:
Step 301 receives the synchronization request that gate equipment is sent, and the synchronization request carries gate identification number;
At regular intervals, gate equipment can send a synchronization request, that is, request server for phase to server It closes data and is synchronized to gate equipment, each manageable data of gate equipment are different, therefore the synchronization that gate equipment is sent is asked Gate identification number can be carried by asking, for identifying some specific gate equipment.
Step 302: according to the synchronization request, gate data corresponding with the gate identification number and batch number being sealed Dress processing, obtains synchrodata;
After server receives the synchronization request, the gate identification number for parsing its carrying takes according to the gate identification number Corresponding gate data out, wherein gate data refer to user information and ticket information, and specifically, user information can be with It is the ID card No. and my base64 encoded photograph of encryption, ticket information can be encrypted course line coding, draft bank And the QR code content of ticket, these data are to obtain and be stored in server when user is using client booking, In,.Server all generates a batch number to the gate data of every batch transfer, and the data of different batches correspond to different batches Number, gate data corresponding with gate identification number and batch number are made encapsulation process by server, obtain synchrodata.
Step 303: Xiang Suoshu gate equipment sends the synchrodata, so that the gate equipment returns to response request, The response request carries the batch number;
All gate data are storable in the first relational database table, by client are needed to synchronous institute the same day Some gate data transmissions are ranked up into the first relational database table, and according to certain time sequence, for example, can be by According to the tandem sequence of time of departure, the more early gate data of time of departure are arranged more forward.
Before sending the synchrodata to corresponding gate equipment, by the synchrodata from first relationship type Database table maps in default storage system.The default storage system is a key-value storage system, the same to step number According to preset the storage in storage system be not permanent at this, but respective handling is carried out according to subsequent operation.Then it services Device sends the synchrodata to gate equipment again.
Gate equipment receives and processes the synchrodata, and after processing, gate equipment can send response request to server, Meanwhile the batch of the synchrodata can be returned to server.
Step 304: being requested according to the response, mark gate data corresponding with the batch number for synchronous regime.
The synchronized gate data of server-tag are to repeat to synchronize in order to prevent, when taking gate data next time, just Labeled data will not be further taken out.
The present embodiment is applied to server, which comprises receive first by a kind of gate method of data synchronization The synchronization request that gate equipment is sent, the synchronization request carry gate identification number;Further according to the synchronization request, will with it is described The corresponding gate data of gate identification number and batch number make encapsulation process, obtain synchrodata;It is sent again to the gate equipment The synchrodata, so that the gate equipment returns to response request, the response request carries the batch number;Last basis The response request, marks gate data corresponding with the batch number for synchronous regime.By the above-mentioned means, the present invention is real Applying example can be to have synchronized the gate data markers for having been issued to gate equipment, and prevent from taking out and repeat gate data, in turn Prevent Data duplication synchronous.In some embodiments, referring to Fig. 5, step 304 further include:
Step 3041: judging whether the response request meets default response condition;
Default response condition is pre-set condition, and in some embodiments, it includes default effective for presetting response condition Duration, which can be identical as the gate equipment transmission time interval of synchronization request, for example, gate equipment every 10 Minute sends a synchronization request to server, then default effective time is also 10 minutes, and the synchrodata is stored in The effective time of default storage system is also 10 minutes.The response duration that server judges response request whether be less than or Equal to the default effective time, the synchrodata in default storage system is handled according to judging result.
Step 3042: if satisfied, judging that the corresponding key assignments of batch number described in the default storage system whether there is;
The synchrodata is stored in the default storage system, according to batch number, is stored in the form of key assignments default Storage system, if the response duration is not above preset duration, then server is further according to the batch in response request Number, the corresponding key assignments of the batch number is found in default storage system and is further processed if the key assignments can be found, if institute Stating response duration, perhaps so proof gate equipment response is not present more than duration or synchrodata in key assignments more than preset duration There is exception, then in addition server can be handled data.
Step 3043: if so, the synchrodata is transferred to the second relationship type number from the default storage system According to library table, for storing the synchrodata synchronized;
In some embodiments, if the response duration of response request is less than or equal to the default effective time, and And can also find the corresponding key assignments of the batch number in default storage system, then prove that gate equipment response is normal, same to step number According to also without heterodoxy, then the synchrodata in default storage system is just transferred to second relevant database by server Table, all synchrodatas synchronized are put into second relational database table, and server is being next subsynchronous When taking gate data, can by the first relational database table gate data and the second relational database table in data into Row compares, if existing in the second relational database table from the data read in the first relational database table, then demonstrate,proving The gate data of bright reading are synchronous data, then server will not further take out the gate data, can be prevented with this Repeat synchronous gate data.
Step 3043: if it is not, the synchrodata is cancelled.
If the response duration is greater than the default effective time namely the response duration is unsatisfactory for the default response Data in default storage system are then cancelled then proving gate equipment duration time-out or the response duration are not had by condition There is time-out, but occur exception when gate equipment synchrodata, such as mistake occurs in the batch number in response request, it can not It is abnormal that corresponding key assignments of the batch number etc. is found in default storage system, then server is equally in default storage system Synchrodata is cancelled.
Referring to Fig. 6, in a kind of another embodiment of gate method of data synchronization provided by the invention, it is described to be connect described Before receiving the synchronization request that gate equipment is sent, this method 400 further include:
Step 401: judging whether there is the new gate data and need to synchronize;
It because user's booking time is different, when synchronous gate data, might have some new user's bookings, judge Whether the ticket information of new user belongs to the ticket information on the same day, if the ticketing service of user's purchase is the course line on the same day, then new use The ticket information at family with Customer information these new gate data be also required to it is synchronous.
Step 402: if so, updating first relational database table;
If there is new gate data to need to synchronize, then these new gate data are just put into the first relational database table In, it similarly, is ranked up sequentially in time, wherein the Customer information in new gate data equally includes being compiled based on base64 The passenger image of code mode.
Step 403: receiving the synchronization request that gate equipment is sent, the synchronization request carries gate identification number;
Step 404: according to the synchronization request, gate data corresponding with the gate identification number and batch number being sealed Dress processing, obtains synchrodata;
Step 405: Xiang Suoshu gate equipment sends the synchrodata, so that the gate equipment returns to response request, The response request carries the batch number;
Step 406: being requested according to the response, mark gate data corresponding with the batch number for synchronous regime.
In some embodiments, referring to Fig. 7, it is described to the gate equipment transmission same step number in step 405 According to, comprising:
Step 4051: encrypting the synchrodata in the form of json, obtain encrypted synchrodata;
Json (JavaScript Object Notation, JS object numbered musical notation) is a kind of data exchange lattice of lightweight Formula.It is based on a subset of ECMAScript (the js specification that European Computer association formulates), is programmed using being totally independent of The text formatting of language stores and indicates data.Succinctly and clearly hierarchical structure makes json become ideal data exchange Language.The type of any support can be indicated by json, such as character string, number, object, array etc., json form It is easy to people to read and write, while is also easy to machine parsing and generating, and effectively promoting network transmission efficiency.By the synchronization Data encryption is to keep data safer.
Step 4052: Xiang Suoshu gate equipment sends encrypted synchrodata.
Referring to Fig. 8, Fig. 8 is that the embodiment of the present invention provides a kind of structural schematic diagram of gate data synchronization unit, such as Fig. 8 Shown, which includes the first receiving module 501, the first package module 502, the first sending module 503 and the first label Module 504, wherein the first receiving module 501 is used to receive the synchronization request of gate equipment transmission, the synchronization request carries lock Machine identification number;First package module 502 is used for according to the synchronization request, will gate data corresponding with the gate identification number And batch number makees encapsulation process, obtains synchrodata;First sending module 503 is used to send the synchronization to the gate equipment Data, so that the gate equipment returns to response request, the response request carries the batch number;First mark module 504 For being requested according to the response, mark gate data corresponding with the batch number for synchronous regime.
In some optionally implementations of the present embodiment, please continue to refer to Fig. 8, which further includes first reflecting Module 505 is penetrated, specifically for mapping in default storage system the synchrodata from first relational database table;
In some optionally implementations of the present embodiment, please continue to refer to Fig. 8, which further includes first sentencing Disconnected module 506, the gate data for judging whether there is new need to synchronize;
First update module 507, for updating first relational database table.
Wherein, please continue to refer to Fig. 8, the first sending module 503 includes: the first encryption unit 5031, for json shape Formula encrypts the synchrodata, obtains encrypted synchrodata;
First transmission unit 5032, for sending encrypted synchrodata to the gate equipment.Wherein, continuing with ginseng Fig. 8 is read, the first mark module 504 includes:
First judging unit 5041, for judging whether the response request meets default response condition;
Second judgment unit 5042, for judging whether the corresponding key assignments of batch number described in the default storage system is deposited In;
It is worth noting that the contents such as information exchange, implementation procedure between module in above-mentioned apparatus, due to this hair Bright embodiment of the method is based on same design, and for details, please refer to the description in the embodiment of the method for the present invention, no longer superfluous herein It states.
The embodiment of the invention provides a kind of gate data synchronization unit, the device is by receiving the same of gate equipment transmission Step request, which carries gate identification number will gate number corresponding with gate identification number then according to the synchronization request According to and batch number make encapsulation process, obtain synchrodata, then send the synchrodata to gate equipment so that gate equipment return Response request, response request carry batch number, are finally requested according to response, and marking gate data corresponding with batch number is Synchronous regime.The embodiment is by the above-mentioned means, can prevent Data duplication synchronous.
Referring to Fig. 9, Fig. 9 is that the embodiment of the present invention provides the electronic equipment 600 for executing above-mentioned gate method of data synchronization Hardware structural diagram, as shown in figure 9, the electronic equipment 600 includes:
One or more processors 601 and memory 602, in Fig. 9 by taking a processor 601 as an example.
Processor 601 can be connected with memory 602 by bus or other modes, to be connected by bus in Fig. 9 For.
Memory 602 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software journey Sequence, non-volatile computer executable program and module, as the gate method of data synchronization in the embodiment of the present invention is corresponding Program instruction/module (for example, attached modules shown in Fig. 8).Processor 601 is stored in the memory 602 by operation Non-volatile software program, instruction and module are realized thereby executing the various function application and data processing of server Above method embodiment gate method of data synchronization.
Memory 602 may include storing program area and storage data area, wherein storing program area can store operation system Application program required for system, at least one function;Storage data area, which can be stored, uses institute according to gate data synchronization unit The data etc. of creation.In addition, memory 602 may include high-speed random access memory, it can also include non-volatile memories Device, for example, at least a disk memory, flush memory device or other non-volatile solid state memory parts.In some embodiments In, optional memory 602 includes the memory remotely located relative to processor 601, these remote memories can pass through net Network is connected to gate data synchronization unit.The example of above-mentioned network include but is not limited to internet, intranet, local area network, Mobile radio communication and combinations thereof.
One or more of modules are stored in the memory 602, when by one or more of processors When 601 execution, the gate method of data synchronization in above-mentioned any means embodiment is executed, for example, executing Fig. 2 described above extremely The method and step of Fig. 7 realizes the function of each module and each unit in Fig. 8.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and has Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
The electronic equipment of the embodiment of the present invention exists in a variety of forms, including but not limited to:
(1) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(2) other electronic devices with data interaction function.
The embodiment of the invention provides a kind of non-volatile computer readable storage medium storing program for executing, the computer-readable storage mediums Matter is stored with computer executable instructions, which is executed by one or more processors, for example, execute with The method and step of Fig. 2 to Fig. 7 of upper description realizes the function of each module and each unit in Fig. 8.
The embodiment of the invention provides a kind of computer program products, including are stored in non-volatile computer readable storage Calculation procedure on medium, the computer program include program instruction, are computer-executed constantly, make when described program instructs The computer executes the gate method of data synchronization in above-mentioned any means embodiment, for example, executing Fig. 2 described above extremely The method and step of Fig. 7 realizes the function of each module and each unit in Fig. 8.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member It is physically separated with being or may not be, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules achieve the purpose of the solution of this embodiment.
By the description of above embodiment, those of ordinary skill in the art can be understood that each embodiment can borrow Help software that the mode of general hardware platform is added to realize, naturally it is also possible to pass through hardware.Those of ordinary skill in the art can manage Solution realize above-described embodiment method in all or part of the process be can be instructed by computer program relevant hardware come It completes, the program can be stored in a computer-readable storage medium, and the program is when being executed, it may include such as above-mentioned each The process of the embodiment of method.Wherein, the storage medium can be magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;At this It under the thinking of invention, can also be combined between the technical characteristic in above embodiments or different embodiment, step can be with It is realized with random order, and there are many other variations of different aspect present invention as described above, for simplicity, they do not have Have and is provided in details;Although the present invention is described in detail referring to the foregoing embodiments, the ordinary skill people of this field Member is it is understood that it is still possible to modify the technical solutions described in the foregoing embodiments, or to part of skill Art feature is equivalently replaced;And these are modified or replaceed, each reality of the present invention that it does not separate the essence of the corresponding technical solution Apply the range of a technical solution.

Claims (10)

1. a kind of gate method of data synchronization is applied to server, which is characterized in that the described method includes:
The synchronization request that gate equipment is sent is received, the synchronization request carries gate identification number;
According to the synchronization request, gate data corresponding with the gate identification number and batch number are made into encapsulation process, obtained Synchrodata;
The synchrodata is sent to the gate equipment, so that the gate equipment returns to response request, the response request Carry the batch number;
It is requested according to the response, marks gate data corresponding with the batch number for synchronous regime.
2. the method according to claim 1, wherein the gate data are storable in the first relevant database In table, before sending the synchrodata to the gate equipment, the method also includes:
The synchrodata is mapped in default storage system from first relational database table.
3. according to the method described in claim 2, it is characterized in that, described according to response request, label and the batch Number corresponding gate data are that synchronous regime has included:
Judge whether the response request meets default response condition;
If satisfied, judging that the corresponding key assignments of batch number described in the default storage system whether there is;
If so, the synchrodata is transferred to second relational database table from the default storage system, for depositing Store up the synchrodata synchronized;
If it is not, the synchrodata is cancelled.
4. according to the method described in claim 3, it is characterized in that, the default response condition includes default effective time, institute It states and judges whether the response request meets default response condition, comprising:
Judge whether the response duration of the response request is less than or equal to the default effective time.
5. according to the method described in claim 2, it is characterized in that, it is described reception gate equipment send synchronization request it Before, which comprises
The new gate data are judged whether there is to need to synchronize;
If so, updating first relational database table.
6. the method according to claim 1, wherein the synchronization request is by the gate equipment according to default frequency What rate was sent.
7. the method according to claim 1, wherein the gate data include Customer information and ticket information, Wherein, the Customer information includes the passenger image based on base64 coding mode.
8. method according to any one of claims 1 to 7, which is characterized in that Xiang Suoshu gate equipment sends the synchronization Data, comprising:
The synchrodata is encrypted in the form of json, obtains encrypted synchrodata;
Encrypted synchrodata is sent to the gate equipment.
9. a kind of server characterized by comprising
At least one processor;And
With the memory of at least one processing communication connection;Wherein, the memory be stored with can by it is described at least one The instruction repertorie that processor executes, described instruction program executed by least one described processor, so that described at least one Device perform claim requirement 1 is managed to gate method of data synchronization described in claim 8 any one.
10. a kind of gate data synchronous system characterized by comprising
Several gate equipment;With
Server as claimed in claim 9, the server are based on WebSocket mode and communicate with each gate equipment Connection.
CN201910610268.XA 2019-07-08 2019-07-08 A kind of gate method of data synchronization and server Pending CN110502573A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910610268.XA CN110502573A (en) 2019-07-08 2019-07-08 A kind of gate method of data synchronization and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910610268.XA CN110502573A (en) 2019-07-08 2019-07-08 A kind of gate method of data synchronization and server

Publications (1)

Publication Number Publication Date
CN110502573A true CN110502573A (en) 2019-11-26

Family

ID=68586211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910610268.XA Pending CN110502573A (en) 2019-07-08 2019-07-08 A kind of gate method of data synchronization and server

Country Status (1)

Country Link
CN (1) CN110502573A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112562138A (en) * 2020-11-24 2021-03-26 北京百度网讯科技有限公司 Method, device, equipment and storage medium for managing gate
CN112988881A (en) * 2019-12-13 2021-06-18 Oppo广东移动通信有限公司 Data synchronization method and device and computer readable storage medium
CN113377867A (en) * 2021-06-10 2021-09-10 四川省明厚天信息技术股份有限公司 Data synchronization method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291342A (en) * 2008-06-18 2008-10-22 中兴通讯股份有限公司 Data synchronizing method and system in distributed system
CN105279800A (en) * 2015-10-20 2016-01-27 中铁程科技有限责任公司 Identity card ticket checking method and system
CN107146124A (en) * 2017-03-14 2017-09-08 北京中软万维网络技术有限公司 A kind of implementation method, system and the device of electronics one-way ticket
CN107819795A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of major-minor server data synchronous method of DNS, apparatus and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291342A (en) * 2008-06-18 2008-10-22 中兴通讯股份有限公司 Data synchronizing method and system in distributed system
CN105279800A (en) * 2015-10-20 2016-01-27 中铁程科技有限责任公司 Identity card ticket checking method and system
CN107819795A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of major-minor server data synchronous method of DNS, apparatus and system
CN107146124A (en) * 2017-03-14 2017-09-08 北京中软万维网络技术有限公司 A kind of implementation method, system and the device of electronics one-way ticket

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988881A (en) * 2019-12-13 2021-06-18 Oppo广东移动通信有限公司 Data synchronization method and device and computer readable storage medium
CN112562138A (en) * 2020-11-24 2021-03-26 北京百度网讯科技有限公司 Method, device, equipment and storage medium for managing gate
CN113377867A (en) * 2021-06-10 2021-09-10 四川省明厚天信息技术股份有限公司 Data synchronization method and device and electronic equipment
CN113377867B (en) * 2021-06-10 2022-10-21 四川省明厚天信息技术股份有限公司 Data synchronization method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN112288097B (en) Federal learning data processing method, federal learning data processing device, computer equipment and storage medium
CN108306877B (en) NODE JS-based user identity information verification method and device and storage medium
CN108898390A (en) Intelligent contract call method and device, electronic equipment based on block chain
CN110502573A (en) A kind of gate method of data synchronization and server
US20220318776A1 (en) Method, server, and readable storage medium for processing payment in offline scenario
CN104915829B (en) Exchange method and device are applied based on NFC technique
CN105898741B (en) The control method and control system and UAV system of unmanned plane
CN110659134A (en) Data processing method and device applied to artificial intelligence platform
CN110519297A (en) A kind of data processing method and equipment based on block chain private key
CN107948592B (en) A kind of method, apparatus and intelligent terminal of shared camera
CN107086907A (en) Key synchronization, encapsulation transmission method and device for quantum key distribution process
EP4191498A1 (en) Data communication method and apparatus, computer device, and storage medium
WO2001071523A1 (en) Transparent user and session management for web applications
CN110096551A (en) Credit data storage method, device, equipment and medium based on block chain
CN110111193A (en) A kind of method and device of data processing
CN107886006B (en) Data operation method and device and electronic equipment
CN110399717A (en) Key acquisition method and device, storage medium and electronic device
KR20180011257A (en) Automatic recharging system, method and server
US20230259938A1 (en) Blockchain-based data processing method and apparatus, device, readable storage medium and computer program product
CN108985747A (en) Split transaction executes
CN109995699A (en) Management of multimedia equipment system and management method
CN109525949A (en) Register method and device, storage medium, server, user terminal
CN109754329A (en) Processing method, terminal, server and the storage medium of e-sourcing
US20140289832A1 (en) System, Method, And Apparatus For Using A Virtual Bucket To Transfer Electronic Data
CN109783126A (en) A kind of distribution Global ID's generation method and its device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination