CN107566346B - 3D game data transmission method and device, storage medium and electronic device - Google Patents

3D game data transmission method and device, storage medium and electronic device Download PDF

Info

Publication number
CN107566346B
CN107566346B CN201710678365.3A CN201710678365A CN107566346B CN 107566346 B CN107566346 B CN 107566346B CN 201710678365 A CN201710678365 A CN 201710678365A CN 107566346 B CN107566346 B CN 107566346B
Authority
CN
China
Prior art keywords
client
game
server
model
game application
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
CN201710678365.3A
Other languages
Chinese (zh)
Other versions
CN107566346A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710678365.3A priority Critical patent/CN107566346B/en
Publication of CN107566346A publication Critical patent/CN107566346A/en
Application granted granted Critical
Publication of CN107566346B publication Critical patent/CN107566346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Pinball Game Machines (AREA)

Abstract

The invention discloses a transmission method and device of 3D game data, a storage medium and an electronic device. Wherein, the method comprises the following steps: obtaining an operation instruction on a client of a game application, wherein the operation instruction is used for indicating a game of a game running on the client, and the client of the game application comprises: a client of a web page 3D game application; responding to the operation instruction, and establishing long connection between the client and a server of the game application; during the process of running one game, the transmission of game data in one game is carried out between the client and the server through the long connection. The invention solves the technical problem of poor bearing capacity of the server caused by the polling connection between the terminal and the server in the related technology.

Description

