Web game processing method, electronic device and computer readable storage medium

Through the collaborative work of the browser and the server, the script information of the web game engine is automatically converted into scripts suitable for different operating environments, solving the problem of cumbersome web game adaptation process in the existing technology and improving processing efficiency and reliability.

CN112163177BActive Publication Date: 2025-02-14SHANGHAI LIANSHANG NETWORK TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010949043.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-10
Publication Date
2025-02-14
Estimated Expiration
2040-09-10

AI Technical Summary

Technical Problem

In the prior art, web game platforms have inconsistent support for different web game engines, resulting in the need to manually perform tedious adaptive operations, which reduces the efficiency and reliability of web game processing.

Method used

Responding to user operations through the browser, obtain script information of the web game engine, and send it to the server for automatic conversion, adapting to different web game running environments.

Benefits of technology

It simplifies the adaptation process of web games, improves processing efficiency and reliability, and reduces operation time and error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112163177B_ABST
    Figure CN112163177B_ABST
Patent Text Reader

Abstract

The present application provides a web game processing method, electronic device and computer-readable storage medium. In the embodiment of the present application, a browser responds to a first user operation based on a web game conversion page by a user, obtains web script information of a first web game engine, the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine, and further responds to a second user operation based on the web game conversion page by the user, sends the web script information to a server, so that the browser can obtain the second web script file converted by the server according to the web script running rules of the second web game engine and the engine information of the first web game engine, which can be run in a web game running environment implemented based on the second web game engine, and the operation is simple, the operation time is short, and it is not easy to make mistakes.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to the field of interface processing technology, specifically to rendering technology, and especially to a processing method for web games, an electronic device, and a computer-readable storage medium. [Background technology]

[0002] Web games are also called web games, terminalless online games, or web games for short. Web games are online multiplayer interactive games based on web browsers. There is no need to download the client, and there is no problem of insufficient machine configuration. A web game engine is a set of codes (instructions) designed for terminals that run web games and can be recognized by the terminal's browser. Currently, commonly used web game engines include Cocos engine, Egret engine, Laya engine and other types of web game engines. Web games run in a browser environment, and the web game platforms provided by most popular third-party applications do not provide a complete browser environment, but only simulate it to a certain extent so that the web game platform can realize the web game running environment and can be used for web game operation. Web games running on the web game platform provided by third-party applications can be played by clicking, without downloading and installing, and the experience is light, which can be called "mini games".

[0003] However, since most web game platforms are often rendered based on a unified web game engine such as the Cocos engine, in order to enable web games developed by other web game engines different from the web game engine used by the web game platform to run on these web game platforms, operators need to manually perform cumbersome adaptation operations to convert web games developed by other web game engines into adapted games that comply with the processing rules of web games developed by a unified web game engine such as the Cocos engine, so as to adapt to the web game operating environment provided by these web game platforms. The conversion operation of existing web games is cumbersome, takes a long time to operate, and is prone to errors, which leads to a reduction in the efficiency and reliability of web game processing. [Summary of the invention]

[0004] Multiple aspects of the present application provide a web game processing method, an electronic device, and a computer-readable storage medium.

[0005] In one aspect of the present application, a method for processing a web game is provided, comprising:

[0006] The browser obtains web script information of a first web game engine in response to a first user operation of the user based on the web game conversion page, wherein the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine;

[0007] The browser sends the web script information to the server in response to the second user operation of the user based on the web game conversion page, so that the server converts the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine;

[0008] The browser obtains the second web page script file converted by the server.

[0009] Another aspect of the present application provides a method for processing a web game, comprising:

[0010] The server receives web script information of the first web game engine sent by the browser in response to the second user operation of the user based on the web game conversion page, wherein the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine; wherein the web script information of the first web game engine is obtained by the browser in response to the first user operation of the user based on the web game conversion page;

[0011] The server converts the first web script file into a second web script file that can be run in a web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine;

[0012] The server provides the converted second web page script file to the browser.

[0013] Another aspect of the present application provides an electronic device, the device comprising:

[0014] one or more processors;

[0015] a storage device for storing one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement a web game processing method as provided in the above aspect.

[0017] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a web game processing method as provided in the above aspect.

