CN108683936B - Data synchronization method, device, terminal, server and storage medium - Google Patents

Data synchronization method, device, terminal, server and storage medium Download PDF

Info

Publication number
CN108683936B
CN108683936B CN201810460899.3A CN201810460899A CN108683936B CN 108683936 B CN108683936 B CN 108683936B CN 201810460899 A CN201810460899 A CN 201810460899A CN 108683936 B CN108683936 B CN 108683936B
Authority
CN
China
Prior art keywords
terminal
page
instruction
server
terminals
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810460899.3A
Other languages
Chinese (zh)
Other versions
CN108683936A (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.)
Hangzhou Chengying Data Technology Co ltd
Original Assignee
Hangzhou Chengying Data 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 Hangzhou Chengying Data Technology Co ltd filed Critical Hangzhou Chengying Data Technology Co ltd
Priority to CN201810460899.3A priority Critical patent/CN108683936B/en
Publication of CN108683936A publication Critical patent/CN108683936A/en
Application granted granted Critical
Publication of CN108683936B publication Critical patent/CN108683936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/633Control signals issued by server directed to the network components or client
    • H04N21/6332Control signals issued by server directed to the network components or client directed to client

Abstract

The application provides a method and a device for data synchronization, wherein the method is used for a screen display system, the screen display system comprises at least two terminals, and the method comprises the following steps: the at least two terminals are connected with the server; receiving a setting instruction of a server, setting one of the at least two terminals as a sending terminal, and setting the rest of the at least two terminals as receiving terminals; the sending terminal generates a data synchronization instruction by the synchronization data and sends the data synchronization instruction to the server; and the receiving terminal receives a data synchronization instruction issued by the server and displays the synchronization data according to the data synchronization instruction. According to the data synchronization method, one terminal in the screen display system is set to be the sending terminal through the server, the other terminals are the receiving terminals, then the sending terminal sends the synchronization data to the receiving terminals, and the data synchronization is achieved, so that the problem that the playing progress of each terminal is inconsistent is solved, and the user experience is improved.

Description

