CN110166562A - Data synchronous method, apparatus, storage medium and electronic equipment - Google Patents

Data synchronous method, apparatus, storage medium and electronic equipment Download PDF

Info

Publication number
CN110166562A
CN110166562A CN201910441877.7A CN201910441877A CN110166562A CN 110166562 A CN110166562 A CN 110166562A CN 201910441877 A CN201910441877 A CN 201910441877A CN 110166562 A CN110166562 A CN 110166562A
Authority
CN
China
Prior art keywords
client
synchronized
server
implementing result
instruction message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910441877.7A
Other languages
Chinese (zh)
Other versions
CN110166562B (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201910441877.7A priority Critical patent/CN110166562B/en
Publication of CN110166562A publication Critical patent/CN110166562A/en
Application granted granted Critical
Publication of CN110166562B publication Critical patent/CN110166562B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Hardware Redundancy (AREA)

Abstract

This disclosure relates to a kind of method that data are synchronous, device, storage medium and electronic equipment, it is related to wireless communication technology field, this method is applied to server-side, server-side is carried out data transmission by ZeroMQ and destination client, if including: that the connection status being connected to the network between server-side and destination client is converted to normal condition by abnormality, receive the connection instruction message that destination client is sent, connection instruction message is used to indicate connection status and is converted to normal condition by abnormality, in response to receiving connection instruction message, determine client to be synchronized, result acquisition instruction is sent to client to be synchronized, so that client to be synchronized determines the implementing result to be synchronized being locally stored according to result acquisition instruction, implementing result to be synchronized indicates the implementing result for the assignment instructions that client to be synchronized sends server-side, it connects The implementing result to be synchronized that client to be synchronized is sent is received, and synchronizes implementing result to be synchronized.It can be improved the reliability of management system.

Description

Data synchronous method, apparatus, storage medium and electronic equipment
Technical field
This disclosure relates to wireless communication technology field, and in particular, to a kind of synchronous method, apparatus of data, storage are situated between Matter and electronic equipment.
Background technique
With the continuous development of wireless communication technology, more and more technical fields start to lead to using operation management system It crosses server-side and uniformly sends assignment instructions to multiple client, to realize the service management to cluster.For example, SaltStack is managed Reason system is carried out data transmission between server-side and multiple client by ZeroMQ (English: Zero Message Queue), It can be realized the functions such as centralization configuration management, long-range execution, monitoring, to effectively improve the working efficiency of operation maintenance personnel.So And ZeroMQ is a kind of lightweight messages queue, does not support persistence mechanism, when the network connection between server-side and client When occurring abnormal, will lead to server-side can not know client to the implementing result of assignment instructions, i.e., server-side and client it Between implementing result it is inconsistent so that server-side can not determine the subsequent operation to client.
Summary of the invention
Purpose of this disclosure is to provide a kind of data synchronous method, apparatus, storage medium and electronic equipments, to solve The inconsistent problem of implementing result between server-side and client existing in the prior art.
To achieve the goals above, according to the first aspect of the embodiments of the present disclosure, a kind of method that data are synchronous is provided, is answered For server-side, the server-side is carried out data transmission by ZeroMQ and destination client, which comprises
If the connection status being connected to the network between the server-side and the destination client is positive by abnormality conversion Normal state, receives the connection instruction message that the destination client is sent, and the connection instruction message is used to indicate the connection State is converted to normal condition by abnormality;
In response to receiving the connection instruction message, client to be synchronized is determined;
Result acquisition instruction is sent to the client to be synchronized, so that the client to be synchronized is obtained according to the result Instruction fetch determines that the implementing result to be synchronized being locally stored, the implementing result to be synchronized indicate the client to be synchronized to institute State the implementing result of the assignment instructions of server-side transmission;
The implementing result to be synchronized that the client to be synchronized is sent is received, and synchronizes and described to be synchronized executes knot Fruit.
Optionally, determination client to be synchronized includes:
Determine the candidate client connecting with the server-side;
Determine whether to be stored with the corresponding target implementing result of each candidate's client, the target implementing result table Show the candidate client to the implementing result of the assignment instructions;
Using the not stored candidate client of the target implementing result as the client to be synchronized.
Optionally, determination client to be synchronized includes:
By the destination client, as the client to be synchronized.
Optionally, the implementing result to be synchronized includes the task identification of the assignment instructions;It is described synchronize it is described to same Walking implementing result includes:
By the implementing result to be synchronized, the assignment instructions for being stored as the task identification instruction corresponding execute knot Fruit.
According to the second aspect of an embodiment of the present disclosure, a kind of method that data are synchronous is provided, client, the visitor are applied to Family end is carried out data transmission by the ZeroMQ of server-side with the server-side, which comprises
The assignment instructions that the server-side is sent are executed, implementing result to be synchronized is obtained;
If the connection status being connected to the network between the server-side and the client is abnormality, will be described to be synchronized Implementing result is locally stored;
If the connection status is converted to normal condition by abnormality, Xiang Suoshu server-side sends connection instruction message, The connection instruction message is used to indicate the connection status and is converted to normal condition by abnormality, so that the server-side is rung Ying Yu receives the connection instruction message, carries out the synchronous of the implementing result to be synchronized with the client.
Optionally, it is sent described to the server-side after connecting instruction message, the method also includes:
Receive the result acquisition instruction that the server-side is sent according to the connection instruction message, the result acquisition instruction Task identification including the assignment instructions;
The implementing result to be synchronized that is locally stored is determined according to the task identification, and to be synchronized executes knot for described Fruit is sent to the server-side.
According to the third aspect of an embodiment of the present disclosure, a kind of device that data are synchronous is provided, server-side, the clothes are applied to Business end is carried out data transmission by ZeroMQ and destination client, and described device includes:
Receiving module, if the connection status for being connected to the network between the server-side and the destination client is by exception State is converted to normal condition, receives the connection instruction message that the destination client is sent, and the connection instruction message is used for Indicate that the connection status is converted to normal condition by abnormality;
Determining module, for determining client to be synchronized in response to receiving the connection instruction message;
Sending module, for sending result acquisition instruction to the client to be synchronized, so as to the client to be synchronized Determine the implementing result to be synchronized that is locally stored according to the result acquisition instruction, the implementing result to be synchronized indicate it is described to The implementing result for the assignment instructions that sync client sends the server-side;
Synchronization module, the implementing result to be synchronized sent for receiving the client to be synchronized, and synchronize described Implementing result to be synchronized.
Optionally, the determining module includes:
First determines submodule, for determining the candidate client connecting with the server-side;
Second determines submodule, is used to determine whether that being stored with the corresponding target of each candidate's client executes knot Fruit, the target implementing result indicate the candidate client to the implementing result of the assignment instructions;
Third determines submodule, is used for the not stored candidate client of the target implementing result as described in Client to be synchronized.
Optionally, the determining module is used for:
By the destination client, as the client to be synchronized.
Optionally, the implementing result to be synchronized includes the task identification of the assignment instructions;The synchronization module is used for:
By the implementing result to be synchronized, the assignment instructions for being stored as the task identification instruction corresponding execute knot Fruit.
According to a fourth aspect of embodiments of the present disclosure, a kind of device that data are synchronous is provided, client, the visitor are applied to Family end is carried out data transmission by the ZeroMQ of server-side with the server-side, and described device includes:
Execution module, the assignment instructions sent for executing the server-side, obtains implementing result to be synchronized;
Memory module, if the connection status for being connected to the network between the server-side and the client is abnormal shape The implementing result to be synchronized is locally stored state;
Sending module, if being converted to normal condition by abnormality for the connection status, Xiang Suoshu server-side is sent Instruction message is connected, the connection instruction message is used to indicate the connection status and is converted to normal condition by abnormality, with Toilet states server-side in response to receiving the connection instruction message, carries out the implementing result to be synchronized with the client It is synchronous.
Optionally, described device further include:
Receiving module, for it is described to the server-side send connection instruction message after, receive the server-side according to The result acquisition instruction that the connection instruction message is sent, the result acquisition instruction includes the task mark of the assignment instructions Know;
The sending module is also used to according to the determining implementing result to be synchronized being locally stored of the task identification, And the implementing result to be synchronized is sent to the server-side.
According to a fifth aspect of the embodiments of the present disclosure, a kind of computer readable storage medium is provided, calculating is stored thereon with The step of machine program, the method that the data that realization first aspect provides when which is executed by processor synchronize.
According to a sixth aspect of an embodiment of the present disclosure, a kind of electronic equipment is provided, comprising:
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize the data of first aspect offer The step of synchronous method.
According to the 7th of the embodiment of the present disclosure the aspect, a kind of computer readable storage medium is provided, calculating is stored thereon with The step of machine program, the method that the data that realization second aspect provides when which is executed by processor synchronize.
According to the eighth aspect of the embodiment of the present disclosure, a kind of electronic equipment is provided, comprising:
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize the data of second aspect offer The step of synchronous method.
Through the above technical solutions, the connection status that the disclosure is connected to the network between server-side and destination client is by different When normal state is converted to normal condition, destination client is used to indicate connection status to server-side transmission and is converted to normal condition Connect instruction message.After server-side receives connection instruction message, client to be synchronized is determined, then send and tie to client to be synchronized Fruit acquisition instruction.Client to be synchronized determines the execution knot to be synchronized being locally stored according to the result acquisition instruction received Fruit, and implementing result to be synchronized is sent to server-side.Server-side receives implementing result to be synchronized, and by implementing result to be synchronized It synchronizes.Can implementing result between synchronous service end and client, improve the reliability of management system.
Other feature and advantage of the disclosure will the following detailed description will be given in the detailed implementation section.
Detailed description of the invention
Attached drawing is and to constitute part of specification for providing further understanding of the disclosure, with following tool Body embodiment is used to explain the disclosure together, but does not constitute the limitation to the disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the synchronous method of data shown according to an exemplary embodiment;
Fig. 2 is the flow chart of the synchronous method of another data shown according to an exemplary embodiment;
Fig. 3 is a kind of flow chart of the synchronous method of data shown according to an exemplary embodiment;
Fig. 4 is the flow chart of the synchronous method of another data shown according to an exemplary embodiment;
Fig. 5 is a kind of block diagram of the synchronous device of data shown according to an exemplary embodiment;
Fig. 6 is the block diagram of the synchronous device of another data shown according to an exemplary embodiment;
Fig. 7 is a kind of block diagram of the synchronous device of data shown according to an exemplary embodiment;
Fig. 8 is the block diagram of the synchronous device of another data shown according to an exemplary embodiment;
Fig. 9 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment;
Figure 10 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Before the synchronous method, apparatus of the data for introducing disclosure offer, storage medium and electronic equipment, first to this Application scenarios involved by each embodiment are disclosed to be introduced.The application scenarios can be SaltStack management system, SaltStack management system is using C/S (English: Client/Server, Chinese: client/server) mode, server-side It (Server) is master, client (client) is minion, and server-side carries out data by ZeroMQ and destination client Transmission, due in ZeroMQ data output and input be it is asynchronous, do not support persistence mechanism.Wherein, server-side energy It is enough uniformly to send assignment instructions to multiple client, to manage multiple client concentratedly.
Fig. 1 is a kind of flow chart of the synchronous method of data shown according to an exemplary embodiment, as shown in Figure 1, should Method is applied to server-side, and server-side is carried out data transmission by ZeroMQ and destination client, this method comprises:
Step 101, if the connection status being connected to the network between server-side and destination client is positive by abnormality conversion Normal state, receives the connection instruction message that destination client is sent, and connection instruction message is used to indicate connection status by abnormal shape State is converted to normal condition.
For example, it in SaltStack management system, is carried out by ZeroMQ between server-side and multiple client Data transmission, destination client can be any one client in multiple client.Due to the originals such as external interference, equipment is impaired Cause, the connection status being connected to the network between server-side and client be possible to for abnormality (such as: network fluctuation, suspension, clothes The scenes such as business end is abnormal, server-side related service stops).If connection status is that abnormality occurs to send out in server-side to client Before sending assignment instructions, then server-side transmission assignment instructions will will fail, (i.e. server-side can know that assignment instructions are sent and lose Lose), therefore, assignment instructions can be retransmitted when connection status is converted to normal condition.If connection status is abnormality Occur after server-side sends assignment instructions to client, then server-side will be unable to know holding for client executing assignment instructions Row will be as a result, i.e. client will will fail to the corresponding implementing result of server-side transmission assignment instructions.At this point, client can be according to Predetermined period (such as: 2s) cycle detection connection status, when connection status is converted to normal condition by abnormality, to service End sends connection instruction message.Server-side can know connection status by abnormality according to the connection instruction message received Be converted to normal condition.
Step 102, in response to receiving connection instruction message, client to be synchronized is determined.
It is exemplary, since server-side can manage multiple client concentratedly, if network between server-side and destination client The connection status of connection is abnormality, the company being connected to the network between server-side and other clients in addition to destination client The state of connecing may also be abnormality, it is possible to which the implementing result for having multiple client to execute assignment instructions is not synchronized to service End.Therefore after receiving connection instruction message, the client to be synchronized that needs synchronize, client to be synchronized can be determined It can be one or more clients.Determine that the strategy of client to be synchronized can be with are as follows: using destination client as visitor to be synchronized Family end, or server-side determine do not receive which client assignment instructions implementing result, using these clients as Client to be synchronized, can also be using all clients connecting with server-side as client to be synchronized.
Step 103, result acquisition instruction is sent to client to be synchronized, so that client to be synchronized refers to according to result acquisition The implementing result to be synchronized for determining and being locally stored is enabled, implementing result to be synchronized indicates that client to be synchronized appoints server-side transmission The implementing result of business instruction.
Step 104, the implementing result to be synchronized that client to be synchronized is sent is received, and synchronizes implementing result to be synchronized.
It is exemplary, it is determined that after client to be synchronized, server-side is to client to be synchronized (one or more clients) Unified to send result acquisition instruction, as a result acquisition instruction is used to indicate client to be synchronized and implementing result to be synchronized is sent to clothes Business end.Client to be synchronized searches implementing result to be synchronized after receiving result acquisition instruction in being locally stored, and will be to same Step implementing result is sent to server-side.Server-side carries out implementing result to be synchronized same after receiving implementing result to be synchronized Step, it can be understood as stored implementing result to be synchronized to confirm that the subsequent management to client operates.Wherein, to Synchronous implementing result sends assignment instructions, the execution of client executing assignment instructions to be synchronized to client to be synchronized for server-side As a result, implementing result for example can be JSON (English: Java Script Object Notation) format, it may include appointing Whether business instruction runs succeeded, and also may include the concrete outcome of the task of assignment instructions instruction, is to obtain CPU with assignment instructions For utilization rate, implementing result may include: that instruction execution success or instruction execution failure can be with if instruction execution success Including the current CPU usage of client.
It should be noted that according to the realization mechanism of SaltStack management system, in embodiment provided by the disclosure, Carry out data transmission all being by 4505 and 4,506 two ports between server-side and client.Wherein, server-side passes through 4505 Port is by data (such as: result acquisition instruction) Push to ZeroMQ, so that client obtains the data from ZeroMQ, together Sample, client is by 4506 ports by data (such as: connection instruction message, implementing result to be synchronized) Push to ZeroMQ In, so that server-side obtains the data from ZeroMQ.Further server-side is received by 4505 ports to be sent by client Data, can be and carry out encrypted data according to preset algorithm (such as: AES encryption algorithm).
In conclusion the server-side in the disclosure, the connection status being connected to the network between server-side and destination client When being converted to normal condition by abnormality, receives the connection status that is used to indicate that destination client is sent and be converted to normal condition Connection instruction message, the instruction message of response connection later determines client to be synchronized, then send result to client to be synchronized Acquisition instruction finally receives the implementing result to be synchronized being locally stored that client to be synchronized is sent, and executes knot for be synchronized Fruit synchronizes.Can implementing result between synchronous service end and client, improve the reliability of management system.
Fig. 2 is the flow chart of the synchronous method of another data shown according to an exemplary embodiment, as shown in Fig. 2, Step 102 can be realized by following steps:
Step 1021, the candidate client connecting with server-side is determined.
Step 1022, it is determined whether be stored with the corresponding target implementing result of each candidate client, target implementing result Indicate candidate client to the implementing result of assignment instructions.
Step 1023, using the not stored candidate client of target implementing result as client to be synchronized.
Specifically, to determine client to be synchronized, the candidate client connecting with server-side, candidate client can be first determined End can be understood as whole clients that network connection is established with server-side, can also be that server-side has sent assignment instructions Client.If the connection status being connected to the network between server-side and client is normal condition, meeting in server-side always Each candidate client is stored with to the implementing result of assignment instructions.It therefore can be corresponding by searching for each candidate client Target implementing result, if the corresponding target implementing result of a certain candidate's client is not stored, then candidate's client is made For client to be synchronized.Wherein, client to be synchronized can be one or more, may include destination client, can also not Including destination client.
It in another implementation, can be directly using destination client as client to be synchronized.Further, may be used Using by each candidate client as client to be synchronized.
Optionally, implementing result to be synchronized includes the task identification of assignment instructions.The implementation of step 103 can wrap It includes:
By implementing result to be synchronized, it is stored as the corresponding implementing result of assignment instructions of task identification instruction.
For example, server-side to client send assignment instructions when, can generate one can unique identification task refer to The task identification (jid) of order, and task identification and assignment instructions are sent jointly into client.Client refers in the task of receiving After order, a new process can be derived to execute assignment instructions, after the completion of assignment instructions execute, implementing result to be synchronized can be with Include task identification, can also include the client identification for capableing of unique identification client.Server-side can pre-establish One task execution situation model will record the execution knot of each client executing assignment instructions in task execution situation model Task execution situation model can be interpreted as a table by fruit, contain three column datas: first row record client identification, Secondary series logger task mark, third column record implementing result, every data line indicate that a certain client is executing a certain task The implementing result of instruction.Which candidate client is server-side can search according to client identification in task executive condition model Hold no corresponding implementing result.
Implementing result to be synchronized is stored in task execution situation model after obtaining implementing result to be synchronized by server-side, It include in the record of corresponding task identification and client identification, as the corresponding execution of client executing assignment instructions to be synchronized As a result.Further, server-side can also arrive task action result mold sync after synchronizing implementing result to be synchronized In SaltStack management system in the execution account of the history model of assignment instructions, so that server-side can be according to execution history feelings The subsequent management to client of condition model validation operates.
In conclusion the server-side in the disclosure, the connection status being connected to the network between server-side and destination client When being converted to normal condition by abnormality, receives the connection status that is used to indicate that destination client is sent and be converted to normal condition Connection instruction message, the instruction message of response connection later determines client to be synchronized, then send result to client to be synchronized Acquisition instruction finally receives the implementing result to be synchronized being locally stored that client to be synchronized is sent, and executes knot for be synchronized Fruit synchronizes.Can implementing result between synchronous service end and client, improve the reliability of management system.
Fig. 3 is a kind of flow chart of the synchronous method of data shown according to an exemplary embodiment, as shown in figure 3, should Method is applied to client, and client is carried out data transmission by the ZeroMQ of server-side with server-side, this method comprises:
Step 201, the assignment instructions that server-side is sent are executed, implementing result to be synchronized is obtained.
Step 202, if the connection status being connected to the network between server-side and client is abnormality, by execution to be synchronized As a result it is locally stored.
Step 203, if connection status is converted to normal condition by abnormality, connection instruction message is sent to server-side, Connection instruction message is used to indicate connection status and is converted to normal condition by abnormality, so that server-side is in response to the company of receiving Instruction message is connect, carries out the synchronous of implementing result to be synchronized with client.
For example, in SaltStack management system, server-side sends assignment instructions, visitor by ZeroMQ to client After family termination receives assignment instructions, a new process is derived to execute assignment instructions after task execution is completed and can obtain Implementing result to be synchronized needs to be sent to the implementing result of server-side.At this point, being connected according to network between client and server-side The difference of the connection status connect is not also identical to the processing mode of implementing result to be synchronized.
If connection status is abnormality, at this time if client sends implementing result to be synchronized, server-side to server-side Implementing result to be synchronized can not be received, i.e. server synchronization fails.Therefore implementing result to be synchronized first can be subjected to local deposit Storage, such as implementing result to be synchronized is stored in local log file.Later, client can be recycled according to predetermined period and be examined Connection status is surveyed, until connection status is converted to normal condition by abnormality, connection instruction message is sent to server-side, to accuse Know that server-side connection status is converted to normal condition by abnormality.So that server-side is after receiving connection instruction message, it is right Implementing result to be synchronized synchronizes.The server-side implementation synchronous to implementing result to be synchronized may include: client hair After sending connection instruction message, continue to send implementing result to be synchronized to server-side, so that server-side is by implementing result to be synchronized As the corresponding implementing result of client executing assignment instructions to be synchronized.It is also possible to server-side and first sends result acquisition instruction, Client is receiving result acquisition instruction and then implementing result to be synchronized is sent to server-side, so that server-side will be to Synchronous implementing result is as the corresponding implementing result of client executing assignment instructions to be synchronized.
Fig. 4 is the flow chart of the synchronous method of another data shown according to an exemplary embodiment, as shown in figure 4, After step 203, this method further include:
Step 204, the result acquisition instruction that server-side is sent according to connection instruction message is received, as a result acquisition instruction includes The task identification of assignment instructions.
Step 205, the implementing result to be synchronized being locally stored is determined according to task identification, and implementing result to be synchronized is sent out It send to server-side.
It is exemplary, since server-side has managed multiple client, if the network between server-side and a certain client connects Connecing state is abnormality, and network connection state between server-side and other clients may also be to be abnormal, therefore server-side Synchronous multiple client may be needed (to may include the client for sending connection instruction message, can not also include sending connection The client of instruction message) execute assignment instructions implementing result to be synchronized.Therefore, it can be selected from server-side to needing to synchronize Client send result acquisition instruction, wherein result acquisition instruction includes the task mark for capableing of unique identification assignment instructions Know, which can be what server-side was generated when sending assignment instructions to client.Client is obtained receiving result After instruction fetch, local implementing result to be synchronized is stored according to task identification lookup, and implementing result to be synchronized is sent to Server-side, so that server-side is using implementing result to be synchronized as the corresponding implementing result of client executing assignment instructions to be synchronized.
In conclusion the client in the disclosure, is first carried out the assignment instructions of server-side transmission, obtains execution to be synchronized As a result, being carried out when the connection status being connected to the network between server-side and client is abnormality to implementing result to be synchronized It is locally stored, when connection status is converted to normal condition, is used to indicate connection status to server-side transmission and is converted to normal shape The connection instruction message of state.So that server-side carries out the synchronous of implementing result to be synchronized with client according to connection instruction message. Can implementing result between synchronous service end and client, improve the reliability of management system.
Fig. 5 is a kind of block diagram of the synchronous device of data shown according to an exemplary embodiment, as shown in figure 5, the dress It sets 300 and is applied to server-side, server-side is carried out data transmission by ZeroMQ and destination client, comprising:
Receiving module 301, if the connection status for being connected to the network between server-side and destination client is by abnormality Normal condition is converted to, the connection instruction message that destination client is sent is received, connection instruction message is used to indicate connection status Normal condition is converted to by abnormality.
Determining module 302, for determining client to be synchronized in response to receiving connection instruction message.
Sending module 303, for sending result acquisition instruction to client to be synchronized, so that client to be synchronized is according to knot Fruit acquisition instruction determines that the implementing result to be synchronized being locally stored, implementing result to be synchronized indicate client to be synchronized to server-side The implementing result of the assignment instructions of transmission.
Synchronization module 304, the implementing result to be synchronized sent for receiving client to be synchronized, and synchronize execution to be synchronized As a result.
Fig. 6 is the block diagram of the synchronous device of another data shown according to an exemplary embodiment, as shown in fig. 6, really Cover half block 302 includes:
First determines submodule 3021, for determining the candidate client connecting with server-side.
Second determines submodule 3022, is used to determine whether that being stored with the corresponding target of each candidate client executes knot Fruit, target implementing result indicate candidate client to the implementing result of assignment instructions.
Third determines submodule 3023, for using the not stored candidate client of target implementing result as visitor to be synchronized Family end.
Optionally it is determined that module 302 can be also used for destination client, as client to be synchronized.
Optionally, implementing result to be synchronized includes the task identification of assignment instructions, and synchronization module 304 is used for:
By implementing result to be synchronized, it is stored as the corresponding implementing result of assignment instructions of task identification instruction.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
In conclusion the server-side in the disclosure, the connection status being connected to the network between server-side and destination client When being converted to normal condition by abnormality, receives the connection status that is used to indicate that destination client is sent and be converted to normal condition Connection instruction message, the instruction message of response connection later determines client to be synchronized, then send result to client to be synchronized Acquisition instruction finally receives the implementing result to be synchronized being locally stored that client to be synchronized is sent, and executes knot for be synchronized Fruit synchronizes.Can implementing result between synchronous service end and client, improve the reliability of management system.
Fig. 7 is a kind of block diagram of the synchronous device of data shown according to an exemplary embodiment, which is applied to Client, client are carried out data transmission by the ZeroMQ of server-side with server-side, comprising:
Execution module 401 obtains implementing result to be synchronized for executing the assignment instructions of server-side transmission.
Memory module 402 will be to if connection status for being connected to the network between server-side and client is abnormality Synchronous implementing result is locally stored.
Sending module 403 sends connection to server-side and refers to if being converted to normal condition by abnormality for connection status Show message, connection instruction message is used to indicate connection status and is converted to normal condition by abnormality, so as to server-side in response to Connection instruction message is received, carries out the synchronous of implementing result to be synchronized with client.
Fig. 8 is the block diagram of the synchronous device of another data shown according to an exemplary embodiment, which also wraps It includes:
Receiving module 404 disappears for after sending connection instruction message to server-side, receiving server-side according to connection instruction The result acquisition instruction sent is ceased, as a result acquisition instruction includes the task identification of assignment instructions.
Sending module 403 is also used to according to the determining implementing result to be synchronized being locally stored of task identification, and will be to be synchronized Implementing result is sent to server-side.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
In conclusion the client in the disclosure, is first carried out the assignment instructions of server-side transmission, obtains execution to be synchronized As a result, being carried out when the connection status being connected to the network between server-side and client is abnormality to implementing result to be synchronized It is locally stored, when connection status is converted to normal condition, is used to indicate connection status to server-side transmission and is converted to normal shape The connection instruction message of state.So that server-side carries out the synchronous of implementing result to be synchronized with client according to connection instruction message. Can implementing result between synchronous service end and client, improve the reliability of management system.
Fig. 9 is the block diagram of a kind of electronic equipment 500 shown according to an exemplary embodiment.As shown in figure 9, the electronics is set Standby 500 may include: processor 501, memory 502.The electronic equipment 500 can also include multimedia component 503, input/ Export one or more of (I/O) interface 504 and communication component 505.
Wherein, processor 501 is used to control the integrated operation of the electronic equipment 500, to complete above-mentioned Fig. 3 and Fig. 4 institute All or part of the steps in the synchronous method of the data shown.Memory 502 is for storing various types of data to support The operation of the electronic equipment 500, these data for example may include any using journey for what is operated on the electronic equipment 500 The instruction of sequence or method and the relevant data of application program, such as contact data, the message of transmitting-receiving, picture, audio, view Frequency etc..The memory 502 can realize by any kind of volatibility or non-volatile memory device or their combination, Such as static random access memory (Static Random Access Memory, abbreviation SRAM), electrically erasable is only It reads memory (Electrically Erasable Programmable Read-Only Memory, abbreviation EEPROM), it is erasable Except programmable read only memory (Erasable Programmable Read-Only Memory, abbreviation EPROM), may be programmed only It reads memory (Programmable Read-Only Memory, abbreviation PROM), read-only memory (Read-Only Memory, Abbreviation ROM), magnetic memory, flash memory, disk or CD.Multimedia component 503 may include screen and audio component. Wherein screen for example can be touch screen, and audio component is used for output and/or input audio signal.For example, audio component can be with Including a microphone, microphone is for receiving external audio signal.The received audio signal can be further stored in Memory 502 is sent by communication component 505.Audio component further includes at least one loudspeaker, is used for output audio signal. I/O interface 504 provides interface between processor 501 and other interface modules, other above-mentioned interface modules can be keyboard, mouse Mark, button etc..These buttons can be virtual push button or entity button.Communication component 505 is for the electronic equipment 500 and its Wired or wireless communication is carried out between his equipment.Wireless communication, such as Wi-Fi, bluetooth, near-field communication (Near Field Communication, abbreviation NFC), 2G, 3G or 4G or they one or more of combination, therefore corresponding communication Component 505 may include: Wi-Fi module, bluetooth module, NFC module.
In one exemplary embodiment, electronic equipment 500 can be by one or more application specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device, Abbreviation DSPD), programmable logic device (Programmable Logic Device, abbreviation PLD), field programmable gate array (Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics member Part is realized, for executing above-mentioned Fig. 3 method synchronous with data shown in Fig. 4.
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should The step of above-mentioned Fig. 3 method synchronous with data shown in Fig. 4 is realized when program instruction is executed by processor.For example, the meter Calculation machine readable storage medium storing program for executing can be the above-mentioned memory 502 including program instruction, and above procedure instruction can be by electronic equipment 500 Processor 501 execute to complete above-mentioned Fig. 3 method synchronous with data shown in Fig. 4.
In a further exemplary embodiment, a kind of computer program product is also provided, which includes energy Enough computer programs executed by programmable device, which has uses when being executed by the programmable device In the code section for executing above-mentioned Fig. 3 method synchronous with data shown in Fig. 4.
In conclusion the client in the disclosure, is first carried out the assignment instructions of server-side transmission, obtains execution to be synchronized As a result, being carried out when the connection status being connected to the network between server-side and client is abnormality to implementing result to be synchronized It is locally stored, when connection status is converted to normal condition, is used to indicate connection status to server-side transmission and is converted to normal shape The connection instruction message of state.So that server-side carries out the synchronous of implementing result to be synchronized with client according to connection instruction message. Can implementing result between synchronous service end and client, improve the reliability of management system.
Figure 10 is the block diagram of a kind of electronic equipment 600 shown according to an exemplary embodiment.For example, electronic equipment 600 It may be provided as a server.Referring to Fig.1 0, electronic equipment 600 includes processor 622, and quantity can be one or more A and memory 632, for storing the computer program that can be executed by processor 622.The calculating stored in memory 632 Machine program may include it is one or more each correspond to one group of instruction module.In addition, processor 622 can be by It is configured to execute the computer program, to execute above-mentioned Fig. 1 method synchronous with data shown in Fig. 2.
In addition, electronic equipment 600 can also include power supply module 626 and communication component 650, which can be with It is configured as executing the power management of electronic equipment 600, which, which can be configured as, realizes electronic equipment 600 Communication, for example, wired or wireless communication.In addition, the electronic equipment 600 can also include input/output (I/O) interface 658.Electricity Sub- equipment 600 can be operated based on the operating system for being stored in memory 632, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM etc..
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should The step of above-mentioned Fig. 1 method synchronous with data shown in Fig. 2 is realized when program instruction is executed by processor.For example, the meter Calculation machine readable storage medium storing program for executing can be the above-mentioned memory 632 including program instruction, and above procedure instruction can be by electronic equipment 600 Processor 622 execute to complete above-mentioned Fig. 1 method synchronous with data shown in Fig. 2.
In a further exemplary embodiment, a kind of computer program product is also provided, which includes energy Enough computer programs executed by programmable device, which has uses when being executed by the programmable device In the code section for executing above-mentioned Fig. 1 method synchronous with data shown in Fig. 2.
In conclusion the server-side in the disclosure, the connection status being connected to the network between server-side and destination client When being converted to normal condition by abnormality, receives the connection status that is used to indicate that destination client is sent and be converted to normal condition Connection instruction message, the instruction message of response connection later determines client to be synchronized, then send result to client to be synchronized Acquisition instruction finally receives the implementing result to be synchronized being locally stored that client to be synchronized is sent, and executes knot for be synchronized Fruit synchronizes.Can implementing result between synchronous service end and client, improve the reliability of management system.
The preferred embodiment of the disclosure is described in detail in conjunction with attached drawing above, still, the disclosure is not limited to above-mentioned reality The detail in mode is applied, in the range of the technology design of the disclosure, those skilled in the art are considering specification and practice After the disclosure, it is readily apparent that other embodiments of the disclosure, belongs to the protection scope of the disclosure.
It is further to note that specific technical features described in the above specific embodiments, in not lance In the case where shield, it can be combined in any appropriate way.Simultaneously between a variety of different embodiments of the disclosure Any combination can also be carried out, as long as it, without prejudice to the thought of the disclosure, equally should be considered as disclosure disclosure of that. The disclosure is not limited to the precision architecture being described above out, and the scope of the present disclosure is only limited by the attached claims System.

Claims (10)

1. a kind of synchronous method of data, which is characterized in that be applied to server-side, the server-side passes through ZeroMQ and target visitor Family end carries out data transmission, which comprises
If the connection status being connected to the network between the server-side and the destination client is converted to normal shape by abnormality State, receives the connection instruction message that the destination client is sent, and the connection instruction message is used to indicate the connection status Normal condition is converted to by abnormality;
In response to receiving the connection instruction message, client to be synchronized is determined;
Result acquisition instruction is sent to the client to be synchronized, so that the client to be synchronized refers to according to result acquisition The implementing result to be synchronized for determining and being locally stored is enabled, the implementing result to be synchronized indicates the client to be synchronized to the clothes The implementing result for the assignment instructions that business end is sent;
The implementing result to be synchronized that the client to be synchronized is sent is received, and synchronizes the implementing result to be synchronized.
2. the method according to claim 1, wherein determination client to be synchronized includes:
Determine the candidate client connecting with the server-side;
Determine whether to be stored with the corresponding target implementing result of each candidate's client, the target implementing result indicates institute Candidate client is stated to the implementing result of the assignment instructions;
Using the not stored candidate client of the target implementing result as the client to be synchronized.
3. a kind of synchronous method of data, which is characterized in that be applied to client, the ZeroMQ that the client passes through server-side Carry out data transmission with the server-side, which comprises
The assignment instructions that the server-side is sent are executed, implementing result to be synchronized is obtained;
If the connection status being connected to the network between the server-side and the client is abnormality, by the execution to be synchronized As a result it is locally stored;
If the connection status is converted to normal condition by abnormality, Xiang Suoshu server-side sends connection instruction message, described Connection instruction message is used to indicate the connection status and is converted to normal condition by abnormality, so as to the server-side in response to The connection instruction message is received, carries out the synchronous of the implementing result to be synchronized with the client.
4. according to the method described in claim 3, it is characterized in that, sending connection instruction message to the server-side described Afterwards, the method also includes:
The result acquisition instruction that the server-side is sent according to the connection instruction message is received, the result acquisition instruction includes The task identification of the assignment instructions;
The implementing result to be synchronized being locally stored is determined according to the task identification, and the implementing result to be synchronized is sent out It send to the server-side.
5. a kind of synchronous device of data, which is characterized in that be applied to server-side, the server-side passes through ZeroMQ and target visitor Family end carries out data transmission, and described device includes:
Receiving module, if the connection status for being connected to the network between the server-side and the destination client is by abnormality Normal condition is converted to, the connection instruction message that the destination client is sent is received, the connection instruction message is used to indicate The connection status is converted to normal condition by abnormality;
Determining module, for determining client to be synchronized in response to receiving the connection instruction message;
Sending module, for sending result acquisition instruction to the client to be synchronized, so as to the client to be synchronized according to The result acquisition instruction determines that the implementing result to be synchronized being locally stored, the implementing result to be synchronized indicate described to be synchronized The implementing result for the assignment instructions that client sends the server-side;
Synchronization module, the implementing result to be synchronized sent for receiving the client to be synchronized, and synchronize described to same Walk implementing result.
6. a kind of synchronous device of data, which is characterized in that be applied to client, the ZeroMQ that the client passes through server-side Carry out data transmission with the server-side, described device includes:
Execution module, the assignment instructions sent for executing the server-side, obtains implementing result to be synchronized;
Memory module will if the connection status for being connected to the network between the server-side and the client is abnormality The implementing result to be synchronized is locally stored;
Sending module, if being converted to normal condition by abnormality for the connection status, Xiang Suoshu server-side sends connection Instruction message, the connection instruction message is used to indicate the connection status and is converted to normal condition by abnormality, with toilet Server-side is stated in response to receiving the connection instruction message, carries out the same of the implementing result to be synchronized with the client Step.
7. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The step of method as claimed in claim 1 or 2 is realized when row.
8. a kind of electronic equipment characterized by comprising
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize method as claimed in claim 1 or 2 Step.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The step of claim 3 or 4 the method are realized when row.
10. a kind of electronic equipment characterized by comprising
Memory is stored thereon with computer program;
Processor, for executing the computer program in the memory, to realize claim 3 or 4 the methods Step.
CN201910441877.7A 2019-05-24 2019-05-24 Data synchronization method and device, storage medium and electronic equipment Active CN110166562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910441877.7A CN110166562B (en) 2019-05-24 2019-05-24 Data synchronization method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910441877.7A CN110166562B (en) 2019-05-24 2019-05-24 Data synchronization method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110166562A true CN110166562A (en) 2019-08-23
CN110166562B CN110166562B (en) 2022-04-05

Family

ID=67632943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910441877.7A Active CN110166562B (en) 2019-05-24 2019-05-24 Data synchronization method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110166562B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800659A (en) * 2020-06-03 2020-10-20 深圳市灰度科技有限公司 Program synchronization method, device, display terminal and storage medium
CN111901341A (en) * 2020-07-28 2020-11-06 北京字节跳动网络技术有限公司 State synchronization method and device
CN111949422A (en) * 2020-08-26 2020-11-17 南京云灿信息科技有限公司 Data multi-level caching and high-speed transmission recording method based on MQ and asynchronous IO
CN112395142A (en) * 2020-11-30 2021-02-23 重庆紫光华山智安科技有限公司 Data management method and device, electronic equipment and storage medium
CN113746931A (en) * 2021-09-10 2021-12-03 联想(北京)有限公司 Data synchronization method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140081912A1 (en) * 2012-09-18 2014-03-20 Inventec Corporation Data synchronizing system and method thereof
CN105359466A (en) * 2013-03-15 2016-02-24 华为技术有限公司 Synchronizing and collaboration of information among a mobile device group
CN107040610A (en) * 2017-05-27 2017-08-11 广东欧珀移动通信有限公司 Method of data synchronization, device, storage medium, terminal and server
CN107741857A (en) * 2017-10-26 2018-02-27 顺丰科技有限公司 A kind of system batch installation method
CN108833047A (en) * 2018-08-13 2018-11-16 东软集团股份有限公司 Method for synchronizing time, device, readable storage medium storing program for executing and electronic equipment
CN109413118A (en) * 2017-08-15 2019-03-01 东软集团股份有限公司 A kind of method, apparatus that realizing session synchronization and storage medium, program product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140081912A1 (en) * 2012-09-18 2014-03-20 Inventec Corporation Data synchronizing system and method thereof
CN105359466A (en) * 2013-03-15 2016-02-24 华为技术有限公司 Synchronizing and collaboration of information among a mobile device group
CN107040610A (en) * 2017-05-27 2017-08-11 广东欧珀移动通信有限公司 Method of data synchronization, device, storage medium, terminal and server
CN109413118A (en) * 2017-08-15 2019-03-01 东软集团股份有限公司 A kind of method, apparatus that realizing session synchronization and storage medium, program product
CN107741857A (en) * 2017-10-26 2018-02-27 顺丰科技有限公司 A kind of system batch installation method
CN108833047A (en) * 2018-08-13 2018-11-16 东软集团股份有限公司 Method for synchronizing time, device, readable storage medium storing program for executing and electronic equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800659A (en) * 2020-06-03 2020-10-20 深圳市灰度科技有限公司 Program synchronization method, device, display terminal and storage medium
CN111901341A (en) * 2020-07-28 2020-11-06 北京字节跳动网络技术有限公司 State synchronization method and device
CN111901341B (en) * 2020-07-28 2022-05-24 北京字节跳动网络技术有限公司 State synchronization method and device
CN111949422A (en) * 2020-08-26 2020-11-17 南京云灿信息科技有限公司 Data multi-level caching and high-speed transmission recording method based on MQ and asynchronous IO
CN111949422B (en) * 2020-08-26 2024-04-16 南京云灿信息科技有限公司 Data multi-level cache and high-speed transmission recording method based on MQ and asynchronous IO
CN112395142A (en) * 2020-11-30 2021-02-23 重庆紫光华山智安科技有限公司 Data management method and device, electronic equipment and storage medium
CN112395142B (en) * 2020-11-30 2023-05-26 重庆紫光华山智安科技有限公司 Data management method, device, electronic equipment and storage medium
CN113746931A (en) * 2021-09-10 2021-12-03 联想(北京)有限公司 Data synchronization method and device

Also Published As

Publication number Publication date
CN110166562B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN110166562A (en) Data synchronous method, apparatus, storage medium and electronic equipment
CN107733708B (en) Equipment parameter configuration method and device, computer equipment and storage medium
CN108429740A (en) A kind of method and device obtaining device identification
CN109101381A (en) Configuration file update method, system, electronic equipment and storage medium
CN109656778A (en) Data capture method, device, computer equipment and storage medium
CN108390885A (en) A kind of method and device obtaining device identification
CN110324115A (en) A kind of data transmission method, device, storage medium and terminal device
CN112988317B (en) Multi-mode cloud desktop management and control method and device
CN103441861A (en) Method and device for generating data records
CN110289685A (en) Method for inspecting, terminal device and the storage medium of power distribution network resource
CN108139964A (en) Cloud service configuration method and device, storage medium and cloud service system
JP2017118489A (en) System and method using machine readable code for testing communication network
CN110263565A (en) Method and apparatus for calling service
CN106506515A (en) A kind of authentication method and device
CN112367680A (en) External communication test method and device based on intelligent electric meter and computer equipment
CN109828840A (en) Resource method of combination, device, storage medium and electronic equipment
CN106455042B (en) A kind of time synchronization between nodes method, wireless sensor network and its node
CN113315774A (en) Instrument testing method and instrument testing device
FI20215764A1 (en) Electric vehicle charging management and client device
CN110417567A (en) A kind of configuration method and device of internet of things equipment
CN110868341B (en) Method and device for testing intelligent management unit of in-situ protection
WO2020255272A1 (en) Electronic apparatus and method
CN111026503A (en) Remote sensing satellite ground station monitoring method and system based on virtualization
CN109698774A (en) Method and device for monitoring device working condition
CN110276191A (en) A kind of equipment configuration method, device and electronic equipment

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
GR01 Patent grant
GR01 Patent grant