[0018] It can be seen from the above technical solution that the embodiment of the present application obtains web script information of the first web game engine through the browser in response to the first user operation of the user based on the web game conversion page, the web script information of the first web game engine includes the first web script file developed by the first web game engine and the engine information of the first web game engine, and further responds to the second user operation of the user based on the web game conversion page, The web script information is sent to the server, so that the browser can obtain the server according to the web script running rules of the second web game engine and the engine information of the first web game engine, and converts the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine. The user only needs to operate through the browser interface to trigger the server to automatically perform the conversion operation of the web script file to adapt to the web game running environment, without participating in the conversion operation of the web script file. The operation is simple, the operation time is short, and it is not easy to make mistakes, thereby improving the efficiency and reliability of web game processing.

[0019] In addition, by adopting the technical solution provided by the present application, the browser interface operation can be used to replace the existing tedious adaptation operations performed manually, which can effectively improve the processing efficiency and further reduce the error rate.

[0020] In addition, by adopting the technical solution provided by the present application, there is no need to install additional applications on the terminal. The conversion operation of the web script file can be achieved by operating the browser application of the terminal, which is simple, convenient and highly operable.

[0021] In addition, the technical solution provided by this application can effectively improve the user experience.

Brief Description of the Drawings

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0023] Figure 1 A flowchart of a method for processing a web game provided in one embodiment of the present application;

[0024] Figure 2 for Figure 1 A schematic diagram of a web game conversion page provided by the corresponding embodiment;

[0025] Figure 3 A flowchart of a method for processing a web game provided by another embodiment of the present application;

[0026] Figure 4 FIG. 1 is a block diagram of an exemplary computer system / server 12 suitable for implementing embodiments of the present application. [Specific implementation method]

[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] It should be noted that the terminals involved in the embodiments of the present invention may include but are not limited to mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers, personal computers (PCs), MP3 players, MP4 players, wearable devices (for example, smart glasses, smart watches, smart bracelets, etc.), etc.

[0029] In addition, the term "and / or" in the embodiments of the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the embodiments of the present application, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0030] Figure 1 A flowchart of a method for processing a web game provided in an embodiment of the present application is shown in FIG. Figure 1 shown.

[0031] 101. In response to a first user operation based on a web game conversion page, the browser obtains web script information of a first web game engine, where the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine.

[0032] 102. In response to a second user operation of the user based on the web game conversion page, the browser sends the web script information to the server, so that the server can convert the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine.

[0033] 103. The browser obtains the second web page script file converted by the server.

[0034] It should be noted that the browser of the execution subject of 101 to 103 may be a browser application located in the terminal, for example, IE browser, Google Chrome, etc.

[0035] In this application, the so-called first web game engine and the second web game engine can be a set of codes (instructions) designed for a terminal running a web game and can be recognized by the terminal's browser or browser environment. The first web game engine and the second web game engine are web game engines of different types.

[0036] Since web games need to run in a browser environment, if you want to run these web games in a third-party application, you need to use the web game platform provided by the third-party application to simulate the browser environment to a certain extent so that it can realize the web game running environment for the web games developed by the web game engine to run.

[0037] Usually, the web game engine used to develop web games may be different from the web game engine used by the web game platform for page rendering. This will result in web games developed by one type of web game engine being unable to run on web game platforms based on other types. For example, web games developed by the Egret engine cannot run on web game platforms based on the Cocos engine.

[0038] Therefore, it is necessary to adopt the technical solution provided by the present application to realize the conversion of web script files of web games developed by web game engines so as to adapt them to run on web game platforms implemented based on different web game engines.

[0039] In the present application, the second web game engine can be a web game engine used by the web game platform for page rendering, such as the Cocos engine, etc., and the first web game engine can be a web game engine different from the web game platform for page rendering, such as the Egret engine or Laya engine and other web game engines.

[0040] In this way, the browser responds to the user's first user operation based on the web game conversion page, obtains the web script information of the first web game engine, and the web script information of the first web game engine includes the first web script file developed by the first web game engine and the engine information of the first web game engine. Further responds to the user's second user operation based on the web game conversion page, the web script information is sent to the server, so that the browser can obtain the server according to the web script running rules of the second web game engine and the engine information of the first web game engine, and converts the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine. The user only needs to operate through the browser interface to trigger the server to automatically perform the conversion operation of the web script file to adapt to the web game running environment, without participating in the conversion operation of the web script file. The operation is simple, the operation time is short, and it is not easy to make mistakes, thereby improving the efficiency and reliability of web game processing.