Data synchronization method, device, terminal, server and storage medium
Technical Field
The present application relates to the field of data synchronization technologies, and in particular, to a method and an apparatus for data synchronization.
Background
The large screen display system can display various computers (workstations), network signals and various video signals, and the pictures can be freely windowed, enlarged, reduced and superimposed. The application field of the large-screen display system is more and more extensive with the coming of the digital era, the monitoring, centralized dispatching and communication systems are mostly applied at present, and the application industry is mainly distributed in the fields of public security, military, traffic, government, finance, energy, large-scale enterprises, radio and television and the like.
Currently, a large-screen display system is actually a web page system and is finally deployed on a physical large screen. The physical large screen is formed by splicing a plurality of physical small screens, and each physical small screen corresponds to one physical terminal. Since a large screen display system has different layouts and resolutions, sometimes a page may be displayed across a plurality of physical small screens, and this situation is actually that the same page is opened on a plurality of different terminals, but their offset positions are different. This can cause a problem that when there are animations, videos, etc. on the page, the animation or video will be played first on the page that has been loaded first, even if the difference between the front and back is 1 second (due to network or machine), the user experience will be seriously affected.
Therefore, a solution is needed to synchronize all data on a page in a large screen display system to enhance the user experience.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for data synchronization, a terminal, a server, and a computer-readable storage medium, so as to solve technical defects in the prior art.
The application discloses a data synchronization method, which is used for a screen display system, wherein the screen display system comprises at least two terminals, and the method comprises the following steps:
the at least two terminals are connected with the server;
receiving a setting instruction of a server, setting one of the at least two terminals as a sending terminal, and setting the rest of the at least two terminals as receiving terminals;
the sending terminal generates a data synchronization instruction by the synchronization data and sends the data synchronization instruction to the server;
and the receiving terminal receives a data synchronization instruction issued by the server and displays the synchronization data according to the data synchronization instruction.
In an exemplary embodiment of the application, the receiving the setting instruction of the server, setting one of the at least two terminals as a sending terminal, and the remaining terminals of the at least two terminals as receiving terminals includes:
the at least two terminals respectively send connection instructions to the server, wherein the connection instructions comprise: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
the at least two terminals receive a first setting instruction sent by the server, wherein the first setting instruction comprises: a page identifier set as a transmitting terminal;
and each terminal in the at least two terminals checks whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the terminal, if so, the terminal sets the terminal as the sending terminal, and if not, the terminal sets the terminal as the receiving terminal.
In an exemplary embodiment of the present application, the method further comprises:
if the connection between the sending terminal and the server is abnormal, at least two receiving terminals receive a second setting instruction sent by the server again; wherein the second setting instruction includes: the page identification of the sending terminal is reset in at least two receiving terminals;
and each of the at least two receiving terminals checks whether the page identifier of the sending terminal in the second setting instruction is the same as the page identifier of the receiving terminal, and if so, the receiving terminal resets the receiving terminal to the sending terminal.
In an exemplary embodiment of the present application, the data synchronization instruction includes: sending a page name, a display component name and synchronous data of the terminal;
the synchronization data includes: displaying data of the component;
the receiving terminal receives a data synchronization instruction issued by a server, displays the synchronization data according to the data synchronization instruction, and comprises:
the receiving terminal finds the corresponding display component according to the display component name;
and the receiving terminal sets the display state of the display assembly according to the data of the display assembly so as to display the effect of the display assembly.
The application discloses a data synchronization method, which is used for a server and comprises the following steps:
sending a setting instruction to at least two terminals belonging to a screen display system, and setting one of the at least two terminals as a sending terminal and the rest of the at least two terminals as receiving terminals;
receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
In an exemplary embodiment of the present application, the server sends a setting instruction to at least two terminals belonging to one screen display system to set one of the at least two terminals as a sending terminal and the rest of the at least two terminals as receiving terminals, including:
the method comprises the steps that a server receives a connection instruction sent by a terminal and updates connection information of the terminal; wherein the connection instruction comprises: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
the server selects one of the at least two terminals with the same room number and the same page name as a sending terminal, selects the rest of the at least two terminals with the same room number and the same page name as receiving terminals, and sends a first setting instruction to the at least two terminals with the same room number and the same page name; wherein the first setting instruction includes: and setting the page identifier as the page identifier of the sending terminal.
In an exemplary embodiment of the present application, the method of data synchronization further comprises:
if the server detects that the connection with the sending terminal is abnormal, the server reselects one of the at least two receiving terminals with the same room number and the same page name as the sending terminal, and sends a second setting instruction to the at least two receiving terminals with the same room number and the same page name; wherein the second setting instruction includes: is reset to the page identification of the transmitting terminal.
In an exemplary embodiment of the present application, the server receiving the connection instruction and updating the connection information of the terminal includes:
the server judges whether the room number of the terminal in the connection instruction is prestored, and if not, the room number is created;
and the server judges whether the page of the terminal is connected for the first time according to the page identification of the terminal, if so, the page information of the terminal is newly added, and if not, the prestored page information of the terminal is updated.
The application discloses device of data synchronization sets up in the terminal, at least two the terminal belongs to a screen display system, the device includes:
the connection module is used for establishing connection between each terminal and the server;
a setting instruction receiving module, configured to receive, by each terminal, a setting instruction of a server to set itself as a sending terminal or a receiving terminal, where the server sets one of the at least two terminals as the sending terminal, and the rest of the at least two terminals are the receiving terminals;
the data synchronization instruction sending module is used for generating a data synchronization instruction by the synchronization data and sending the data synchronization instruction to the server under the condition that the terminal is set as a sending terminal;
and the synchronous data display module is used for receiving a data synchronization instruction issued by a server under the condition that the terminal is set as a receiving terminal, and displaying the synchronous data according to the data synchronization instruction.
The application discloses device of data synchronization sets up in the server, includes:
the system comprises a setting instruction sending module, a setting instruction sending module and a display module, wherein the setting instruction sending module is used for sending a setting instruction to at least two terminals belonging to one screen display system, one of the at least two terminals is set as a sending terminal, and the rest of the at least two terminals are set as receiving terminals;
the data synchronization instruction receiving module is used for receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and the data synchronization instruction forwarding module is used for sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
The application discloses a terminal, including memory, treater and the computer instruction that stores on the memory and can run on the treater, two at least terminals belong to a screen display system, realize the following step when the treater carries out the instruction:
establishing connection with a server;
receiving a setting instruction of a server to set the server as a sending terminal or a receiving terminal, wherein the server sets one of the at least two terminals as the sending terminal, and the rest of the at least two terminals are the receiving terminals;
under the condition that the terminal is set as a sending terminal, a synchronous data generation data synchronization instruction is sent to a server;
and under the condition that the terminal is set as a receiving terminal, receiving a data synchronization instruction issued by a server, and displaying the synchronization data according to the data synchronization instruction.
The application discloses a server, comprising a memory, a processor and computer instructions stored on the memory and operable on the processor, wherein the processor implements the following steps when executing the instructions:
sending a setting instruction to at least two terminals belonging to a screen display system, and setting one of the at least two terminals as a sending terminal and the rest of the at least two terminals as receiving terminals;
receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
The present application discloses a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method for data synchronization of a terminal as described above.
The present application discloses a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method for data synchronization of a server as described above.
According to the data synchronization method, one terminal in the screen display system is set to be the sending terminal through the server, the other terminals are the receiving terminals, then the sending terminal sends the synchronization data to the receiving terminals, and the data synchronization is achieved, so that the problem that the playing progress of each terminal is inconsistent is solved, and the user experience is improved.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a method for data synchronization according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a step 102 of a method for data synchronization according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a step 104 of a method for data synchronization according to an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating a method of data synchronization according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating a step 401 in a data synchronization method according to an embodiment of the present application;
FIG. 6 is an interaction diagram of a method of data synchronization according to an embodiment of the present application;
FIG. 7 is an interaction diagram of a method of data synchronization according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of an apparatus for data synchronization according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of an apparatus for data synchronization according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The embodiment of the application discloses a data synchronization method which is used for a screen display system. The screen display system comprises at least two terminals, each terminal corresponds to one physical small screen, and the physical small screens are spliced into one physical large screen. And each terminal sends the data of the terminal to the small physical screen for display, and finally, the overall display effect is formed in the large physical screen. How to keep the data display synchronization in each physical small screen is a technical problem to be mainly solved by the data synchronization method of the embodiment.
It should be noted that the data described in this embodiment includes data such as animation, video, and pictures.
Referring to FIG. 1, the method comprises 101-104:
101. and the at least two terminals are connected with the server.
In the present embodiment, there are various methods for implementing step 101, and a specific implementation manner is illustrated below. As will be appreciated by those skilled in the art, the following specific embodiments are merely illustrative and are not further limiting on the present step 101.
In a specific implementation, a websocket protocol connection is established between the terminal and the server in this embodiment. The websocket Protocol is a network Protocol based on a Transmission Control Protocol (TCP), and implements full-duplex (full-duplex) communication between a browser and a server, which allows the server to actively send information to a terminal.
The server implements the server side program using nodejs (sds). Nodejs is a Javascript operating environment (runtime), released in 5 months of 2009, developed by Ryan Dahl, and essentially encapsulates Chrome V8 engine.
102. And receiving a setting instruction of the server, setting one of the at least two terminals as a sending terminal, and setting the rest of the at least two terminals as receiving terminals.
Specifically, referring to fig. 2, this step 102 includes:
201. and the at least two terminals respectively send connection instructions to the server.
Wherein, the connection instruction (join) comprises: room number (room) of the terminal, page information of the terminal; the page information of the terminal comprises: the page name (page) of the terminal, the page identifier (page id) of the terminal, and the network address (search) of the page of the terminal.
It should be noted that the purpose of the connection instruction (join) is not to establish a connection between the server and the terminal in step 101, but to implement setting of whether the terminal is a sending terminal or a receiving terminal by the server. The connection instruction is a precondition for triggering the server to issue the setting instruction.
202. And the at least two terminals receive a first setting instruction sent by the server.
Wherein the first setting instruction includes: is set as the page identification of the transmitting terminal.
203. Each of the at least two terminals checks whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the sending terminal, if so, step 204 is executed, and if not, step 205 is executed.
204. The terminal sets itself as a transmitting terminal.
205. The terminal sets itself as a receiving terminal.
In summary, it may be set as a sending terminal or a receiving terminal for each terminal, depending on the setting of the server.
In addition, in the using process, an abnormality may occur in the connection between the sending terminal and the server, and there may be various reasons for the abnormality, such as the sending terminal itself crashes, network congestion, and the like. In this case, the server needs to reselect one of the remaining receiving terminals as the transmitting terminal, and continue to implement the data synchronization method of the present application.
Specifically, after the sending terminal is abnormally connected with the server, the method further includes:
2011. and at least two receiving terminals re-receive the second setting instruction sent by the server. Wherein the second setting instruction includes: and the page identifier of the sending terminal is reset in at least two receiving terminals.
2012. And each of the at least two receiving terminals checks whether the page identifier of the sending terminal in the second setting instruction is the same as the page identifier of the sending terminal, if so, step 2013 is executed, and if not, step 2014 is executed.
2013. The receiving terminal resets itself as the transmitting terminal.
2014. The receiving terminal does not make any setting and keeps itself as the receiving terminal.
By this step 102, the setting of the transmitting terminal and the receiving terminal is completed.
103. And the sending terminal generates a data synchronization instruction by the synchronization data and sends the data synchronization instruction to the server.
In this embodiment, the data synchronization instruction (sync) includes: transmitting a page name (page), a display component name (component), and synchronization data (data) of the terminal;
the synchronization data includes: the data (state) of the component is displayed.
It should be explained that the screen display system referred to in this embodiment is essentially a web page system, and each terminal corresponds to a page, and the page is correspondingly displayed in a physical small screen. The page of each terminal is composed of various display components, the display components have different states, and the corresponding display effect of each state (state) can be different, so that the data (state) of the display components can be designed according to the service requirement, and only the data (state) of the display components need to be synchronized during synchronization, thereby reducing the transmitted data amount and improving the processing efficiency.
In this embodiment, the data (state) of the display component is a UI data model of the display component, and is a data basis for rendering the display component.
104. And the receiving terminal receives a data synchronization instruction issued by the server and displays the synchronization data according to the data synchronization instruction.
Specifically, referring to fig. 3, this step 104 includes:
301. and the receiving terminal searches the corresponding display component according to the display component name.
302. And the receiving terminal sets the display state of the display assembly according to the data of the display assembly so as to display the effect of the display assembly.
The above is a method of data synchronization on the terminal side in the present embodiment, and a method of data synchronization on the server side in the present embodiment is described in detail below.
The embodiment discloses a data synchronization method for a server, referring to fig. 4, including steps 401 to 403:
401. and sending a first setting instruction to at least two terminals belonging to one screen display system, so as to set one of the at least two terminals as a sending terminal and the rest of the at least two terminals as receiving terminals.
Specifically, referring to fig. 5, the step 401 specifically includes steps 501 to 502:
501. and the server receives the connection instruction and updates the connection information of the terminal.
Wherein the join instruction (join) comprises: room number (room) of the terminal, page information of the terminal;
the page information of the terminal comprises: the page name (page) of the terminal, the page identifier (page id) of the terminal, and the network address (search) of the page of the terminal.
Specifically, this step 501 specifically includes:
5011. and the server judges whether the room number of the terminal in the connection instruction is prestored, and if not, the room number is created.
5012. And the server judges whether the page of the terminal is connected for the first time according to the page identification of the terminal, if so, the page information of the terminal is newly added, and if not, the prestored page information of the terminal is updated.
502. The server selects one of the at least two terminals with the same room number and the same page name as a sending terminal, selects the rest of the at least two terminals with the same room number and the same page name as receiving terminals, and sends a first setting instruction to the at least two terminals with the same room number and the same page name.
Wherein the first setting instruction includes: and setting the page identifier as the page identifier of the sending terminal.
As can be seen from step 502, terminals with the same room number and the same page name can communicate with each other, and terminals that are not in the same room number and have different page names will not affect each other.
Optionally, in actual use, a situation that the connection between the sending terminal and the server is abnormal may occur. In this case, the server needs to reselect one terminal as a transmitting terminal among the receiving terminals. The server may select the sending terminal in various ways, for example, randomly.
If the server detects that the connection with the sending terminal is abnormal, this step 401 further includes:
503. the server reselects one of the at least two receiving terminals with the same room number and the same page name as a sending terminal, and sends a second setting instruction to the at least two receiving terminals with the same room number and the same page name; wherein the second setting instruction includes: is reset to the page identification of the transmitting terminal.
This step 401 is executed, and the server completes the setting of the transmitting terminal and the receiving terminal.
402. And receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal.
The foregoing embodiments have been described in detail with respect to the composition of the data synchronization instruction, and are not described herein again.
403. And sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
It should be noted that, in this step 403, the server does not process the data synchronization instruction, but directly forwards the data synchronization instruction to the receiving terminal, so as to improve the processing efficiency of the server.
In this step, the server may determine the receiving terminal that needs to forward the data synchronization instruction based on the room number (room) of the terminal and the page identifier (pageid) of the terminal in the connection instruction.
According to the data synchronization method, one terminal in the screen display system is set to be the sending terminal through the server, the other terminals are the receiving terminals, then the sending terminal sends the synchronization data to the receiving terminals, and the data synchronization is achieved, so that the problem that the playing progress of each terminal is inconsistent is solved, and the user experience is improved.
By the method of the embodiment, when a plurality of terminals need to perform data synchronization, only one terminal is a sending terminal, and the other terminals are receiving terminals, which is because the data display is a continuous schedule, and if the plurality of terminals perform synchronization, the data display is easily disordered. Therefore, only one sending terminal can send data, and other terminals are responsible for receiving and displaying, so that the display effect of all the terminals is consistent.
For a more detailed description of the solution of the embodiments of the present application, refer to fig. 6. It should be noted that only one terminal is shown in fig. 6, there are at least two terminals in this application, and the method steps performed by each terminal are the same as the method steps performed by the terminal shown in fig. 6. Before data synchronization, a method for establishing connection between a terminal and a server according to an embodiment of the present application includes:
601. and the terminal establishes communication connection with the server.
Specifically, a websocket protocol connection is established between the terminal and the server in this embodiment.
602. And the terminal sends a connection instruction to the server.
The foregoing description of the connection command has been detailed, and is not repeated herein.
603. The server checks whether the room number of the terminal exists, if not, step 604 is executed, and if so, step 605 is executed.
In this step, the server needs to analyze the connection instruction and obtain the room number of each terminal in the connection instruction.
604. The server creates the room number.
605. The server determines whether the page of the terminal is connected for the first time, if so, step 606 is executed, and if not, step 607 is executed.
606. The server adds the page information of the terminal and then executes step 607.
607. The server updates the connection information of the terminal.
608. The server sends a first setting instruction to the terminal.
For the first setting command, the foregoing has been detailed, and the detailed description is omitted here.
609. The terminal checks whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the sending terminal, if so, step 610 is executed, and if not, step 611 is executed.
610. Setting itself as the sending terminal.
611. Setting itself as the receiving terminal.
Fig. 7 shows a flowchart of data synchronization between a terminal and a server according to the present application. The method for data synchronization in one embodiment of the application includes:
701. and the sending terminal initializes the page.
702. And the sending terminal generates a data synchronization instruction from the synchronization data.
The foregoing description has been introduced with respect to the data synchronization command, and will not be repeated herein.
703. And the sending terminal sends a data synchronization instruction to the server.
704. The server finds the corresponding receiving terminal.
Specifically, the server may perform the search of the receiving terminal according to the room number of the terminal and the page identifier (pageid) of the terminal.
705. The server sends a data synchronization instruction to the receiving terminal.
706. And the receiving terminal sets the display state of the display component according to the data of the display component in the data synchronization instruction.
The above is a detailed description of the data synchronization method according to the embodiment of the present application, and the following is a detailed description of the data synchronization apparatus according to the present application.
The embodiment further provides a data synchronization apparatus, which is disposed in a terminal, where at least two terminals belong to a screen display system, and referring to fig. 8, the apparatus includes:
a connection module 801, configured to establish a connection between each terminal and a server;
a setting instruction receiving module 802, configured to receive, by each terminal, a setting instruction of a server, so as to set itself as a sending terminal or a receiving terminal, where the server sets one of the at least two terminals as the sending terminal, and the rest of the at least two terminals are the receiving terminals;
a data synchronization instruction sending module 803, configured to send a data synchronization instruction generated by the synchronization data to the server in a case where the terminal is set as a sending terminal;
a synchronous data display module 804, configured to receive a data synchronization instruction issued by a server when the terminal is set as a receiving terminal, and display the synchronous data according to the data synchronization instruction.
Optionally, the setting instruction receiving module 802 includes:
a connection instruction sending module, configured to send a connection instruction (join) to a server, where the connection instruction includes: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the steps of obtaining a page name of a terminal, a page identifier (pageid) of the terminal and a network address of a page of the terminal;
a first setting instruction receiving module, configured to receive a first setting instruction sent by the server, where the first setting instruction includes: a page identifier set as a transmitting terminal;
and the self attribute setting module is used for checking whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the self, if so, the self attribute setting module sets the self as the sending terminal, and if not, the self attribute setting module sets the self as the receiving terminal.
Optionally, the setting instruction receiving module 802 includes:
a second setting instruction receiving module, configured to, if the connection between the sending terminal and the server is abnormal, re-receive, by at least two receiving terminals, a second setting instruction sent by the server; wherein the second setting instruction includes: the page identification of the sending terminal is reset in at least two receiving terminals;
and the sending terminal resetting module is used for checking whether the page identifier of the sending terminal in the second setting instruction is the same as the page identifier of the receiving terminal by each of the at least two receiving terminals, and if so, resetting the receiving terminal to be the sending terminal.
Optionally, the data synchronization instruction includes: sending a page name, a display component name and synchronous data of the terminal; the synchronization data includes: displaying data of the component;
the synchronized data display module 804 includes:
the display component searching module is used for searching the corresponding display component according to the display component name;
and the effect display module is used for setting the display state of the display assembly according to the data of the display assembly so as to display the effect of the display assembly.
The data synchronization device provided by the application sets one terminal in a screen display system as a sending terminal and other terminals as receiving terminals through the server, then enables the sending terminal to send synchronous data to the receiving terminals, so that the data synchronization is realized, the problem that the playing progress of each terminal is inconsistent is solved, and the user experience is improved.
The above is a schematic scheme of an apparatus for data synchronization of the present embodiment. It should be noted that the technical solution of the data synchronization apparatus and the technical solution of the data synchronization method belong to the same concept, and details that are not described in detail in the technical solution of the data synchronization apparatus can be referred to the description of the technical solution of the data synchronization method.
The embodiment further provides a data synchronization apparatus, which is disposed in the server, with reference to fig. 9, and includes:
a setting instruction sending module 901, configured to send a setting instruction to at least two terminals belonging to one screen display system, where one of the at least two terminals is set as a sending terminal, and the rest of the at least two terminals are set as receiving terminals;
a data synchronization instruction receiving module 902, configured to receive a data synchronization instruction that includes synchronization data and is sent by the sending terminal;
a data synchronization instruction forwarding module 903, configured to send the data synchronization instruction to the receiving terminal, so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
Optionally, the setting instruction sending module 901 includes: the device comprises a connection information updating module and a first setting instruction sending module. Wherein the content of the first and second substances,
and the connection information updating module is used for receiving a connection instruction of the terminal and updating the connection information of the terminal.
Wherein the join instruction (join) comprises: the room number of the terminal and the page information of the terminal;
the page information of the terminal comprises: the page name of the terminal, the page identification of the terminal and the network address of the page of the terminal.
Specifically, the step of receiving the connection instruction by the connection information updating module and updating the connection information of the terminal includes:
the connection information updating module judges whether the room number of the terminal in the connection instruction is prestored, and if not, the room number is created;
and the connection information updating module judges whether the page of the terminal is connected for the first time according to the page identification of the terminal, if so, the page information of the terminal is newly added, and if not, the prestored page information of the terminal is updated.
A first setting instruction sending module, configured to select one of the at least two terminals with the same room number and the same page name as a sending terminal, select the rest of the at least two terminals with the same room number and the same page name as receiving terminals, and send a first setting instruction to the at least two terminals with the same room number and the same page name; wherein the first setting instruction includes: and setting the page identifier as the page identifier of the sending terminal.
If the server detects that the connection with the sending terminal is abnormal, the setting instruction sending module 901 further includes:
a second setting instruction sending module, configured to reselect one of the at least two receiving terminals with the same room number and the same page name as a sending terminal, and send a second setting instruction to the at least two receiving terminals with the same room number and the same page name; wherein the second setting instruction includes: is reset to the page identification of the transmitting terminal.
The data synchronization device provided by the application sets one terminal in a screen display system as a sending terminal and other terminals as receiving terminals through the server, then enables the sending terminal to send synchronous data to the receiving terminals, so that the data synchronization is realized, the problem that the playing progress of each terminal is inconsistent is solved, and the user experience is improved.
The above is a schematic scheme of an apparatus for data synchronization of the present embodiment. It should be noted that the technical solution of the data synchronization apparatus and the technical solution of the data synchronization method belong to the same concept, and details that are not described in detail in the technical solution of the data synchronization apparatus can be referred to the description of the technical solution of the data synchronization method.
Fig. 10 is a block diagram illustrating a structure of a terminal 1000 according to an embodiment of the present application. Components of terminal 1000 can include, but are not limited to, memory 1010 and processor 1020. The processor 1020 is coupled to the memory 1010.
Although not shown in FIG. 10, it is to be appreciated that terminal 1000 can also include a network interface that enables terminal 1000 to communicate via one or more networks. Examples of such networks include a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The network interface may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE1002.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In an embodiment of the present application, the other components of terminal 1000 described above and not shown in fig. 10 can also be connected to each other, e.g. via a bus. It should be understood that the block diagram of the terminal shown in fig. 10 is for exemplary purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as desired.
Terminal 1000 can be any type of stationary or mobile terminal including a mobile computer or mobile terminal (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable terminal (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary terminal such as a desktop computer or PC.
The terminal disclosed by the application comprises a memory, a processor and computer instructions which are stored on the memory and can be run on the processor, wherein at least two terminals belong to a screen display system, and the processor executes the instructions to realize the following steps:
establishing connection with a server;
receiving a first setting instruction of a server to set the server as a sending terminal or a receiving terminal, wherein the server sets one of the at least two terminals as the sending terminal, and the rest of the at least two terminals are the receiving terminals;
under the condition that the terminal is set as a sending terminal, a synchronous data generation data synchronization instruction is sent to a server;
and under the condition that the terminal is set as a receiving terminal, receiving a data synchronization instruction issued by a server, and displaying the synchronization data according to the data synchronization instruction.
The application also discloses a server, comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:
sending a first setting instruction to at least two terminals belonging to a screen display system, and setting one of the at least two terminals as a sending terminal and the rest of the at least two terminals as receiving terminals;
receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
An embodiment of the present application also provides a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method for data synchronization of a terminal or the steps of the method for data synchronization of a server as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned data synchronization method belong to the same concept, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the above-mentioned data synchronization method.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (12)

1. A method for data synchronization, wherein the method is used for an on-screen display system, the on-screen display system comprises at least two terminals, and the method comprises:
the at least two terminals are connected with the server;
the at least two terminals respectively send connection instructions to the server, wherein the connection instructions comprise: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
the at least two terminals receive a first setting instruction sent by the server, wherein the first setting instruction comprises: a page identifier set as a transmitting terminal;
each terminal of the at least two terminals checks whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the terminal, if so, the terminal sets the terminal as the sending terminal, and if not, the terminal sets the terminal as the receiving terminal;
the sending terminal generates a data synchronization instruction by the synchronization data and sends the data synchronization instruction to the server;
and the receiving terminal receives a data synchronization instruction issued by the server and displays the synchronization data according to the data synchronization instruction.
2. The method of data synchronization of claim 1, wherein the method further comprises:
if the connection between the sending terminal and the server is abnormal, at least two receiving terminals receive a second setting instruction sent by the server again; wherein the second setting instruction includes: the page identification of the sending terminal is reset in at least two receiving terminals;
and each of the at least two receiving terminals checks whether the page identifier of the sending terminal in the second setting instruction is the same as the page identifier of the receiving terminal, and if so, the receiving terminal resets the receiving terminal to the sending terminal.
3. The method of data synchronization of claim 1,
the data synchronization instructions include: sending a page name, a display component name and synchronous data of the terminal;
the synchronization data includes: displaying data of the component;
the receiving terminal receives a data synchronization instruction issued by a server, displays the synchronization data according to the data synchronization instruction, and comprises:
the receiving terminal finds the corresponding display component according to the display component name;
and the receiving terminal sets the display state of the display assembly according to the data of the display assembly so as to display the effect of the display assembly.
4. A method for data synchronization, for a server, comprising:
the method comprises the steps that a server receives a connection instruction sent by a terminal and updates connection information of the terminal; wherein the connection instruction comprises: the method comprises the following steps of setting a room number of a terminal and page information of the terminal, wherein the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
the server selects one of the at least two terminals with the same room number and the same page name as a sending terminal, selects the rest of the at least two terminals with the same room number and the same page name as receiving terminals, and sends a first setting instruction to the at least two terminals with the same room number and the same page name; wherein the first setting instruction includes: setting the page identifier as a sending terminal;
receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
5. The method of data synchronization of claim 4, further comprising:
if the server detects that the connection with the sending terminal is abnormal, the server reselects one of the at least two receiving terminals with the same room number and the same page name as the sending terminal, and sends a second setting instruction to the at least two receiving terminals with the same room number and the same page name; wherein the second setting instruction includes: is reset to the page identification of the transmitting terminal.
6. The method for data synchronization according to claim 4, wherein the server receives the connection instruction and updates the connection information of the terminal, including:
the server judges whether the room number of the terminal in the connection instruction is prestored, and if not, the room number is created;
and the server judges whether the page of the terminal is connected for the first time according to the page identification of the terminal, if so, the page information of the terminal is newly added, and if not, the prestored page information of the terminal is updated.
7. A data synchronization device is characterized in that the device is arranged on terminals, at least two terminals belong to a screen display system, and the device comprises:
the connection module is used for establishing connection between each terminal and the server;
a connection instruction sending module, configured to send a connection instruction (join) to a server, where the connection instruction includes: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the steps of obtaining a page name of a terminal, a page identifier (pageid) of the terminal and a network address of a page of the terminal;
a first setting instruction receiving module, configured to receive a first setting instruction sent by the server, where the first setting instruction includes: a page identifier set as a transmitting terminal;
the self-attribute setting module is used for checking whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the sending terminal, if so, the self-attribute setting module sets the sending terminal as the sending terminal, and if not, the self-attribute setting module sets the receiving terminal as the receiving terminal;
the data synchronization instruction sending module is used for generating a data synchronization instruction by the synchronization data and sending the data synchronization instruction to the server under the condition that the terminal is set as a sending terminal;
and the synchronous data display module is used for receiving a data synchronization instruction issued by a server under the condition that the terminal is set as a receiving terminal, and displaying the synchronous data according to the data synchronization instruction.
8. An apparatus for data synchronization, which is provided in a server, includes:
a connection information updating module, configured to receive a connection instruction of a terminal, and update connection information of the terminal, where the connection instruction (join) includes: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
a first setting instruction sending module, configured to select one of the at least two terminals with the same room number and the same page name as a sending terminal, select the rest of the at least two terminals with the same room number and the same page name as receiving terminals, and send a first setting instruction to the at least two terminals with the same room number and the same page name; wherein the first setting instruction includes: setting the page identifier as a sending terminal;
the data synchronization instruction receiving module is used for receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and the data synchronization instruction forwarding module is used for sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
9. A terminal comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, wherein at least two terminals belong to a single on-screen display system, and wherein the processor executes the instructions to perform the steps of:
establishing connection with a server;
the at least two terminals respectively send connection instructions to the server, wherein the connection instructions comprise: the room number of the terminal and the page information of the terminal; the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
the at least two terminals receive a first setting instruction sent by the server, wherein the first setting instruction comprises: a page identifier set as a transmitting terminal;
each terminal of the at least two terminals checks whether the page identifier of the sending terminal in the first setting instruction is the same as the page identifier of the terminal, if so, the terminal sets the terminal as the sending terminal, and if not, the terminal sets the terminal as the receiving terminal;
under the condition that the terminal is set as a sending terminal, a synchronous data generation data synchronization instruction is sent to a server;
and under the condition that the terminal is set as a receiving terminal, receiving a data synchronization instruction issued by a server, and displaying the synchronization data according to the data synchronization instruction.
10. A server comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor when executing the instructions performs the steps of:
the method comprises the steps that a server receives a connection instruction sent by a terminal and updates connection information of the terminal; wherein the connection instruction comprises: the method comprises the following steps of setting a room number of a terminal and page information of the terminal, wherein the page information of the terminal comprises: the method comprises the following steps of (1) the page name of a terminal, the page identification of the terminal and the network address of the page of the terminal;
the server selects one of the at least two terminals with the same room number and the same page name as a sending terminal, selects the rest of the at least two terminals with the same room number and the same page name as receiving terminals, and sends a first setting instruction to the at least two terminals with the same room number and the same page name; wherein the first setting instruction includes: setting the page identifier as a sending terminal;
receiving a data synchronization instruction which contains synchronization data and is sent by the sending terminal;
and sending the data synchronization instruction to the receiving terminal so that the receiving terminal displays the synchronization data according to the data synchronization instruction.
11. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 3.
12. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 4 to 6.
CN201810460899.3A 2018-05-15 2018-05-15 Data synchronization method, device, terminal, server and storage medium Active CN108683936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810460899.3A CN108683936B (en) 2018-05-15 2018-05-15 Data synchronization method, device, terminal, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810460899.3A CN108683936B (en) 2018-05-15 2018-05-15 Data synchronization method, device, terminal, server and storage medium

Publications (2)

Publication Number Publication Date
CN108683936A CN108683936A (en) 2018-10-19
CN108683936B true CN108683936B (en) 2020-12-11

Family

ID=63806359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810460899.3A Active CN108683936B (en) 2018-05-15 2018-05-15 Data synchronization method, device, terminal, server and storage medium

Country Status (1)

Country Link
CN (1) CN108683936B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901938B (en) * 2019-02-26 2021-11-19 北京华夏电通科技股份有限公司 Interactive large-screen system based on WebSocket communication and visual display method
CN112559638B (en) * 2021-02-20 2021-05-07 恒生电子股份有限公司 Data synchronization method, device, equipment and storage medium
CN113448527B (en) * 2021-06-28 2023-05-26 华科融资租赁有限公司 Data synchronization method, device, computer equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2045810A1 (en) * 2007-10-01 2009-04-08 TTPCOM Limited Synchronisation of media operations on multiple devices

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8887189B2 (en) * 2007-09-28 2014-11-11 Verizon Patent And Licensing Inc. Methods and systems for providing synchronized display of content
CN103065658B (en) * 2012-12-18 2015-07-08 华为技术有限公司 Control method and device of multi-terminal synchronized playing
CN104954149B (en) * 2014-03-26 2018-10-30 华为技术有限公司 The method, apparatus and system of data sharing are carried out in Web conference
KR102364085B1 (en) * 2015-08-11 2022-02-17 엘지전자 주식회사 Mobile terminal and control method for the mobile terminal
CN105357750A (en) * 2015-10-20 2016-02-24 北京小鸟听听科技有限公司 Method and selection device for selecting master synchronization equipment, control equipment and electronic equipment
US20170135057A1 (en) * 2015-11-05 2017-05-11 Smarter Apps, Inc. Cheering system
CN105578248B (en) * 2015-12-30 2020-07-31 Tcl新技术(惠州)有限公司 Fancy splicing playing method, device and system
CN105468327A (en) * 2016-01-12 2016-04-06 福建星网锐捷安防科技有限公司 Large screen splicing display method, device and system
CN107783702A (en) * 2016-08-31 2018-03-09 阿里巴巴集团控股有限公司 Control method, the device and system of display data
CN107783744B (en) * 2016-08-31 2022-06-14 阿里巴巴集团控股有限公司 Data display and control method, device, system and display equipment of spliced screen

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2045810A1 (en) * 2007-10-01 2009-04-08 TTPCOM Limited Synchronisation of media operations on multiple devices

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"大屏幕拼接可视化技术的研究进展";张繁等;《计算机辅助设计与图形学学报》;20160131;第29卷(第1期);全文 *

Also Published As

Publication number Publication date
CN108683936A (en) 2018-10-19

Similar Documents

Publication Publication Date Title
CN108683936B (en) Data synchronization method, device, terminal, server and storage medium
US11695979B2 (en) Method and device of displaying multi-screen interactive
CN109343929B (en) Multi-screen interaction method and system based on virtualized shared video memory
CN102355500B (en) Service push method and device
US11910072B2 (en) Multi-screen interactive display method and apparatus
US10585914B1 (en) Methods and apparatus for a distributed shared memory for device synchronization
US20150117513A1 (en) Bandwidth reduction system and method
CN104394191A (en) Method, control terminal, and system for remotely controlling mobile terminal
CN103530096A (en) Remote control method, remote control equipment and display equipment
US11483681B2 (en) Special effect synchronization method, device, and storage medium
CN104199728A (en) Image transmission information displaying method and device
CN104320491A (en) Method for synchronous display between mobile device and web terminal
CN113590072A (en) Split screen display method and device
CN113810761A (en) Multi-terminal interaction method, device and system
CN103365061A (en) Cloud projection system
CN113868575A (en) Webpage same-screen method and system
CN109635266A (en) Three-dimensional visualization edit methods, device and three-dimension visible sysem
CN110018875B (en) Desktop synchronization implementation method based on IDV
JP2023518779A (en) Network connection method and apparatus for training participants of common training model
CN110442334B (en) Multi-user collaborative graph configuration method, electronic equipment and server
CN111078530A (en) Application program debugging method and system, electronic equipment and computer readable storage medium
CN103365062A (en) Cloud projection method
CN109963030A (en) A kind of screen shares processing method and equipment
CN110620761B (en) Method and device for realizing multi-person virtual interaction
CN110035248B (en) Conference call-ordering method and 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
GR01 Patent grant
GR01 Patent grant