CN109347916B - Game interaction method and device and computer readable storage medium - Google Patents

Game interaction method and device and computer readable storage medium Download PDF

Info

Publication number
CN109347916B
CN109347916B CN201811074484.9A CN201811074484A CN109347916B CN 109347916 B CN109347916 B CN 109347916B CN 201811074484 A CN201811074484 A CN 201811074484A CN 109347916 B CN109347916 B CN 109347916B
Authority
CN
China
Prior art keywords
game
interface
interaction
request
platform
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
CN201811074484.9A
Other languages
Chinese (zh)
Other versions
CN109347916A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201811074484.9A priority Critical patent/CN109347916B/en
Publication of CN109347916A publication Critical patent/CN109347916A/en
Application granted granted Critical
Publication of CN109347916B publication Critical patent/CN109347916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/131Protocols for games, networked simulations or virtual reality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The disclosure relates to a game interaction method, a game interaction device and a computer readable storage medium, and belongs to the technical field of games. The method comprises the following steps: responding to an interactive request generated in the running process of the web game, determining an interface corresponding to the interactive request, wherein the interface is integrated in a game platform in the terminal equipment and is used for identifying a method for processing the interactive request; and processing the interactive request by calling the method identified by the interface through the interface. The interactive request generated by the web game calls the interface of the game platform, and then calls the method capable of realizing the interactive request, and the method is not required to be directly called by the game, so that different versions of games do not need to be developed for different game platforms, and the game development cost is greatly reduced. In addition, in the game interaction process, the game interacts with the server by calling the interface of the game platform, and compared with the process of directly interacting with the server through the game, the process increases the concealment of game data and has higher safety degree.

Description