[0041] In this application, the browser can output a specific page in advance, namely the web game conversion page, such as Figure 2 The user only needs to operate the page elements on the web game conversion page output by the browser, such as selecting controls, uploading controls, converting controls, downloading controls, etc., to trigger the server to automatically convert the web script file to adapt to the web game running environment.

[0042] Optionally, in a possible implementation of this embodiment, the first web page script file may include a web page script file of a specific type of web page, for example, a web page script file of a Hypertext Markup Language (HTML) version 5 (HTML5) web page.

[0043] Specifically, a first web game engine, for example, an Egret engine or a Laya engine, or other second web game engine that is different from the web game platform used for page rendering, can be used to export a web script file of a specific type of web page developed by the first web game engine as the first web script file to be converted.

[0044] In a specific implementation process, after exporting the web script file of the specific type of web page developed by the first web game engine as the first web script file to be converted, the exported first web script file can be further stored.

[0045] Specifically, the first web page script file may be stored in a storage device of the terminal.

[0046] In a specific implementation process, the storage device of the terminal can be a slow storage device, specifically a hard disk of a computer system, or it can also be a non-operating memory of a mobile phone, that is, a physical memory, for example, a read-only memory (ROM) and a memory card, etc. This embodiment does not specifically limit this.

[0047] In another specific implementation process, the storage device of the terminal may also be a fast storage device, specifically the memory of a computer system, or may also be the running memory of a mobile phone, i.e., the system memory, for example, a random access memory (RAM), etc. This embodiment does not specifically limit this.

[0048] Optionally, in a possible implementation of this embodiment, in 101, the browser may specifically obtain the path information provided by the user based on the web game conversion page in response to the user's first operation based on the web game conversion page, and then the browser obtains the first web script file developed by the first web game engine according to the path information. The browser may also obtain the identification information of the first web game engine provided by the user based on the web game conversion page in response to the user's second operation based on the web game conversion page, and then the browser obtains the engine information of the first web game engine according to the identification information of the first web game engine, such as the web game engine type, web game engine name, and the compilation language supported by the web game engine.

[0049] The first operation of the user based on the web game conversion page and the second operation of the user based on the web game conversion page may not have a fixed order. The user may first perform the first operation based on the web game conversion page and then perform the second operation based on the web game conversion page, or may first perform the second operation based on the web game conversion page and then perform the first operation based on the web game conversion page. This embodiment does not specifically limit this.

[0050] In this implementation, the user can operate (such as one or more operations such as clicking operation and selecting operation) the upload control on the web game conversion page, such as Figure 2 The "Upload Mini Game Package" upload button on the web game conversion page shown in the figure can be used to input path information, which can indicate the storage location of the first web script file developed by the first web game engine. The user can also operate (such as one or more operations such as clicking, selecting, etc.) the selection control on the web game conversion page, such as Figure 2Click the "XX Mini Game" selection button on the web game conversion page shown to determine the identification information of the first web game engine.

[0051] Optionally, in a possible implementation of this embodiment, in 102, the browser may specifically send the web page script information to the server in response to one or several user operations of the user based on the web game conversion page.

[0052] In this implementation, the user can operate (such as one or more operations such as clicking, selecting, etc.) the conversion control on the web game conversion page, such as Figure 2 The "Start Conversion" conversion button on the web game conversion page shown triggers the browser to send the web script information to the server, and the server performs conversion operations based on the web script information.

[0053] After the server receives the web script information sent by the browser, the server can convert the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine.

[0054] Specifically, the server can create a running directory and an entry file for running a web game according to the web script running rules of the second web game engine, and then the server can adapt the script content and resource content of the first web script file according to the web script running rules of the second web game engine and the engine information of the first web game engine to obtain adapted content. Finally, the server can obtain the second web script file according to the running directory, the entry file and the adapted content.

[0055] For example, the server can specifically copy the script content and resource content of the first web page script file to the running directory, and then further perform code adaptation based on the entry file. The server can further add an adapter file, such as a runtime-adapter.js file, to the entry file, such as main.js, and then further import the code for running the web game, such as the index.js file.

[0056] Since the extensible hypertext transfer request (XmlHttpRequest, XHR) implemented by the web game platform does not support reading local files, the server can further add adaptation files in the entry file, such as main.js, to implement local file reading during the adaptation process.

[0057] Optionally, in a possible implementation of this embodiment, in 103, the browser may specifically receive the second web page script file converted by the server and sent by the server.