3D game data transmission method and device, storage medium and electronic device
Technical Field
The invention relates to the field of data transmission, in particular to a method and a device for transmitting 3D game data, a storage medium and an electronic device.
Background
At present, a web game is favored by users due to the advantages of convenience and time saving, a mobile web game is more convenient to run on a mobile phone, users experience interactive marketing games or mobile web games on the basis of mobile end web pages and have greater convenience, and the traditional 3D mode games are mainly applied to the problem that traditional clients are configured on the basis of user machines, and large-scale popularization and optimization are not carried out on the PC web games and the mobile web games.
The traditional 3D scheme has a great problem in the performance of PC webpages and mobile webpages, particularly, the FLASH-based 3D model is extremely large in memory consumption on the PC webpages, FLASH is not supported on a mobile terminal, a traditional webpage server polls a server to send a request to the server for continuous explosion, the bearing capacity and the performance of the server cannot be greatly improved, and the limitation is great.
In view of the above problem in the related art that the load-bearing capacity of the server is poor due to the polling connection between the terminal and the server, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for transmitting 3D game data, a storage medium and an electronic device, which are used for at least solving the technical problem of poor bearing capacity of a server caused by the fact that a terminal and the server are connected in a polling mode in the related art.
According to an aspect of an embodiment of the present invention, there is provided a transmission method of 3D game data, including: obtaining an operation instruction on a client of a game application, wherein the operation instruction is used for indicating a game play of the game application running on the client, and the client of the game application comprises: a client of a web page 3D game application; responding to the operation instruction, and establishing a long connection between the client and a server of the game application; and in the process of running the game, transmitting game data in the game between the client and the server through the long connection.
According to another aspect of the embodiments of the present invention, there is also provided a transmission apparatus of 3D game data, including: an obtaining unit, configured to obtain an operation instruction on a client of a game application, where the operation instruction is used to instruct a game play of the game application to run on the client, and the client of the game application includes: a client of a web page 3D game application; a response unit, configured to respond to the operation instruction, and establish a long connection between the client and a server of the game application; and the transmission unit is used for transmitting the game data in the one-game between the client and the server through the long connection in the process of running the one-game.
In an embodiment of the present invention, the transmission of the 3D game data may obtain, on a client of a game application (e.g., a web page 3D game application), an operation instruction for instructing a game play of the game application to be executed on the client, and then in response to the operation instruction, a long connection is established between the client and the server of the game application, and during the course of running a game, by transmitting the game data in one game between the client and the server through the long connection, and the request is sent to the server in a polling mode during each game, so that the number of the requests needing to be processed by the server is reduced, the number of the games borne by the server is enhanced, the technical problem that the carrying capacity of the terminal and the server connected in a polling mode in the related technology is poor can be solved, and the technical effect of enhancing the carrying capacity of the server is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic diagram of a hardware environment of a transmission method of 3D game data according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative method of transmission of 3D game data according to an embodiment of the invention;
FIG. 3 is a block diagram of an alternative system framework for intelligent three-dimensional visual interaction and multi-user website page experience game and communication optimization, according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the overall logic of an alternative program according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an alternative load initialization optimization according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an alternative configuration of a 3D interactive game interface, according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an alternative mobile phone motion coordinate system according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of an alternative system flow according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of an alternative polling connection of a client to a server according to an embodiment of the invention;
FIG. 10 is a schematic diagram of an alternative long connection of multiple clients to a server in accordance with an embodiment of the present invention;
FIG. 11 is a schematic diagram of an alternative 3D game data transmission arrangement according to an embodiment of the invention;
FIG. 12 is a schematic diagram of an alternative 3D game data transmission arrangement according to an embodiment of the invention; and
fig. 13 is a block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present invention, an embodiment of a method for transmitting 3D game data is provided.
Alternatively, in the present embodiment, the transmission method of the 3D game data described above may be applied to a hardware environment constituted by the server 102 and the terminal 104 as shown in fig. 1. As shown in fig. 1, a server 102 is connected to a terminal 104 via a network including, but not limited to: the terminal 104 is not limited to a PC, a mobile phone, a tablet computer, etc. in a wide area network, a metropolitan area network, or a local area network. The game data transmission method according to the embodiment of the present invention may be executed by the server 102, the terminal 104, or both the server 102 and the terminal 104. The terminal 104 may execute the transmission method of the 3D game data according to the embodiment of the present invention by a client installed thereon.
Fig. 2 is a flowchart of an alternative 3D game data transmission method according to an embodiment of the present invention, and as shown in fig. 2, the method may include the following steps:
step S202, obtaining an operation instruction on a client of the game application, wherein the operation instruction is used for instructing a game of the game application to run on the client, and the client of the game application comprises: a client of a web page 3D game application;
step S204, responding to the operation instruction, and establishing long connection between the client and the server of the game application;
in step S206, during the one-play operation, the transmission of the game data in the one-play is performed between the client and the server via the long connection.
Through the above-described steps S202 to S206, the transmission of the 3D game data may acquire, on the client of the game application (e.g., the web page 3D game application), an operation instruction for instructing one game of the game application to run on the client, and then in response to the operation instruction, a long connection is established between the client and the server of the game application, and during the course of running a game, by transmitting the game data in one game between the client and the server through the long connection, and the request is sent to the server in a polling mode during each game, so that the number of the requests needing to be processed by the server is reduced, the number of the games borne by the server is enhanced, the technical problem that the carrying capacity of the terminal and the server connected in a polling mode in the related technology is poor can be solved, and the technical effect of enhancing the carrying capacity of the server is achieved.
In the technical solution provided in step S202, the client of the game application may be used to log in a client of the game, and the user may log in a game corresponding to the client through the client to run a corresponding game application. During the process of running the game application by the user, the user can send out an operation instruction for controlling the game through the client of the game application. The server of the game application can receive the operation instruction acquired from the client of the game application and instruct a game of the game application to run on the client according to the operation instruction, so that a user can play the game through the client.
As an alternative embodiment, the client of the game application comprises: a client of a web-based 3D gaming application.
By adopting the embodiment of the invention, the client of the game application can be a webpage 3D game application client, and the user can access the webpage 3D game application through the client of the game application.
Alternatively, the client of the game application may include a browser module, through which the client of the game application may transmit the operation instruction to the server of the game application.
Alternatively, the browser module may be embedded on a client of the gaming application for enabling the client of the gaming application to communicate with a server of the gaming application through the browser module.
Alternatively, the browser module may be a common browser on the terminal device where the client of the game application is located, and in a case where the client of the game application needs to access the server of the game application, the address of the server of the game application may be sent to the common browser of the terminal device through the client of the game application, so that a connection between the server of the game application and the client of the game application is established through the common browser of the terminal device.
As an alternative embodiment, the client of the web page 3D game application comprises: a web page client in the mobile terminal, or a PC web page client.
By adopting the embodiment of the invention, the client of the webpage 3D game application can be a webpage client in a mobile terminal, can also be a PC webpage client, and can use the client of the webpage game application on various types of terminals.
In the technical solution provided in step S204, after the client acquires the operation instruction, a communication connection between the client and the server corresponding to the game application may be established, so that the client of the game application and the server of the game application may transmit information to each other, where a long connection mode may be adopted between the client of the game application and the server of the game application.
It should be noted that a long connection means that a plurality of packets can be continuously transmitted over one connection, and if no packet is transmitted during the connection holding period, both of them are required to transmit a link check packet.
As an alternative embodiment, establishing a long connection between the client and the server of the gaming application comprises: a long connection based on the WebSocket protocol is established between the client and the server of the game application.
By adopting the embodiment of the invention, the long connection between the client and the server of the game application can be suggested through the WebSocket protocol, the real-time response can be carried out, the feedback strength and the performance to the user behavior can be accelerated, in addition, the memory consumed by the WebSocket protocol is lower than that of the 3D model based on FLASH, and the technical problem of large memory consumption caused by the webpage construction based on the 3D model of FLASH in the related technology can be solved by establishing the long connection based on the WebSocket protocol between the client and the server of the game application.
It should be noted that the WebSocket protocol is a new network protocol based on TCP. It realizes full duplex communication between browser and server. The browser and the server are in full duplex communication, and can be interpreted in a popular way that the server actively sends information to the client, so that the server and the client can carry out real-time transmission by means of a WebSocket protocol.
In the technical solution provided in step S206, after the server of the game application obtains the operation instruction on the client of the game application, a game of the game application may be run on the client of the game application, and a long connection between the client of the game application and the server of the game application is established during the game, so that game data generated in the game when the client of the game application runs on the client of the game application is transmitted through the long connection between the client of the game application and the server of the game application.
As an alternative embodiment, after obtaining the operation instruction on the client of the game application and before the transmission of the game data in one game between the client and the server through the long connection, the method may further include: and rendering the 3D picture required in one game on the client through a running 3D engine, wherein the 3D engine adopts a JavaScript rendering framework.
By adopting the embodiment of the invention, the 3D picture required in one game can be rendered on the client by adopting the 3D engine of the JavaScript rendering frame, so that the 3D picture required by the client is obtained.
As an alternative embodiment, rendering 3D pictures required in one game by a running 3D engine on a client includes: searching a 3D model required for rendering a 3D picture on a client; loading the 3D model in the client under the condition that the 3D model is not found, and creating a model object in the 3D model; under the condition that the 3D model is found, a model object in the 3D model is established; the 3D model and model objects are rendered by a 3D engine.
By adopting the embodiment of the invention, under the condition that the client renders the 3D picture required by the game, the 3D model required by rendering the 3D picture can be searched from the client, and under the condition that the 3D model is searched, the model object in the 3D model is created on the 3D picture required to be rendered; under the condition that the 3D model is not found, the 3D model can be loaded in the client, the loaded model object in the 3D model is created on the 3D picture to be rendered, the 3D model and the model object are rendered through the 3D engine to obtain the rendered 3D picture, and therefore the rendered 3D picture can be obtained quickly.
As an optional embodiment, in a case that the required 3D picture is a tree, it may be found on the client whether a 3D model of the tree exists, and in a case that the 3D model of the tree is found, the model of the tree is created on the 3D picture to be rendered; and in the case that the 3D model of the tree is not found, loading the 3D model of the tree through the client, and creating the model of the tree on a 3D picture to be rendered. After the model of the tree is established on the 3D picture to be rendered, the model of the tree can be rendered through a 3D engine, and the 3D picture to be rendered is obtained.
As an alternative embodiment, the JavaScript rendering framework includes: js framework.
By adopting the embodiment of the invention, through the three-dimensional (three-dimensional) JavaScript rendering frame, 3D rendering materials can be enriched, and different requirements for rendering 3D pictures can be met.
It should be noted that JavaScript is an transliterated script language, is a dynamic type, weak type, prototype-based language, and a built-in support type, has been widely used in Web application development, and is commonly used as a Web page to add various dynamic functions, thereby providing a smoother and more beautiful browsing effect for users.
Js is a 3D engine running in a browser, is a WebGL third-party library written by JavaScript, and can be used for creating various three-dimensional scenes including various objects such as a camera, light shadow, and material.
The invention also provides a preferred embodiment, which provides an intelligent three-dimensional visual interaction multi-user website page experience game and communication optimization interaction scheme.
The invention provides a 3D multi-user interactive network based on technologies such as HTML5, WebGL, three.js, WebSocket, NodeJS and the like; the game also greatly optimizes the performance and experience of the game in the aspects of graphic drawing, media playing, message transmission, real-time interaction and scene simulation experience.
Fig. 3 is a schematic diagram of a system framework for optional intelligent three-dimensional visual interaction multi-user website page experience game and communication optimization according to an embodiment of the present invention, and as shown in fig. 3, a client program performs 3D rendering through thread. The server program establishes message communication with the client program through WebSocket, establishes service through NodeJS and accesses the database through MySQL.
It should be noted that the Cascading Style Sheet (CSS), which is called a Cascading Style Sheets throughout english, is a computer language for representing documents such as HTML and XML, and is used to statically modify a web page and dynamically format elements of the web page in cooperation with various scripting languages.
It should be noted that nodjs is a platform established based on Chrome JavaScript runtime, is used for conveniently establishing a network application with a fast response speed and easy expansion, and is suitable for running a real-time application with intensive data on a distributed device.
It should be noted that MySQL is a relational database management system, and stores data in different tables, thereby increasing the speed of data management and improving the flexibility of data.
According to the embodiment of the invention, the system takes the Canvas element as the content bearer to construct as an interface layer (UI layer), renders the game picture based on WebGL, and performs server side response based on NodeJS.
It should be noted that, in the new HTML standard HTML5, the Canvas element is used to draw graphics on the web page, and the graphics operation can be directly performed on the HTML through the Canvas element.
It should be noted that, the Interface layer (UI layer) is called User Interface layer in english, and is located at the outermost layer for displaying data and receiving data input by a User.
FIG. 4 is a schematic diagram of the overall logic of an alternative program according to an embodiment of the present invention, such as the login interface, the lobby interface, the room interface, the load interface, and the game interface shown in FIG. 4, according to the interface where the player is located.
On the client side, after entering the client, the client sends a request for accessing the server, receives a page sent back by the server and enters a login interface; the client receives the login information filled by the player on a login interface, sends the login information to the server, receives an interface jump command returned by the server, and jumps to a hall interface; the client receives the room information of 'joining a room' and 'creating a room' selected by a user on a hall interface, sends the room information to the server, and then receives an interface jump command returned by the server to jump to a loading interface loading game; after the client finishes game loading on the loading interface, receiving a model information interface skip command sent by the server, entering a game and displaying a game interface; in the game process, two-way message communication is established between the client and the server, the instruction for ending the game is sent by the server after the game is ended, options for continuing the game and quitting the program are displayed for the user, and if the client receives the option for continuing the game, a room interface is returned; and if the client receives the option of exiting the program, sending a command of disconnecting the message to the server.
And starting a program on the server side, processing client access under the condition of receiving a request for accessing the server, sending a page back to the client, and then respectively processing each client, taking the client 1 as an example, after receiving login information sent by the client, the server returns an interface skip command to the client, sends the login information to a database through a verification login program, then creates a player object, receives player information returned by the database in the process of creating the player team image, and enters the process of distributing rooms. The server can receive the room information sent by the client in the process of distributing the rooms, returns an interface jump command to the client, and then creates a new game. In the process that the server creates a new game, the server sends a model information interface jump command to the client, then the server creates a message loop in a room, receives an instruction of entering the game sent by the client, returns the interface jump command to the client and starts the game. In the game process, the server enters the process of processing the game event in the room, establishes two-way message communication with the client in the process of processing the game event in the room, then sends win and lose information after finishing the game, and sends an instruction for finishing the game to the client. After the game is finished, if the server receives the disconnection information, processing a player quitting instruction, and sending the player information to a database; if the disconnection information is not received, the game is prepared for the next game and the process of distributing the rooms is returned.
And starting the service at the database side, verifying login reading information after receiving the login information, returning player information, and updating the player information after verifying the login reading information and receiving player information generated after processing the quit of the player.
On the client side, in the process of opening the client to enter the login interface, the client sends an access request to the server and receives a page returned by the server, and then the client enters the login interface.
Fig. 5 is a schematic diagram of an optional loading initialization optimization according to an embodiment of the present invention, as shown in fig. 5, when loading is performed for the first time, game information is obtained to prepare for loading a model, then required model names are obtained from the game information, then required model names are searched in a local model list, and a model object is created under the condition that a model is found; loading the model under the condition that the model is not found, saving the model into a local model list, and then creating a model object; and executing the process of reloading after the model object is established no matter whether the model is found or not, and returning to the starting step in the process of first loading.
Js, building and drawing a 3D interactive game interface.
Js creates scene, renderer, camera principles, from which models can be from Blender, Maya, Chinema4D, 3DMax or created manually by themselves, creating experience perspectives.
It should be noted that the blend is an open-source cross-platform all-around three-dimensional animation software, and provides a series of short animation production solutions from modeling, animation, material, rendering, audio processing, video clipping and the like.
It should be noted that Maya is a three-dimensional animation software.
Note that Chinema4D is a 3D presentation software.
It should be noted that 3D Max is called 3D Studio Max in english, and is a three-dimensional animation rendering and producing software.
FIG. 6 is a schematic diagram of an alternative 3D interactive game interface according to an embodiment of the present invention, as shown in FIG. 6, where a front clipping plane, a viewing frustum, and a back clipping plane are captured by a camera.
And secondly, establishing user behavior monitoring such as user shaking the mobile phone, mobile phone direction change, mouse change and the like by using a Device Motion interface (JavaScript Device Motion Api) and a mouse event Api, and communicating game rendering picture data established by three.
Fig. 7 is a schematic diagram of an alternative mobile phone motion coordinate system according to an embodiment of the present invention, as shown in fig. 7, a direction perpendicular to a plane of the mobile phone is taken as a Z-axis of the coordinate system, where an upward direction of the perpendicular plane is a positive direction of the Z-axis; and establishing an X axis and a Y axis in a direction parallel to the plane of the mobile phone, wherein the positive direction of the X axis points to the direction of a receiver of the mobile phone from the center of the screen, and the positive direction of the Y axis is vertical to the Y axis and is parallel to the screen.
And thirdly, constructing an audio interaction module by using an HTML5Video interface (HTML5Video Api), and constructing and adjusting a user scene change appearance style and a technical style by using a CSS.
In this embodiment, the network Audio interface (Web Audio Api) can control Audio required in the game, and can provide a complete interface with a play function, and the network Audio interface (Web Audio Api) is controlled according to the logic JS of the game interface, so that a better game interaction experience can be obtained. The base style and appearance interaction transformation is optimized using CSS.
And fourthly, establishing real-time communication back-end and front-end series data based on NodeJS and WebSocket.
In this embodiment, the WebSocket library socket.io is used to implement the two-way communication between the browser and the server, and NodeJS is used as the backend data communication language of the server and is connected in series with the front end response data interface.
It should be noted that socket.io is used for realizing real-time communication between the browser and the nodjs.
In the embodiment, the server program monitors through the port, establishes service for the game player, accesses the database verification information in sequence to establish port (Socket) connection, and controls the behavior of the game player through logic in the game process.
It should be noted that two programs on the network implement data exchange through a bidirectional communication connection, and one end of the exchange is called a Socket.
Fig. 8 is a schematic diagram of an alternative system flow according to an embodiment of the present invention, as shown in fig. 8, in the process of logging in the game, in the case of logging in, a plurality of players (for example, player 1, player 2, player 3, and player 4) are connected through a port (Socket), and then the plurality of players are allocated to a room or Group (Group), and the players in the room or Group (Group) play the game together, and then perform data logic processing, and then output feedback respectively.
Fig. 9 is a schematic diagram of an alternative polling connection between a CLIENT and a SERVER according to an embodiment of the present invention, such as the bidirectional communication between a CLIENT (CLIENT) and a SERVER (SERVER) shown in fig. 9.
Fig. 10 is a schematic diagram of an optional long connection of multiple CLIENTs and a SERVER according to an embodiment of the present invention, and as shown in fig. 10, a communication relationship between multiple CLIENTs (CLIENT) and a SERVER (SERVER).
By adopting the embodiment of the invention, the 3D model can be constructed and the scene mode can be optimized through the camera model view angle of three.
By adopting the embodiment of the invention, the communication interface with the game front end can be established through Socket, and the feedback strength and performance of the user behavior can be increased in a real-time response mode.
By adopting the embodiment of the invention, the game experience of communication and interaction between the back end and the front end can be established through the interface (Device motion Api) of the Device motion.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. 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 by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to an embodiment of the present invention, there is also provided a game data transmission apparatus for implementing the above-described 3D game data transmission method. Fig. 11 is a schematic diagram of an alternative 3D game data transmission apparatus according to an embodiment of the present invention, and as shown in fig. 11, the apparatus may include: an obtaining unit 1101 configured to obtain, on a client of a game application, an operation instruction indicating that a game of the game application is executed on the client, the client of the game application including: a client of a web page 3D game application; a response unit 1103, configured to, in response to the operation instruction, establish a long connection between the client and the server of the game application; the transmission unit 1105 is configured to transmit game data in one game between the client and the server via the long connection during one game.
It should be noted that the obtaining unit 1101 in this embodiment may be configured to execute step S202 in this embodiment of the application method, the responding unit 1103 in this embodiment may be configured to execute step S204 in this embodiment of the application method, and the transmitting unit 1105 in this embodiment may be configured to execute step S206 in this embodiment of the application method.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above method embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
As an alternative embodiment, as shown in fig. 12, the transmission unit 1105 includes: a transmission module 11051, configured to establish a long connection based on the WebSocket protocol between the client and the server of the game application.
As an alternative embodiment, the apparatus may further comprise: and the rendering unit is used for rendering a 3D picture required in one game on the client through a running 3D engine after the client of the game application acquires the operation instruction and before the transmission of the game data in the one game is carried out between the client and the server through long connection, wherein the 3D engine adopts a JavaScript rendering frame.
As an alternative embodiment, the rendering unit may include: the searching module is used for searching a 3D model required by rendering a 3D picture on the client; the first establishing module is used for loading the 3D model in the client under the condition that the 3D model is not found, and establishing a model object in the 3D model; the second establishing module is used for establishing the model object in the 3D model under the condition that the 3D model is found; and the rendering module is used for rendering the 3D model and the model object through the 3D engine.
As an alternative embodiment, the JavaScript rendering framework includes: js framework.
As an alternative embodiment, the client of the game application comprises: a client of a web-based 3D gaming application.
As an alternative embodiment, the client of the web page 3D game application comprises: a web page client in the mobile terminal, or a PC web page client.
Through the above-described modules, the transmission of 3D game data can acquire, on a client of a game application (e.g., a web page 3D game application), an operation instruction for instructing a game play of the game application to be executed on the client, and then in response to the operation instruction, a long connection is established between the client and the server of the game application, and during the course of running a game, by transmitting the game data in one game between the client and the server through the long connection, and the request is sent to the server in a polling mode during each game, so that the number of the requests needing to be processed by the server is reduced, the number of the games borne by the server is enhanced, the technical problem that the carrying capacity of the terminal and the server connected in a polling mode in the related technology is poor can be solved, and the technical effect of enhancing the carrying capacity of the server is achieved.
According to an embodiment of the present invention, there is also provided a terminal for implementing the transmission method of 3D game data described above.
Fig. 13 is a block diagram of a terminal according to an embodiment of the present invention, and as shown in fig. 13, the terminal may include: one or more processors 201 (only one of which is shown), a memory 203, and a transmission means 205, as shown in fig. 13, the terminal may further include an input/output device 207.
The memory 203 may be used to store software programs and modules, such as program instructions/modules corresponding to the transmission method and apparatus of game data in the embodiment of the present invention, and the processor 201 executes various functional applications and data processing by running the software programs and modules stored in the memory 203, that is, implements the transmission method of 3D game data. The memory 203 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 203 may further include memory located remotely from the processor 201, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 205 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 205 includes a network adapter (NIC) that can be connected to a router via a network cable and other network devices to communicate with the internet or a local area network. In one example, the transmission device 205 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Wherein the memory 203 is specifically used for storing application programs.
The processor 201 may call an application stored in the memory 203 to perform the following steps: obtaining an operation instruction on a client of a game application, wherein the operation instruction is used for indicating a game of a game running on the client, and the client of the game application comprises: a client of a web page 3D game application; responding to the operation instruction, and establishing long connection between the client and a server of the game application; during the process of running one game, the transmission of game data in one game is carried out between the client and the server through the long connection.
The processor 201 is further configured to perform the following steps: a long connection based on the WebSocket protocol is established between the client and the server of the game application.
The processor 201 is further configured to perform the following steps: and rendering the 3D picture required in one game on the client through a running 3D engine, wherein the 3D engine adopts a JavaScript rendering framework.
The processor 201 is further configured to perform the following steps: searching a 3D model required for rendering a 3D picture on a client; loading the 3D model in the client under the condition that the 3D model is not found, and creating a model object in the 3D model; under the condition that the 3D model is found, a model object in the 3D model is established; the 3D model and model objects are rendered by a 3D engine.
The processor 201 is further configured to perform the following steps: the JavaScript rendering framework comprises: js framework.
The processor 201 is further configured to perform the following steps: the client of the game application comprises: a client of a web-based 3D gaming application.
The processor 201 is further configured to perform the following steps: the client of the webpage 3D game application comprises: a web page client in the mobile terminal, or a PC web page client.
The embodiment of the invention provides a transmission scheme of 3D game data. The transmission of the 3D game data can obtain an operation instruction for instructing a game in one session running on a client of a game application (e.g., a web page 3D game application), then, in response to the operation instruction, establish a long connection between the client and a server of the game application, and in the process of running the game in one session, perform transmission of game data in the game in one session between the client and the server through the long connection without sending a request to the server in a polling manner during each game session, thereby reducing the number of requests that the server needs to process, enhancing the number of games borne by the server, and solving the technical problem of poor bearing capacity of the server connected by the terminal and the server in a polling manner in the related art, thereby achieving the technical effect of enhancing the bearing capacity of the server.
Optionally, the specific examples in this embodiment may refer to the examples described in the method embodiment and the apparatus embodiment described above, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 13 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 13 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 13, or have a different configuration than shown in FIG. 13.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The embodiment of the invention also provides a storage medium. Alternatively, in the present embodiment, the storage medium may be used for a program code for executing a transmission method of 3D game data.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, obtaining an operation instruction on a client of the game application, wherein the operation instruction is used for instructing a game of the game application to run on the client, and the client of the game application includes: a client of a web page 3D game application;
s2, responding to the operation instruction, and establishing long connection between the client and the server of the game application;
s3, during one game, the transmission of the game data in one game is performed between the client and the server via the long connection.
Optionally, the storage medium is further arranged to store program code for performing the steps of: a long connection based on the WebSocket protocol is established between the client and the server of the game application.
Optionally, the storage medium is further arranged to store program code for performing the steps of: and rendering the 3D picture required in one game on the client through a running 3D engine, wherein the 3D engine adopts a JavaScript rendering framework.
Optionally, the storage medium is further arranged to store program code for performing the steps of: searching a 3D model required for rendering a 3D picture on a client; loading the 3D model in the client under the condition that the 3D model is not found, and creating a model object in the 3D model; under the condition that the 3D model is found, a model object in the 3D model is established; the 3D model and model objects are rendered by a 3D engine.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the JavaScript rendering framework comprises: js framework.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the client of the game application comprises: a client of a web-based 3D gaming application.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the client of the webpage 3D game application comprises: a web page client in the mobile terminal, or a PC web page client.
Optionally, the specific examples in this embodiment may refer to the examples described in the method embodiment and the apparatus embodiment described above, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, 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.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (14)

