Game running method and device, set-top box and storage medium
By compiling the target virtual machine into the target dynamic link library and deploying it in the set-top box, the problem of high difficulty in game deployment in the set-top box is solved, and the game is reliable and conveniently deployed, reducing development and maintenance costs.
Patent Information
- Application Number
- CN202411396828.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-10-09
AI Technical Summary
In the prior art, game deployment in set-top boxes is more difficult, and existing mini-game deployment solutions have the problem of game deployment being more difficult.
By compiling the target virtual machine into a target dynamic link library and packaging it into a data packet that is adapted to the target operating system, the target virtual machine can reliably run on the target operating system, using the target dynamic link library to decouple the virtual machine to the target dynamic link library and package it into a data packet that is adapted to the target operating system. computer and game applications to reduce deployment difficulty.
It reduces the difficulty of deploying games in set-top boxes, improves the convenience of game deployment, and reduces development and maintenance costs, achieving reliable operation of games.
Smart Images

Figure CN118921511B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game operation technology, and more specifically, to a game operation method and apparatus, a set-top box and a storage medium. Background Technology
[0002] Set-top boxes, as devices capable of providing IPTV (Internet Protocol Television) and OTT (Over-The-Top) services, are widely used. In existing technologies, to enhance users' entertainment needs, set-top boxes typically offer simple mini-games. However, the inventors have discovered that existing mini-game deployment schemes present a relatively high deployment difficulty. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a game running method and apparatus, a set-top box and a storage medium, so as to improve the problem of the high difficulty of deploying games in set-top boxes in the prior art.
[0004] To achieve the above objectives, this application adopts the following technical solution:
[0005] A game running method, applied to a set-top box, wherein the set-top box deploys a target operating system and a target game application, the game running method comprising:
[0006] Install the target data package adapted to the target operating system onto the target operating system, so that the target virtual machine in the target data package can run on the target operating system. The target data package is formed by compiling the target virtual machine into a target dynamic link library and packaging the target dynamic link library into a data package adapted to the target operating system.
[0007] In response to a target user's game download operation, the target game file is downloaded from the target device and stored in the location corresponding to the target virtual machine;
[0008] In response to a target user's action to start the game, the system controls the target virtual machine to run, causing the target virtual machine to execute the target game file.
[0009] The target game application obtains the target audio and video data generated by the target virtual machine executing the target game file, and performs playback processing on the target audio and video data to realize the running of the target game corresponding to the target game file.
[0010] In a preferred embodiment of this application, in the above-described game running method, the step of obtaining target audio and video data generated by the target virtual machine executing the target game file through the target game application, and performing playback processing on the target audio and video data to achieve the running of the target game corresponding to the target game file, includes:
[0011] Create at least one target buffer management object, wherein each target buffer management object is used to manage a corresponding target buffer, the target buffer belongs to a memory area outside the heap memory corresponding to the target virtual machine, and the data objects in the heap memory are managed by the garbage collector corresponding to the target virtual machine;
[0012] Using the at least one target buffer management object, the target audio and video data generated by the target virtual machine executing the target game file is transmitted to the target game application, and the target game application plays the target audio and video data to realize the running of the target game corresponding to the target game file.
[0013] In a preferred embodiment of this application, in the above-described game running method, the step of using the at least one target buffer management object to transmit the target audio and video data generated by the target virtual machine executing the target game file to the target game application, and then using the target game application to play the target audio and video data to achieve the running of the target game corresponding to the target game file, includes:
[0014] The target audio and video data generated by the target virtual machine executing the target game file is transmitted to a memory area managed by at least one target buffer management object for caching;
[0015] The target game application accesses the memory region managed by the at least one target buffer management object to obtain the corresponding target audio and video data.
[0016] The target game application is used to play the target audio and video data in order to run the target game corresponding to the target game file.
[0017] In a preferred embodiment of this application, in the above-described game running method, the step of transmitting the target audio and video data generated by the target virtual machine executing the target game file to a memory region managed by the at least one target buffer management object for caching includes:
[0018] The process of the target virtual machine executing the target game file is monitored to determine the current game running stage;
[0019] Based on the current game operation stage, object control is performed on the at least one target buffer management object to form at least one new target buffer management object;
[0020] The target audio and video data generated by the target game file currently being executed by the target virtual machine is transferred to at least one new memory area managed by a new target buffer management object for caching.
[0021] In a preferred embodiment of this application, in the above-described game operation method, the step of performing object control on the at least one target buffer management object based on the current game operation stage to form at least one new target buffer management object includes:
[0022] Based on the current game running stage, the current data volume of the target audio and video data generated by the target virtual machine currently executing the target game file is determined;
[0023] Based on the current data volume, object control is performed on the at least one target buffer management object to form at least one new target buffer management object. Specifically, when the current data volume is greater than the data storage volume of the memory region managed by the at least one target buffer management object, at least one target buffer management object is added based on the at least one target buffer management object. When the current data volume is equal to the data storage volume of the memory region managed by the at least one target buffer management object, the at least one target buffer management object is maintained. When the current data volume is less than the data storage volume of the memory region managed by the at least one target buffer management object, at least one target buffer management object is destroyed.
[0024] In a preferred embodiment of this application, in the above-described game running method, the step of obtaining target audio and video data generated by the target virtual machine executing the target game file through the target game application, and performing playback processing on the target audio and video data to achieve the running of the target game corresponding to the target game file, includes:
[0025] The target game application obtains a game stage-data volume mapping table obtained by the target virtual machine parsing the target game file, wherein the game stage-data volume mapping table contains the data volume of the target game corresponding to the target game file in each game running stage;
[0026] Based on the game stage-data volume mapping table, the current data volume of the target audio and video data generated by the first game sub-file and the second game sub-file of the target game file currently executed by the target virtual machine is determined, and a corresponding number of buffer management objects are created based on the current data volume. The first game sub-file contains the game's code, resources and related library files, and the second game sub-file contains the game's description, configuration and permission requirements metadata.
[0027] Using the corresponding number of buffer management objects created based on the current data volume, the target audio and video data generated by the first game sub-file and the second game sub-file in the target game file executed by the target virtual machine is transmitted to the target game application, and the target game application plays the target audio and video data to realize the running of the target game corresponding to the target game file.
[0028] In a preferred embodiment of this application, in the above-described game running method, the step of downloading the target game file from the target device and storing the target game file in the location corresponding to the target virtual machine in response to the target user's game download operation includes:
[0029] In response to a game download request from a target user, the generated first game download request information is sent to the target device. After receiving the first game download request information, the target device analyzes the target user's game preference information based on the target user's historical game data and / or historical TV data, generates a corresponding candidate game file directory based on the game preference information, and sends the candidate game file directory to the set-top box.
[0030] Obtain the candidate game file directory and display the candidate game file directory so that the target user can access the candidate game file directory;
[0031] In response to the target user's game selection request based on the candidate game file directory, a second game download request is generated and sent to the target device. After receiving the second game download request, the target device sends the target game file corresponding to the game selected by the target user to the set-top box.
[0032] The target game file is obtained and stored in the location corresponding to the target virtual machine, so that the target virtual machine can obtain the target game file when it runs.
[0033] This application also provides a game running device for use in a set-top box, wherein the set-top box deploys a target operating system and a target game application, and the game running device includes:
[0034] A virtual machine installation module is used to install a target data package adapted to the target operating system onto the target operating system, so that the target virtual machine in the target data package can run on the target operating system. The target data package is formed by compiling the target virtual machine into a target dynamic link library and packaging the target dynamic link library into a data package adapted to the target operating system.
[0035] The game download module is used to respond to a target user's game download operation by downloading the target game file from the target device and storing the target game file in the location corresponding to the target virtual machine;
[0036] The game execution module is used to respond to the target user's game start operation, control the target virtual machine to run, and make the target virtual machine execute the target game file;
[0037] The audio and video playback module is used to obtain target audio and video data generated by the target virtual machine executing the target game file through the target game application, and to perform playback processing on the target audio and video data to realize the running of the target game corresponding to the target game file.
[0038] Based on the above, this application also provides a set-top box, including:
[0039] Memory, used to store computer programs;
[0040] A processor connected to the memory is used to execute the computer program stored in the memory to implement the game running method described above.
[0041] Based on the above, this application also provides a computer-readable storage medium storing a computer program that executes the various steps of the above-described game running method when the computer program is run.
[0042] The game running method, apparatus, set-top box, and storage medium provided in this application install a target data package adapted to the target operating system onto the target operating system, enabling the target virtual machine in the target data package to run on the target operating system; secondly, in response to a target user's game download operation, the target game file is downloaded from the target device and stored in the corresponding location of the target virtual machine; then, in response to a target user's game start operation, the target virtual machine is controlled to run, causing the target virtual machine to execute the target game file; finally, through the target game application, the target audio and video data generated by the target virtual machine executing the target game file is obtained, and the target audio and video data is played. Based on the above, since the target virtual machine can be compiled into a target dynamic link library and packaged into a target data package adapted to the target operating system, the target virtual machine can reliably run on the target operating system. Furthermore, because a target dynamic link library is used, it can be decoupled from the target game application, thereby reducing the difficulty of deploying the game on the set-top box. Therefore, it can improve the problem of high deployment difficulty of games on set-top boxes in the existing technology. In addition, since a target dynamic link library is used, modifications and extensions to the target virtual machine or the target game files can be performed independently without modifying or extending the target game application as well, which can further improve the convenience of game deployment and reduce development and maintenance costs. Attached Figure Description
[0043] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.
[0044] Figure 1 This is a structural block diagram of a set-top box provided in an embodiment of this application.
[0045] Figure 2 This is a flowchart illustrating the game operation method provided in an embodiment of this application.
[0046] Figure 3 A block diagram of a game running device provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0048] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0049] like Figure 1 As shown in the illustration, this application provides a set-top box. The set-top box may include a memory, a processor, and a game running device.
[0050] Specifically, the memory and the processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, the memory and the processor can be electrically connected via one or more communication buses or signal lines. The game running device includes at least one software functional module stored in the memory in the form of software or firmware. The processor is used to execute executable computer programs stored in the memory, such as the software functional modules and computer programs included in the game running device, to implement the game running method provided in the embodiments of this application.
[0051] Optionally, the memory may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. Furthermore, the processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a System on Chip (SoC), etc.; it may also be a Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0052] I understand. Figure 1 The structure shown is for illustrative purposes only; the set-top box may also include components that are more advanced than those shown. Figure 1 The more or fewer components shown, or having the same Figure 1The different configurations shown may include, for example, a communication unit for exchanging information with other devices (such as a backend server).
[0053] Combination Figure 2 This application also provides a game running method applicable to the aforementioned set-top box. The method steps defined in the process related to the game running method can be implemented by the set-top box, and the set-top box deploys a target operating system (such as Android) and a target game application (application). The following will describe... Figure 2 The specific process shown will be explained in detail.
[0054] Step S110: Install the target data package adapted to the target operating system onto the target operating system, so that the target virtual machine in the target data package can run on the target operating system.
[0055] In this embodiment, the set-top box can install a target data package adapted to the target operating system onto the target operating system, enabling the target virtual machine in the target data package to run on the target operating system. Specifically, the target data package is formed by compiling the target virtual machine into a target dynamic link library and packaging the target dynamic link library into a data package adapted to the target operating system. For example, the JVM (Virtual Machine) is the environment in which Java programs run, allowing Java programs to run in bytecode form on any operating system. Adapting the JVM to run on the Android operating system includes: modifying the JVM to adapt to the specific hardware and software interfaces of the Android system; compiling the JVM into a dynamic link library, which can be dynamically loaded by Android applications at runtime; and then packaging the dynamic link library into an APK (Android Package), which can be further integrated into the Android system of the set-top box, thus installing and deploying the JVM accordingly.
[0056] Step S120: In response to the target user's game download operation, download the target game file from the target device and store the target game file in the location corresponding to the target virtual machine.
[0057] In this embodiment of the application, the set-top box can respond to a target user's game download operation by downloading a target game file from the target device and storing the target game file in a location corresponding to the target virtual machine, such as a storage location accessible to the target virtual machine, so that the target virtual machine can obtain the target game file when it runs.
[0058] Step S130: In response to the target user's game-starting operation, control the target virtual machine to run, so that the target virtual machine executes the target game file.
[0059] In this embodiment, the set-top box can respond to the target user's game-starting operation (such as the target user clicking the confirmation button on the game interface) and control the target virtual machine to run, so that the target virtual machine executes the target game file. That is, the target game file runs in the target virtual machine (the target game file is developed based on the J2ME standard, and the JVM can execute it reliably). The specific process of game execution is not specifically limited here.
[0060] Step S140: Obtain the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and perform playback processing on the target audio and video data to realize the running of the target game corresponding to the target game file.
[0061] In this embodiment, the set-top box can obtain target audio and video data generated by the target virtual machine executing the target game file through the target game application, and perform playback processing on the target audio and video data (e.g., playing the target audio and video data through a connected playback device) to realize the operation of the target game corresponding to the target game file. Exemplarily, in some alternative implementations, in response to the target user clicking a button such as "back" or "exit" on the game interface, the operation of the target virtual machine can be shut down, causing the game to end.
[0062] Based on the above, since the target virtual machine can be compiled into a target dynamic link library and packaged into a target data package adapted to the target operating system, the target virtual machine can reliably run on the target operating system. Furthermore, because a target dynamic link library is used, it can be decoupled from the target game application, thereby reducing the difficulty of deploying the game on the set-top box. Therefore, it can improve the problem of high deployment difficulty of games on set-top boxes in existing technologies. In addition, since a target dynamic link library is used, modifications and extensions to the target virtual machine or the target game files can be performed independently without modifying or extending the target game application as well. This further improves the convenience of game deployment, reduces development and maintenance costs, and makes it highly valuable for application.
[0063] It should be noted that for step S120, the specific method of downloading the target game file is not limited and can be selected according to actual needs.
[0064] For example, in an alternative implementation, in order to improve the convenience of users downloading games, make users more sticky with the application of game services, and make full use of the corresponding game resources, the above-mentioned step S120 may further include steps S121, S122, S123 and S124, the specific contents of each step are as follows.
[0065] Step S121: In response to the game download request operation made by the target user, the generated first game download request information is sent to the target device.
[0066] In this embodiment, in response to a game download request from a target user, a first game download request message can be sent to a target device. Upon receiving the first game download request message, the target device can analyze the target user's game preference information based on their historical game data and / or historical television data (data from historical television viewing). Based on this preference information, a corresponding candidate game file directory (i.e., a directory of potentially liked games) can be generated, and this candidate game file directory can be sent to the set-top box. It should be noted that for historical game data, related games can be directly found based on the games corresponding to the historical game data, which can be considered as potentially liked games. For historical television data, analysis and prediction can be performed using a neural network to determine potentially liked games. This neural network can be a recurrent neural network, trained using sample television data and corresponding game preference labels, enabling the analysis and prediction of potentially liked games.
[0067] Step S122: Obtain the candidate game file directory and display the candidate game file directory so that the target user can access the candidate game file directory.
[0068] In this embodiment of the application, after sending the first game download request information, the candidate game file directory can be obtained and displayed so that the target user can obtain the candidate game file directory. For example, it can be sent to a connected display device for display so that the target user can view the candidate game file directory.
[0069] Step S123: In response to the game selection request operation made by the target user based on the candidate game file directory, the generated second game download request information is sent to the target device.
[0070] In this embodiment, after displaying the candidate game file directory, in response to the target user's game selection request based on the candidate game file directory, a generated second game download request information can be sent to the target device. Upon receiving the second game download request information, the target device sends the target game file (or the address of the target game file) corresponding to the game selected by the target user to the set-top box.
[0071] Step S124: Obtain the target game file and store the target game file in the location corresponding to the target virtual machine, so that the target virtual machine can obtain the target game file when it runs.
[0072] In this embodiment of the application, after sending the second game download request information, the target game file can be obtained and stored in the location corresponding to the target virtual machine, so that the target virtual machine can obtain the target game file when it runs.
[0073] It should be noted that for step S140, the specific method of obtaining the target audio and video data generated by the target virtual machine executing the target game file is not limited and can be selected according to actual needs.
[0074] For example, in a first alternative implementation, in order to improve the efficiency of acquiring the target audio and video data and reduce the resource consumption of data transmission, the above step S140 may include steps S141, S142 and S143, the specific contents of each step are as follows.
[0075] Step S141: Obtain the game stage-data volume mapping table obtained by the target virtual machine parsing the target game file through the target game application.
[0076] In this embodiment, the target game application can obtain a game stage-data volume mapping table obtained by the target virtual machine parsing the target game file. The game stage-data volume mapping table contains the data volume of the target game corresponding to the target game file at each game execution stage. For example, the data volume of the first stage is A, the data volume of the second stage is B, and each data volume can be obtained by pre-testing different stages.
[0077] Step S142: Based on the game stage-data volume mapping table, determine the current data volume of the target audio and video data generated by the first game sub-file and the second game sub-file in the target game file currently being executed by the target virtual machine, and create a corresponding number of buffer management objects based on the current data volume.
[0078] In this embodiment, after obtaining the game stage-data volume mapping table, the current data volume of the target audio and video data generated by the first and second game sub-files in the target game file currently being executed by the target virtual machine can be determined based on the game stage-data volume mapping table, and a corresponding number of buffer management objects can be created based on the current data volume. The first game sub-file contains the game's code, resources, and related library files, while the second game sub-file contains metadata about the game's description, configuration, and permission requirements. In other words, the data volume corresponding to the current game stage can be determined based on the game stage-data volume mapping table. Then, a corresponding number of buffer management objects can be determined based on this data volume. For example, the larger the data volume, the more buffer management objects (DirectByteBuffer, described below) need to be created to store the generated target audio and video data.
[0079] Step S143: Using the corresponding number of buffer management objects created based on the current data volume, the target audio and video data generated by the first game sub-file and the second game sub-file of the target game file executed by the target virtual machine is transmitted to the target game application, and the target game application plays the target audio and video data to realize the running of the target game corresponding to the target game file.
[0080] In this embodiment, after creating the buffer management object, a corresponding number of buffer management objects created based on the current data volume can be used to transmit the target audio and video data generated by the target virtual machine executing the first and second game sub-files of the target game file to the target game application. The target game application then plays the target audio and video data to run the target game corresponding to the target game file. For example, the target audio and video data generated by the target virtual machine executing the first and second game sub-files of the target game file can be stored in the memory area corresponding to the buffer management object. The target game application can directly access this memory area to directly obtain the target audio and video data, thereby improving efficiency and reducing overhead.
[0081] For example, in a second alternative implementation, in order to improve the efficiency of acquiring the target audio and video data and reduce the resource consumption of data transmission, the above step S140 may also include steps S144 and S145, the specific contents of each step are as follows.
[0082] Step S144: Create at least one target buffer management object.
[0083] In this embodiment, at least one target buffer management object can be created first. For example, a buffer management object pool can be used to manage the at least one target buffer management object. Each target buffer management object manages a corresponding target buffer. The target buffer belongs to a memory region outside the heap memory of the target virtual machine (i.e., the local memory corresponding to the operating system), and the data objects in the heap memory are managed by the garbage collector corresponding to the target virtual machine. That is, the data in the target buffer is not managed by the garbage collector (JVM garbage collection mechanism).
[0084] Step S145: Using the at least one target buffer management object, the target audio and video data generated by the target virtual machine executing the target game file is transmitted to the target game application, and the target game application plays the target audio and video data to realize the running of the target game corresponding to the target game file.
[0085] In this embodiment of the application, after creating the at least one target buffer management object, the at least one target buffer management object can be used to transmit the target audio and video data generated by the target virtual machine executing the target game file to the target game application, and the target game application can then perform playback processing on the target audio and video data to realize the running of the target game corresponding to the target game file.
[0086] It is understandable that in step S145 above, the specific method of transmitting and processing the target audio and video data is not limited and can be selected according to actual needs.
[0087] For example, in an alternative implementation, in order to ensure the reliable transmission and processing of the target audio and video data, the above step S145 may further include steps S145a, S145b and S145c, the specific contents of each step are as follows.
[0088] Step S145a: The target audio and video data generated by the target virtual machine executing the target game file is transmitted to the memory area managed by the at least one target buffer management object for caching.
[0089] In this embodiment, the target audio and video data generated by the target virtual machine executing the target game file can be transmitted to the memory area managed by the at least one target buffer management object for caching, that is, it is not stored through the heap memory corresponding to the target virtual machine.
[0090] Step S145b: The target game application accesses the memory region managed by the at least one target buffer management object to obtain the corresponding target audio and video data.
[0091] In this embodiment, after the target audio and video data is transmitted to the memory area managed by the at least one target buffer management object for caching, due to the special nature of the target buffer management object, namely the DirectByteBuffer mechanism, the target game application can directly access the target audio and video data to obtain it. That is, the target game application can access the memory area managed by the at least one target buffer management object to obtain the corresponding target audio and video data, avoiding the problem of copying and outputting data stored in heap memory.
[0092] Step S145c: The target audio and video data is played through the target game application to enable the target game corresponding to the target game file to run.
[0093] In this embodiment of the application, after the target game application obtains the target audio and video data, it can play the target audio and video data to enable the running of the target game corresponding to the target game file.
[0094] It is understood that the specific method of transmitting the target audio and video data to the memory area managed by the target buffer management object for caching in step S145a is not limited. For example, in an alternative implementation, in order to further reduce the overhead of memory resources or improve the utilization of memory resources, step S145a may further include steps a1, a2 and a3, the specific contents of each step are as follows.
[0095] Step a1: Monitor the process of the target virtual machine executing the target game file to determine the current game running stage.
[0096] In this embodiment of the application, since the size of the memory region managed by the target buffer management object is generally fixed after its creation and is difficult to adjust dynamically, and the amount of data generated at different stages of the game is generally different, in order to make the memory region managed by the target buffer management object dynamically adapt to the amount of data in the game stage, the process of the target virtual machine executing the target game file can be monitored to determine the current game running stage.
[0097] Step a2: Based on the current game running stage, perform object control on the at least one target buffer management object to form at least one new target buffer management object.
[0098] In this embodiment of the application, after obtaining the current game running stage, object management can be performed on the at least one target buffer management object based on the current game running stage, such as maintaining, adding, or destroying, to form at least one new target buffer management object.
[0099] Step a3: Transfer the target audio and video data generated by the target game file currently being executed by the target virtual machine to at least one new memory area managed by a new target buffer management object for caching.
[0100] In this embodiment of the application, after forming at least one new target buffer management object, the target audio and video data generated by the target virtual machine currently executing the target game file can be transmitted to the memory area managed by the at least one new target buffer management object for caching, so that the memory area managed by the at least one new target buffer management object is adapted to the amount of target audio and video data generated by the currently executing target game file, thereby realizing the rational utilization of resources.
[0101] It is understood that in step a2 above, the specific method of object control for the at least one target buffer management object is not limited. For example, in an alternative implementation, to improve the reliability of object control, step a2 above may further include:
[0102] First, based on the current game running stage, the current data volume of the target audio and video data generated by the target virtual machine currently executing the target game file can be determined;
[0103] Secondly, based on the current data volume, object management can be performed on the at least one target buffer management object to form at least one new target buffer management object. Specifically, when the current data volume is greater than the data storage capacity of the memory region managed by the at least one target buffer management object, at least one additional target buffer management object can be added (i.e., increasing data storage space to reliably store more data). When the current data volume is equal to the data storage capacity of the memory region managed by the at least one target buffer management object, the at least one target buffer management object can be maintained (i.e., the number remains unchanged). When the current data volume is less than the data storage capacity of the memory region managed by the at least one target buffer management object, at least one target buffer management object can be destroyed (i.e., reducing data storage space, i.e., releasing occupied memory).
[0104] It's important to note that DirectByteBuffer is primarily used explicitly by Java applications (specifically, it can be created by calling ByteBuffer.allocateDirect(int capacity)) rather than being automatically used by the JVM to store running data. This buffer provides a way for Java programs to allocate and manage data directly in native memory (i.e., non-Java heap memory), thus bypassing the JVM's garbage collection mechanism. In other words, for the target audio and video data generated by executing the target game file, DirectByteBuffer can be used to directly map the file data into native memory, avoiding data copying between the JVM and the operating system, thereby improving processing speed. Therefore, once an instance of DirectByteBuffer is available, it can be used to store data of any form. Basic data types such as int, long, and byte can be written directly to this buffer, and data can also be read directly from other sources (such as files, networks, etc.) into this buffer.
[0105] Combination Figure 3 This application also provides a game running device applicable to the aforementioned set-top box. The game running device may include a virtual machine installation module, a game download module, a game execution module, and an audio / video playback module.
[0106] The virtual machine installation module is used to install a target data package adapted to the target operating system onto the target operating system, enabling the target virtual machine in the target data package to run on the target operating system. The target data package is formed by compiling the target virtual machine into a target dynamic link library and packaging the target dynamic link library into a data package adapted to the target operating system. In this embodiment, the virtual machine installation module can be used to execute... Figure 2 For details regarding step S110 shown, please refer to the preceding description of step S110 for information about the virtual machine installation module.
[0107] The game download module is used to respond to a target user's game download operation, download the target game file from the target device, and store the target game file in the location corresponding to the target virtual machine. In this embodiment, the game download module can be used to execute... Figure 2 The details of step S120 shown above, and the relevant content regarding the game download module, can be found in the preceding description of step S120.
[0108] The game execution module is used to control the target virtual machine to run in response to a target user's game-starting operation, causing the target virtual machine to execute the target game file. In this embodiment, the game execution module can be used to execute... Figure 2 The details of step S130 shown above, and the relevant content regarding the game execution module, can be found in the preceding description of step S130.
[0109] The audio and video playback module is used to obtain target audio and video data generated by the target virtual machine executing the target game file through the target game application, and to perform playback processing on the target audio and video data to realize the running of the target game corresponding to the target game file. In this embodiment of the application, the audio and video playback module can be used to execute... Figure 2 The relevant content regarding the audio and video playback module in step S140 shown can be found in the previous description of step S140.
[0110] In this embodiment of the application, corresponding to the game running method applied to the set-top box described above, a computer-readable storage medium is also provided, which stores a computer program that executes the various steps of the game running method when the computer program is run.
[0111] The steps executed by the aforementioned computer program during runtime will not be described in detail here; please refer to the explanation of the game operation method above.
[0112] In summary, the game running method, apparatus, set-top box, and storage medium provided in this application install a target data package adapted to the target operating system onto the target operating system, enabling the target virtual machine in the target data package to run on the target operating system; secondly, in response to a target user's game download operation, the target game file is downloaded from the target device and stored in the corresponding location of the target virtual machine; then, in response to a target user's game start operation, the target virtual machine is controlled to run, causing the target virtual machine to execute the target game file; finally, through the target game application, the target audio and video data generated by the target virtual machine executing the target game file is obtained, and the target audio and video data is played. Based on the above, since the target virtual machine can be compiled into a target dynamic link library and packaged into a target data package adapted to the target operating system, the target virtual machine can reliably run on the target operating system. Furthermore, because a target dynamic link library is used, it can be decoupled from the target game application, thereby reducing the difficulty of deploying the game on the set-top box. Therefore, it can improve the problem of high deployment difficulty of games on set-top boxes in the existing technology. In addition, since a target dynamic link library is used, modifications and extensions to the target virtual machine or the target game files can be performed independently without modifying or extending the target game application as well, which can further improve the convenience of game deployment and reduce development and maintenance costs.
[0113] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0114] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0115] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0116] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A game running method, characterized in that: Applied to a set-top box, the set-top box is deployed with a target operating system and a target game application, and the game running method includes: Installing a target data packet adapted to the target operating system onto the target operating system so that a target virtual machine in the target data packet can run on the target operating system, wherein the target data packet is formed by compiling the target virtual machine into a target dynamic link library and packaging the target dynamic link library into a data packet adapted to the target operating system; In response to the target user performing a game download operation, downloading a target game file from the target device, and storing the target game file in a location corresponding to the target virtual machine; In response to the target user performing a game start operation, controlling the target virtual machine to run so that the target virtual machine executes the target game file; Obtaining, through the target game application, target audio and video data generated by the target virtual machine executing the target game file, and playing and processing the target audio and video data to realize the operation of the target game corresponding to the target game file; The step of obtaining, through the target game application, the target audio and video data generated by the target virtual machine executing the target game file, and playing and processing the target audio and video data to realize the operation of the target game corresponding to the target game file includes: Obtaining, through the target game application, a game stage-data volume mapping table obtained by parsing the target game file by the target virtual machine, wherein the game stage-data volume mapping table contains the data volume of the target game corresponding to the target game file at each game running stage; Based on the game stage-data volume mapping table, determine the current data volume of the target audio and video data generated by the first game sub-file and the second game sub-file in the target game file currently executed by the target virtual machine, and create a corresponding number of buffer management objects based on the current data volume, wherein the first game sub-file contains the game code, resources and related library files, and the second game sub-file contains the description, configuration and permission requirement metadata of the game; Using a corresponding number of buffer management objects created based on the current data volume, the target audio and video data generated by the target virtual machine executing the first game sub-file and the second game sub-file in the target game file is transmitted to the target game application, and the target audio and video data is played and processed through the target game application to realize the operation of the target game corresponding to the target game file.
2. The game running method according to claim 1, characterized in that: The step of downloading a target game file from a target device in response to a target user performing a game download operation, and storing the target game file in a location corresponding to the target virtual machine includes: In response to a game download request operation performed by a target user, the generated first game download request information is sent to a target device, wherein after receiving the first game download request information, the target device analyzes the game preference information of the target user based on the historical game data and / or historical TV data of the target user, generates a corresponding candidate game file directory based on the game preference information, and sends the candidate game file directory to the set-top box; Acquire the candidate game file directory, and display the candidate game file directory so that the target user can acquire the candidate game file directory; In response to the game selection request operation performed by the target user based on the candidate game file directory, the generated second game download request information is sent to the target device, wherein after receiving the second game download request information, the target device sends the target game file corresponding to the game selected by the target user to the set-top box; The target game file is obtained, and the target game file is stored in a location corresponding to the target virtual machine, so that the target game file can be obtained when the target virtual machine is running.
3. A game running device, characterized in that: Applied to a set-top box, the set-top box is deployed with a target operating system and a target game application, and the game running device includes: a virtual machine installation module, configured to install a target data packet adapted to the target operating system onto the target operating system, so that the target virtual machine in the target data packet can run on the target operating system, wherein the target data packet is formed by compiling the target virtual machine into a target dynamic link library and packaging the target dynamic link library into a data packet adapted to the target operating system; A game download module, configured to download a target game file from a target device in response to a target user performing a game download operation, and store the target game file in a location corresponding to the target virtual machine; A game execution module, configured to control the target virtual machine to run in response to a target user performing a game start operation, so that the target virtual machine executes the target game file; An audio and video playback module, used to obtain, through the target game application, target audio and video data generated by the target virtual machine executing the target game file, and play the target audio and video data to realize the operation of the target game corresponding to the target game file; The step of obtaining target audio and video data generated by the target virtual machine executing the target game file through the target game application, and playing the target audio and video data to realize the operation of the target game corresponding to the target game file, includes: Obtaining, through the target game application, a game stage-data volume mapping table obtained by parsing the target game file by the target virtual machine, wherein the game stage-data volume mapping table contains the data volume of the target game corresponding to the target game file at each game running stage; Based on the game stage-data volume mapping table, determine the current data volume of the target audio and video data generated by the first game sub-file and the second game sub-file in the target game file currently executed by the target virtual machine, and create a corresponding number of buffer management objects based on the current data volume, wherein the first game sub-file contains the game code, resources and related library files, and the second game sub-file contains the description, configuration and permission requirement metadata of the game; Using a corresponding number of buffer management objects created based on the current data volume, the target audio and video data generated by the target virtual machine executing the first game sub-file and the second game sub-file in the target game file is transmitted to the target game application, and the target audio and video data is played and processed through the target game application to realize the operation of the target game corresponding to the target game file.
4. A set-top box, characterized in that: include: Memory for storing computer programs; A processor connected to the memory is used to execute the computer program stored in the memory to implement the game running method described in any one of claims 1-2.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is run, the game running method according to any one of claims 1 to 2 is executed.