Game running method and device, set top box and storage medium

By compiling the target virtual machine into a target dynamic link library and adapting it to the target operating system, the problem of high difficulty in game deployment is solved, and the game is independently run and managed in the set-top box is realized, and the development and maintenance costs are reduced.

CN118921511AActive Publication Date: 2024-11-08SICHUAN TIANYI COMHEART TELECOM
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411396828.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-11-08
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

In the prior art, the deployment of games in set-top boxes is relatively difficult, and it is difficult to independently modify or expand game virtual machines and game files.

Method used

The target dynamic link library is used to compile the target virtual machine into a data packet that is adapted to the target operating system, and decouple the target game application to realize the independent operation and management of the game virtual machine.

Benefits of technology

Reduces the difficulty of deploying games in set-top boxes, improves deployment convenience and reduces development and maintenance costs, allowing separate modifications and extensions of virtual machines and game files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921511A_ABST
    Figure CN118921511A_ABST
Patent Text Reader

Abstract

The invention provides a game running method and device, a set top box and a storage medium, and relates to the technical field of game running. In the application, a target data packet adapted to a target operating system is installed on the target operating system, so that a target virtual machine in the target data packet can run on the target operating system; secondly, in response to game downloading operation performed by the target user, downloading a target game file from the target device, and storing the target game file in a position corresponding to the target virtual machine; then, in response to a game starting operation performed by the target user, controlling the target virtual machine to run, so that the target virtual machine executes the target game file; and finally, through the target game application, obtaining target audio and video data generated when the target virtual machine executes the target game file, and playing the target audio and video data. Based on the content, the problem that in the prior art, deployment difficulty of games in the set top box is high can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game operation technology, and in particular to a game operation method and device, a set-top box and a storage medium. Background Art

[0002] As a device that can provide IPTV (Internet Protocol Television) and OTT (Over-The-Top) services, set-top boxes are widely used. In the prior art, in order to improve the set-top box's demand for richer entertainment for users, small games (some relatively simple games) services are generally provided to users based on the set-top box. However, the inventors have found through research that based on the existing small game deployment solution, there is a problem of relatively high difficulty in game deployment. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a game running method and device, a set-top box and a storage medium to improve the problem of high difficulty in deploying games in set-top boxes in the prior art.

[0004] To achieve the above objectives, this application adopts the following technical solutions: A game running method is applied to a set-top box, wherein the set-top box is deployed with a target operating system and a target game application, and the game running method comprises: 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; 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 and processed to realize the operation of the target game corresponding to the target game file.

[0005] In a preferred embodiment of the present application, in the above-mentioned game running method, the step of obtaining the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and playing and processing the target audio and video data to realize the running of the target game corresponding to the target game file includes: Creating at least one target buffer management object, wherein each of the target buffer management objects is used to manage a corresponding target buffer, the target buffer belongs to a memory area other than a heap memory corresponding to the target virtual machine, and data objects in the heap memory are managed by a garbage collector corresponding to the target virtual machine; Utilizing 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 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.

[0006] In a preferred embodiment of the present application, in the above-mentioned 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 playing and processing the target audio and video data through the target game application to realize the running of the target game corresponding to the target game file includes: 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; Accessing the memory area managed by the at least one target buffer management object through the target game application to obtain corresponding target audio and video data; The target audio and video data are played and processed through the target game application to realize the operation of the target game corresponding to the target game file.

[0007] In a preferred embodiment of the present application, in the above-mentioned 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 the memory area managed by the at least one target buffer management object for caching includes: Monitoring the process of executing the target game file by the target virtual machine to determine the current game running stage; Based on the current game running stage, performing object management on the at least one target buffer management object to form at least one new target buffer management object; The target audio and video data generated by the target game file currently executed by the target virtual machine is transmitted to a memory area managed by at least one new target buffer management object for caching.