[0058] At this time, after obtaining the second web page script file, the server may immediately send the second web page script file converted by the server to the browser.

[0059] By adopting the technical solution provided by this implementation method, the browser can obtain the second web page script file converted by the server in real time without the user performing any additional operations through the browser interface, which can further improve the efficiency of web game processing.

[0060] Optionally, in a possible implementation of this embodiment, in 103, the browser may specifically download the second web page script file converted by the server from the server in response to a third user operation of the user based on the web game conversion page.

[0061] In this implementation, the user can operate (such as one or more operations such as clicking, selecting, etc.) the download control on the web game conversion page, such as Figure 2 The "Click to Download" download button on the web game conversion page shown triggers the browser to request the server to download the second web script file converted by the server.

[0062] At this time, after obtaining the second web page script file, the server does not immediately send the second web page script file converted by the server to the browser, but waits for the download request from the browser. After receiving the download request sent by the browser, the server sends the second web page script file converted by the server to the browser.

[0063] With the technical solution provided by this implementation, the user needs to perform additional user operations through the browser interface to trigger the browser to obtain the second web page script file converted by the server. Since it is a triggering user operation actively performed by the user through the browser interface, the user can further accurately provide the storage path of the downloaded second web page script file, thereby realizing the purposeful storage processing of the downloaded second web page script file, which can further improve the reliability of web page game processing.

[0064] At this point, the second web script file converted by the server can be obtained. In this way, the user obtains a web script file that can be run normally in the web game running environment based on the second web game engine provided by the third-party application, without the need for tedious manual modification, and can realize that the web game developed by the first web game engine can be run in the web game running environment based on the second web game engine provided by any third-party application.

[0065] Taking the example that a web game developed by the Egret engine needs to run on a web game platform based on the Cocos engine, the user can export the Egret web script file of the Html5 web page developed by the Egret engine as the first web script file to be converted.

[0066] Usually, the Egret web script file of the Html5 web page developed by the Egret engine is a compressed file after compression processing, which may include script content and resource content, for example, resource files such as picture resources, sound resources, etc. that are used when the script content is running. The user uploads the Egret web script file of the Html5 web page to the server through the operation of the browser interface, and sends the engine information of the Egret engine corresponding to the Egret web script file of the Html5 web page to the server.

[0067] After the server receives the above content provided by the browser, the server can decompress the compressed file uploaded to the server through the browser.

[0068] Then, the server can adapt the script content and resource content of the Egret web page script file of the Html5 web page according to the web page script running rules of the Cocos engine and the engine information of the Egret engine to obtain adapted content.

[0069] Finally, the server can obtain the Cocos web page script file according to the running directory, the entry file and the adaptation content as the second web page script file after the conversion is completed.

[0070] Usually, the server can further compress the obtained Cocos web page script file to serve as the second web page script file after conversion.

[0071] At this point, the server can provide the browser with the converted Cocos web script file. In this way, the user obtains the Cocos web script file that can run normally in the web game running environment based on the Cocos engine provided by the third-party application. Without the tedious manual modification work, the Egret web game developed by the Egret engine can be run in the web game running environment based on the Cocos engine provided by any third-party application.

[0072] The implementation principle of the present application is to utilize the browser / server (Browser / Server, B / S) mode. The user operates in the browser and uploads the mini-game product package (i.e., the web script file of the web game to be converted, i.e., the first web script file) to the server. Then, the server converts the mini-game product package. After the conversion is completed, the user can obtain the mini-game conversion result package (i.e., the web script file after the web game is converted, i.e., the second web script file).

[0073] In this embodiment, the browser responds to a first user operation based on a web game conversion page by a user to obtain web script information of a first web game engine, the web script information of the first web game engine including a first web script file developed by the first web game engine and engine information of the first web game engine. Further, in response to a second user operation based on the web game conversion page by the user, the web script information is sent to a server, so that the browser can obtain the second web script file converted by the server according to the web script running rules of the second web game engine and the engine information of the first web game engine, which can be run in a web game running environment implemented based on the second web game engine. The user only needs to operate through the browser interface to trigger the server to automatically perform the conversion operation of the web script file to adapt to the web game running environment, without participating in the conversion operation of the web script file. The operation is simple, the operation time is short, and it is not easy to make mistakes, thereby improving the efficiency and reliability of web game processing.