1. A method for transmitting 3D game data, comprising:
obtaining an operation instruction on a client of a game application, wherein the operation instruction is used for indicating a game play of the game application running on the client, and the client of the game application comprises: a client of a web page 3D game application;
responding to the operation instruction, and establishing long connection between the client and the server of the game application, wherein the server of the game application carries out server side response based on NodeJS;
during the process of running the game, transmitting the game data in the game play between the client and the server through the long connection, wherein the transmitting the game data in the game play between the client and the server through the long connection comprises: io and the NodeJS are used for real-time communication between the browser module and the NodeJS, and the client comprises the browser module.
2. The method of claim 1, wherein establishing the long connection between the client and the server of the gaming application comprises:
and establishing a long connection based on a WebSocket protocol between the client and the server of the game application.
3. The method of claim 1, after obtaining the operation instruction on the client of the game application and before the transmission of the game data in the game play between the client and the server through the long connection, further comprising:
and rendering a 3D picture required in the one-game on the client through a running 3D engine, wherein the 3D engine adopts a JavaScript rendering frame.
4. The method of claim 3, wherein rendering, on the client, a 3D picture required in the one game by a running 3D engine comprises:
searching a 3D model required for rendering the 3D picture on the client;
loading the 3D model in the client side and creating a model object in the 3D model under the condition that the 3D model is not found;
under the condition that the 3D model is found, creating a model object in the 3D model;
rendering, by the 3D engine, the 3D model and the model objects.
5. The method of claim 3, wherein the JavaScript rendering framework comprises: js framework.
6. The method of claim 1, wherein the client of the web page 3D game application comprises: a web page client in the mobile terminal, or a PC web page client.
7. A transmission apparatus of 3D game data, comprising:
an obtaining unit, configured to obtain an operation instruction on a client of a game application, where the operation instruction is used to instruct a game play of the game application to run on the client, and the client of the game application includes: a client of a web page 3D game application;
the response unit is used for responding to the operation instruction and establishing long connection between the client and the server of the game application, wherein the server of the game application carries out server side response based on NodeJS;
a transmission unit, configured to perform transmission of game data in the one game between the client and the server through the long connection during running of the one game, where the transmission of game data in the one game between the client and the server through the long connection includes: io and the NodeJS are used for real-time communication between the browser module and the NodeJS, and the client comprises the browser module.
8. The apparatus of claim 7, wherein the transmission unit comprises:
and the transmission module is used for establishing long connection based on a WebSocket protocol between the client and the server of the game application.
9. The apparatus of claim 7, further comprising:
and the rendering unit is used for rendering a 3D picture required in the game in one game on the client through a running 3D engine after an operation instruction is obtained on the client of the game application and before the game data in the game in one game is transmitted between the client and the server through the long connection, wherein the 3D engine adopts a JavaScript rendering frame.
10. The apparatus of claim 9, wherein the rendering unit comprises:
the searching module is used for searching a 3D model required by rendering the 3D picture on the client;
a first creating module, configured to load the 3D model in the client and create a model object in the 3D model if the 3D model is not found;
the second establishing module is used for establishing the model object in the 3D model under the condition that the 3D model is found;
a rendering module to render the 3D model and the model object through the 3D engine.
11. The apparatus of claim 9, wherein the JavaScript rendering framework comprises: js framework.
12. The apparatus of claim 7, wherein the client of the web page 3D game application comprises: a web page client in the mobile terminal, or a PC web page client.
13. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any one of claims 1 to 6.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any one of claims 1 to 6 by means of the computer program.
CN201710678365.3A 2017-08-10 2017-08-10 3D game data transmission method and device, storage medium and electronic device Active CN107566346B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710678365.3A CN107566346B (en) 2017-08-10 2017-08-10 3D game data transmission method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710678365.3A CN107566346B (en) 2017-08-10 2017-08-10 3D game data transmission method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN107566346A CN107566346A (en) 2018-01-09
CN107566346B true CN107566346B (en) 2020-08-11