[0008] In a preferred embodiment of the present application, in the above-mentioned game running method, the step of performing object management on the at least one target buffer management object based on the current game running stage to form at least one new target buffer management object includes: Based on the current game running stage, determining a current data volume of target audio and video data generated by the target virtual machine currently executing the target game file; Based on the current data volume, object management is performed on the at least one target buffer management object to form at least one new target buffer management object, wherein when the current data volume is greater than the data storage capacity of the memory area managed by the at least one target buffer management object, at least one target buffer management object is added on the basis of the at least one target buffer management object; when the current data volume is equal to the data storage capacity of the memory area managed by the at least one target buffer management object, the at least one target buffer management object is maintained; and when the current data volume is less than the data storage capacity of the memory area managed by the at least one target buffer management object, at least one target buffer management object is destroyed in the at least one target buffer management object.

[0009] In a preferred embodiment of the present application, in the above-mentioned game running method, the step of obtaining the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and playing and processing the target audio and video data to realize the running 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.

[0010] In a preferred embodiment of the present application, in the above-mentioned game running method, the step of downloading the target game file from the target device in response to the 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.

[0011] The present application also provides a game running device, which is applied to a set-top box, wherein 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; The audio and video playback module is used to obtain the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and to play and process the target audio and video data to realize the operation of the target game corresponding to the target game file.

[0012] On the basis of the above, the present application also provides a set-top box, including: Memory for storing computer programs; The processor connected to the memory is used to execute the computer program stored in the memory to implement the above-mentioned game running method.

[0013] On the basis of the above, the present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is run, each step of the above-mentioned game running method is executed.

[0014] The game running method and device, set-top box and storage medium provided in the present application install a target data packet adapted to a 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; secondly, in response to a target user performing a game download operation, a target game file is downloaded from a target device, and the target game file is stored in a location corresponding to the target virtual machine; then, in response to a target user performing a game start operation, the target virtual machine is controlled to run, so that the target virtual machine executes the target game file; finally, through a target game application, 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 and processed. Based on the above content, since the target virtual machine can be compiled into a target dynamic link library and the target dynamic link library can be packaged into a target data packet adapted to the target operating system, the target virtual machine can reliably run on the target operating system, and since the target dynamic link library is used, it can be decoupled from the target game application, thereby reducing the difficulty of deploying the game in the set-top box. Therefore, the problem of high difficulty in deploying games in the set-top box in the prior art can be improved; in addition, since the target dynamic link library is used, whether it is modification or expansion of the target virtual machine or modification or expansion of the target game file, it can be carried out separately without the need to modify or expand the target game application at the same time, which can further improve the convenience of game deployment and reduce development and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings.

[0016] Figure 1 This is a structural block diagram of a set-top box provided in an embodiment of the present application.

[0017] Figure 2 A flowchart of a game operation method provided in an embodiment of the present application.

[0018] Figure 3 A block diagram of a game running device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0021] like Figure 1 As shown, an embodiment of the present application provides a set-top box, wherein the set-top box may include a memory, a processor, and a game running device.

[0022] In detail, the memory and the processor are electrically connected directly or indirectly to achieve data transmission or interaction. For example, the memory and the processor can be electrically connected through one or more communication buses or signal lines. The game running device includes at least one software function module stored in the memory in the form of software or firmware. The processor is used to execute an executable computer program stored in the memory, for example, the software function module and computer program included in the game running device, so as to implement the game running method provided in the embodiment of the present application.

[0023] Optionally, the memory may be, but not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an 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), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0024] Understandably, Figure 1 The structure shown is for illustration only, and the set-top box may also include Figure 1 More or fewer components as shown, or with Figure 1 The different configurations shown, for example, may also include a communication unit for exchanging information with other devices (such as a background server).

[0025] Combination Figure 2 The embodiment of the present application also provides a game running method applicable to the above-mentioned 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 is deployed with a target operating system (such as an Android system) and a target game application (application). Figure 2 The specific process shown is explained in detail.

[0026] Step S110: installing 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.

[0027] In an embodiment of the present application, the set-top box can 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. Exemplarily, JVM (virtual machine) is an environment for Java program operation, allowing Java program to run on any operating system in the form of bytecode. Adjusting JVM to enable it to run on the Android operating system includes: modifying JVM to adapt to the specific hardware and software interfaces of the Android system. Compiling JVM into a dynamic link library, such a library can be dynamically loaded by Android applications at runtime. Then, the dynamic link library can be packaged into apk (Android Package, a kind of Android data packet), and apk can be further built into the Android system of the set-top box, so that JVM is also installed and deployed.