[0074] In addition, by adopting the technical solution provided by the present application, the browser interface operation can be used to replace the existing tedious adaptation operations performed manually, which can effectively improve the processing efficiency and further reduce the error rate.

[0075] In addition, by adopting the technical solution provided by the present application, there is no need to install additional applications on the terminal. The conversion operation of the web script file can be achieved by operating the browser application of the terminal, which is simple, convenient and highly operable.

[0076] In addition, the technical solution provided by this application can effectively improve the user experience.

[0077] Figure 3 A flowchart of a method for processing a web game provided by another embodiment of the present application is shown as follows: Figure 3 shown.

[0078] 301. The server receives web script information of a first web game engine sent by a browser in response to a second user operation of a user based on a web game conversion page, wherein the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine; wherein the web script information of the first web game engine is obtained by the browser in response to the first user operation of the user based on the web game conversion page.

[0079] 302. The server converts the first web script file into a second web script file that can be run in a web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine.

[0080] 303. The server provides the converted second web page script file to the browser.

[0081] It should be noted that the server that executes 301 to 303 may be a processing engine located in a network-side server, or may be a distributed system located on the network side, which is not particularly limited in this embodiment.

[0082] In this application, the so-called first web game engine and the second web game engine can be a set of codes (instructions) designed for a terminal running a web game and can be recognized by the terminal's browser or browser environment. The first web game engine and the second web game engine are web game engines of different types.

[0083] Since web games need to run in a browser environment, if you want to run these web games in a third-party application, you need to use the web game platform provided by the third-party application to simulate the browser environment to a certain extent so that it can realize the web game running environment for the web games developed by the web game engine to run.

[0084] Usually, the web game engine used to develop web games may be different from the web game engine used by the web game platform for page rendering. This will result in web games developed by one type of web game engine being unable to run on web game platforms based on other types. For example, web games developed by the Egret engine cannot run on web game platforms based on the Cocos engine.

[0085] Therefore, it is necessary to adopt the technical solution provided by the present application to realize the conversion of web script files of web games developed by web game engines so as to adapt them to run on web game platforms implemented based on different web game engines.

[0086] In the present application, the second web game engine can be a web game engine used by the web game platform for page rendering, such as the Cocos engine, etc., and the first web game engine can be a web game engine different from the web game platform for page rendering, such as the Egret engine or Laya engine and other web game engines.

[0087] In this way, the browser responds to the user's first user operation based on the web game conversion page, obtains the web script information of the first web game engine, and the web script information of the first web game engine includes the first web script file developed by the first web game engine and the engine information of the first web game engine. Further responds to the user's second user operation based on the web game conversion page, the web script information is sent to the server, so that the browser can obtain the server according to the web script running rules of the second web game engine and the engine information of the first web game engine, and converts the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine. The user only needs to operate through the browser interface to trigger the server to automatically perform the conversion operation of the web script file to adapt to the web game running environment, without participating in the conversion operation of the web script file. The operation is simple, the operation time is short, and it is not easy to make mistakes, thereby improving the efficiency and reliability of web game processing.

[0088] In this application, the browser can output a specific page in advance, namely the web game conversion page, such as Figure 2 The user only needs to operate the page elements on the web game conversion page output by the browser, such as selecting controls, uploading controls, converting controls, downloading controls, etc., to trigger the server to automatically convert the web script file to adapt to the web game running environment.

[0089] Optionally, in a possible implementation of this embodiment, the first web page script file may include a web page script file of a specific type of web page, for example, a web page script file of a Hypertext Markup Language (HTML) version 5 (HTML5) web page.

[0090] Specifically, a first web game engine, for example, an Egret engine or a Laya engine, or other second web game engine that is different from the web game platform used for page rendering, can be used to export a web script file of a specific type of web page developed by the first web game engine as the first web script file to be converted.

[0091] In a specific implementation process, after exporting the web script file of the specific type of web page developed by the first web game engine as the first web script file to be converted, the exported first web script file can be further stored.

[0092] Specifically, the first web page script file may be stored in a storage device of the terminal.

[0093] In a specific implementation process, the storage device of the terminal can be a slow storage device, specifically a hard disk of a computer system, or it can also be a non-operating memory of a mobile phone, that is, a physical memory, for example, a read-only memory (ROM) and a memory card, etc. This embodiment does not specifically limit this.

[0094] In another specific implementation process, the storage device of the terminal may also be a fast storage device, specifically the memory of a computer system, or may also be the running memory of a mobile phone, i.e., the system memory, for example, a random access memory (RAM), etc. This embodiment does not specifically limit this.