Family

ID=60975138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710678365.3A Active CN107566346B (en) 2017-08-10 2017-08-10 3D game data transmission method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN107566346B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110227259B (en) * 2018-03-06 2022-04-29 华为技术有限公司 Data processing method, device, server and system
CN109011569A (en) * 2018-07-06 2018-12-18 佛山市灏金赢科技有限公司 A kind of data transmission method and data transmission device
CN110071925B (en) * 2019-04-25 2021-01-15 腾讯科技(深圳)有限公司 Data transmission method and corresponding server and computer readable storage medium
CN110134894A (en) * 2019-04-28 2019-08-16 陕西六道网络科技有限公司 Multiple terminals type variable exchange method and system based on browser d engine and Websocket
CN110711385A (en) * 2019-10-23 2020-01-21 北京达佳互联信息技术有限公司 Game online interaction method and device, electronic equipment and storage medium
CN116510285A (en) * 2023-05-08 2023-08-01 北京畅游天下网络技术集团有限公司 Game performance data acquisition method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470773A (en) * 2007-12-25 2009-07-01 山东易通商业经纪有限公司 Method for implementing web page game system based on WEB browser
CN103425491A (en) * 2013-07-30 2013-12-04 广州市动景计算机科技有限公司 Game engine
CN104602031A (en) * 2015-02-12 2015-05-06 腾讯科技(深圳)有限公司 Video data display method and server
WO2016070373A1 (en) * 2014-11-06 2016-05-12 北京安奇智联科技有限公司 Method for implementing synchronous preview display between mobile terminal and web terminal
CN106209857A (en) * 2016-07-14 2016-12-07 腾讯科技(深圳)有限公司 Data transmission method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470773A (en) * 2007-12-25 2009-07-01 山东易通商业经纪有限公司 Method for implementing web page game system based on WEB browser
CN103425491A (en) * 2013-07-30 2013-12-04 广州市动景计算机科技有限公司 Game engine
WO2016070373A1 (en) * 2014-11-06 2016-05-12 北京安奇智联科技有限公司 Method for implementing synchronous preview display between mobile terminal and web terminal
CN104602031A (en) * 2015-02-12 2015-05-06 腾讯科技(深圳)有限公司 Video data display method and server
CN106209857A (en) * 2016-07-14 2016-12-07 腾讯科技(深圳)有限公司 Data transmission method and device

