WO2020063088A1 - 游戏平台的底层调用方法及相关产品 - Google Patents

游戏平台的底层调用方法及相关产品 Download PDF

Info

Publication number
WO2020063088A1
WO2020063088A1 PCT/CN2019/098065 CN2019098065W WO2020063088A1 WO 2020063088 A1 WO2020063088 A1 WO 2020063088A1 CN 2019098065 W CN2019098065 W CN 2019098065W WO 2020063088 A1 WO2020063088 A1 WO 2020063088A1
Authority
WO
WIPO (PCT)
Prior art keywords
rendering
data
game
engine
engines
Prior art date
Application number
PCT/CN2019/098065
Other languages
English (en)
French (fr)
Inventor
李森林
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020063088A1 publication Critical patent/WO2020063088A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • the present application relates to the technical field of electronic devices, and in particular, to a low-level calling method of a game platform and related products.
  • games are widely used in electronic devices. Some games run on game platforms.
  • the existing game platforms cannot provide game developers with low-level calls to the game platform. This causes game developers to fail to use the low-level capabilities of the game platform. Game development progress.
  • the embodiments of the present application provide a low-level calling method and related products of a game platform, which can provide game developers with low-level calling of the game platform and improve the progress of game development.
  • an embodiment of the present application provides a low-level calling method of a game platform, where the method is applied to an electronic device, and the method includes the following steps:
  • the initialization operation includes: loading the underlying rendering in a JS engine, and adding an application programming interface API that calls rendering in the JS engine;
  • Receive the first game call the underlying rendering through the API interface of the JS engine to perform rendering processing on the first game, and run the first game.
  • a capability calling device for a game platform is provided.
  • the device is applied to an electronic device.
  • the device includes:
  • An initialization unit is configured to perform a game platform initialization operation.
  • the initialization operation includes: loading the underlying rendering in a JS engine, and adding an application programming interface API that calls rendering in the JS engine;
  • a receiving unit configured to receive a first game
  • the processing unit is configured to call the underlying rendering through the API interface of the JS engine to perform rendering processing on the first game, and run the first game.
  • an embodiment of the present application provides an electronic device including a processor, a memory, a communication interface, and one or more programs.
  • the one or more programs are stored in the memory, and are configured by the above.
  • the processor executes the program, and the program includes instructions for executing steps in the first aspect of the embodiment of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute a computer program as described in the first embodiment of the present application.
  • an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the implementation of the present application.
  • the JS engine loads the API interface to implement the underlying rendering call.
  • the gaming platform can directly implement the underlying rendering through the JS engine API. Call to implement the rendering operation of the first game picture, thereby facilitating developers to call the underlying capabilities of the game platform and improving the speed of game development.
  • FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a bottom-layer calling method of a game platform disclosed in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of another underlying calling method of a game platform disclosed in an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of another electronic device disclosed in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a low-level calling device of a game platform disclosed in an embodiment of the present application.
  • an embodiment herein means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application.
  • the appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they independent or alternative embodiments that are mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
  • the electronic devices involved in the embodiments of the present application may include various handheld devices (such as smart phones) with wireless communication functions, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem, and various forms User equipment (UE), mobile station (MS), terminal device (terminal device), R & D / testing platform, server, etc.
  • UE User equipment
  • MS mobile station
  • terminal device terminal device
  • R & D / testing platform server
  • FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device includes a control circuit and an input-output circuit, and the input-output circuit is connected to the control circuit.
  • the control circuit may include a storage and processing circuit.
  • the storage circuit in the storage and processing circuit may be a memory, such as a hard disk drive memory, a non-volatile memory (such as a flash memory or other electronic programmable read-only memory used to form a solid-state drive, etc.), a volatile memory (such as a static Or dynamic random access memory, etc.), this embodiment is not limited.
  • the processing circuit in the storage and processing circuit can be used to control the operation of the electronic device.
  • the processing circuit can be implemented based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
  • the storage and processing circuit can be used to run software in an electronic device, such as playing an incoming call alert ringing application, playing a short message alert ringing application, playing an alarm alert ringing application, playing a media file application, Internet protocol voice (voice Over Internet Protocol (VOIP) telephone calling applications, operating system functions, etc.
  • These software can be used to perform some control operations, such as playing the call alert ring, playing the short message alert ring, playing the alarm alert ring, playing media files, making voice phone calls, and other functions in electronic devices.
  • the examples are not limited.
  • the input-output circuit can be used to enable the electronic device to implement data input and output, that is, to allow the electronic device to receive data from an external device and to allow the electronic device to output data from the electronic device to the external device.
  • the input-output circuit may further include a sensor.
  • the sensor may include an ambient light sensor, an infrared proximity sensor based on light and capacitance, an ultrasonic sensor, and a touch sensor (for example, a light touch sensor and / or a capacitive touch sensor, where the touch sensor may be part of a touch display screen, or Can be used independently as a touch sensor structure), acceleration sensor, gravity sensor, and other sensors.
  • the input-output circuit may further include an audio component, and the audio component may be used to provide audio input and output functions for the electronic device.
  • the audio component may also include a tone generator and other components for generating and detecting sound.
  • the input-output circuit may also include one or more display screens.
  • the display screen may include one or a combination of a liquid crystal display, an organic light emitting diode display, an electronic ink display, a plasma display, and a display using other display technologies.
  • the display screen may include a touch sensor array (ie, the display screen may be a touch display screen).
  • the touch sensor can be a capacitive touch sensor formed by a transparent array of touch sensor electrodes (such as indium tin oxide (ITO) electrodes), or it can be a touch sensor formed using other touch technologies, such as sonic touch, pressure-sensitive touch, resistance Touch, optical touch, etc. are not limited in the embodiments of the present application.
  • the input-output circuit can further include a communication circuit that can be used to provide the electronic device with the ability to communicate with external devices.
  • the communication circuit may include analog and digital input-output interface circuits, and wireless communication circuits based on radio frequency signals and / or optical signals.
  • the wireless communication circuit in the communication circuit may include a radio frequency transceiver circuit, a power amplifier circuit, a low noise amplifier, a switch, a filter, and an antenna.
  • the wireless communication circuit in the communication circuit may include a circuit for supporting near field communication (NFC) by transmitting and receiving a near field coupled electromagnetic signal.
  • the communication circuit may include a near field communication antenna and a near field communication transceiver.
  • the communication circuit may also include a cellular phone transceiver and antenna, a wireless local area network transceiver circuit and antenna, and the like.
  • the input-output circuit may further include other input-output units.
  • the input-output unit may include a button, a joystick, a click wheel, a scroll wheel, a touch pad, a keypad, a keyboard, a camera, a light emitting diode, and other status indicators.
  • the electronic device may further include a battery (not shown), and the battery is used to provide power to the electronic device.
  • FIG. 2 provides a method for invoking a capability of a game platform. The method is executed by the electronic device shown in FIG. 1. The method shown in FIG. 2 includes the following steps:
  • Step S201 Perform a game platform initialization operation.
  • the initialization operation of the above step S201 may specifically be that the underlying rendering is loaded into a JS engine.
  • the JS engine includes: an application programming interface (English: Application Programming Interface, API), and the API is used to call the underlying rendering.
  • the above-mentioned underlying rendering is implemented by C ++, and this application does not limit the specific implementation manner of the above-mentioned C ++.
  • the above initialization operation may specifically include:
  • Step S202 Receive the first game, call the underlying rendering through the API interface of the JS engine to perform rendering processing on the first game, and run the first game.
  • the technical solution provided in this application loads the API interface in the JS engine to implement the underlying rendering call.
  • the gaming platform can directly implement the underlying rendering call through the JS engine's API to implement The rendering operation of the first game picture, thereby facilitating developers to call the underlying capabilities of the game platform and improving the speed of game development.
  • the calling the underlying rendering through the API interface of the JS engine to perform rendering processing on the first game specifically includes:
  • the JS engine determines the rendering data corresponding to the rendering, divides the rendering data into multiple rendering sub-data, passes the multiple rendering sub-data to the bottom layer, and the bottom layer distributes multiple rendering sub-data to multiple cores, and each core performs rendering sub-data rendering After the operation, the rendering sub-results are obtained. Each core passes the rendering sub-results to the bottom layer. The bottom layer combines multiple rendering sub-results into a rendering result and returns it to the JS engine.
  • the above allocating multiple rendering sub-data to multiple JS engines may specifically include:
  • the above division method of the master JS engine and the n slave JS engines includes, but is not limited to, division by a preset method, that is, the processing in multiple JS engines can be stronger (or the engine with the largest number of threads).
  • the main JS engine and others are slave JS engines. Because the master JS engine allocates more serial data, the processing time of serial data directly affects the overall processing efficiency, so the stronger JS engine is assigned as The main engine.
  • connection relationship to determine the JS engine with the most interconnection among multiple JS engines as the main JS engine. For example, 1 of the 5 JS engines is connected to the other 4 JS engines to determine the JS engine.
  • the master engine in which the way is to avoid the need to forward the data, the master-slave data can be sent directly, reducing the time of data transmission.
  • the determining the serial data and the parallel data in the rendering data specifically includes:
  • Obtaining multiple steps of rendering data extracting the first storage interval of the output data of the first step and the second storage interval of the input data of the second step in two adjacent steps of the multiple steps, such as the second storage interval and The first storage interval overlaps, and it is determined that the output data of the first storage interval and the input data of the second storage interval are serial data; if the second storage interval does not overlap with the first storage interval, the first storage interval is determined.
  • the output data of the storage section and the input data of the second storage section are both parallel data.
  • serial data For the criticality between the data to determine whether it is parallel data or serial data, for serial data, it generally requires the data processed in the previous step, but for parallel data, it is not necessary, then it can be determined whether its storage space overlaps. Whether the data is parallel or serial.
  • the calling the underlying rendering through the JS engine's API interface to perform rendering processing on the first game specifically includes:
  • first JS engine with an idle API from multiple JS engines, call the idle API of the first JS engine, call the underlying rendering, and perform rendering processing on the first game.
  • the calling JS engine may be determined according to the mapping relationship between the rendering and the engine.
  • mapping relationship may be preset by a user or may be determined by an actual calling relationship.
  • an API corresponding to a capability call instruction may be an API corresponding to a rendering capability.
  • JS Java script
  • JS is a web front-end description language, and it is also a script language with good security based on object and event-driven.
  • APIs are predefined functions designed to provide applications and developers with the ability to access a set of routines based on certain software or hardware without having to access the source code or understand the details of the internal working mechanism.
  • the JS engine determines the rendering data corresponding to the rendering instructions, divides the rendering data into multiple rendering sub-data, passes the multiple rendering sub-data to the bottom layer, and the bottom layer sends multiple rendering sub-data.
  • the data is distributed to multiple cores.
  • Each core performs rendering operations on the rendering sub-data to obtain rendering sub-results.
  • Each core passes the rendering sub-results to the bottom layer.
  • the bottom layer combines multiple rendering sub-results into a rendering result and returns it to the JS engine.
  • the above technical solution divides the rendering data of the rendering instruction, so that for a multi-core processor, each core can process a part of the rendering sub-data.
  • the specific rendering sub-data may be data based on a picture frame as a basic unit, of course. In practical applications, it can also be smaller or larger picture units. In this way, the rendering data is split and processed by multiple cores in parallel, which can improve rendering speed and facilitate developer applications.
  • running the first game includes:
  • the calling the underlying rendering through the JS engine's API interface to perform rendering processing on the first game specifically includes:
  • This rendering data is split into multiple rendering sub-data, multiple rendering sub-data is assigned to multiple JS engines to perform rendering operations to obtain multiple rendering sub-results, and multiple rendering sub-results are combined to obtain rendering results.
  • FIG. 3 provides a low-level calling method of a game platform.
  • the method is executed by the electronic device shown in FIG. 1.
  • the method specifically includes:
  • Step S301 Perform a game platform initialization operation.
  • Step S302 Receive a first game.
  • Step S303 Split the rendering data into multiple rendering sub-data, allocate the multiple rendering sub-data to multiple JS engines, and perform rendering operations respectively to obtain multiple rendering sub-results;
  • Step S304 Combine multiple rendering sub-results to obtain a rendering result
  • Step S305 Use the storage space of the surface software (Surface View) of the system software (for example, Android) to render and display the rendered first game, invoke the rules of the first game, and run the first game according to the rules.
  • the system software for example, Android
  • the technical solution provided in this application loads the API interface in the JS engine to implement the underlying rendering call.
  • the gaming platform can directly implement the underlying rendering call through the JS engine's API to implement The rendering operation of the first game picture, thereby facilitating developers to call the underlying capabilities of the game platform and improving the speed of game development.
  • FIG. 4 is a schematic structural diagram of another electronic device disclosed in an embodiment of the present application.
  • the electronic device includes a processor, a memory, a communication interface, and one or more programs.
  • One or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for performing the following steps:
  • the initialization operation includes: loading the underlying rendering in a JS engine, the JS engine includes: an application programming interface API, the API is used to call rendering;
  • Receive the first game call the underlying rendering through the API interface of the JS engine to perform rendering processing on the first game, and run the first game.
  • the technical solution provided in this application loads the API interface in the JS engine to implement the underlying rendering call.
  • the gaming platform can directly implement the underlying rendering call through the JS engine's API to implement The rendering operation of the first game picture, thereby facilitating developers to call the underlying capabilities of the game platform and improving the speed of game development.
  • the above program includes instructions for performing the following steps:
  • the API interface of the JS engine calls the underlying rendering to perform rendering processing on the first game specifically including:
  • the JS engine determines the rendering data corresponding to the rendering, divides the rendering data into multiple rendering sub-data, passes the multiple rendering sub-data to the bottom layer, and the bottom layer distributes multiple rendering sub-data to multiple cores, and each core performs rendering sub-data rendering After the operation, the rendering sub-results are obtained. Each core passes the rendering sub-results to the bottom layer. The bottom layer combines multiple rendering sub-results into a rendering result and returns it to the JS engine.
  • the above program includes instructions for performing the following steps:
  • the running the first game specifically includes: drawing and displaying the rendered first game using the storage space of the surface drawing of the system software, invoking a rule of the first game, and running the first game according to the rule.
  • the above program includes instructions for performing the following steps:
  • the calling the underlying rendering through the JS engine API interface to perform rendering processing on the first game specifically includes:
  • This rendering data is split into multiple rendering sub-data, multiple rendering sub-data is assigned to multiple JS engines to perform rendering operations to obtain multiple rendering sub-results, and multiple rendering sub-results are combined to obtain rendering results.
  • the allocating multiple rendering sub-data to multiple JS engines may specifically include:
  • the determining the serial data and parallel data in the rendering data may specifically include:
  • the above program includes instructions for performing the following steps:
  • the calling the underlying rendering through the JS engine API interface to perform rendering processing on the first game specifically includes:
  • the electronic device includes a hardware structure and / or a software module corresponding to each function.
  • this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is performed by hardware or computer software-driven hardware depends on the specific application of the technical solution and design constraints. Professional technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
  • the embodiments of the present application may divide the functional units of the electronic device according to the foregoing method examples.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit. It should be noted that the division of the units in the embodiments of the present application is schematic, and is only a logical function division. There may be another division manner in actual implementation.
  • FIG. 5 is a schematic structural diagram of a capability calling device of a game platform disclosed in an embodiment of the present application, which is applied to the electronic device shown in FIG. 1.
  • the capability calling device 500 of the game platform includes an initialization unit 501, The receiving unit 502 and the processing unit 503.
  • the initialization unit 501 is configured to perform a game platform initialization operation.
  • the initialization operation includes: loading a low-level rendering in a JS engine, and the JS engine includes: an application programming interface API, and the API is used to call rendering;
  • a receiving unit 502 configured to receive a first game
  • the processing unit 503 is configured to call the underlying rendering through the API interface of the JS engine to perform rendering processing on the first game, and run the first game.
  • the technical solution provided in this application loads the API interface in the JS engine to implement the underlying rendering call.
  • the gaming platform can directly implement the underlying rendering call through the JS engine's API to implement The rendering operation of the first game picture, thereby facilitating developers to call the underlying capabilities of the game platform and improving the speed of game development.
  • the processing unit 503 is specifically configured to perform rendering on the first game by calling the underlying rendering through the API interface of the JS engine:
  • the JS engine determines the rendering data corresponding to the rendering, divides the rendering data into multiple rendering sub-data, passes the multiple rendering sub-data to the bottom layer, and the bottom layer distributes multiple rendering sub-data to multiple cores, and each core performs rendering sub-data rendering After the operation, the rendering sub-results are obtained. Each core passes the rendering sub-results to the bottom layer. The bottom layer combines multiple rendering sub-results into a rendering result and returns it to the JS engine.
  • the processing unit 503 is specifically configured to:
  • the processing unit 503 is specifically configured to perform rendering processing on the first game by calling the underlying rendering through the API interface of the JS engine:
  • This rendering data is split into multiple rendering sub-data, multiple rendering sub-data is assigned to multiple JS engines to perform rendering operations to obtain multiple rendering sub-results, and multiple rendering sub-results are combined to obtain rendering results.
  • the processing unit 503 is specifically configured to:
  • the processing unit 503 is specifically configured to:
  • Obtaining multiple steps of rendering data extracting the first storage interval of the output data of the first step and the second storage interval of the input data of the second step in two adjacent steps of the multiple steps, such as the second storage interval and The first storage interval overlaps, and it is determined that the output data of the first storage interval and the input data of the second storage interval are serial data; if the second storage interval does not overlap with the first storage interval, the first storage interval is determined.
  • the output data of the storage section and the input data of the second storage section are both parallel data.
  • the processing unit 503 is specifically configured to:
  • n other JS engines other than the master JS engine are used as slave engines.
  • the processing unit 503 is specifically configured to perform rendering processing on the first game by calling the underlying rendering through the API interface of the JS engine:
  • each "unit” can be, for example, an integrated circuit ASIC, a single circuit, used to execute one or more software or firmware.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute a low-level call of any game platform as described in the foregoing method embodiments. Part or all of the steps of a method.
  • An embodiment of the present application further provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the operations described in the foregoing method embodiments. Some or all of the steps of the underlying calling method of any game platform.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may Integration into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software program modules.
  • the integrated unit When the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it may be stored in a computer-readable memory.
  • the technical solution of the present application essentially or part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the foregoing memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk, and other media that can store program codes.
  • the program may be stored in a computer-readable memory, and the memory may include a flash disk. , ROM, RAM, disk or disc, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

一种游戏平台的底层调用方法及相关产品,所述方法应用于电子装置,所述方法包括如下步骤:执行游戏平台初始化操作(S201),所述初始化操作包括:将底层渲染加载在JS引擎内,在所述JS引擎添加调用渲染的应用程序编程接口API;接收第一游戏,通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏(S202)。该方法具有提高游戏开发进度的优点。

Description

游戏平台的底层调用方法及相关产品 技术领域
本申请涉及电子设备技术领域,具体涉及一种游戏平台的底层调用方法及相关产品。
背景技术
随着电子设备(如手机、平板电脑等)的大量普及应用,电子设备能够支持的应用越来越多,功能越来越强大,电子设备向着多样化、个性化的方向发展,成为用户生活中不可缺少的电子用品。
尤其是游戏,在电子设备中得到广泛应用,有些游戏基于游戏平台运行,现有的游戏平台无法为游戏开发者提供游戏平台的底层调用,这样导致游戏开发者无法使用游戏平台的底层能力,影响游戏开发的进度。
发明内容
本申请实施例提供了一种游戏平台的底层调用方法及相关产品,能够为游戏开发者提供游戏平台底层的调用,提升游戏开发的进度。
第一方面,本申请实施例提供一种游戏平台的底层调用方法,所述方法应用于电子装置,所述方法包括如下步骤:
执行游戏平台初始化操作,所述初始化操作包括:将底层渲染加载在JS引擎内,在所述JS引擎添加调用渲染的应用程序编程接口API;
接收第一游戏,通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏。
第二方面,提供一种游戏平台的能力调用装置,所述装置应用于电子装置,所述装置包括:
初始化单元,用于执行游戏平台初始化操作,所述初始化操作包括:将底层渲染加载在JS引擎内,在所述JS引擎添加调用渲染的应用程序编程接口API;
接收单元,用于接收第一游戏;
处理单元,用于通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏。
第三方面,本申请实施例提供一种电子设备,包括处理器、存储器、通信接口,以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行本申请实施例第一方面中的步骤的指令。
第四方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,上述计算机程序使得计算机执行如本申请实施例第一方面中所描述的部分或全部步骤。
第五方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
可以看出,本申请提供的技术方案在游戏平台初始化以后,在JS引擎加载了API接口实现底层渲染的调用,这样在接收第一游戏后,游戏平台可以直接将通过JS引擎的API实现底层渲染的调用以实现对第一游戏图片的渲染操作,从而方便开发者对游戏平台底层能力的调用,提高游戏开发的速度。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种电子设备的结构示意图;
图2是本申请实施例公开的一种游戏平台的底层调用方法的流程示意图;
图3是本申请实施例公开的另一种游戏平台的底层调用方法的流程示意图;
图4是本申请实施例公开的另一种电子设备的结构示意图;
图5是本申请实施例公开的一种游戏平台的底层调用装置的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
本申请实施例所涉及到的电子设备可以包括各种具有无线通信功能的手持设备(如智能手机)、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(user equipment,UE),移动台(mobile station,MS),终端设备(terminal device)、研发/测试平台、服务器等等。为方便描述,上面提到的设备统称为电子设备。
请参阅图1,图1是本申请实施例提供了一种电子设备的结构示意图,电子设备包括控制电路和输入-输出电路,输入输出电路与控制电路连接。
其中,控制电路可以包括存储和处理电路。该存储和处理电路中的存储电路可以是存储器,例如硬盘驱动存储器,非易失性存储器(例如闪存或用于形成固态驱动器的其它电子可编程只读存储器等),易失性存储器(例如静态或 动态随机存取存储器等)等,本申请实施例不作限制。存储和处理电路中的处理电路可以用于控制电子设备的运转。该处理电路可以基于一个或多个微处理器,微控制器,数字信号处理器,基带处理器,功率管理单元,音频编解码器芯片,专用集成电路,显示驱动器集成电路等来实现。
存储和处理电路可用于运行电子设备中的软件,例如播放来电提示响铃应用程序、播放短消息提示响铃应用程序、播放闹钟提示响铃应用程序、播放媒体文件应用程序、互联网协议语音(voice over internet protocol,VOIP)电话呼叫应用程序、操作系统功能等。这些软件可以用于执行一些控制操作,例如,播放来电提示响铃、播放短消息提示响铃、播放闹钟提示响铃、播放媒体文件、进行语音电话呼叫以及电子设备中的其它功能等,本申请实施例不作限制。
其中,输入-输出电路可用于使电子设备实现数据的输入和输出,即允许电子设备从外部设备接收数据和允许电子设备将数据从电子设备输出至外部设备。
输入-输出电路可以进一步包括传感器。传感器可以包括环境光传感器,基于光和电容的红外接近传感器,超声波传感器,触摸传感器(例如,基于光触摸传感器和/或电容式触摸传感器,其中,触摸传感器可以是触控显示屏的一部分,也可以作为一个触摸传感器结构独立使用),加速度传感器,重力传感器,和其它传感器等。输入-输出电路还可以进一步包括音频组件,音频组件可以用于为电子设备提供音频输入和输出功能。音频组件还可以包括音调发生器以及其它用于产生和检测声音的组件。
输入-输出电路还可以包括一个或多个显示屏。显示屏可以包括液晶显示屏,有机发光二极管显示屏,电子墨水显示屏,等离子显示屏,使用其它显示技术的显示屏中一种或者几种的组合。显示屏可以包括触摸传感器阵列(即,显示屏可以是触控显示屏)。触摸传感器可以是由透明的触摸传感器电极(例如氧化铟锡(ITO)电极)阵列形成的电容式触摸传感器,或者可以是使用其它触摸技术形成的触摸传感器,例如音波触控,压敏触摸,电阻触摸,光学触摸等,本申请实施例不作限制。
输入-输出电路还可以进一步包括通信电路可以用于为电子设备提供与外部设备通信的能力。通信电路可以包括模拟和数字输入-输出接口电路,和基 于射频信号和/或光信号的无线通信电路。通信电路中的无线通信电路可以包括射频收发器电路、功率放大器电路、低噪声放大器、开关、滤波器和天线。举例来说,通信电路中的无线通信电路可以包括用于通过发射和接收近场耦合电磁信号来支持近场通信(near field communication,NFC)的电路。例如,通信电路可以包括近场通信天线和近场通信收发器。通信电路还可以包括蜂窝电话收发器和天线,无线局域网收发器电路和天线等。
输入-输出电路还可以进一步包括其它输入-输出单元。输入-输出单元可以包括按钮,操纵杆,点击轮,滚动轮,触摸板,小键盘,键盘,照相机,发光二极管和其它状态指示器等。
其中,电子设备还可以进一步包括电池(未图示),电池用于给电子设备提供电能。
下面对本申请实施例进行详细介绍。
参阅图2,图2提供了一种游戏平台的能力调用方法,该方法有如图1所示的电子装置执行,该方法如图2所示,包括如下步骤:
步骤S201、执行游戏平台初始化操作;
上述步骤S201的初始化操作具体可以为,将底层渲染加载在JS引擎内,该JS引擎包括:应用程序编程接口(英文:Application Programming Interface,API),该API用于调用该底层渲染。上述底层渲染通过C++实现,本申请并不限制上述C++的具体实现方式。
上述初始化操作具体可以包括:
确定登录的游戏平台,加载游戏平台的本地存储文件,启动C++、JS引擎以及系统软件平台,将该游戏平台的本地存储文件,JS引擎通过API接口调用C++实现对游戏平台图片的渲染,在渲染完成后,在系统软件平台运行该游戏平台。
步骤S202、接收第一游戏,通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏。
本申请提供的技术方案在游戏平台初始化以后,在JS引擎加载了API接口实现底层渲染的调用,这样在接收第一游戏后,游戏平台可以直接将通过JS引擎的API实现底层渲染的调用以实现对第一游戏图片的渲染操作,从而方 便开发者对游戏平台底层能力的调用,提高游戏开发的速度。
可选的,如所述电子装置包括多核处理器,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
JS引擎确定渲染对应的渲染数据,将渲染数据划分成多个渲染子数据,将多个渲染子数据传递给底层,底层将多个渲染子数据分发给多核,每个核将渲染子数据执行渲染操作以后得到渲染子结果,每个核将渲染子结果传递给底层,底层将多个渲染子结果组成渲染结果后返回给JS引擎。
可选的,上述将多个渲染子数据分配个多个JS引擎具体可以包括:
确定该渲染数据中的串行数据和并行数据,将多个JS引擎划分成主JS引擎和n个从JS引擎,将串行数据划分值主JS引擎,将并行数据分别下发至不同的从JS引擎,所述n为大于等于2的整数,所述串行数据和并行数据为所述渲染子数据。
上述主JS引擎和n个从JS引擎的划分方法包括但不限于,可以通过预设设定的方式来划分,即将多个JS引擎中处理能够较强(也可以是线程数量最多的引擎)确定为主JS引擎,其他的为从JS引擎,因为对于主JS引擎,其分配了更多的串行数据,串行数据的处理时间直接影响到整体的处理效率,所以分配较强的JS引擎为主引擎。
其次,还可以以连接关系来分配,确定多个JS引擎中互联数量最多的JS引擎作为主JS引擎,例如5个JS引擎中有1个JS引擎连接了其他4个JS引擎,确定该JS引擎为主引擎,其中方式是为了避免数据需要转发,主到从的数据可以直接发送,减少数据发送的时间。
可选的,所述确定该渲染数据中的串行数据和并行数据具体包括:
获取渲染数据的多个步骤,提取多个步骤中相邻的两个步骤中第一步骤的输出数据第一存储区间与第二步骤的输入数据第二存储区间,如所述第二存储区间与第一存储区间交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为串行数据;如所述第二存储区间与第一存储区间不交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为并行数据。
对于数据之间的关键性来确定是否为并行数据或串行数据,对于串行数据,其一般需要使用前面步骤处理的数据,而并行数据则不需要,那么确定其存储 空间是否重叠即能够确定该数据是否为并行或串行数据。
可选的,如所述JS引擎为多个时,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
获取多个JS引擎中每个JS引擎的任务数量,选择任务数量最少的第一JS引擎,调用第一JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理。
对于多个JS引擎的情况,需要确定多个JS引擎中任务数量最小的引擎,此引擎比较空闲,这样执行渲染的调用可以提高调用的效率。
当然在实际应用中,还可以是,从多个JS引擎中选择API空闲的第一JS引擎,调用第一JS引擎的空闲的API调用底层渲染对第一游戏执行渲染处理。
可选的,如为多个JS引擎时,可以依据渲染与引擎的映射关系确定调用的JS引擎。
上述映射关系可以有用户预先设定或可以由实际的调用关系来确定,具体的,例如为渲染,其能力调用指令对应的API可以为渲染能力对应的API。
JS(java Script)是一种web前端的描述语言,也是一种基于对象(object)和事件驱动(Event Driven)的、安全性好的脚本语言。
API是一些预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件得以访问一组例程的能力,而又无需访问源码,或理解内部工作机制的细节。
为了对外提供统一的API接口,需要对开发者开放资源调用API的站点提供开放统一的API接口环境,来帮助使用者访问站点的功能和资源。
可选的,如电子装置为多核处理器,则JS引擎确定渲染指令对应的渲染数据,将渲染数据划分成多个渲染子数据,将多个渲染子数据传递给底层,底层将多个渲染子数据分发给多核,每个核将渲染子数据执行渲染操作以后得到渲染子结果,每个核将渲染子结果传递给底层,底层将多个渲染子结果组成渲染结果后返回给JS引擎。
上述技术方案将渲染指令的渲染数据进行拆分,这样对于多核处理器来说,每个核均能够处理一部分渲染子数据,具体的该渲染子数据可以是以图片帧为基本单元的数据,当然在实际应用中,也可以为更小或更大的图片单位。这样 将渲染数据拆分以后由多核并行处理,能够提高渲染的速度,方便开发者应用。
可选的,运行第一游戏具体包括:
使用系统软件的表层绘制作为容器对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
可选的,如所述JS引擎为多个时,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
将该渲染数据拆分成多个渲染子数据,将多个渲染子数据分配个多个JS引擎分别执行渲染操作得到多个渲染子结果,将多个渲染子结果组合起来得到渲染结果。
参阅图3,图3提供了一种游戏平台的底层调用方法,该方法由如图1所示的电子装置执行,该方法具体包括:
步骤S301、执行游戏平台初始化操作。
确定登录的游戏平台,加载游戏平台的本地存储文件,启动C++、JS引擎以及系统软件平台,将该游戏平台的本地存储文件,JS引擎通过API接口调用C++实现对游戏平台图片的渲染,在渲染完成后,在系统软件平台运行该游戏平台。
步骤S302、接收第一游戏;
步骤S303、将该渲染数据拆分成多个渲染子数据,将多个渲染子数据分配个多个JS引擎分别执行渲染操作得到多个渲染子结果;
步骤S304、将多个渲染子结果组合起来得到渲染结果;
步骤S305、使用系统软件(例如安卓)的表层绘制(Surface View)的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
本申请提供的技术方案在游戏平台初始化以后,在JS引擎加载了API接口实现底层渲染的调用,这样在接收第一游戏后,游戏平台可以直接将通过JS引擎的API实现底层渲染的调用以实现对第一游戏图片的渲染操作,从而方便开发者对游戏平台底层能力的调用,提高游戏开发的速度。
请参阅图4,图4是本申请实施例公开的另一种电子设备的结构示意图,如图所示,该电子设备包括处理器、存储器、通信接口,以及一个或多个程序, 其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令:
执行游戏平台初始化操作,所述初始化操作包括:将底层渲染加载在JS引擎内,所述JS引擎包括:应用程序编程接口API,所述API用于调用渲染;
接收第一游戏,通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏。
本申请提供的技术方案在游戏平台初始化以后,在JS引擎加载了API接口实现底层渲染的调用,这样在接收第一游戏后,游戏平台可以直接将通过JS引擎的API实现底层渲染的调用以实现对第一游戏图片的渲染操作,从而方便开发者对游戏平台底层能力的调用,提高游戏开发的速度。
在一种可选的方案中,上述程序包括用于执行以下步骤的指令:
如所述电子装置包括多核处理器,所述过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
JS引擎确定渲染对应的渲染数据,将渲染数据划分成多个渲染子数据,将多个渲染子数据传递给底层,底层将多个渲染子数据分发给多核,每个核将渲染子数据执行渲染操作以后得到渲染子结果,每个核将渲染子结果传递给底层,底层将多个渲染子结果组成渲染结果后返回给JS引擎。
在一种可选的方案中,上述程序包括用于执行以下步骤的指令:
所述运行第一游戏具体包括:使用系统软件的表层绘制的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
在一种可选的方案中,上述程序包括用于执行以下步骤的指令:
如所述JS引擎为多个时,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
将该渲染数据拆分成多个渲染子数据,将多个渲染子数据分配个多个JS引擎分别执行渲染操作得到多个渲染子结果,将多个渲染子结果组合起来得到渲染结果。
在一种可选的方案中,上述程序包括用于执行以下步骤的指令:所述将多个渲染子数据分配个多个JS引擎具体可以包括:
确定该渲染数据中的串行数据和并行数据,将多个JS引擎划分成主JS引 擎和n个从JS引擎,将串行数据划分值主JS引擎,将并行数据分别下发至不同的从JS引擎,所述n为大于等于2的整数,所述串行数据和并行数据为所述渲染子数据。
在一种可选的方案中,上述程序包括用于执行以下步骤的指令:所述确定该渲染数据中的串行数据和并行数据具体可以包括:
获取渲染数据的多个步骤,提取多个步骤中相邻的两个步骤中第一步骤的输出数据第一存储区间与第二步骤的输入数据第二存储区间,如所述第二存储区间与第一存储区间交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为串行数据;如所述第二存储区间与第一存储区间不交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为并行数据。在一种可选的方案中,上述程序包括用于执行以下步骤的指令:
如所述JS引擎为多个时,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
获取多个JS引擎中每个JS引擎的任务数量,选择任务数量最少的第一JS引擎,调用第一JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所提供的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
请参阅图5,图5是本申请实施例公开的一种游戏平台的能力调用装置的 结构示意图,应用于图1所示的电子设备,所述游戏平台的能力调用装置500包括初始化单元501、接收单元502和处理单元503,其中,
初始化单元501,用于执行游戏平台初始化操作,所述初始化操作包括:将底层渲染加载在JS引擎内,所述JS引擎包括:应用程序编程接口API,所述API用于调用渲染;
接收单元502,用于接收第一游戏;
处理单元503,用于通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏。
本申请提供的技术方案在游戏平台初始化以后,在JS引擎加载了API接口实现底层渲染的调用,这样在接收第一游戏后,游戏平台可以直接将通过JS引擎的API实现底层渲染的调用以实现对第一游戏图片的渲染操作,从而方便开发者对游戏平台底层能力的调用,提高游戏开发的速度。
可选的,如所述电子装置包括多核处理器,在所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染方面,所述处理单元503具体用于:
JS引擎确定渲染对应的渲染数据,将渲染数据划分成多个渲染子数据,将多个渲染子数据传递给底层,底层将多个渲染子数据分发给多核,每个核将渲染子数据执行渲染操作以后得到渲染子结果,每个核将渲染子结果传递给底层,底层将多个渲染子结果组成渲染结果后返回给JS引擎。
可选的,在所述运行第一游戏方面,所述处理单元503具体用于:
使用系统软件的表层绘制的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
可选的,如所述JS引擎为多个时,在所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理方面,所述处理单元503具体用于:
将该渲染数据拆分成多个渲染子数据,将多个渲染子数据分配个多个JS引擎分别执行渲染操作得到多个渲染子结果,将多个渲染子结果组合起来得到渲染结果。
可选的,在所述将多个渲染子数据分配个多个JS引擎方面,所述处理单元503具体用于:
确定该渲染数据中的串行数据和并行数据,将多个JS引擎划分成主JS引 擎和n个从JS引擎,将串行数据划分值主JS引擎,将并行数据分别下发至不同的从JS引擎,所述n为大于等于2的整数,所述串行数据和并行数据为所述渲染子数据。
可选的,在所述确定该渲染数据中的串行数据和并行数据方面,所述处理单元503具体用于:
获取渲染数据的多个步骤,提取多个步骤中相邻的两个步骤中第一步骤的输出数据第一存储区间与第二步骤的输入数据第二存储区间,如所述第二存储区间与第一存储区间交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为串行数据;如所述第二存储区间与第一存储区间不交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为并行数据。
可选的,在所述将多个JS引擎划分成主JS引擎和n个从JS引擎方面,所述处理单元503具体用于:
确定多个JS引擎中互联数量最多的JS引擎作为主JS引擎,将除所述主JS引擎之外的n个其他JS引擎作为从引擎。
可选的,如所述JS引擎为多个时,在所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理方面,所述处理单元503具体用于:
获取多个JS引擎中每个JS引擎的任务数量,选择任务数量最少的第一JS引擎,调用第一JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理。
需要注意的是,本申请实施例所描述的电子设备是以功能单元的形式呈现。这里所使用的术语“单元”应当理解为尽可能最宽的含义,用于实现各个“单元”所描述功能的对象例如可以是集成电路ASIC,单个电路,用于执行一个或多个软件或固件程序的处理器(共享的、专用的或芯片组)和存储器,组合逻辑电路,和/或提供实现上述功能的其他合适的组件。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任何一种游戏平台的底层调用方法的部分或全部步骤。
本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计 算机执行如上述方法实施例中记载的任何一种游戏平台的底层调用方法的部分或全部步骤。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。
所述集成的单元如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网 络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、ROM、RAM、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种游戏平台的底层调用方法,其特征在于,所述方法应用于电子装置,所述方法包括如下步骤:
    执行游戏平台初始化操作,所述初始化操作包括:将底层渲染加载在JS引擎内,在所述JS引擎添加调用渲染的应用程序编程接口API;
    接收第一游戏,通过JS引擎的APl接口调用底层渲染对所述第一游戏执行渲染处理,运行第一游戏。
  2. 根据权利要求1所述的方法,其特征在于,如所述电子装置包括多核处理器,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
    JS引擎确定渲染对应的渲染数据,将渲染数据划分成多个渲染子数据,将多个渲染子数据传递给底层,底层将多个渲染子数据分发给多核,每个核将渲染子数据执行渲染操作以后得到渲染子结果,每个核将渲染子结果传递给底层,底层将多个渲染子结果组成渲染结果后返回给JS引擎。
  3. 根据权利要求1所述的方法,其特征在于,所述运行第一游戏具体包括:
    使用系统软件的表层绘制的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
  4. 根据权利要求2所述的方法,其特征在于,所述运行第一游戏具体包括:
    使用系统软件的表层绘制的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
  5. 根据权利要求1所述的方法,其特征在于,如所述JS引擎为多个时,所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
    将该渲染数据拆分成多个渲染子数据,将多个渲染子数据分配个多个JS引擎分别执行渲染操作得到多个渲染子结果,将多个渲染子结果组合起来得到渲染结果。
  6. 根据权利要求5所述的方法,其特征在于,所述将多个渲染子数据分 配个多个JS引擎具体包括:
    确定该渲染数据中的串行数据和并行数据,将多个JS引擎划分成主JS引擎和n个从JS引擎,将串行数据划分值主JS引擎,将并行数据分别下发至不同的从JS引擎,所述n为大于等于2的整数,所述串行数据和并行数据为所述渲染子数据。
  7. 根据权利要求6所述的方法,其特征在于,所述确定该渲染数据中的串行数据和并行数据具体包括:
    获取渲染数据的多个步骤,提取多个步骤中相邻的两个步骤中第一步骤的输出数据第一存储区间与第二步骤的输入数据第二存储区间,如所述第二存储区间与第一存储区间交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为串行数据;如所述第二存储区间与第一存储区间不交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为并行数据。
  8. 根据权利要求6所述的方法,其特征在于,所述将多个JS引擎划分成主JS引擎和n个从JS引擎具体包括:
    确定多个JS引擎中互联数量最多的JS引擎作为主JS引擎,将除所述主JS引擎之外的n个其他JS引擎作为从引擎。
  9. 根据权利要求1所述的方法,其特征在于,如所述JS引擎为多个时,所述通过JS引擎的APl接口调用底层渲染对所述第一游戏执行渲染处理具体包括:
    获取多个JS引擎中每个JS引擎的任务数量,选择任务数量最少的第一JS引擎,调用第一JS引擎的APl接口调用底层渲染对所述第一游戏执行渲染处理。
  10. 一种游戏平台的能力调用装置,其特征在于,所述装置应用于电子装置,所述装置包括:
    初始化单元,用于执行游戏平台初始化操作,所述初始化操作包括:将底层渲染加载在JS引擎内,在所述JS引擎添加调用渲染的应用程序编程接口API;
    接收单元,用于接收第一游戏;
    处理单元,用于通过JS引擎的API接口调用底层渲染对所述第一游戏执 行渲染处理,运行第一游戏。
  11. 根据权利要求10所述的装置,其特征在于,如所述电子装置包括多核处理器,在所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染方面,所述处理单元具体用于:
    JS引擎确定渲染对应的渲染数据,将渲染数据划分成多个渲染子数据,将多个渲染子数据传递给底层,底层将多个渲染子数据分发给多核,每个核将渲染子数据执行渲染操作以后得到渲染子结果,每个核将渲染子结果传递给底层,底层将多个渲染子结果组成渲染结果后返回给JS引擎。
  12. 根据权利要求10所述的装置,其特征在于,在所述运行第一游戏方面,所述处理单元具体用于:
    使用系统软件的表层绘制的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
  13. 根据权利要求11所述的装置,其特征在于,在所述运行第一游戏方面,所述处理单元具体用于:
    使用系统软件的表层绘制的存储空间对渲染后的第一游戏进行绘制显示,调用第一游戏的规则,依据该规则运行第一游戏。
  14. 根据权利要求10所述的装置,其特征在于,如所述JS引擎为多个时,在所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理方面,所述处理单元具体用于:
    将该渲染数据拆分成多个渲染子数据,将多个渲染子数据分配个多个JS引擎分别执行渲染操作得到多个渲染子结果,将多个渲染子结果组合起来得到渲染结果。
  15. 根据权利要求14所述的装置,其特征在于,在所述将多个渲染子数据分配个多个JS引擎方面,所述处理单元具体用于:
    确定该渲染数据中的串行数据和并行数据,将多个JS引擎划分成主JS引擎和n个从JS引擎,将串行数据划分值主JS引擎,将并行数据分别下发至不同的从JS引擎,所述n为大于等于2的整数,所述串行数据和并行数据为所述渲染子数据。
  16. 根据权利要求15所述的装置,其特征在于,在所述确定该渲染数据 中的串行数据和并行数据方面,所述处理单元具体用于:
    获取渲染数据的多个步骤,提取多个步骤中相邻的两个步骤中第一步骤的输出数据第一存储区间与第二步骤的输入数据第二存储区间,如所述第二存储区间与第一存储区间交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为串行数据;如所述第二存储区间与第一存储区间不交叠,确定该第一存储区间的输出数据以及第二存储区间的输入数据均为并行数据。
  17. 根据权利要求15所述的装置,其特征在于,在所述将多个JS引擎划分成主JS引擎和n个从JS引擎方面,所述处理单元具体用于:
    确定多个JS引擎中互联数量最多的JS引擎作为主JS引擎,将除所述主JS引擎之外的n个其他JS引擎作为从引擎。
  18. 根据权利要求10所述的装置,其特征在于,如所述JS引擎为多个时,在所述通过JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理方面,所述处理装置具体用于:
    获取多个JS引擎中每个JS引擎的任务数量,选择任务数量最少的第一JS引擎,调用第一JS引擎的API接口调用底层渲染对所述第一游戏执行渲染处理。
  19. 一种电子设备,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-9任一项所述的方法中的步骤的指令。
  20. 一种计算机可读存储介质,其特征在于,存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-9任一项所述的方法。
PCT/CN2019/098065 2018-09-25 2019-07-27 游戏平台的底层调用方法及相关产品 WO2020063088A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811114458.4A CN109271156B (zh) 2018-09-25 2018-09-25 游戏平台的底层调用方法及相关产品
CN201811114458.4 2018-09-25

Publications (1)

Publication Number Publication Date
WO2020063088A1 true WO2020063088A1 (zh) 2020-04-02

Family

ID=65197935

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/098065 WO2020063088A1 (zh) 2018-09-25 2019-07-27 游戏平台的底层调用方法及相关产品

Country Status (2)

Country Link
CN (1) CN109271156B (zh)
WO (1) WO2020063088A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271156B (zh) * 2018-09-25 2022-02-18 Oppo广东移动通信有限公司 游戏平台的底层调用方法及相关产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103713891A (zh) * 2012-10-09 2014-04-09 阿里巴巴集团控股有限公司 一种在移动设备上进行图形渲染的方法和装置
CN103957400A (zh) * 2014-05-09 2014-07-30 北京乐成光视科技发展有限公司 一种基于Unity3D游戏引擎的裸眼3D显示系统
CN104067317A (zh) * 2011-09-08 2014-09-24 宝福特控股私人有限公司 用于在真实世界视频剪辑内对合成对象进行可视化的系统和方法
US20160050253A1 (en) * 2012-03-23 2016-02-18 Google Inc. Asynchronous Message Passing
CN107292945A (zh) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 视频图像的图层渲染处理方法及其系统
CN109271156A (zh) * 2018-09-25 2019-01-25 Oppo广东移动通信有限公司 游戏平台的底层调用方法及相关产品

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101416100B1 (ko) * 2012-08-07 2014-07-14 인크로스 주식회사 하이브리드 웹 어플리케이션에서 자바스크립트 연동을 위한 인터페이스
CN102880470B (zh) * 2012-09-18 2015-08-19 中山市世宇动漫科技有限公司 一种三维游戏引擎内核结构
CN106445508B (zh) * 2013-07-30 2020-07-14 阿里巴巴(中国)有限公司 一种游戏引擎
CN103631565B (zh) * 2013-11-13 2016-09-21 北京像素软件科技股份有限公司 场景资源的加载方法和加载装置
US10417817B2 (en) * 2014-11-13 2019-09-17 Nvidia Corporation Supersampling for spatially distributed and disjoined large-scale data
CN104572114B (zh) * 2015-01-23 2017-11-28 盟游(北京)科技有限公司 一种绑定装置、应用更新装置及方法
CN105741227A (zh) * 2016-01-26 2016-07-06 网易(杭州)网络有限公司 渲染方法和装置
US10573056B2 (en) * 2017-03-06 2020-02-25 3D Patents, Llc Multi-view processing unit systems and methods
CN108280027B (zh) * 2018-02-08 2021-06-01 金蝶软件(中国)有限公司 一种脚本的并发调试渲染方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104067317A (zh) * 2011-09-08 2014-09-24 宝福特控股私人有限公司 用于在真实世界视频剪辑内对合成对象进行可视化的系统和方法
US20160050253A1 (en) * 2012-03-23 2016-02-18 Google Inc. Asynchronous Message Passing
CN103713891A (zh) * 2012-10-09 2014-04-09 阿里巴巴集团控股有限公司 一种在移动设备上进行图形渲染的方法和装置
CN103957400A (zh) * 2014-05-09 2014-07-30 北京乐成光视科技发展有限公司 一种基于Unity3D游戏引擎的裸眼3D显示系统
CN107292945A (zh) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 视频图像的图层渲染处理方法及其系统
CN109271156A (zh) * 2018-09-25 2019-01-25 Oppo广东移动通信有限公司 游戏平台的底层调用方法及相关产品

Also Published As

Publication number Publication date
CN109271156A (zh) 2019-01-25
CN109271156B (zh) 2022-02-18

Similar Documents

Publication Publication Date Title
JP6671394B2 (ja) サードパーティアプリケーションに対するデジタルアシスタント拡張性
WO2020048218A1 (zh) 应用页面的展示方法、装置、存储介质和电子设备
EP3627314B1 (en) Method for game running and related products
EP3089021A2 (en) Electronic device
EP3531290A1 (en) Data backup method, apparatus, electronic device, storage medium, and system
CN110752980A (zh) 一种消息发送方法及电子设备
CN109213613B (zh) 图像信息的传输方法、装置、存储介质及电子设备
CN109889348A (zh) 一种图像分享方法及装置
WO2017193496A1 (zh) 应用数据的处理方法、装置和终端设备
CN110475020B (zh) 设备控制方法及相关产品
WO2020052307A1 (zh) 权限配置方法及相关产品
US20220150201A1 (en) Message sending method and terminal device
WO2017206901A1 (zh) 进程控制方法及相关设备
WO2019128571A1 (zh) 资源管理方法、装置、移动终端及计算机可读存储介质
WO2020052392A1 (zh) 游戏平台的能力调用方法及相关产品
US9757651B2 (en) Electronic device and method of processing user input by electronic device
CN114327087A (zh) 输入事件处理方法、装置、电子设备和存储介质
CN106919458B (zh) Hook目标内核函数的方法及装置
WO2020063088A1 (zh) 游戏平台的底层调用方法及相关产品
WO2019179068A1 (zh) 风险检测方法、装置、移动终端和存储介质
WO2020052354A1 (zh) 游戏加载方法及相关产品
WO2020107177A1 (zh) 一种音频资源调用的方法、装置及电子设备
CN113595662B (zh) 信号提示方法、装置、终端设备及存储介质
KR101981885B1 (ko) 애플리케이션 가속화 방법 및 디바이스
WO2020057202A1 (zh) 游戏运行方法及相关产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19864443

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19864443

Country of ref document: EP

Kind code of ref document: A1