[0095] In the present application, the browser may specifically obtain the path information provided by the user based on the web game conversion page in response to the user's first operation based on the web game conversion page, and then the browser obtains the first web script file developed by the first web game engine according to the path information. The browser may also obtain the identification information of the first web game engine provided by the user based on the web game conversion page in response to the user's second operation based on the web game conversion page, and then the browser obtains the engine information of the first web game engine according to the identification information of the first web game engine.

[0096] The first operation of the user based on the web game conversion page and the second operation of the user based on the web game conversion page may not have a fixed order. The user may first perform the first operation based on the web game conversion page and then perform the second operation based on the web game conversion page, or may first perform the second operation based on the web game conversion page and then perform the first operation based on the web game conversion page. This embodiment does not specifically limit this.

[0097] In this implementation, the user can operate (such as one or more operations such as clicking operation and selecting operation) the upload control on the web game conversion page, such as Figure 2 The "Upload Mini Game Package" upload button on the web game conversion page shown in the figure can be used to input path information, which can indicate the storage location of the first web script file developed by the first web game engine. The user can also operate (such as one or more operations such as clicking, selecting, etc.) the selection control on the web game conversion page, such as Figure 2 Click the "XX Mini Game" selection button on the web game conversion page shown to determine the identification information of the first web game engine.

[0098] After obtaining the first web script file developed by the first web game engine and the engine information of the first web game engine, such as the web game engine type, the web game engine name, the compilation language supported by the web game engine, etc., the browser can further send the web script information to the server in response to one or several user operations of the user based on the web game conversion page.

[0099] In this implementation, the user can operate (such as one or more operations such as clicking, selecting, etc.) the conversion control on the web game conversion page, such as Figure 2 The "Start Conversion" conversion button on the web game conversion page shown triggers the browser to send the web script information to the server, and the server performs conversion operations based on the web script information.

[0100] Optionally, in a possible implementation of this embodiment, in 302, the server may convert the first web script file into a second web script file that can be run in a web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine.

[0101] Specifically, the server can create a running directory and an entry file for running a web game according to the web script running rules of the second web game engine, and then the server can adapt the script content and resource content of the first web script file according to the web script running rules of the second web game engine and the engine information of the first web game engine to obtain adapted content. Finally, the server can obtain the second web script file according to the running directory, the entry file and the adapted content.

[0102] For example, the server can specifically copy the script content and resource content of the first web page script file to the running directory, and then further perform code adaptation based on the entry file. The server can further add an adapter file, such as a runtime-adapter.js file, to the entry file, such as main.js, and then further import the code for running the web game, such as the index.js file.

[0103] Since the extensible hypertext transfer request (XmlHttpRequest, XHR) implemented by the web game platform does not support reading local files, the server can further add adaptation files in the entry file, such as main.js, to implement local file reading during the adaptation process.

[0104] Optionally, in a possible implementation manner of this embodiment, in 303, the server may specifically send the second web page script file converted by the server to the browser.

[0105] In this implementation, the browser may specifically receive the second web page script file converted by the server and sent by the server.

[0106] At this time, after obtaining the second web page script file, the server may immediately send the second web page script file converted by the server to the browser.

[0107] By adopting the technical solution provided by this implementation method, the browser can obtain the second web page script file converted by the server in real time without the user performing any additional operations through the browser interface, which can further improve the efficiency of web game processing.

[0108] Optionally, in a possible implementation of this embodiment, in 303, the server may specifically provide the browser with the second web script file downloaded by the browser in response to the third user operation of the user based on the web game conversion page.

[0109] In this implementation, the browser may specifically download the second web page script file converted by the server from the server in response to a third user operation of the user based on the web page game conversion page.

[0110] In this implementation, the user can operate (such as one or more operations such as clicking, selecting, etc.) the download control on the web game conversion page, such as Figure 2 The "Click to Download" download button on the web game conversion page shown triggers the browser to request the server to download the second web script file converted by the server.

[0111] At this time, after obtaining the second web page script file, the server does not immediately send the second web page script file converted by the server to the browser, but waits for the download request from the browser. After receiving the download request sent by the browser, the server sends the second web page script file converted by the server to the browser.