Game interaction method and device and computer readable storage medium
Technical Field
The present disclosure relates to the field of game technologies, and in particular, to a game interaction method and apparatus, and a computer-readable storage medium.
Background
With the development of the mobile terminal industry, the functions of the mobile terminal become stronger, and a Web game which can be opened at any time without installation, such as a HyperText Markup Language standard latest version (H5) game, is gradually emerging.
Web games are typically downloaded and loaded through the game platform. When playing a webpage game, the terminal equipment receives a downloading instruction sent by a user on an interface of a game platform; the terminal equipment sends a game resource downloading request to the server through the game platform; the server sends the corresponding game resources to the terminal equipment, and the terminal equipment receives the game resources sent by the server; the terminal equipment loads game resources, starts a web game and then carries out information interaction with the server through the web game.
Because some functions of the web game need to be realized (for example, user information is acquired) by calling a method of a game platform, and different versions of the game platform exist, for example, an apple mobile operating system (iPhone OS, IOS) game platform, an android game platform, a fast application game platform, a web game platform, and the like, in order to ensure that the web game can call methods in different game platforms, developers need to develop different versions of web games matched with the respective game platforms when developing the web games, which causes a large amount of engineering for game development and time and labor consumption. In addition, in the game interaction process, because the game data are sent to the server by the terminal equipment through the webpage game, the game data can be found only by tracking the webpage game, so that not only can the user tamper the game data through software to realize cheating, but also the data are easy to steal, and the data interaction safety is poor.
Disclosure of Invention
The present disclosure provides a game interaction method, device and computer-readable storage medium to reduce the workload of game development and improve the security of game data interaction.
According to a first aspect of embodiments of the present disclosure, there is provided a game interaction method, the method comprising: responding to an interaction request generated in the running process of a web game, and determining an interface corresponding to the interaction request, wherein the interface is integrated in a game platform in terminal equipment and is used for identifying a method for processing the interaction request; and calling the method identified by the interface through the interface to process the interactive request.
In the embodiment of the disclosure, the interaction request generated by the web game calls the interface of the game platform, and then calls the method capable of realizing the interaction request, and the method does not need to be directly called by the game, so that for different game platforms, games of different versions do not need to be respectively developed, but the method calling is realized through the interface designed in each game platform, the interface in the game platform shields the differentiation of the method of each game platform, and the game development cost is greatly reduced. In addition, in the game interaction process, the game interacts with the server by calling the interface of the game platform, and the data originally sent by the game is processed by the called method through the calling, so that the process increases the concealment of the game data and has higher safety degree compared with the process of directly interacting with the server through the game.
In one implementation manner of the present disclosure, the determining, in response to an interaction request generated during a running process of a webgame, an interface corresponding to the interaction request includes: determining an interface of a game platform in the terminal equipment corresponding to the interaction request according to the corresponding relation between the interaction request and the interface; and calling an interface of a game platform in the terminal equipment corresponding to the interaction request.
In the implementation mode, the corresponding relation between the interactive request and the interface is well defined in the software development kit, so that the calling process can be completed by directly writing the corresponding relation in the web game or the game platform. For example, the corresponding relationship between the interaction request and the interface is defined in the game platform, so when the interaction request is generated, the terminal device only needs to determine the interface corresponding to the interaction request according to the corresponding relationship between the interaction request and the interface defined in the game platform, and then processes the interaction request through the interface calling method. For example, when a user information acquisition request is generated, the terminal device calls a user information acquisition interface in the game platform according to the corresponding relationship to perform processing.
In an implementation manner of the present disclosure, the invoking, by the interface, the method identified by the interface to process the interaction request includes: determining a method defined in the interface; and calling a method defined in the interface to process the interactive request.
In the implementation mode, a method to be executed is defined in the interface, and the method is a method in the game platform or a local method, and the calling process can be completed by calling the method defined in the interface.
In one implementation of the present disclosure, the method further comprises: when the webpage game is started, the unreleased connection is adopted to carry out information interaction with the server, and the unreleased connection is the connection established between the closed webpage game and the server when the webpage game runs.
Generally, each time a user starts a web game, the user needs to establish a connection with the server once, and the starting speed of the game is slow. In the implementation mode, the connection which is not released can be adopted to connect the server, so that the starting speed is greatly accelerated.
In one implementation of the present disclosure, the method further comprises: and when the webpage game is finished or the background runs, carrying out notification reminding on the notification bar.
In the implementation mode, the prompt is carried out through the notification bar message, so that the user can further know the game running state.
In one implementation of the present disclosure, the interface includes a game information sending interface, a user information obtaining interface, an advertisement obtaining interface, an audio playing interface, and a vibration interface.
By defining the interface, various interactive requests in the game running process can be met.
In one implementation manner of the present disclosure, the game platform is a fast application game platform, an apple mobile operating system game platform, an android game platform, or a web game platform.
In this implementation, four mainstream web game platforms are listed, so that a version of game developed by a developer can access the four game platforms at the same time.
In one implementation of the present disclosure, the interface is a JavaScript interface.
In the implementation mode, since the game platforms such as the fast application, android and apple are compiled by adopting JAVA language, and the webpage game platform is compiled by adopting Html language, the JS language development interface is adopted, and the fast application, android and apple can be simultaneously applied to the platforms.
According to a second aspect of an embodiment of the present disclosure, there is provided a game interaction apparatus, the apparatus comprising: the system comprises a determining unit, a processing unit and a processing unit, wherein the determining unit is used for responding to an interaction request generated in the running process of a web game, determining an interface corresponding to the interaction request, the interface is integrated in a game platform in terminal equipment, and the interface is used for identifying a method for processing the interaction request; and the processing unit is used for calling the method identified by the interface through the interface to process the interactive request.
In an implementation manner of the present disclosure, the determining unit is configured to determine, according to a correspondence between an interaction request and an interface, an interface of a game platform in the terminal device corresponding to the interaction request; and calling an interface of a game platform in the terminal equipment corresponding to the interaction request.
In one implementation of the present disclosure, the processing unit is configured to determine a method defined in the interface; and calling a method defined in the interface to process the interactive request.
In one implementation of the present disclosure, the apparatus further includes: and the communication unit is used for performing information interaction with the server by adopting unreleased connection when the webpage game is started, wherein the unreleased connection is the connection established with the server when the closed webpage game runs.
In an implementation manner of the present disclosure, the processing unit is further configured to perform notification reminding in a notification bar when the web game is ended or running in a background.
In one implementation of the present disclosure, the interface includes a game information sending interface, a user information obtaining interface, an advertisement obtaining interface, an audio playing interface, and a vibration interface.
In one implementation manner of the present disclosure, the game platform is a fast application game platform, an apple mobile operating system game platform, an android game platform, or a web game platform.
In one implementation of the present disclosure, the interface is a JavaScript interface.
According to a third aspect of the embodiments of the present disclosure, there is provided a game interaction apparatus, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: responding to an interaction request generated in the running process of a web game, and determining an interface corresponding to the interaction request, wherein the interface is integrated in a game platform in terminal equipment and is used for identifying a method for processing the interaction request; and calling the method identified by the interface through the interface to process the interactive request.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of a game interaction device, enable the game interaction device to perform the game interaction method according to the first aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a system diagram of a game interaction provided by an embodiment of the present disclosure;
FIG. 2 is a flow diagram illustrating a method of game interaction in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of game interaction in accordance with an exemplary embodiment;
FIG. 4 is an interface schematic diagram illustrating a gaming platform according to an exemplary embodiment;
FIG. 5 is a schematic diagram illustrating the structure of a game interaction device, according to an exemplary embodiment;
FIG. 6 is a block diagram illustrating a game interaction device, according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In order to facilitate understanding of the technical solutions provided by the embodiments of the present disclosure, the following description will first describe a game platform technology:
fig. 1 is a schematic diagram of a game platform system provided in an embodiment of the present disclosure. Referring to fig. 1, the system includes a terminal device 10, including but not limited to a computer device or a mobile terminal, and a server 20. The terminal device 10 is provided with a game platform on which various web games are displayed, and is a game entrance for a player.
Because some functions of the web game need to be realized by calling a method of a game platform (for example, user information is acquired), and different versions of the game platform exist, such as an IOS game platform, an android game platform, a fast application game platform, a web game platform, and the like, in order to ensure that the web game can call methods in different game platforms, developers need to develop web games of different versions matched with the game platforms when developing the web game, which causes a large amount of game development engineering and time and labor consumption.
When playing a web game, the terminal device 10 receives a download instruction issued by a user on an interface of a game platform; the terminal device 10 sends a game resource downloading request to the server 20 through the game platform; the server 20 sends the corresponding game resource to the terminal device 10, and the terminal device 10 receives the game resource sent by the server 20; the terminal device 10 loads game resources, starts a web game, and then performs information interaction with the server 20 through the web game.
In the game interaction process, since the game data is directly sent to the server 20 by the terminal device through the web game, the game data can be found only by tracking the web game, so that not only can the user tamper the game data through software to implement cheating, but also the data is easy to steal, resulting in poor data interaction security.
The embodiment of the disclosure provides a game interaction method, a game interaction device and a computer-readable storage medium, which can reduce the game development engineering quantity and enhance the security of game data interaction, and are detailed in the following embodiments.
FIG. 2 is a flow diagram illustrating a game interaction method according to an exemplary embodiment. The method can be executed by a terminal device, and referring to fig. 2, the game interaction method comprises the following steps:
in step S11, in response to an interaction request generated during the operation of the web game, an interface corresponding to the interaction request is determined, the interface is integrated in a game platform in the terminal device, and the interface is used for identifying a method for processing the interaction request.
In the disclosed embodiment, the web game is a game that is run through a browser or web view (WebView). For example, may be an H5 game.
The interactive request comprises a game information sending request, a user information obtaining request, an advertisement obtaining request, an audio playing request, a vibration request and the like.
The game information sending request can include a game starting information sending request, a game ending information sending request, a game error information sending request, a game point information sending request, a game real-time information sending request and the like, wherein the game starting information sending request is used for sending game starting information, the game ending information sending request is used for sending game ending information, the game error information sending request is used for sending game error information, the game point information sending request is used for sending game points, and the game real-time information sending request is used for sending real-time information in a game process. The user information acquisition request is used for acquiring user information of a user currently logged in by the game platform from the game platform for use in the game. The advertisement acquisition request is used for acquiring an advertisement resource loaded in the game from the server. The audio playing request is used for requesting the terminal equipment to play audio. The vibration request is used for requesting the terminal equipment to vibrate.
In the disclosed embodiment, the game platform is used for displaying various web games and is an entrance for a player to play the game. The game platform can be a fast application game platform, an IOS game platform, an android game platform or a webpage game platform.
In the embodiment of the disclosure, the interface may be a JavaScript (JS) interface, and since game platforms such as fast application, android, IOS, and the like can support JavaScript and Html compiling and running, and the web game is compiled by Html and JavaScript languages, the JS language development interface is adopted, and can be simultaneously applied to each platform. In the game Development process, a developer uses a JS Software Development Kit (SDK) provided by a game platform developer to develop, and the JSSDK defines a corresponding relationship between an interaction request and an interface of a game platform. Correspondingly, the interface defined in the JSSDK is integrated in the game platform, and the corresponding relationship between the interaction request and the interface of the game platform is set in the game or the game platform, so that the interaction request generated during the running of the game can call the interface in the game platform for processing, and the terminal device can execute the steps. The correspondence between the interaction request and the interface of the game platform is preferably set in the game platform, thereby reducing the workload of game development.
The interface may include a game information sending interface, and the interface may specifically include a game start information sending interface (game _ start), a game end information sending interface (game _ end), a game error information sending interface (game _ error), a game credit information sending interface (game _ goal), a game real-time information sending interface (available for real-time fighting), and the like. The interfaces may also include a user information acquisition interface (get _ userinfo), an advertisement acquisition interface (game _ show _ ad), an audio playback interface, a vibration interface, and the like. The interface corresponds to the previous interactive request, for example, the game information sending interface corresponds to a game information sending request, the user information obtaining interface corresponds to a user information obtaining request, the advertisement obtaining interface corresponds to an advertisement obtaining request, the audio playing interface corresponds to an audio playing request, and the vibration interface corresponds to a vibration request.
In different game platforms, the corresponding relation between the interaction request and the interface is the same, and the setting of the interface in different game platforms is also the same, so that the difference between the game platforms is shielded, the difference of the method between different game platforms is shielded, and the game of the same version can be accessed into different game platforms.
In the disclosed embodiments, a method may refer to a JAVA method, which is a collection of statements used to collectively perform a function. In the embodiment of the present disclosure, the methods called by the interface include two types, one is a service method, which is provided by the game platform and is used to implement the related services of the game, such as a game information sending method, a user information obtaining method, an advertisement obtaining method, and the like, and the other is a system local (Native) method, which is provided by the system of the terminal device and is used to implement the system services of the terminal device, such as an audio playing method, a vibration method, and the like.
In step S12, the interactive request is processed through the method identified by the interface call interface.
In the embodiment of the present disclosure, since the interaction request and the interface are correspondingly set, and a corresponding method is defined in the interface, after the interface corresponding to the interaction request is determined, the defined method is called through the interface to execute the action requested by the interaction request, where the action includes, but is not limited to, sending game information, obtaining user information, sending an advertisement obtaining request, and the like.
For example, when the game information sending method is called, the terminal device sends game information to the server, so that the server can record the game duration and the credits of the user, or provide real-time fighting service for the game according to the real-time information provided by the game. When the user information acquisition method is called, the terminal device acquires the user information of the user currently logged in by the game platform from the game platform, so that the game can use the user information. When the advertisement acquisition method is called, the terminal equipment sends an advertisement acquisition request to the server, then receives the advertisement resource returned by the server, and finally loads the advertisement resource in the webpage game, thereby improving the commercial value of the game.
For another example, when the audio playing method is called, the terminal device controls the audio processing module to perform audio decoding, and then controls the speaker to perform audio playing. When the vibration method is called, the terminal equipment controls the vibrator to vibrate.
In the embodiment of the disclosure, the interaction request generated by the web game calls the interface of the game platform, and then calls the method capable of realizing the interaction request, and the method does not need to be directly called by the game, so that for different game platforms, games of different versions do not need to be respectively developed, but the method calling is realized through the interface designed in each game platform, the interface in the game platform shields the differentiation of the method of each game platform, and the game development cost is greatly reduced. In addition, in the game interaction process, the game interacts with the server by calling the interface of the game platform, and the data originally sent by the game is processed by the called method through the calling, so that the process increases the concealment of the game data and has higher safety degree compared with the process of directly interacting with the server through the game.
Optionally, determining, in response to an interaction request generated during the operation of the web game, an interface corresponding to the interaction request includes: determining an interface of a game platform in the terminal equipment corresponding to the interactive request according to the corresponding relation between the interactive request and the interface; and calling an interface of the game platform in the terminal equipment corresponding to the interactive request.
In the implementation mode, the corresponding relation between the interactive request and the interface is well defined in the JSSDK toolkit, so that the calling process can be completed by directly writing the corresponding relation in a webpage game or a game platform. For example, the corresponding relationship between the interaction request and the interface is defined in the game platform, so when the interaction request is generated, the terminal device only needs to determine the interface corresponding to the interaction request according to the corresponding relationship between the interaction request and the interface defined in the game platform, and then processes the interaction request through the interface calling method. For example, when a user information acquisition request is generated, the terminal device calls a user information acquisition interface in the game platform according to the corresponding relationship to perform processing.
The correspondence between the interactive request and the interface may be specifically represented by a correspondence between an identifier of the interactive request and an identifier of the interface, where the identifier of the interactive request may be a name, a number, and the like of the interactive request, and the identifier of the interface may be a name, a number, and the like of the interface. For example, the name of the user information acquisition interface is get _ userinfo, the name of the user information acquisition request is get _ userinfo, and the interaction request named get _ userinfo corresponds to the interface named get _ userinfo.
Optionally, the processing the interactive request by the method identified by the interface call interface includes: determining a method defined in the interface; and calling a method defined in the interface to process the interactive request.
In this implementation, the interface defines a method to be executed, and the method is a method in the game platform or a Native method, and the calling process can be completed by calling the method defined in the interface.
The method defined in the interface may be as follows: interface name { [ public ] [ static ] [ final ] constant; [ public ] [ abstrat ] method; }. Wherein, "[ public ] [ static ] [ final ] constant" is used to define a constant in the interface, and "[ public ] [ abstrat ] method" is used to define a method in the interface. Of course, this is only a simple example, and the interface definition may actually include more content.
Optionally, the method further comprises: when the webpage game is started, the unreleased connection is used for information interaction with the server, and the unreleased connection is the connection established between the closed webpage game and the server when running.
Generally, each time a user starts a web game, the user needs to establish a connection with the server once, and the starting speed of the game is slow. In the implementation mode, the connection which is not released can be adopted to connect the server, so that the starting speed is greatly accelerated.
Optionally, the method further comprises: and when the webpage game is finished or the background runs, carrying out notification reminding on the notification bar.
In the implementation mode, the prompt is carried out through the notification bar message, so that the user can further know the game running state.
It is noted that the foregoing steps S11-S12 and the foregoing optional steps may be combined arbitrarily.
FIG. 3 is a flow diagram illustrating a game interaction method according to an exemplary embodiment. The method is executed by the terminal device and the server together, referring to fig. 3, the game interaction method comprises the following steps:
in step S21, the terminal device receives a download instruction issued by the user on the interface of the game platform.
In the disclosed embodiment, the game platform is used for displaying various web games and is an entrance for a player to play the game. The game platform can be a fast application game platform, an IOS game platform, an android game platform or a webpage game platform. The web game is a game operated by a browser or WebView. For example, may be an H5 game.
The game platform is provided with display frames of all the web games and corresponding download buttons, and when the download buttons are clicked by a user, the terminal equipment receives a download instruction sent by the user, so that subsequent game downloading actions are carried out. FIG. 4 is an interface schematic diagram illustrating a gaming platform according to an exemplary embodiment. Referring to fig. 4, a display frame 210 of each webgame and a corresponding download button 220 are displayed on the interface of the game platform, and a user can download the game by clicking the download button 220.
In step S22, the terminal device transmits a game resource download request to the server via the game platform.
In the embodiment of the present disclosure, the server stores game resources of each game. After the game development is completed, the game developer submits the game resources to the game platform. The game resources are stored in the server by a developer of the game platform, the game is put on the game platform, and a download path is set, wherein the download path is consistent with the path of the game resources stored in the server. Because different game platforms correspond to the same version of games, the server only needs to store the game resources of one version, and therefore the storage resources of the server can be saved.
In the disclosed embodiment, the game resource download request includes an identification of the game that needs to be downloaded.
In the embodiment of the present disclosure, the server may be a server cluster, which can provide services for a large game platform, and the server cluster is implemented by technologies such as netty (JAVA open source framework), nginx (HTTP and reverse proxy service), zookeeper (distributed application coordination service), and redis (database).
In step S23, the server transmits the corresponding game resource to the terminal device. And the terminal equipment receives the game resources sent by the server.
After receiving a game resource downloading request sent by the terminal equipment, the server searches for the corresponding game resource according to the game identifier carried in the game resource downloading request, and then sends the game resource to the terminal equipment. And after receiving the game resources sent by the server, the terminal equipment stores the game resources to a game storage position of the terminal equipment, wherein the game storage position can be set in the game platform.
In step S24, the terminal device loads a game resource and starts a web game.
And after receiving the game resources sent by the server, the terminal equipment loads the game resources through the game platform and runs the webpage game. The webpage game loading process comprises the steps of loading a game home page, establishing connection with a server, loading a game main body, performing information interaction with the server and the like.
The process of establishing connection with the server can be realized by adopting the following modes: when the webpage game is started, the unreleased connection is used for information interaction with the server, and the unreleased connection is the connection established between the closed webpage game and the server when running. Generally, each time a user starts a web game, the user needs to establish a connection with the server once, and the starting speed of the game is slow. In the implementation mode, the connection which is not released can be adopted to connect the server, so that the starting speed is greatly accelerated.
For example, before the web game is started, the terminal device already establishes a connection with the server when running other web games, and does not release the connection for a while after the game is closed. Then the connection can be used to interact with the server when the subsequent web game is started. The certain time can be set in the game platform according to the requirement, for example, 30 minutes. Of course, the time may also be adjusted by the terminal device according to the current load level, for example, the time is shorter when the load is higher, and the time is longer when the load is lower.
Further, the method may further include: the terminal device stores a record of the connection established between the terminal device and the server, wherein the record comprises the establishment time of the connection, the release time of the connection and the corresponding web game. Further, the terminal device may determine, according to the netpage game corresponding to the connection, whether the connection is established with the server when the netpage game is running, the connection being closed; if the connection is determined to be the connection established with the server when the closed webgame is operated, the terminal device may determine whether to release the connection according to the establishment time of the connection. And when the terminal equipment determines not to release the connection, the connection is adopted to carry out information interaction with the server when other webpage games are started.
In step S25, when an interaction request is generated during the operation of the web game, the terminal device determines, in response to the interaction request generated during the operation of the web game, an interface corresponding to the interaction request, the interface being integrated in a game platform in the terminal device, the interface being used to identify a method for processing the interaction request.
The interactive request comprises a game information sending request, a user information obtaining request, an advertisement obtaining request, an audio playing request, a vibration request and the like.
The game information sending request can include a game starting information sending request, a game ending information sending request, a game error information sending request, a game point information sending request, a game real-time information sending request and the like, wherein the game starting information sending request is used for sending game starting information, the game ending information sending request is used for sending game ending information, the game error information sending request is used for sending game error information, the game point information sending request is used for sending game points, and the game real-time information sending request is used for sending real-time information in a game process. The user information acquisition request is used for acquiring user information of a user currently logged in by the game platform from the game platform for use in the game. The advertisement acquisition request is used for acquiring an advertisement resource loaded in the game from the server. The audio playing request is used for requesting the terminal equipment to play audio. The vibration request is used for requesting the terminal equipment to vibrate.
In the embodiment of the disclosure, the interface may be a JavaScript (JS) interface, and since game platforms such as fast application, android, IOS, and the like can support JavaScript and Html compiling and running, and the web game is compiled by Html and JavaScript languages, the JS language development interface is adopted, and can be simultaneously applied to each platform. In the game development process, a developer uses a JSSDK provided by a game platform developer to develop, and the JSSDK defines the corresponding relation between an interaction request and an interface of a game platform. Correspondingly, the interface defined in the JSSDK is integrated in the game platform, and the corresponding relationship between the interaction request and the interface of the game platform is set in the game or the game platform, so that the interaction request generated during the running of the game can call the interface in the game platform for processing, and the terminal device can execute the steps. The correspondence between the interaction request and the interface of the game platform is preferably set in the game platform, thereby reducing the workload of game development.
The interface may include a game information sending interface, and the interface may specifically include a game start information sending interface (game _ start), a game end information sending interface (game _ end), a game error information sending interface (game _ error), a game credit information sending interface (game _ goal), a game real-time information sending interface (available for real-time fighting), and the like. The interfaces may also include a user information acquisition interface (get _ userinfo), an advertisement acquisition interface (game _ show _ ad), an audio playback interface, a vibration interface, and the like. The interface corresponds to the previous interactive request, for example, the game information sending interface corresponds to a game information sending request, the user information obtaining interface corresponds to a user information obtaining request, the advertisement obtaining interface corresponds to an advertisement obtaining request, the audio playing interface corresponds to an audio playing request, and the vibration interface corresponds to a vibration request.
In different game platforms, the corresponding relation between the interaction request and the interface is the same, and the setting of the interface in different game platforms is also the same, so that the difference between the game platforms is shielded, the difference of the method between different game platforms is shielded, and the game of the same version can be accessed into different game platforms.
In the disclosed embodiments, a method may refer to a JAVA method, which is a collection of statements used to collectively perform a function. In the embodiment of the present disclosure, the methods called by the interface include two types, one is a service method, which is provided by the game platform and is used to implement the related services of the game, such as a game information sending method, a user information obtaining method, an advertisement obtaining method, and the like, and the other is a system local (Native) method, which is provided by the system of the terminal device and is used to implement the system services of the terminal device, such as an audio playing method, a vibration method, and the like.
In this step, in response to an interaction request generated during the operation of the web game, determining an interface corresponding to the interaction request includes: determining an interface of a game platform in the terminal equipment corresponding to the interactive request according to the corresponding relation between the interactive request and the interface; and calling an interface of the game platform in the terminal equipment corresponding to the interactive request.
In the implementation mode, the corresponding relation between the interactive request and the interface is well defined in the JSSDK toolkit, so that the calling process can be completed by directly writing the corresponding relation in a webpage game or a game platform. For example, the corresponding relationship between the interaction request and the interface is defined in the game platform, so when the interaction request is generated, the terminal device only needs to determine the interface corresponding to the interaction request according to the corresponding relationship between the interaction request and the interface defined in the game platform, and then processes the interaction request through the interface calling method. For example, when a user information acquisition request is generated, the terminal device calls a user information acquisition interface in the game platform according to the corresponding relationship to perform processing.
The correspondence between the interactive request and the interface may be specifically represented by a correspondence between an identifier of the interactive request and an identifier of the interface, where the identifier of the interactive request may be a name, a number, and the like of the interactive request, and the identifier of the interface may be a name, a number, and the like of the interface. For example, the name of the user information acquisition interface is get _ userinfo, the name of the user information acquisition request is get _ userinfo, and the interaction request named get _ userinfo corresponds to the interface named get _ userinfo.
In step S26, the terminal device processes the interaction request through the method identified by the interface call interface.
In the embodiment of the present disclosure, since the interaction request and the interface are correspondingly set, and a corresponding method is defined in the interface, after the interface corresponding to the interaction request is determined, the defined method is called through the interface to execute the action requested by the interaction request, where the action includes, but is not limited to, sending game information, obtaining user information, sending an advertisement obtaining request, and the like.
In this step, the terminal device realizes the aforementioned interaction request through an interface calling method in the game platform. Processing the interactive request through the method identified by the interface calling interface, including: determining a method defined in the interface; and calling a method defined in the interface to process the interactive request.
In this implementation, the method to be executed is defined in the interface, and whether the method is a method in the game platform or a Native method, the processing procedure for the interaction request in step S26 is completed by calling the method defined in the interface.
For example, when the game information sending method is called, the terminal device sends game information to the server, so that the server can record the game duration and the credits of the user, or provide real-time fighting service for the game according to the real-time information provided by the game. When the user information acquisition method is called, the terminal device acquires the user information of the user currently logged in by the game platform from the game platform, so that the game can use the user information. When the advertisement acquisition method is called, the terminal equipment sends an advertisement acquisition request to the server, then receives the advertisement resource returned by the server, and finally loads the advertisement resource in the webpage game, thereby improving the commercial value of the game.
For another example, when the audio playing method is called, the terminal device controls the audio processing module to perform audio decoding, and then controls the speaker to perform audio playing. When the vibration method is called, the terminal equipment controls the vibrator to vibrate.
Further, the method may further include: and when the webpage game is finished or the background runs, carrying out notification reminding on the notification bar.
In the implementation mode, the prompt is carried out through the notification bar message, so that the user can further know the game running state.
In the embodiment of the disclosure, the interaction request generated by the web game calls the interface of the game platform, and then calls the method capable of realizing the interaction request, and the method does not need to be directly called by the game, so that for different game platforms, games of different versions do not need to be respectively developed, but the method calling is realized through the interface designed in each game platform, the interface in the game platform shields the differentiation of the method of each game platform, and the game development cost is greatly reduced. In addition, in the game interaction process, the game interacts with the server by calling the interface of the game platform, and the data originally sent by the game is processed by the called method through the calling, so that the process increases the concealment of the game data and has higher safety degree compared with the process of directly interacting with the server through the game.
In addition, after the scheme is adopted, the interaction requests of the web games are realized through the interfaces in the game platform, so that the web games can be better managed uniformly through the game platform. For example, the number of the web games started at the same time is managed by the game platform, the game platform records the number of the currently started web games through an interactive request, and when the number of the web games started at the same time reaches an upper limit, the web games cannot be started any more. The number of the simultaneously started web games can be set in the game platform, so that the effect of the game platform is improved, and the control force of the platform is improved.
FIG. 5 is a schematic diagram illustrating the structure of a game interaction device, according to an exemplary embodiment. Software in the terminal device, referring to fig. 5, the game interaction apparatus includes: a determination unit 301 and a processing unit 302.
The determining unit 301 is configured to determine, in response to an interaction request generated during the operation of the web game, an interface corresponding to the interaction request, where the interface is integrated in a game platform in the terminal device, and the interface is used to identify a method for processing the interaction request; the processing unit 302 is configured to process the interaction request through the method identified by the interface call interface.
Optionally, the determining unit 301 is configured to determine, according to a correspondence between the interaction request and the interface, an interface of a game platform in the terminal device corresponding to the interaction request; and calling an interface of the game platform in the terminal equipment corresponding to the interactive request.
Optionally, the processing unit 302 is configured to determine a method defined in the interface; and calling a method defined in the interface to process the interactive request.
Optionally, the apparatus further comprises: the communication unit 303 is configured to perform information interaction with the server by using a connection that is not released when the web game is started, where the connection that is not released is a connection established with the server when the web game is running.
Optionally, the processing unit 302 is further configured to perform a notification reminder in the notification bar when the web game is ended or running in the background.
Optionally, the interface includes a game information sending interface, a user information obtaining interface, an advertisement obtaining interface, an audio playing interface, and a vibration interface.
Optionally, the game platform is a fast application game platform, an apple mobile operating system game platform, an android game platform, or a web game platform.
Optionally, the interface is a JavaScript interface.
The manner in which the determination unit 301 calls the interface may be seen in step S25; the way in which the processing unit 302 processes the interaction request may be seen in step S26; the manner in which the communication unit 303 interacts information with the server may be referred to in step S24, and a detailed description is omitted here.
Fig. 6 is a block diagram illustrating a game interaction apparatus 600 according to an exemplary embodiment, where the apparatus 600 may be the aforementioned terminal device, such as a mobile terminal. Referring to FIG. 6, game interaction device 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an interface to input/output (I/O) 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the game interaction device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the game interaction apparatus 600. Examples of such data include instructions for any software program or method operating on the game interaction device 600, contact data, phone book data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 606 provides power to the various components of game interaction device 600. The power components 606 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the game interaction device 600.
The multimedia component 608 includes a screen that provides an output interface between the game interaction device 600 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the game interaction device 600 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 may include a Microphone (MIC) configured to receive external audio signals when the game interaction device 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the game interaction device 600. For example, the sensor component 614 may detect an open/closed state of the game interaction device 600, the relative positioning of the components, such as the display and keypad of the game interaction device 600, the sensor component 614 may also detect a change in position of the game interaction device 600 or a component of the game interaction device 600, the presence or absence of user contact with the game interaction device 600, orientation or acceleration/deceleration of the game interaction device 600, and a change in temperature of the game interaction device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging software. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate wireless communication between the game interaction apparatus 600 and other devices. In the disclosed embodiment, the communication component 616 may access a wireless network based on a communication standard, such as 2G, 3G, 4G, or 5G, or a combination thereof, so as to implement the physical downlink control signaling detection. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. Optionally, the communication component 616 further includes an NFC module.
In an exemplary embodiment, the game interaction apparatus 600 may be implemented by one or more software Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the game interaction methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as memory 604 comprising instructions, that may be executed by processor 620 of game interaction device 600 to perform the game interaction method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. A game interaction method, the method comprising:
the method comprises the steps that a terminal device responds to an interaction request generated in the running process of a web game, an interface corresponding to the interaction request is determined, the interface is integrated in a game platform in the terminal device and is used for identifying a method for processing the interaction request, in different game platforms, the corresponding relation between the interaction request and the interface is the same, and the setting of the interface in different game platforms is also the same;
and the terminal equipment calls the method identified by the interface through the interface to process the interactive request.
2. The game interaction method of claim 1, wherein the determining, in response to an interaction request generated during the operation of the web game, an interface corresponding to the interaction request comprises:
determining an interface of a game platform in the terminal equipment corresponding to the interaction request according to the corresponding relation between the interaction request and the interface;
and calling an interface of a game platform in the terminal equipment corresponding to the interaction request.
3. A game interaction method as in claim 1, wherein said invoking the method identified by the interface through the interface to process the interaction request comprises:
determining a method defined in the interface;
and calling a method defined in the interface to process the interactive request.
4. A game interaction method as claimed in any one of claims 1 to 3, wherein the method further comprises:
when the webpage game is started, the unreleased connection is adopted to carry out information interaction with the server, and the unreleased connection is the connection established between the closed webpage game and the server when the webpage game runs.
5. A game interaction method as claimed in any one of claims 1 to 3, wherein the method further comprises:
and when the webpage game is finished or the background runs, carrying out notification reminding on the notification bar.
6. A game interaction method according to any one of claims 1 to 3, wherein the interface includes a game information transmission interface, a user information acquisition interface, an advertisement acquisition interface, an audio playing interface and a vibration interface.
7. A game interaction method according to any one of claims 1 to 3, wherein the game platform is a fast application game platform, an apple mobile operating system game platform, an android game platform or a web game platform.
8. A game interaction method as claimed in any one of claims 1 to 3, wherein the interface is a JavaScript interface.
9. A game interaction device is applied to a terminal device, and the device comprises:
a determining unit, configured to determine, in response to an interaction request generated during a running process of a web game, an interface corresponding to the interaction request, where the interface is integrated in a game platform in a terminal device, and the interface is used to identify a method for processing the interaction request, where, in different game platforms, the correspondence between the interaction request and the interface is the same, and the settings of the interfaces in different game platforms are also the same;
and the processing unit is used for calling the method identified by the interface through the interface to process the interactive request.
10. The game interaction apparatus according to claim 9, wherein the determining unit is configured to determine, according to a correspondence between an interaction request and an interface, an interface of a game platform in the terminal device corresponding to the interaction request; and calling an interface of a game platform in the terminal equipment corresponding to the interaction request.
11. A game interaction device as claimed in claim 9, wherein the processing unit is configured to determine a method defined in the interface; and calling a method defined in the interface to process the interactive request.
12. A game interaction device as claimed in any one of claims 9 to 11, wherein the device further comprises: and the communication unit is used for performing information interaction with the server by adopting unreleased connection when the webpage game is started, wherein the unreleased connection is the connection established with the server when the closed webpage game runs.
13. A game interaction device as claimed in any one of claims 9 to 11, wherein the processing unit is further configured to perform a notification reminder in a notification bar when the web game is finished or running in the background.
14. A game interaction device as claimed in any one of claims 9 to 11, wherein the interface comprises a game information transmission interface, a user information acquisition interface, an advertisement acquisition interface, an audio playback interface and a vibration interface.
15. A game interaction device as claimed in any one of claims 9 to 11, wherein the game platform is a fast application game platform, an apple mobile operating system game platform, an android game platform or a web game platform.
16. A game interaction device as in any one of claims 9-11, wherein the interface is a JavaScript interface.
17. A game interaction device is applied to a terminal device, and the device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
responding to an interaction request generated in the running process of a web game, determining an interface corresponding to the interaction request, wherein the interface is integrated in a game platform in terminal equipment and is used for identifying a method for processing the interaction request, and in different game platforms, the corresponding relation between the interaction request and the interface is the same, and the setting of the interface in different game platforms is also the same;
and calling the method identified by the interface through the interface to process the interactive request.
18. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of a game interaction apparatus, enable the game interaction apparatus to perform the game interaction method of any one of claims 1 to 8.
CN201811074484.9A 2018-09-14 2018-09-14 Game interaction method and device and computer readable storage medium Active CN109347916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811074484.9A CN109347916B (en) 2018-09-14 2018-09-14 Game interaction method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811074484.9A CN109347916B (en) 2018-09-14 2018-09-14 Game interaction method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109347916A CN109347916A (en) 2019-02-15
CN109347916B true CN109347916B (en) 2021-10-26