[0028] Step S120, in response to the target user performing a game download operation, downloading the target game file from the target device, and storing the target game file in a location corresponding to the target virtual machine.

[0029] In an embodiment of the present application, the set-top box can respond to the target user performing a game download operation, download the target game file from the target device, and store the target game file to a location corresponding to the target virtual machine, such as a storage location accessible to the target virtual machine, so that the target game file can be obtained when the target virtual machine is running.

[0030] Step S130, 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.

[0031] In an embodiment of the present application, the set-top box can control the operation of the target virtual machine in response to the target user performing a game start operation (such as the target user clicking a confirmation button on the game interface), 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 the game running is not specifically limited here.

[0032] Step S140, obtaining the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and playing and processing the target audio and video data to realize the operation of the target game corresponding to the target game file.

[0033] In an embodiment of the present application, the set-top box can obtain the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and play the target audio and video data (such as 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 return or exit on the game interface, the operation of the target virtual machine can be shut down, so that the game ends.

[0034] Based on the above content, since the target virtual machine can be compiled into a target dynamic link library and the target dynamic link library can be packaged into a target data packet adapted to the target operating system, the target virtual machine can reliably run on the target operating system, and since the target dynamic link library is adopted, it can be decoupled from the target game application, thereby reducing the difficulty of deploying the game in the set-top box. Therefore, the problem of high difficulty in deploying games in the set-top box in the prior art can be improved; in addition, since the target dynamic link library is adopted, whether it is modification or expansion of the target virtual machine or modification or expansion of the target game file, it can be carried out separately without the need to modify or expand the target game application at the same time, which can further improve the convenience of game deployment, reduce development and maintenance costs, and make it have higher application value.

[0035] 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.

[0036] For example, in an alternative implementation, in order to improve the convenience for users to download games, make users have a higher stickiness to the application of game services, and enable the corresponding game resources to be fully utilized, the above-mentioned step S120 may further include step S121, step S122, step S123 and step S124, and the specific content of each step is described as follows.

[0037] Step S121, in response to the game download request operation performed by the target user, the generated first game download request information is sent to the target device.

[0038] In an embodiment of the present application, in response to a game download request operation performed by a target user, a generated first game download request message can be sent to a target device. After receiving the first game download request message, the target device can analyze the game preference information of the target user based on the historical game data and / or historical TV data (data of watching TV in history) of the target user, and generate a corresponding candidate game file directory (i.e., a directory of games that may be liked) based on the game preference information, and send the candidate game file directory 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 as games that may be liked. For historical TV data, analysis and prediction can be performed through a neural network to determine games that may be liked. The neural network can be a recurrent neural network, and corresponding training is performed using sample TV data and corresponding game preference tags, so that analysis and prediction of games that may be liked can be performed.

[0039] Step S122, obtaining the candidate game file directory, and displaying the candidate game file directory so that the target user can obtain the candidate game file directory.

[0040] In an embodiment of the present 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.

[0041] Step S123, 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.

[0042] In the embodiment of the present application, after the candidate game file directory is displayed, the generated second game download request information can be sent to the target device in response to the game selection request operation performed by the target user based on the candidate game file directory. After 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.

[0043] Step S124, obtaining the target game file, and storing the target game file 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.

[0044] In an embodiment of the present application, after sending the second game download request information, the target game file can be obtained and 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.

[0045] What needs to be explained about step S140 is that 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.

[0046] For example, in the first alternative implementation, in order to improve the efficiency of acquiring the target audio and video data and reduce resource consumption of data transmission, the above-mentioned step S140 may include step S141, step S142 and step S143, and the specific content of each step is described as follows.

[0047] Step S141, obtaining, through the target game application, a game stage-data volume mapping table obtained by the target virtual machine parsing the target game file.

[0048] In the embodiment of the present application, the target game application can be used to obtain a game stage-data volume mapping table obtained by parsing the target game file by the target virtual machine. 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, such as the data volume of the first stage is A, and the data volume of the second stage is B. Each data volume can be obtained by running tests for different stages in advance.

[0049] Step S142, based on the game stage-data volume mapping table, determines the current data volume of the target audio and video data generated by the target virtual machine currently executing the first game sub-file and the second game sub-file in the target game file, and creates a corresponding number of buffer management objects based on the current data volume.

[0050] In an embodiment of the present application, after obtaining 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 in the target game file currently 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. Among them, the first game sub-file contains the game code, resources and related library files, and the second game sub-file contains the game description, configuration and permission requirements metadata. 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, the corresponding number of buffer management objects can be determined based on the data volume. For example, the larger the data volume, the more buffer management objects (DirectByteBuffer, related descriptions are described later) need to be created to store the generated target audio and video data.

[0051] Step S143, using a corresponding number of buffer management objects created based on the current data volume, transmits 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 to the target game application, and plays and processes the target audio and video data through the target game application to realize the operation of the target game corresponding to the target game file.

[0052] In an embodiment of the present application, after the buffer management object is created, 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 can be transmitted to the target game application by using the corresponding number of buffer management objects created based on the current data amount, and the target audio and video data can be played and processed by the target game application to realize the operation of 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 game sub-file and the second game sub-file in the target game file is stored in the memory area corresponding to the buffer management object, and the target game application can directly access the memory area to directly obtain the target audio and video data, thereby improving efficiency and reducing overhead.

[0053] For another example, in a second alternative implementation, in order to improve the efficiency of acquiring the target audio and video data and reduce resource consumption of data transmission, the above-mentioned step S140 may also include step S144 and step S145, and the specific content of each step is described as follows.

[0054] Step S144: create at least one target buffer management object.

[0055] In an embodiment of the present application, at least one target buffer management object may be created first, for example, the at least one target buffer management object may be managed by a buffer management object pool. Each of the target buffer management objects is used to manage a corresponding target buffer, and the target buffer belongs to a memory area other than the heap memory corresponding to 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. In other words, the data in the target buffer is not managed by the garbage collector (the garbage collection mechanism of the JVM).

[0056] Step S145, using the at least one target buffer management object, transmits the target audio and video data generated by the target virtual machine executing the target game file to the target game application, and plays and processes the target audio and video data through the target game application to realize the operation of the target game corresponding to the target game file.

[0057] In an embodiment of the present 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 audio and video data can be played and processed through the target game application to realize the operation of the target game corresponding to the target game file.

[0058] It can be understood that, in the above step S145, the specific method of transmitting and processing the target audio and video data is not limited and can be selected according to actual needs.

[0059] For example, in an alternative implementation, in order to ensure reliable transmission and processing of the target audio and video data, the above-mentioned step S145 may further include step S145a, step S145b and step S145c, and the specific content of each step is described as follows.

[0060] Step S145a: transmitting the target audio and video data generated by the target virtual machine executing the target game file to the memory area managed by the at least one target buffer management object for caching.

[0061] In an embodiment of the present application, the target audio and video data generated by the target virtual machine executing the target game file can be transferred to the memory area managed by the at least one target buffer management object for caching, that is, not stored through the heap memory corresponding to the target virtual machine.

[0062] Step S145b: Access the memory area managed by the at least one target buffer management object through the target game application to obtain the corresponding target audio and video data.

[0063] In an embodiment of the present application, after the target audio and video data is transferred to the memory area managed by the at least one target buffer management object for caching, due to the particularity of the target buffer management object, that is, the DirectByteBuffer mechanism, the target game application can directly access the target audio and video data to obtain it, that is, the memory area managed by the at least one target buffer management object can be accessed through the target game application to obtain the corresponding target audio and video data, avoiding the problem of storing the data in the heap memory and needing to copy and output it.

[0064] Step S145c, playing and processing the target audio and video data through the target game application to realize the operation of the target game corresponding to the target game file.

[0065] In an embodiment of the present application, after the target game application obtains the target audio and video data, the target audio and video data can be played and processed by the target game application to realize the operation of the target game corresponding to the target game file.

[0066] It can be understood that the specific method of transferring the target audio and video data to the memory area managed by the target buffer management object for caching in the above-mentioned 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, the above-mentioned step S145a can further include step a1, step a2 and step a3, and the specific content of each step is described as follows.

[0067] Step a1, monitoring the process of the target virtual machine executing the target game file to determine the current game running stage.

[0068] In an embodiment of the present application, since the size of the memory area managed by the target buffer management object is generally fixed after creation and is difficult to adjust dynamically, and the amount of data generated in different stages of the game is generally different, in order to dynamically adapt the memory area managed by the target buffer management object 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.

[0069] Step a2: Based on the current game running stage, object management is performed on the at least one target buffer management object to form at least one new target buffer management object.

[0070] In an embodiment of the present application, after obtaining the current game running stage, object management and control can be performed on the at least one target buffer management object based on the current game running stage, such as maintenance, addition, destruction, etc., to form at least one new target buffer management object.

[0071] Step a3: transmitting the target audio and video data generated by the target virtual machine currently executing the target game file to a memory area managed by at least one new target buffer management object for caching.

[0072] In an embodiment of the present application, after at least one new target buffer management object is formed, the target audio and video data generated by the target virtual machine's current execution of the target game file can be transferred to a memory area managed by at least one new target buffer management object for caching, so that the memory area managed by at least one new target buffer management object is adapted to the data volume of the target audio and video data generated by the current execution of the target game file, thereby achieving rational utilization of resources.

[0073] It can be understood that, in the above step a2, the specific manner of performing object management on the at least one target buffer management object is not limited. For example, in an alternative implementation, in order to improve the reliability of object management, the above step a2 may further include: 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; Secondly, based on the current data volume, object management and control can be performed on the at least one target buffer management object to form at least one new target buffer management object, wherein, when the current data volume is greater than the data storage capacity of the memory area managed by the at least one target buffer management object, at least one target buffer management object can be added on the basis of the at least one target buffer management object (that is, data storage space is increased to reliably store more data); when the current data volume is equal to the data storage capacity of the memory area managed by the at least one target buffer management object, the at least one target buffer management object can be maintained (that is, the number remains unchanged); when the current data volume is less than the data storage capacity of the memory area managed by the at least one target buffer management object, at least one target buffer management object in the at least one target buffer management object is destroyed (that is, data storage space is reduced, that is, occupied memory is released).

[0074] It should be noted that DirectByteBuffer is mainly used explicitly by Java applications (specifically, it can be created by calling ByteBuffer.allocateDirect(int capacity)), rather than automatically used by the JVM to store running data. This buffer provides a way for Java programs to allocate and manage data directly in local memory (that is, non-Java heap memory), thereby bypassing the garbage collection mechanism of the JVM. 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 to local memory, which can avoid data copying between the JVM and the operating system, thereby increasing the processing speed. In this way, once you have an instance of DirectByteBuffer, you can use it to store any form of data, you can directly write basic data types such as int, long, byte, etc. to this buffer, you can also read data directly from other sources (such as files, networks, etc.) into this buffer.

[0075] Combination Figure 3 The embodiment of the present application also provides a game running device applicable to the above 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 and video playback module.

[0076] The virtual machine installation module is used 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. In an embodiment of the present application, the virtual machine installation module can be used to execute Figure 2 As shown in step S110, the relevant contents of the virtual machine installation module can refer to the above description of step S110.

[0077] The game download module is used to respond to the target user performing a game download operation, download the target game file from the target device, and store the target game file in a location corresponding to the target virtual machine. In the embodiment of the present application, the game download module can be used to execute Figure 2 As shown in step S120, the relevant contents of the game download module can refer to the above description of step S120.

[0078] The game execution module is used to control the target virtual machine to run in response to the target user performing a game start operation, so that the target virtual machine executes the target game file. Figure 2 As shown in step S130, the relevant contents of the game execution module can refer to the above description of step S130.

[0079] The audio and video playback module is used to obtain the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and play the target audio and video data to realize the operation of the target game corresponding to the target game file. Figure 2 As shown in step S140, the relevant contents of the audio and video playback module can refer to the above description of step S140.

[0080] In an embodiment of the present application, corresponding to the above-mentioned game running method applied to the set-top box, a computer-readable storage medium is also provided, in which a computer program is stored, and when the computer program is run, each step of the game running method is executed.

[0081] Among them, the steps executed when the aforementioned computer program is running will not be described one by one here, and reference can be made to the explanation of the game running method in the previous article.

[0082] In summary, the game running method and device, set-top box and storage medium provided by the present application install the target data packet adapted to the target operating system on the target operating system, so that the target virtual machine in the target data packet can run on the target operating system; secondly, in response to the target user performing a game download operation, the target game file is downloaded from the target device, and the target game file is stored in the location corresponding to the target virtual machine; then, in response to the target user performing a game start operation, the target virtual machine is controlled to run, so that the target virtual machine executes 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 and processed. Based on the above content, since the target virtual machine can be compiled into a target dynamic link library and the target dynamic link library can be packaged into a target data packet adapted to the target operating system, the target virtual machine can reliably run on the target operating system, and since the target dynamic link library is used, it can be decoupled from the target game application, thereby reducing the difficulty of deploying the game in the set-top box. Therefore, the problem of high difficulty in deploying games in the set-top box in the prior art can be improved; in addition, since the target dynamic link library is used, whether it is modification or expansion of the target virtual machine or modification or expansion of the target game file, it can be carried out separately without the need to modify or expand the target game application at the same time, which can further improve the convenience of game deployment and reduce development and maintenance costs.

[0083] In several embodiments provided in the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device and method embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains 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 box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0084] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0085] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code. It should be noted that in this article, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