[0112] With the technical solution provided by this implementation, the user needs to perform additional user operations through the browser interface to trigger the browser to obtain the second web page script file converted by the server. Since it is a triggering user operation actively performed by the user through the browser interface, the user can further accurately provide the storage path of the downloaded second web page script file, thereby realizing the purposeful storage processing of the downloaded second web page script file, which can further improve the reliability of web page game processing.

[0113] The implementation principle of the present application is to utilize the browser / server (Browser / Server, B / S) mode. The user operates in the browser and uploads the mini-game product package (i.e., the web script file of the web game to be converted, i.e., the first web script file) to the server. Then, the server converts the mini-game product package. After the conversion is completed, the user can obtain the mini-game conversion result package (i.e., the web script file after the web game is converted, i.e., the second web script file).

[0114] At this point, the second web script file converted by the server can be obtained. In this way, the user obtains a web script file that can be run normally in the web game running environment based on the second web game engine provided by the third-party application, without the need for tedious manual modification, and can realize that the web game developed by the first web game engine can be run in the web game running environment based on the second web game engine provided by any third-party application.

[0115] Taking the example that a web game developed by the Egret engine needs to run on a web game platform based on the Cocos engine, the user can export the Egret web script file of the Html5 web page developed by the Egret engine as the first web script file to be converted.

[0116] Usually, the Egret web script file of the Html5 web page developed by the Egret engine is a compressed file after compression processing, which may include script content and resource content, for example, resource files such as picture resources, sound resources, etc. that are used when the script content is running. The user uploads the Egret web script file of the Html5 web page to the server through the operation of the browser interface, and sends the engine information of the Egret engine corresponding to the Egret web script file of the Html5 web page to the server.

[0117] After the server receives the above content provided by the browser, the server can decompress the compressed file uploaded to the server through the browser.

[0118] Then, the server can adapt the script content and resource content of the Egret web page script file of the Html5 web page according to the web page script running rules of the Cocos engine and the engine information of the Egret engine to obtain adapted content.

[0119] Finally, the server can obtain the Cocos web page script file according to the running directory, the entry file and the adaptation content as the second web page script file after the conversion is completed.

[0120] Usually, the server can further compress the obtained Cocos web page script file to serve as the second web page script file after conversion.

[0121] At this point, the server can provide the browser with the converted Cocos web script file. In this way, the user obtains the Cocos web script file that can run normally in the web game running environment based on the Cocos engine provided by the third-party application. Without the tedious manual modification work, the Egret web game developed by the Egret engine can be run in the web game running environment based on the Cocos engine provided by any third-party application.

[0122] In this embodiment, the browser responds to a first user operation based on a web game conversion page by a user to obtain web script information of a first web game engine, the web script information of the first web game engine including a first web script file developed by the first web game engine and engine information of the first web game engine. Further, in response to a second user operation based on the web game conversion page by the user, the web script information is sent to a server, so that the browser can obtain the second web script file converted by the server according to the web script running rules of the second web game engine and the engine information of the first web game engine, which can be run in a web game running environment implemented based on the second web game engine. The user only needs to operate through the browser interface to trigger the server to automatically perform the conversion operation of the web script file to adapt to the web game running environment, without participating in the conversion operation of the web script file. The operation is simple, the operation time is short, and it is not easy to make mistakes, thereby improving the efficiency and reliability of web game processing.

[0123] In addition, by adopting the technical solution provided by the present application, the browser interface operation can be used to replace the existing tedious adaptation operations performed manually, which can effectively improve the processing efficiency and further reduce the error rate.

[0124] In addition, by adopting the technical solution provided by the present application, there is no need to install additional applications on the terminal. The conversion operation of the web script file can be achieved by operating the browser application of the terminal, which is simple, convenient and highly operable.

[0125] In addition, the technical solution provided by this application can effectively improve the user experience.

[0126] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0127] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0128] Another embodiment of the present application further provides an electronic device, the electronic device comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement Figure 1or Figure 3 The corresponding embodiment provides a method for processing web games in any embodiment.

[0129] Figure 4 A block diagram of an exemplary computer system / server 12 suitable for use in implementing embodiments of the present application is shown. Figure 4 The computer system / server 12 shown is merely an example and should not limit the functionality and scope of use of the embodiments of the present application.

[0130] like Figure 4 As shown, computer system / server 12 is represented in the form of a general-purpose computing device. Components of computer system / server 12 may include, but are not limited to: one or more processors or processing units 16, storage devices or system memory 28, and buses 18 that connect different system components (including system memory 28 and processing units 16).