Family

ID=65305645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811074484.9A Active CN109347916B (en) 2018-09-14 2018-09-14 Game interaction method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109347916B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111150999B (en) * 2019-12-27 2023-08-22 网易(杭州)网络有限公司 Game data access method, device, system, equipment and storage medium
CN111338633B (en) * 2020-02-10 2023-08-15 Oppo(重庆)智能科技有限公司 Method and device for generating installation-free file and electronic equipment
CN111324340B (en) * 2020-02-20 2021-07-20 腾讯科技(深圳)有限公司 Interaction method and device based on webpage copy, storage medium and computer equipment
EP4194067A1 (en) * 2020-08-07 2023-06-14 Xiamen Yaji Software Co., Ltd. Game engine resource processing method and apparatus, and electronic device and computer-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873525A (en) * 2012-12-17 2014-06-18 沈琼茂 System and method for creating digital content operation platform
CN108114469A (en) * 2018-01-29 2018-06-05 北京神州泰岳软件股份有限公司 Game interaction method, apparatus, terminal and game interaction model based on dialogue

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10248206B2 (en) * 2013-08-20 2019-04-02 Xsync Technologies Llc Systems and methods for multimedia tactile augmentation
CN105354872B (en) * 2015-11-04 2018-02-27 深圳墨麟科技股份有限公司 A kind of rendering engine based on 3D web games, implementation method and tools
CN106202284B (en) * 2016-06-29 2019-08-06 珠海金山网络游戏科技有限公司 A kind of system and method that questionnaire is quickly collected in mobile phone games

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873525A (en) * 2012-12-17 2014-06-18 沈琼茂 System and method for creating digital content operation platform
CN108114469A (en) * 2018-01-29 2018-06-05 北京神州泰岳软件股份有限公司 Game interaction method, apparatus, terminal and game interaction model based on dialogue