Also Published As

Publication number Publication date
CN107566346A (en) 2018-01-09

Similar Documents

Publication Publication Date Title
CN107566346B (en) 3D game data transmission method and device, storage medium and electronic device
CN107632824B (en) A kind of generation method of augmented reality module, generating means and generate system
CN113209632B (en) Cloud game processing method, device, equipment and storage medium
CN112073754B (en) Cloud game screen projection method and device, computer equipment, computer readable storage medium and cloud game screen projection interaction system
US8517838B2 (en) Online game system and method of data resource handling for an online game
CN102323882A (en) Data processing device and method applied to Web3D
JP5411386B1 (en) Server and method for providing game
CN103747074B (en) mobile monitoring system based on Web server
JP2022553996A (en) Video playback method, device, equipment and computer program
CN114007143A (en) Information interaction method, device and equipment, computer storage medium and program product
WO2024037110A1 (en) Data processing method and apparatus, device, and medium
CN103313120A (en) Method, mobile terminal, cloud terminal and system for displaying frame
JP5411385B1 (en) Server and method for providing game
CN113365111A (en) Interaction method and device based on live broadcast
CN112911320A (en) Live broadcast method and device, computer equipment and storage medium
CN114173173A (en) Barrage information display method and device, storage medium and electronic equipment
US9088631B2 (en) Game streaming system and method of supporting the multiuser and multiplatform
JP7301453B2 (en) IMAGE PROCESSING METHOD, IMAGE PROCESSING APPARATUS, COMPUTER PROGRAM, AND ELECTRONIC DEVICE
CN115040866A (en) Cloud game image processing method, device, equipment and computer readable storage medium
CN117311708B (en) Dynamic modification method and device for resource display page in 3D scene of webpage end
JP5504370B1 (en) Server and method for displaying video on client terminal
WO2024037139A1 (en) Method and apparatus for prompting information in virtual scene, electronic device, storage medium, and program product
CN115120964A (en) Stand-alone cloud game player interaction method and system and electronic equipment
CN118018703A (en) Method, apparatus and storage medium for performing streaming processing on stereoscopic mode
JP2015088156A (en) Server and method for displaying video image on client terminal

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