Disclosure of Invention
The embodiment of the invention provides a cross-platform multi-screen interaction method, device and system, which can improve the robustness, speed and quality of a cross-platform multi-screen interaction process.
The cross-platform multi-screen interaction method provided by the embodiment of the invention specifically comprises the following steps:
receiving a main control authority setting request sent by a request client; the master control authority setting request can be initiated to a server side by any client side, and comprises a master control client side identification code and at least one controlled client side identification code;
according to the master control authority setting request, setting the client corresponding to the master control client identification code as a master control client, and setting the client corresponding to each controlled client identification code as a controlled client;
acquiring a display interface of the master control client, and sending the display interface to each controlled client for display;
and receiving the control operation sent by the master control client, and sending the control operation to each controlled client so that each controlled client performs corresponding operation processing according to the control operation.
Further, according to the master control permission setting request, setting the client corresponding to the master control client identification code as a master control client, and setting the client corresponding to each controlled client identification code as a controlled client, specifically including:
inquiring a preset client register table according to the master control authority setting request; the client registry comprises a client identification code and a master control authority state of at least one client;
setting a master control authority state corresponding to the master control client identification code in the client registration table to be started;
and setting the master control authority state corresponding to the controlled client identification code in the client registry to be closed.
Further, before the receiving the master control permission setting request sent by the requesting client, the method further includes:
receiving a connection request sent by the request client; the connection request comprises a request client identification code of the request client;
inquiring a preset client register table according to the connection request; the client registry comprises at least one client identification code of a client;
if the client registration table contains the identification code of the request client, sending a connection success notice to the request client;
and if the client registry does not contain the request client identification code, adding the request client identification code to the client registry, and sending a connection success notice to the request client.
Further, the master control client identification code is the request client identification code; the requesting client identification code is dynamically randomly generated by the requesting client.
Further, the receiving a master control permission setting request sent by a request client specifically includes:
and acquiring the master control permission setting request sent by the request client by adopting a WebSocket protocol from a port 8881.
Correspondingly, an embodiment of the present invention further provides a cross-platform multi-screen interaction device, which specifically includes:
the master control authority setting request receiving module is used for receiving a master control authority setting request sent by a request client; the master control authority setting request can be initiated to a server side by any client side, and comprises a master control client side identification code and at least one controlled client side identification code;
the client permission setting module is used for setting the client corresponding to the main control client identification code as a main control client and setting the client corresponding to each controlled client identification code as a controlled client according to the main control permission setting request;
the interface synchronous display module is used for acquiring a display interface of the master control client and sending the display interface to each controlled client for display; and the number of the first and second groups,
and the operation synchronous interaction module is used for receiving the control operation sent by the master control client and sending the control operation to each controlled client so that each controlled client performs corresponding operation processing according to the control operation.
Further, the client permission setting module specifically includes:
the client registry inquiring unit is used for inquiring a preset client registry according to the master control authority setting request; the client registry comprises a client identification code and a master control authority state of at least one client;
the master control client setting unit is used for setting the master control authority state corresponding to the master control client identification code in the client registration table to be started; and the number of the first and second groups,
and the controlled client setting unit is used for setting the master control authority state corresponding to the controlled client identification code in the client registration table to be closed.
Further, the cross-platform multi-screen interaction device further comprises:
a connection request receiving module, configured to receive a connection request sent by the request client; the connection request comprises a request client identification code of the request client;
the client registry query module is used for querying a preset client registry according to the connection request; the client registry comprises at least one client identification code of a client;
a first connection success notification sending module, configured to send a connection success notification to the requesting client when the client registry includes the identifier of the requesting client; and the number of the first and second groups,
and the second connection success notification sending module is used for adding the identification code of the request client into the client registry and sending a connection success notification to the request client when the client registry does not contain the identification code of the request client.
Further, the master control client identification code is the request client identification code; the requesting client identification code is dynamically randomly generated by the requesting client.
Correspondingly, the embodiment of the invention also provides a cross-platform multi-screen interaction system, which specifically comprises a server and at least one client;
the server is the cross-platform multi-screen interaction device;
and each client is connected with the server in real time through a WebSocket protocol.
The embodiment of the invention has the following beneficial effects:
according to the cross-platform multi-screen interaction method, device and system provided by the embodiment of the invention, the intermediate devices are added in the main control client and the controlled client for regulation and transition, so that data can be temporarily stored in the intermediate medium, the data loss caused by sudden power failure and accidents is avoided, a large amount of data recovery time is saved, and the robustness, speed and quality of the cross-platform multi-screen interaction process can be improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a schematic structural diagram of a preferred embodiment of a cross-platform multi-screen interaction system provided by the present invention includes a server 11 and at least one client 12;
the server 11 is a cross-platform multi-screen interaction device according to any one of the following embodiments;
each client 12 is connected with the server 11 in real time through a WebSocket protocol.
As shown in fig. 2, a flowchart of a cross-platform multi-screen interaction method according to a preferred embodiment of the present invention includes steps S21 to S24, which are as follows:
s21: receiving a main control authority setting request sent by a request client; the master control authority setting request comprises a master control client identification code and at least one controlled client identification code.
It should be noted that, the embodiment is executed by the server in the cross-platform multi-screen interaction system.
In this embodiment, any one of the clients in the cross-platform multi-screen interaction system may initiate a master permission setting request to the server, so as to set itself or another client as the master client. The master control authority setting request sent to the server by the client serving as the request client comprises the client identification code of the client to be set as the master control client and the client identification codes of other clients which are not used as the master control client.
In another preferred embodiment, the step S21 may further include a sub-step S2101, which is as follows:
s2101: and acquiring the master control permission setting request sent by the request client by adopting a WebSocket protocol from a port 8881.
In this embodiment, the server includes a port 8881 for communicating with the HTML web service in the client. More preferably, the server and the client communicate with each other by using a WebSocket protocol.
Specifically, the requesting client may send a master control authority setting request to the server by clicking a specific function button or making a specific gesture action, so that the server sets the master control authority of each client.
S22: and setting the client corresponding to the main control client identification code as a main control client and setting the client corresponding to each controlled client identification code as a controlled client according to the main control authority setting request.
In this embodiment, after receiving the master control authority setting request, the server parses the master control authority setting request to obtain the master control client identifier and each controlled client identifier therein, sets the client corresponding to the master control client identifier as the master control client, and sets the client corresponding to each controlled client identifier as the controlled client.
Specifically, the step S22 may further include sub-steps S2201 to S2203, which are as follows:
s2201: inquiring a preset client register table according to the master control authority setting request; the client registry comprises at least one client identification code and a master control authority state of the client.
In this embodiment, the server stores a client registration table in advance, which is used to register the relevant information of all clients connected locally. Specifically, the client registry comprises client identification codes, link addresses and master control authority states of various locally connected clients. Wherein, in some more preferred embodiments, the master authority state is represented by a parameter masterCtrl.
S2202: and setting the master control authority state corresponding to the master control client identification code in the client registration table to be started.
In this embodiment, after the server obtains the master control authority state corresponding to the master control client identifier in the master control authority setting request by querying the client registry, the server sets the master control authority state to be on, that is, sets the value of the parameter masterCtrl to true, which indicates that the client corresponding to the master control client identifier is set as the master control client.
S2203: and setting the master control authority state corresponding to the controlled client identification code in the client registry to be closed.
In this embodiment, after the server obtains the master control authority state corresponding to the controlled client identifier in the master control authority setting request by querying the client registry, the server sets the master control authority state to be closed, that is, sets the value of the parameter masterCtrl to false, which indicates that the client corresponding to the controlled client identifier is set as the controlled client.
In some embodiments, the user who defaults to learning right can automatically remove the qualification of acquiring the master control according to the general administrative specification of the project, and can only be activated to become the master control display end through the authorization of the master control.
S23: and acquiring a display interface of the master control client, and sending the display interface to each controlled client for display.
In this embodiment, after determining the master control authority of each client, the server automatically obtains the display interface of the master control client therein, and synchronously displays the display interface of the master control client to the display screens of each controlled client.
In another preferred embodiment, the server may further display the display interface of the master client to the display interfaces of the respective clients in a master client mode. Specifically, the master control client clicks a button with the same screen function, and sends a same screen command to the server to trigger the interface synchronous display operation of the server, wherein the command specification is as follows: send ("drawPointDragEnd:: right-top |5," + di + ", <% > -sessionId >); wherein, the 'drawPointDragEnd' is the function name, the 'right-top' and the '5' are the parameters of the function, and a plurality of parameters need to be separated by '|'.
In another preferred embodiment, the display interface of the master client is obtained, and the logic command after the state of the display interface is sent to each controlled client, the same series of the logic command simulates the same picture, the non-same series of the logic command obtains a positioning line by calculating the corresponding actual part of the organ through a background, and the series of the logic command is marked by a straight line, namely the synchronization technology of the far-distance desktop or the video stream is not simple. Each displayed interface can obtain the operation effect of the image according with the medical diagnosis qualification according to the background data of the medical image, such as independent acquisition of CT value and the like.
S24: and receiving the control operation sent by the master control client, and sending the control operation to each controlled client so that each controlled client performs corresponding operation processing according to the control operation.
In this embodiment, a user performs corresponding operations on a control, a text, a picture, and the like displayed in a local display screen in a master control client, and the master control client sends the related control operations of the user to a server. The server side forwards the control operation to each controlled client side, so that each controlled client side realizes corresponding operation processing according to the control operation, and the effect of synchronously displaying the relevant operation of the user in the main control client side to each controlled client side is achieved.
Specifically, before sending the control operation to each controlled client, the server firstly queries a pre-stored client registration table, obtains a link address corresponding to each controlled client identification code from the pre-stored client registration table, and sends the control operation to the client corresponding to each link address, so as to send the control operation to each controlled client.
In some more preferred embodiments, after the server completes the setting of the master control authority of each client, the server performs fixed processing and fuzzy processing on each local function module. Wherein the fixed processing refers to that a called function module is specified in a message response; the fuzzy processing specifies redefining a function module to be called by an intelligent parsing sentence, wherein the function module is executed by generating a new object by re-spelling a character string.
In other more preferred embodiments, the server may further invoke a related operation function of the server according to a specific requirement before forwarding the control operation, and forward the operation result together with the control operation to each controlled client.
In another preferred embodiment, the cross-platform multi-screen interaction method further includes steps S01 to S04, which are specifically as follows:
s01: receiving a connection request sent by the request client; the connection request comprises a request client identification code of the request client.
In this embodiment, before performing cross-platform multi-screen interaction, the requesting client needs to register in the server and connect with the server. Specifically, the requesting client dynamically generates an identification code of the requesting client, and sends a connection request to the server after generating a corresponding connection request according to the identification code. The server receives the connection request and checks whether the requesting client is registered.
It is further noted that, in some more preferred embodiments, the master client identification code is the requesting client identification code; the requesting client identification code is dynamically randomly generated by the requesting client. Namely, the master client is the requesting client. Specifically, the identification code of the requesting client is dynamically and randomly generated by the requesting client through a server dynamic session id. The requesting client identification code is dynamically randomly generated by the requesting central server at the time of the first connection.
S02: inquiring a preset client register table according to the connection request; the client registry comprises at least one client identification code of the client.
In this embodiment, the server analyzes the received connection request to obtain the identifier of the requesting client, and queries whether an identifier identical to the identifier of the requesting client is registered in the client registration table, if so, it indicates that the requesting client is registered, otherwise, it indicates that the requesting client is unregistered.
In some specific embodiments, the identification code has 2 kinds of checking total codes and series total codes, each of which is an identification code with more than 128 digits (digits + dot separation) combination which is basically and globally unique.
S03: and if the client registration table contains the identification code of the request client, sending a connection success notice to the request client.
In this embodiment, when the server checks that the request client is registered, the server directly sends a connection success notification to the request client, so that the request client initiates a subsequent cross-platform multi-screen interaction request to the server. Whether the request client side is consistent with the sending main control side or not is determined by totally checking the subordinate relation between the codes and the serial codes.
S04: and if the client registry does not contain the request client identification code, adding the request client identification code to the client registry, and sending a connection success notice to the request client.
In this embodiment, when the server checks that the requesting client is not registered, the server adds the received identifier of the requesting client and the link address of the requesting client to the client registry to complete registration of the requesting client. And finally, sending a connection success notice to the request client so that the request client initiates a subsequent cross-platform multi-screen interaction request to the server.
According to the cross-platform multi-screen interaction method provided by the embodiment of the invention, the intermediate devices are added in the main control client and the controlled client for regulation and transition, so that data can be temporarily stored in the intermediate medium, the data loss caused by sudden power failure and accidents is avoided, a large amount of data recovery time is saved, and the robustness, the speed and the quality of the cross-platform multi-screen interaction process can be improved. Meanwhile, the problem that a large amount of unnecessary image data interaction is reduced between the master control and the controlled system is solved, the flow is saved, the quantum-level teaching interaction effect is achieved under the condition that high bandwidth is not needed, and the functions of intelligence and superiority are achieved on the premise that the minimum network resources are consumed. In addition, the method has no relation with the size of the operated screen, a background driving software platform, client software and the like, and can be realized only by configuring an internal central service module in an intranet or connecting core service through the Internet and through a common HTML5 compatible browser without additional special processing.
Correspondingly, the invention also provides a cross-platform multi-screen interaction device, which can realize all the processes of the cross-platform multi-screen interaction method in the embodiment.
As shown in fig. 3, a schematic structural diagram of a preferred embodiment of a cross-platform multi-screen interaction device provided in the present invention is as follows:
a master control authority setting request receiving module 31, configured to receive a master control authority setting request sent by a request client; the master control authority setting request comprises a master control client identification code and at least one controlled client identification code;
the client permission setting module 32 is configured to set, according to the master control permission setting request, a client corresponding to the master control client identification code as a master control client, and set a client corresponding to each controlled client identification code as a controlled client;
the interface synchronous display module 33 is configured to obtain a display interface of the master control client, and send the display interface to each controlled client for display; specifically, the display interface is sent to each controlled client to start the same kind of functions to perform interface synchronous display;
the interface asynchronous display module is used for acquiring a display command of the master control client, comparing the command of the display interface at a central server side and calculating a corresponding command and a parameter when the command of the display interface does not belong to a uniform series, and sending the command and the parameter to each controlled client to start a heterogeneous function to display the interface; and the number of the first and second groups,
and the operation synchronization interaction module 34 is configured to receive the control operation sent by the master control client, and send the control operation to each controlled client, so that each controlled client performs corresponding operation logic processing suitable for a local screen according to the control operation.
In another preferred embodiment, the client permission setting module specifically includes:
the client registry inquiring unit is used for inquiring a preset client registry according to the master control authority setting request; the client registry comprises a client identification code and a master control authority state of at least one client;
the master control client setting unit is used for setting the master control authority state corresponding to the master control client identification code in the client registration table to be started; and the number of the first and second groups,
and the controlled client setting unit is used for setting the master control authority state corresponding to the controlled client identification code in the client registration table to be closed.
In another preferred embodiment, the cross-platform multi-screen interaction device further includes:
a connection request receiving module, configured to receive a connection request sent by the request client; the connection request comprises a request client identification code of the request client;
the client registry query module is used for querying a preset client registry according to the connection request; the client registry comprises at least one client identification code of a client;
a first connection success notification sending module, configured to send a connection success notification to the requesting client when the client registry includes the identifier of the requesting client; and the number of the first and second groups,
and the second connection success notification sending module is used for adding the identification code of the request client into the client registry and sending a connection success notification to the request client when the client registry does not contain the identification code of the request client.
Further, the master control client identification code is the request client identification code; the requesting client identification code is dynamically randomly generated by the requesting client.
Specifically, the master control client identification code is the request client identification code; and the identification code of the request client is dynamically and randomly generated by the request central server during the first connection and is kept valid until the next page refreshing.
In another preferred embodiment, the master control permission setting request receiving module specifically includes:
a request receiving unit, configured to obtain, from a port 8881, the master control permission setting request sent by the requesting client using a WebSocket protocol.
According to the cross-platform multi-screen interaction device provided by the embodiment of the invention, the intermediate devices are added in the main control client and the controlled client for regulation and transition, so that data can be temporarily stored in the intermediate medium, the data loss caused by sudden power failure and accidents is avoided, a large amount of data recovery time is saved, and the robustness, the speed and the quality of the cross-platform multi-screen interaction process can be improved.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.