Also Published As

Publication number Publication date
CN109347916A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN109347916B (en) Game interaction method and device and computer readable storage medium
CN107329742B (en) Software development kit calling method and device
EP2998899A1 (en) Method and apparatus for running application program
CN107203398B (en) Application distribution method and device
US20150156257A1 (en) Application service providing method and system, and related device
US11360834B2 (en) Application interaction method and apparatus
US9870239B2 (en) Method and device for running application program
CN107862514B (en) Bus card management method, device and system and storage medium
CN107229711B (en) Webpage display method and device
CN109542577B (en) Advertisement updating method and device and computer readable storage medium
CN109117144B (en) Page processing method, device, terminal and storage medium
CN107911482B (en) Target application opening method and device
CN111222014B (en) Request processing method, request processing device, electronic equipment and storage medium
CN111427622A (en) Method and device for executing script codes in application program
CN105808304B (en) Code deployment method, device and system
EP3062481B1 (en) Method and related device for providing application service
CN111079040B (en) Resource sniffing method, device, terminal, server and storage medium
CN111782997A (en) Method and device for loading webpage and storage medium
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN110769275A (en) Method, device and system for processing live data stream
CN111338961B (en) Application debugging method and device, electronic equipment and storage medium
CN111104183B (en) Application program running method and device, electronic equipment and storage medium
CN111597106A (en) Point burying management method and device
CN111008050A (en) Page task execution method, device, terminal and storage medium
CN111290944A (en) Script generation method, device and storage medium

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