Information synchronization methods, devices, electronic equipment and storage media
By using three-dimensional simulation technology to communicate with client servers in situational simulation training, multiple terminals can realize real-time synchronization of different perspective simulations of a three-dimensional scene in a synchronized three-dimensional scene, solving the problems of operability and limited field of view in the existing technology, and improving training efficiency and experience.
Patent Information
- Application Number
- CN202210474217.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-04-29
AI Technical Summary
In the existing situational simulation training, the simulation scenario is not operable and the field of vision is limited, resulting in poor training efficiency and experience of the trainees.
By obtaining the user's login information, it is determined that the user is in the main control or controlled client, and the three-dimensional simulation technology is used to render the three-dimensional scene in real time. The simulation scene change information of the main control client is sent to the server and broadcast to the controlled client, so as to realize the real-time synchronization of the same three-dimensional scene by multiple terminals.
It effectively expands the vision of the situational simulation scenario, improves the training efficiency and experience of the trainees during the situational simulation training, and ensures the fluency of the interface display of each client.
Smart Images

Figure CN114928619B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and in particular to an information synchronization method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of computer technology and communication technology, situational simulation training and teaching through computers have been widely popularized in the fields of aerospace, shipbuilding, military operations, etc. For example, military combat simulation through computers can not only create a simulated battlefield environment for combat simulation training, narrow the distance between training and actual combat, and bring trainees an immersive experience, so that trainees can practice command and tactics in complex situations close to actual combat, greatly improving the quality of training, but also can minimize equipment loss, save a lot of funds, reduce training costs, and improve training benefits.
[0003] However, in the existing situational simulation training process, the operability of the simulation scene rendered by the simulation method is not high, and the field of view is too limited, resulting in low efficiency of trainees in simulation scene training, which affects the trainees' training experience.
[0004] Therefore, how to improve the training efficiency and training experience of trainees during situational simulation training has become an urgent problem to be solved in the industry. Summary of the invention
[0005] The present invention provides an information synchronization method, device, electronic device and storage medium, which are used to improve the training efficiency and training experience of trainees during situation simulation training.
[0006] The present invention provides an information synchronization method, comprising:
[0007] Get the user's login information;
[0008] When it is determined based on the login information that the user is in the master client, displaying a first three-dimensional scene;
[0009] Acquiring simulation scene change information of the first three-dimensional scene;
[0010] Sending the simulation scene change information to a server, so that the server broadcasts the simulation scene change information to a controlled client, and the controlled client updates a second three-dimensional scene according to the simulation scene change information;
[0011] The controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
[0012] According to an information synchronization method provided by the present invention, after obtaining the user's login information, the method further includes:
[0013] When it is determined based on the login information that the user is in a controlled client, displaying a second three-dimensional scene;
[0014] Sending the registration information of the controlled client to the server to establish a communication connection with the server;
[0015] Acquire the simulation scene change information of the master control client sent by the server;
[0016] The second three-dimensional scene is updated based on the simulation scene change information.
[0017] The present invention also provides an information synchronization method, comprising:
[0018] Receiving simulation scene change information of a first three-dimensional scene sent by a master control client; the master control client displays the first three-dimensional scene;
[0019] Broadcasting the simulation scene change information to each controlled client, so that each controlled client updates the second three-dimensional scene displayed by each client according to the simulation scene change information;
[0020] The first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
[0021] According to an information synchronization method provided by the present invention, before receiving the simulation scene change information sent by the master control client, the method further includes:
[0022] Receive registration information from multiple clients;
[0023] Based on the registration information of the plurality of clients, determining a controlling client and a controlled client from each of the clients;
[0024] Socket identifiers are allocated and saved for the master client and the controlled client respectively, so as to establish communication connections with the master client and the controlled client.
[0025] According to an information synchronization method provided by the present invention, after respectively allocating and saving socket identifiers for the master client and the controlled client to establish a communication connection with the master client and the controlled client, the method further includes:
[0026] When detecting that there is a socket identifier of the master control client saved last time, replacing the socket identifier of the master control client saved last time with the socket identifier of the current master control client;
[0027] or,
[0028] When it is detected that the communication connection established with the controlled client is disconnected, the socket identifier of the controlled client is deleted.
[0029] The present invention also provides an information synchronization device, comprising:
[0030] The first acquisition module is used to obtain the user's login information;
[0031] A first display module, configured to display a first three-dimensional scene when it is determined that the user is in a master client based on the login information;
[0032] A second acquisition module, used to acquire simulation scene change information of the first three-dimensional scene;
[0033] A first sending module, configured to send the simulation scene change information to a server, so that the server broadcasts the simulation scene change information to a controlled client, and the controlled client updates a second three-dimensional scene according to the simulation scene change information;
[0034] The controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
[0035] The present invention also provides an information synchronization device, comprising:
[0036] A first receiving module is used to receive the simulation scene change information of the first three-dimensional scene sent by the master control client; the master control client displays the first three-dimensional scene;
[0037] A first broadcast module, used for broadcasting the simulation scene change information to each controlled client, so that each controlled client can update the second three-dimensional scene displayed by each client according to the simulation scene change information;
[0038] The first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
[0039] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned information synchronization methods is implemented.
[0040] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the information synchronization method described in any one of the above is implemented.
[0041] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the information synchronization method described above is implemented.
[0042] The present invention provides an information synchronization method, device, electronic device and storage medium. By acquiring the login information of the user, when it is determined that the user is in the main control client, the first three-dimensional scene used for situational simulation training is rendered and displayed in real time through three-dimensional simulation technology, so that the user can perform free interactive operations such as viewing angle adjustment in the first three-dimensional scene to control the model change of the first three-dimensional scene; thus, by acquiring the simulation scene change information of the first three-dimensional scene, the simulation scene change information is sent to the server, so that the server synchronously broadcasts the simulation scene change information to the controlled client that displays the second three-dimensional scene, wherein the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles, thereby the controlled client can synchronously update the second three-dimensional scene in real time according to the simulation scene change information, thereby realizing the real-time synchronization of different viewing angle simulation information of the same three-dimensional scene by multiple terminals, effectively expanding the field of view of the situational simulation scene, and at the same time, the controlled client automatically updates the content of the respective second three-dimensional scene to ensure that the display is consistent with the first three-dimensional scene of the main control client, and the interface of each controlled client is rendered independently, distributedly processed, and the performance does not affect each other, thereby ensuring the smoothness of the display of each client interface, and can greatly improve the training efficiency and training experience of the trainee in the situational simulation training process. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 This is one of the flow charts of the information synchronization method provided by the present invention;
[0045] Figure 2 It is a schematic diagram of the client processing flow in the information synchronization method provided by the present invention;
[0046] Figure 3 This is the second flow chart of the information synchronization method provided by the present invention;
[0047] Figure 4 It is a schematic diagram of the server processing flow in the information synchronization method provided by the present invention;
[0048] Figure 5is a schematic diagram of the overall system structure of the information synchronization method provided by the present invention,
[0049] Figure 6 It is one of the structural schematic diagrams of the information synchronization device provided by the present invention;
[0050] Figure 7 This is the second structural diagram of the information synchronization device provided by the present invention;
[0051] Figure 8 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Combine the following Figure 1-Figure 8 An information synchronization method, device, electronic device and storage medium of the present invention are described.
[0054] Figure 1 It is one of the flowcharts of the information synchronization method provided by the present invention. The execution subject of the method can be a client, such as Figure 1 As shown, the method includes step 110 , step 120 , step 130 and step 140 .
[0055] Step 110, obtaining the user's login information;
[0056] It should be noted that based on the high efficiency of 3D drawing protocol WebGL graphics rendering, it can be directly accessed on the browser, which is convenient and fast. In an embodiment of the present invention, the three-dimensional (3D) scene used for situational simulation training can be a 3D simulation scene and model based on the WebGL standard, which is displayed in the browser web page through the system graphics card.
[0057] In this step, in the embodiment of the present invention, a browser can be used as a client, and the browsers used by multiple clients can be the same browser or different browsers, which is not specifically limited in the embodiment of the present invention.
[0058] In this embodiment, the browser webpage is initialized first, and a user login interface is displayed. The browser can obtain the user's login information by the user inputting login information in the user login interface.
[0059] Step 120, when it is determined based on the login information that the user is in the master client, display the first three-dimensional scene;
[0060] Specifically, the master control client described in the embodiment of the present invention refers to a client with dominant control authority during the situational simulation training process, which can perform control operations such as scene perspective adjustment and screen zooming on the three-dimensional simulation scene in the situational simulation training.
[0061] The first three-dimensional scene described in the embodiment of the present invention refers to a three-dimensional scene for situation simulation training displayed in the webpage of the main control client.
[0062] In this step, after obtaining the user's login information, it can be determined whether the user is in the master client or the controlled client based on the user's login information;
[0063] Furthermore, when it is determined that the user is in the master client, the first three-dimensional scene and the related control interface are displayed. The user can freely perform viewing angle operation control in the first three-dimensional scene through the operation of the control interface to change the three-dimensional scene.
[0064] Step 130, obtaining simulation scene change information of the first three-dimensional scene;
[0065] Specifically, the simulation scene change information described in the embodiment of the present invention refers to the simulation scene change information generated when the first three-dimensional scene changes the current simulation scene after receiving an operation instruction. It can be the scene change information generated by the user performing a scene perspective operation in the first three-dimensional scene, or it can be the scene change information generated in response to the server performing a scene simulation instruction on the first three-dimensional scene.
[0066] Further, in the embodiment of the present invention, when a scene change is detected in the first three-dimensional scene, simulated scene change information of the first three-dimensional scene may be acquired.
[0067] Step 140, sending the simulation scene change information to the server, so that the server broadcasts the simulation scene change information to the controlled client, and the controlled client updates the second three-dimensional scene according to the simulation scene change information;
[0068] The controlled client displays a second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles.
[0069] Specifically, the controlled client described in the embodiment of the present invention refers to a client without dominant control authority in the situation simulation training, which is used to display a three-dimensional scene that keeps the screen synchronized with the first three-dimensional scene displayed by the main control client.
[0070] The second three-dimensional scene described in the embodiment of the present invention refers to a three-dimensional scene for situational simulation training displayed in the web page of the controlled client, which can be a three-dimensional scene under a corresponding perspective based on preset perspective information of the controlled client.
[0071] In an embodiment of the present invention, the number of controlled clients can be set to one or more, and each controlled client displays a second three-dimensional scene. The second three-dimensional scene and the first three-dimensional scene are the same three-dimensional scene from different perspectives during situational simulation training for trainees.
[0072] Optionally, in this embodiment, two controlled clients can be set, namely a first controlled client and a second controlled client. The second three-dimensional scene displayed in the first controlled client can be a three-dimensional scene that maintains a viewing angle of 45° to the left of the first three-dimensional scene, and the second three-dimensional scene displayed in the second controlled client can be a three-dimensional scene that maintains a viewing angle of 45° to the right of the first three-dimensional scene.
[0073] Therefore, by displaying the first three-dimensional scene on the master client and displaying the multiple second three-dimensional scenes on the multiple controlled clients, the field of view of the three-dimensional scene in the situational simulation training can be conveniently and effectively broadened.
[0074] In the embodiment of the present invention, the server may be a server using the WebSocket communication protocol. The WebSocket communication protocol can make data exchange between the client and the server simpler, allowing the server to actively push data to the client to achieve two-way data transmission. The server in the embodiment of the present invention is mainly used to provide a three-dimensional scene synchronization service function, which can specifically realize the registration of each client, synchronization information reception, and synchronization information forwarding.
[0075] In this embodiment, the master client sends registration information to the WebSocket server. The server determines the role information of the master client based on the registration information of the master client, and allocates and saves the corresponding socket ID for the master client, thereby establishing a communication connection between the master client and the server.
[0076] Furthermore, based on the WebGL three-dimensional scene simulation technology, when a scene change is detected in the first three-dimensional scene and the simulated scene change information of the first three-dimensional scene is obtained, the simulated scene change information of the first three-dimensional scene can be sent to the server, so that the server can broadcast the simulated scene change information to the controlled client in real time. The controlled client can therefore perform adaptive scene simulation and rendering according to the simulated scene change information of the first three-dimensional scene, and synchronously update the displayed second three-dimensional scene in real time.
[0077] The information synchronization method of the embodiment of the present invention obtains the login information of the user, and when it is determined that the user is in the master client, the first three-dimensional scene used for situational simulation training is rendered and displayed in real time through the three-dimensional simulation technology, so that the user can perform free interactive operations such as viewing angle adjustment in the first three-dimensional scene to control the model change of the first three-dimensional scene; thus, by obtaining the simulation scene change information of the first three-dimensional scene, the simulation scene change information is sent to the server, so that the server synchronously broadcasts the simulation scene change information to the controlled client that displays the second three-dimensional scene, wherein the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles, thereby, the controlled client can synchronously update the second three-dimensional scene in real time according to the simulation scene change information, thereby realizing real-time synchronization of different viewing angle simulation information of the same three-dimensional scene by multiple terminals, effectively expanding the field of view of the situational simulation scene, and at the same time, the controlled client automatically updates the content of the respective second three-dimensional scenes to ensure that the display is consistent with the first three-dimensional scene of the master client, and the interface of each controlled client is rendered independently, distributedly processed, and the performance does not affect each other, thereby ensuring the smoothness of the display of each client interface, which can greatly improve the training efficiency and training experience of the trainees in the situational simulation training process.
[0078] Based on the above embodiment, as an optional embodiment, after obtaining the user's login information, the method further includes:
[0079] When it is determined based on the login information that the user is in the controlled client, displaying a second three-dimensional scene;
[0080] Sending the registration information of the controlled client to the server to establish a communication connection with the server;
[0081] Obtain the simulation scene change information of the master control client sent by the server;
[0082] The second three-dimensional scene is updated based on the simulation scene change information.
[0083] Specifically, in step 110, after obtaining the user's login information, when it is determined based on the login information that the user is in a controlled client, the browser page can display the second 3D scene based on WebGL 3D simulation, but no control buttons will be displayed in the page.
[0084] It can be understood that the simulation scene change information of the master control client refers to the simulation scene change information of the first three-dimensional scene displayed by the master control client.
[0085] Furthermore, by sending the registration information of the controlled client to the server, the server parses the registration information, determines the controlled role information of the controlled client, and allocates and saves the Socket ID of the controlled client, thereby establishing a communication connection between the server and the controlled client.
[0086] In this embodiment, when the server broadcasts the simulation scene change information of the first three-dimensional scene to the controlled client, the simulation scene change information of the master client sent by the server can be obtained. The controlled client can perform real-time synchronous update of the displayed second three-dimensional scene according to the simulation scene change information, and adjust the three-dimensional viewing angle of the current second three-dimensional scene.
[0087] In this embodiment, the controlled clients may include multiple clients, and the 3D scene display of each controlled client is independently rendered based on WebGL. Through the distributed processing of the controlled clients, the performance is not affected by each other, which can effectively ensure the smoothness of the synchronous rendering of the 3D scene.
[0088] The method of the embodiment of the present invention, when determining that the client is a controlled client, can perform real-time synchronous update of the displayed second three-dimensional scene according to the simulation scene change information by receiving the simulation scene change information of the master client sent by the server, so as to ensure that the three-dimensional scene display is consistent with that of the master client. By independent rendering and distributed processing, the performance does not affect each other, and the smoothness of the display of each client interface is guaranteed, which is conducive to improving the training efficiency and training experience of trainees in the situational simulation training process.
[0089] Figure 2 is a schematic diagram of the client processing flow in the information synchronization method provided by the present invention, such as Figure 2 As shown, in an embodiment of the present invention, the client processing flow is as follows:
[0090] First, the browser webpage is initialized. After the webpage is initialized, the user login page is displayed, which is used for user login. The user role is determined based on the user's login information;
[0091] If the user is determined to be a master user based on the user's login information, that is, the user is in the master client, a related control interface is displayed to allow the user to freely control the viewing angle and operate the scene, that is, the client displays the first three-dimensional scene at this time, and the user can freely control the viewing angle and operate the scene in the first three-dimensional scene;
[0092] If the user is determined to be a controlled user based on the user's login information, that is, the user is in a controlled client, the user operation is prohibited, that is, the client interface will not display any control buttons at this time, and then the client obtains the preset viewing angle information used by the user from the server, and displays the second three-dimensional scene under the preset viewing angle information;
[0093] Furthermore, the client sends registration information to the server, which includes the master / controlled role information, to establish a communication connection with the server;
[0094] Furthermore, the client will enter the internal message processing loop, that is, execute other program processes in the internal loop.
[0095] Figure 3 This is the second flow chart of the information synchronization method provided by the present invention, such as Figure 3 As shown, the execution subject of this method can be a server, such as Figure 3 As shown, the method includes step 310 and step 320.
[0096] Step 310, receiving the simulation scene change information of the first three-dimensional scene sent by the master control client; the master control client displays the first three-dimensional scene;
[0097] Step 320, broadcasting the simulation scene change information to each controlled client, so that each controlled client updates the second three-dimensional scene displayed by each client according to the simulation scene change information;
[0098] The first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
[0099] Specifically, in an embodiment of the present invention, the server may be a server that uses the WebSocket communication protocol, thereby creating a WebSocket server to monitor system messages.
[0100] In an embodiment of the present invention, the master control client displays a first three-dimensional scene. When a user performs a scene perspective operation in the first three-dimensional scene to generate simulated scene change information, or the master control client performs scene simulation on the first three-dimensional scene in response to a server instruction to generate simulated scene change information, the master control client may send the simulated scene change information of the first three-dimensional scene to the server;
[0101] Therefore, in this embodiment, after monitoring the simulation scene change information of the first three-dimensional scene sent by the master client, the server can receive the simulation scene change information of the first three-dimensional scene, and broadcast the simulation scene change information in real time to each controlled client with which a communication connection has been established, so that each controlled client can synchronously update the second three-dimensional scene displayed by each of them in real time according to the simulation scene change information;
[0102] In this embodiment, the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different perspectives. That is to say, by setting multiple controlled clients, the first three-dimensional scene and the second three-dimensional scene under different perspectives displayed by each controlled client can be combined in the same display into a three-dimensional scene that meets the need to widen the field of view, which can greatly improve the training efficiency and training experience of trainees in the situational simulation training process.
[0103] According to the information synchronization method of the embodiment of the present invention, through the three-dimensional simulation technology, the master client can render and display the first three-dimensional scene used for situational simulation training in real time, so that the user can perform free interactive operations such as viewing angle adjustment in the first three-dimensional scene to control the model change of the first three-dimensional scene; thus, by sending the simulation scene change information of the first three-dimensional scene to the server, the server can receive the simulation scene change information, thereby the simulation scene change information of the first three-dimensional scene can be synchronously broadcast to the controlled client that displays the second three-dimensional scene, wherein the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles, thereby, the controlled client can synchronously update the second three-dimensional scene in real time according to the simulation scene change information, thereby realizing real-time synchronization of different viewing angle simulation information of the same three-dimensional scene by multiple terminals, effectively expanding the field of view of the situational simulation scene, and at the same time, through the controlled client automatically updating the content of the respective second three-dimensional scene, it is ensured that the display of the first three-dimensional scene of the master client is consistent, the interface of each controlled client is rendered independently, distributedly processed, and the performance does not affect each other, thereby ensuring the smoothness of the display of each client interface, which can greatly improve the training efficiency and training experience of the trainees in the situational simulation training process.
[0104] Based on the above embodiment, as an optional embodiment, before receiving the simulation scene change information sent by the master control client, the method further includes:
[0105] Receive registration information from multiple clients;
[0106] Based on the registration information of multiple clients, determine a master client and a controlled client from each client;
[0107] Socket identifiers are allocated and saved for the master client and the controlled client respectively, so as to establish communication connection with the master client and the controlled client.
[0108] Specifically, in this embodiment, the registration information includes information about the master or controlled role, and the server can determine whether the client is the master role or the controlled role through the registration information.
[0109] Therefore, based on the registration information of multiple clients, the role information contained in each registration information is parsed, and the controlling client and the controlled client can be determined from each client.
[0110] Furthermore, based on the WebSocket communication protocol, after determining the master client and the controlled client, the server can allocate and save socket identifiers (Socket ID) to the master client and each controlled client, and save the SocketID in an array in the database, thereby establishing a communication connection with the master client and the controlled client.
[0111] The method of the embodiment of the present invention, by adopting a server of the WebSocket communication protocol, assigning Socket IDs to the master client and each controlled client, and establishing a communication connection, can make data exchange between the client and the server simpler, allow the server to actively push data to the client, and help improve the efficiency of synchronous information transmission between the master client and the controlled clients.
[0112] Based on the above embodiment, as an optional embodiment, after respectively allocating and saving socket identifiers for the master client and the controlled client to establish a communication connection with the master client and the controlled client, the method further includes:
[0113] When detecting that there is a socket identifier of the master control client saved last time, replacing the socket identifier of the master control client saved last time with the socket identifier of the current master control client;
[0114] or,
[0115] When it is detected that the communication connection established with the controlled client is disconnected, the socket identifier of the controlled client is deleted.
[0116] Specifically, in an embodiment of the present invention, after the server allocates and saves Socket IDs for the master client and the controlled client respectively to establish a communication connection with the master client and the controlled client, when it is detected that the Socket ID of the master client saved last time exists in the array storing the SocketID, the Socket ID of the master client saved last time can be directly replaced with the Socket ID of the current master client.
[0117] In an embodiment of the present invention, when the server detects that the communication connection established with the controlled client is disconnected, the Socket ID of the controlled client is deleted from the array storing the Socket IDs.
[0118] The method of the embodiment of the present invention adopts the Socket ID of the current master control client to replace the Socket ID of the master control client saved last time, thereby effectively ensuring that the user of the currently logged-in master control client can obtain the dominant control authority in the situation simulation training process and perform scene control operations; by detecting that the communication connection established with the controlled client is disconnected, the Socket ID of the controlled client is deleted, the storage capacity of the local database is released, the system memory pressure is reduced, and the operation efficiency of the system is improved.
[0119] Figure 4 is a schematic diagram of the server processing flow in the information synchronization method provided by the present invention, such as Figure 4 As shown, in this embodiment, the processing flow of the server is as follows:
[0120] Create a WebSocket server and start listening for messages;
[0121] Enter the message loop;
[0122] If the registration information of the master control client is received, the master control role of the master control client is determined, and the Socket ID of the master control client is saved in the array; it should be noted that if there is already a master control Socket ID, that is, the Socket ID of the master control client saved last time exists, the Socket ID of the master control client saved last time is replaced with the Socket ID of the current master control client;
[0123] If the registration information of the controlled client is received, the controlled role of the controlled client is determined, and then the Socket ID of the controlled client is saved in the array for storing Socket IDs in the database;
[0124] If a simulation scene change message is received from the master client, that is, a simulation scene change message of the first three-dimensional scene displayed by the master client is received, the simulation scene change message is broadcast to all controlled clients;
[0125] If a socket disconnect message is detected, that is, the controlled client socket is disconnected, the disconnected socket ID is deleted from the array;
[0126] If it is erroneous data, that is, the server does not support the data to be processed, the erroneous data will be discarded directly.
[0127] Figure 5 is a schematic diagram of the overall system structure of the information synchronization method provided by the present invention, such as Figure 5As shown, the system mainly consists of three parts: Web service, three-dimensional scene synchronization service and multiple clients, such as browser 1, browser 2 and browser 3, wherein the Web service and three-dimensional scene synchronization service can be integrated in the same server, and the client can include a master client and multiple controlled clients.
[0128] In this embodiment, the Web service and each client can exchange data based on the HTTP transmission protocol, and the 3D scene synchronization service and each client can communicate data based on the WebSocket (WS for short) communication protocol.
[0129] Optionally, in this embodiment, the Web service and each client can also exchange data based on the HTTPS transmission protocol, an encrypted version of HTTP, and the three-dimensional scene synchronization service and each client can also communicate data based on the WebSocket Secure (WSS) communication protocol, an encrypted version of WebSocket, thereby improving the security of data transmission.
[0130] In this embodiment, the Web service provides basic Web server functions, and the database of the Web service can store user account information, the role of each account, and the corresponding perspective information; the three-dimensional scene synchronization service can be responsible for the registration of each client, and realize the synchronization information receiving function and the synchronization information forwarding function, etc.
[0131] The information synchronization device provided by the present invention is described below. The information synchronization device described below and the information synchronization method described above can be referenced to each other.
[0132] Figure 6 is one of the structural diagrams of the information synchronization device provided by the present invention, such as Figure 6 As shown, including:
[0133] A first acquisition module 610 is used to acquire the user's login information;
[0134] A first display module 620, configured to display a first three-dimensional scene when it is determined that the user is in a master client based on the login information;
[0135] A second acquisition module 630 is used to acquire simulation scene change information of the first three-dimensional scene;
[0136] A first sending module 640 is used to send the simulation scene change information to the server, so that the server broadcasts the simulation scene change information to the controlled client, and the controlled client updates the second three-dimensional scene according to the simulation scene change information;
[0137] The controlled client displays a second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles.
[0138] The information synchronization device described in this embodiment can be used to execute the above-mentioned information synchronization method embodiment. Its principles and technical effects are similar and will not be repeated here.
[0139] The information synchronization device provided by the embodiment of the present invention obtains the login information of the user, and when it is determined that the user is in the main control client, the first three-dimensional scene used for situational simulation training is rendered and displayed in real time through the three-dimensional simulation technology, so that the user can perform free interactive operations such as viewing angle adjustment in the first three-dimensional scene to control the model change of the first three-dimensional scene; thus, by obtaining the simulation scene change information of the first three-dimensional scene, the simulation scene change information is sent to the server, so that the server synchronously broadcasts the simulation scene change information to the controlled client that displays the second three-dimensional scene, wherein the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles, thereby, the controlled client can synchronously update the second three-dimensional scene in real time according to the simulation scene change information, thereby realizing real-time synchronization of different viewing angle simulation information of the same three-dimensional scene by multiple terminals, effectively expanding the field of view of the situational simulation scene, and at the same time, the controlled client automatically updates the content of the respective second three-dimensional scenes to ensure that the display is consistent with the first three-dimensional scene of the main control client, and the interface of each controlled client is rendered independently, distributedly processed, and the performance does not affect each other, thereby ensuring the smoothness of the interface display of each client, which can greatly improve the training efficiency and training experience of the trainees in the situational simulation training process.
[0140] Figure 7 This is the second structural diagram of the information synchronization device provided by the present invention, such as Figure 7 As shown, including:
[0141] The first receiving module 710 is used to receive the simulation scene change information of the first three-dimensional scene sent by the master control client; the master control client displays the first three-dimensional scene;
[0142] The first broadcast module 720 is used to broadcast the simulation scene change information to each controlled client, so that each controlled client can update the second three-dimensional scene displayed by each client according to the simulation scene change information;
[0143] The first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
[0144] The information synchronization device described in this embodiment can be used to execute the above-mentioned information synchronization method embodiment. Its principles and technical effects are similar and will not be repeated here.
[0145] The information synchronization device provided by the embodiment of the present invention uses a three-dimensional simulation technology, and the master client can render and display the first three-dimensional scene used for situational simulation training in real time, so that the user can perform free interactive operations such as viewing angle adjustment in the first three-dimensional scene to control the model change of the first three-dimensional scene; thereby, by sending the simulation scene change information of the first three-dimensional scene to the server, the server can receive the simulation scene change information, thereby the simulation scene change information of the first three-dimensional scene can be synchronously broadcast to the controlled client that displays the second three-dimensional scene, wherein the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles, thereby, the controlled client can synchronously update the second three-dimensional scene in real time according to the simulation scene change information, thereby realizing real-time synchronization of different viewing angle simulation information of the same three-dimensional scene by multiple terminals, effectively expanding the field of view of the situational simulation scene, and at the same time, the controlled client automatically updates the content of the respective second three-dimensional scene to ensure that the display is consistent with the first three-dimensional scene of the master client, and the interface of each controlled client is rendered independently, distributedly processed, and the performance does not affect each other, thereby ensuring the smoothness of the display of each client interface, which can greatly improve the training efficiency and training experience of the trainees in the situational simulation training process.
[0146] Figure 8 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the information synchronization method provided by the above methods, the method comprising: obtaining the user's login information; displaying the first three-dimensional scene when the user is determined to be in the master client based on the login information; obtaining the simulation scene change information of the first three-dimensional scene; sending the simulation scene change information to the server so that the server broadcasts the simulation scene change information to the controlled client, and the controlled client updates the second three-dimensional scene according to the simulation scene change information; the controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different viewing angles. In addition, the logic instructions in the above memory 830 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.
[0147] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the information synchronization method provided by the above methods, which includes: obtaining the user's login information; displaying a first three-dimensional scene when it is determined that the user is in a master client based on the login information; obtaining simulation scene change information of the first three-dimensional scene; sending the simulation scene change information to a server, so that the server broadcasts the simulation scene change information to a controlled client, and the controlled client updates a second three-dimensional scene according to the simulation scene change information; the controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different perspectives.
[0148] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the information synchronization method provided by the above-mentioned methods, the method comprising: obtaining the user's login information; displaying a first three-dimensional scene when it is determined based on the login information that the user is in a master client; obtaining simulation scene change information of the first three-dimensional scene; sending the simulation scene change information to a server, so that the server broadcasts the simulation scene change information to a controlled client, and the controlled client updates a second three-dimensional scene according to the simulation scene change information; the controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene under different perspectives.
[0149] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An information synchronization method, characterized in that: include: Send the registration information of the master control client to the server. If the server receives the registration information of the master control client, it determines the master control role of the master control client and saves the Socket ID of the master control client into an array. If there is already a master control Socket ID, that is, the last saved master control client Socket ID exists, then the last saved master control client Socket ID is replaced with the current master control client Socket ID; Sending the registration information of the controlled client to the server, if the server receives the registration information of the controlled client, determining the controlled role of the controlled client, and saving the Socket ID of the controlled client into an array for storing Socket IDs in a database; Get the user's login information; When it is determined based on the login information that the user is in the master client, displaying a first three-dimensional scene; The first three-dimensional scene is a 3D simulation scene and model displayed in a browser web page through a system graphics card based on the WebGL standard; Acquiring simulation scene change information of the first three-dimensional scene; Sending the simulation scene change information to a server, so that the server broadcasts the simulation scene change information to a controlled client, and the controlled client updates a second three-dimensional scene according to the simulation scene change information; The controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
2. The information synchronization method according to claim 1, characterized in that: After obtaining the user's login information, the method further includes: When it is determined based on the login information that the user is in a controlled client, displaying a second three-dimensional scene; Sending the registration information of the controlled client to the server to establish a communication connection with the server; Acquire the simulation scene change information of the master control client sent by the server; The second three-dimensional scene is updated based on the simulation scene change information.
3. An information synchronization method, characterized in that: include: If the registration information of the master client is received, the master role of the master client is determined, and the Socket ID of the master client is saved in an array; If there is already a master control Socket ID, that is, the last saved master control client Socket ID exists, then the last saved master control client Socket ID is replaced with the current master control client Socket ID; If the registration information of the controlled client is received, the controlled role of the controlled client is determined, and the Socket ID of the controlled client is saved in an array for storing Socket IDs in the database; Receiving simulation scene change information of a first three-dimensional scene sent by a master control client; the master control client displays the first three-dimensional scene; The first three-dimensional scene is a 3D simulation scene and model displayed in a browser web page through a system graphics card based on the WebGL standard; Broadcasting the simulation scene change information to each controlled client, so that each controlled client updates the second three-dimensional scene displayed by each client according to the simulation scene change information; The first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
4. The information synchronization method according to claim 3, characterized in that: After receiving the registration information of the controlled client, determining the controlled role of the controlled client, and saving the Socket ID of the controlled client into an array for storing Socket IDs in the database, the method further includes: When it is detected that the communication connection established with the controlled client is disconnected, the socket identifier of the controlled client is deleted.
5. An information synchronization device, characterized in that: include: The first acquisition module is used to obtain the user's login information; A first display module, configured to display a first three-dimensional scene when it is determined that the user is in a master client based on the login information; The first three-dimensional scene is a 3D simulation scene and model displayed in a browser web page through a system graphics card based on the WebGL standard; A second acquisition module, used to acquire simulation scene change information of the first three-dimensional scene; A first sending module, configured to send the simulation scene change information to a server, so that the server broadcasts the simulation scene change information to a controlled client, and the controlled client updates a second three-dimensional scene according to the simulation scene change information; The controlled client displays the second three-dimensional scene, and the first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles; The second sending module is used to send the registration information of the master control client to the server. If the server receives the registration information of the master control client, it determines the master control role of the master control client and saves the Socket ID of the master control client into an array; If there is already a master control Socket ID, that is, the last saved master control client Socket ID exists, then the last saved master control client Socket ID is replaced with the current master control client Socket ID; And, the registration information of the controlled client is sent to the server. If the server receives the registration information of the controlled client, it determines the controlled role of the controlled client and saves the Socket ID of the controlled client into an array for storing Socket IDs in the database.
6. An information synchronization device, characterized in that: include: The first receiving module is used to determine the master role of the master client if the registration information of the master client is received, and save the Socket ID of the master client into an array; If there is already a master control Socket ID, that is, the last saved master control client Socket ID exists, then the last saved master control client Socket ID is replaced with the current master control client Socket ID; If the registration information of the controlled client is received, the controlled role of the controlled client is determined, and the Socket ID of the controlled client is saved in an array for storing Socket IDs in the database; Receiving simulation scene change information of a first three-dimensional scene sent by a master control client; the master control client displays the first three-dimensional scene; The first three-dimensional scene is a 3D simulation scene and model displayed in a browser web page through a system graphics card based on the WebGL standard; A first broadcast module, used for broadcasting the simulation scene change information to each controlled client, so that each controlled client can update the second three-dimensional scene displayed by each client according to the simulation scene change information; The first three-dimensional scene and the second three-dimensional scene are the same three-dimensional scene at different viewing angles.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the information synchronization method according to any one of claims 1 to 4 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the information synchronization method according to any one of claims 1 to 4 is implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the information synchronization method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Object display method and device, storage medium and electronic device
CN111195432A