[0131] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0132] Computer system / server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer system / server 12, including volatile and nonvolatile media, removable and non-removable media.

[0133] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer system / server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.

[0134] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0135] The computer system / server 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer system / server 12, and / or any device that enables the computer system / server 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 44. In addition, the computer system / server 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer system / server 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer system / server 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0136] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing Figure 1 or Figure 3 The corresponding embodiment provides a method for processing web games in any embodiment.

[0137] Another embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements Figure 1 or Figure 3The corresponding embodiment provides a method for processing web games in any embodiment.

[0138] Specifically, any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0139] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0140] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0141] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0143] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0146] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing a web game, characterized in that: include: The browser obtains web script information of a first web game engine in response to a first user operation of the user based on the web game conversion page, wherein the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine; The browser sends the web script information to the server in response to the second user operation of the user based on the web game conversion page, so that the server converts the first web script file into a second web script file that can be run in the web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine; The browser obtains the second web page script file converted by the server; wherein, The browser obtains web script information of the first web game engine in response to a first user operation based on a web game conversion page, including: The browser, in response to the first operation of the user based on the web game conversion page, obtains the path information provided by the user based on the web game conversion page; the browser obtains the first web script file developed by the first web game engine according to the path information; The browser, in response to the second operation of the user based on the web game conversion page, obtains the identification information of the first web game engine provided by the user based on the web game conversion page; the browser obtains the engine information of the first web game engine according to the identification information of the first web game engine; The server converts the first web script file into a second web script file that can be run in a web game running environment implemented based on the second web game engine according to the web script running rule of the second web game engine and the engine information of the first web game engine, including: The server creates an operation directory and an entry file according to the web script operation rules of the second web game engine; The server performs adaptation processing on the script content and resource content of the first web page script file according to the web page script running rule of the second web page game engine and the engine information of the first web page game engine to obtain adapted content; The server obtains the second web page script file according to the running directory, the entry file and the adaptation content.

2. The method according to claim 1, characterized in that The first web page script file includes a web page script file of a specific type of web page.

3. The method according to any one of claims 1 to 2, characterized in that: The browser obtains the second webpage script file converted by the server, including: The browser receives the second webpage script file converted by the server and sent by the server; or The browser downloads the second web page script file converted by the server from the server in response to a third user operation of the user based on the web page game conversion page.

4. A method for processing a web game, characterized in that: include: The server receives web script information of the first web game engine sent by the browser in response to the second user operation of the user based on the web game conversion page, wherein the web script information of the first web game engine includes a first web script file developed by the first web game engine and engine information of the first web game engine; wherein the web script information of the first web game engine is obtained by the browser in response to the first user operation of the user based on the web game conversion page; The server converts the first web script file into a second web script file that can be run in a web game running environment implemented based on the second web game engine according to the web script running rules of the second web game engine and the engine information of the first web game engine; The server provides the converted second web page script file to the browser; wherein, The web script information of the first web game engine is obtained by the browser in the following manner: the browser obtains the path information provided by the user based on the web game conversion page in response to the first operation of the user based on the web game conversion page; the browser obtains the first web script file developed by the first web game engine according to the path information; the browser obtains the identification information of the first web game engine provided by the user based on the web game conversion page in response to the second operation of the user based on the web game conversion page; the browser obtains the engine information of the first web game engine according to the identification information of the first web game engine; The server converts the first web script file into a second web script file that can be run in a web game running environment implemented based on the second web game engine according to the web script running rule of the second web game engine and the engine information of the first web game engine, including: The server creates an operation directory and an entry file according to the web script operation rules of the second web game engine; The server performs adaptation processing on the script content and resource content of the first web page script file according to the web page script running rule of the second web page game engine and the engine information of the first web page game engine to obtain adapted content; The server obtains the second web page script file according to the running directory, the entry file and the adaptation content.

5. The method according to claim 4, characterized in that The first web page script file includes a web page script file of a specific type of web page.

6. The method according to any one of claims 4 to 5, characterized in that: The server provides the converted second webpage script file to the browser, including: The server sends the second web page script file converted by the server to the browser; or The server provides the browser with the second web script file downloaded by the browser in response to a third user operation of the user based on the web game conversion page.

7. An electronic device, characterized in that: The device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for switching from mobile game to webgame

    CN104090765A

  • Page text conversion method and system

    CN106354700A