[0086] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present 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; 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 and processed 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 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 includes: Creating at least one target buffer management object, wherein each of the target buffer management objects is used to manage a corresponding target buffer, the target buffer belongs to a memory area other than a heap memory corresponding to the target virtual machine, and data objects in the heap memory are managed by a garbage collector corresponding to the target virtual machine; Utilizing 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 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.

3. The game running method according to claim 2, characterized in that: 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 playing and processing the target audio and video data through the target game application to realize the operation of the target game corresponding to the target game file includes: 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; Accessing the memory area managed by the at least one target buffer management object through the target game application to obtain corresponding target audio and video data; The target audio and video data are played and processed through the target game application to realize the operation of the target game corresponding to the target game file.

4. The game running method according to claim 3, characterized in that: The step of transmitting the target audio and video data generated by the target virtual machine executing the target game file to the memory area managed by the at least one target buffer management object for caching includes: Monitoring the process of executing the target game file by the target virtual machine to determine the current game running stage; Based on the current game running stage, performing object management on the at least one target buffer management object to form at least one new target buffer management object; The target audio and video data generated by the target game file currently executed by the target virtual machine is transmitted to a memory area managed by at least one new target buffer management object for caching.

5. The game running method according to claim 4, characterized in that: The step of performing object management on the at least one target buffer management object based on the current game running stage to form at least one new target buffer management object includes: Based on the current game running stage, determining a current data volume of target audio and video data generated by the target virtual machine currently executing the target game file; Based on the current data volume, object management is performed on the at least one target buffer management object to form at least one new target buffer management object, wherein when the current data volume is greater than the data storage capacity of the memory area managed by the at least one target buffer management object, at least one target buffer management object is added on the basis of the at least one target buffer management object; when the current data volume is equal to the data storage capacity of the memory area managed by the at least one target buffer management object, the at least one target buffer management object is maintained; and when the current data volume is less than the data storage capacity of the memory area managed by the at least one target buffer management object, at least one target buffer management object is destroyed in the at least one target buffer management object.

6. The game running method according to claim 1, characterized in that: The step of 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 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.

7. The game running method according to any one of claims 1 to 6, 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.

8. 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; The audio and video playback module is used to obtain the target audio and video data generated by the target virtual machine executing the target game file through the target game application, and to play and process the target audio and video data to realize the operation of the target game corresponding to the target game file.

9. 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-7.

10. 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 7 is executed.

Citation Information

Patent Citations

  • JAVA virtual machine implementation method for intelligent operating system

    CN103870316A

  • Game data processing method, device and system, electronic equipment and storage medium

    CN111151009A

  • Game pushing method, device and equipment and computer readable storage medium

    CN111935291A

  • Game data processing method and device and storage medium

    CN113423018A

  • Method for realizing operation of J2ME game audio file by IPTV (Internet Protocol Television) set top box

    CN114302243A