WO2021218751A1 - Cloud phone-based media data processing method and terminal device - Google Patents
Cloud phone-based media data processing method and terminal device Download PDFInfo
- Publication number
- WO2021218751A1 WO2021218751A1 PCT/CN2021/088845 CN2021088845W WO2021218751A1 WO 2021218751 A1 WO2021218751 A1 WO 2021218751A1 CN 2021088845 W CN2021088845 W CN 2021088845W WO 2021218751 A1 WO2021218751 A1 WO 2021218751A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- media data
- browser
- cloud
- terminal device
- thread
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- This application relates to the field of cloud technology, and in particular to a media data processing method and terminal equipment based on a cloud mobile phone.
- the cloud phone will send media data to the browser of the personal computer via the network.
- the browser of the personal computer is equipped with a flash plug-in.
- the flash plug-in is used to process the media data and generate audio and video.
- the picture and sound of the cloud application are presented to the user in the browser.
- the Flash plug-in needs to be installed in the browser of the personal computer, and the Flash plug-in only supports the operating system of the personal computer, not applicable to the operating system of the mobile phone.
- This application provides a cloud mobile phone-based media data processing method and a terminal device.
- a script in the browser of the terminal device to decode the media data of the cloud application sent by the cloud mobile phone, it does not need to be limited to a personal computer.
- a cloud-based mobile phone-based media data processing method is provided.
- the method is applied to a terminal device.
- the terminal device includes a browser and a processor, the browser is loaded with a script, and the processor runs all Describe the script to perform the following steps:
- An operation command for the cloud application input by a user in the browser is received, and the operation command is sent to the cloud mobile phone.
- the decoding of the media data of the application sent by the cloud phone is realized by loading the script in the browser of the terminal device, without being limited to a personal computer, and cross-platform audio and video display of the cloud phone application can be realized.
- the processor after sending the operation command to the cloud phone, the processor runs the script to perform the following steps:
- the user's operation commands on the terminal device will also be sent to the cloud phone for operation.
- the media data generated by the cloud phone is then decoded by loading a script in the browser of the terminal device, which can further reduce the number of terminal devices. Without being limited to personal computers, it can achieve cross-platform audio and video display of cloud mobile phone applications.
- the processor runs the script to generate a first browser thread, a second browser thread, and a third browser thread
- the first processing core of the processor runs the first browser thread to receive the first media data
- the second processing core of the processor runs the third browser thread to decode the first media data and obtain the first audio and the first video;
- the first processing core of the processor runs the second browser thread to play the first audio and the first video in the browser; and receives the user’s input in the browser for the game Operation command, sending the operation command to the cloud mobile phone.
- the third browser thread used for decoding can separately occupy the second processing core, thereby increasing the decoding speed.
- decoding the first media data includes:
- the second processing core of the processor runs the third browser thread to force the decoding of the first media data, wherein the media consumption The queue is used to store the first media data.
- the third browser thread can force the decoding of the first media data when the data volume of the media data in the media consumption queue is less than the threshold, without slowly waiting for the media data in the media consumption queue. Decoding is performed only when the amount of data is greater than or equal to the threshold, which speeds up the decoding process of the third browser thread and effectively reduces the time delay.
- decoding the first media data includes:
- the second processing core of the processor runs the third browser thread to add pseudo frames to the media consumption queue, so that the media consumption
- the data amount of the media data including the pseudo frame in the queue is greater than or equal to a threshold
- the first media data is decoded when the data amount of the media data is greater than or equal to the threshold.
- the method of adding pseudo frames accelerates the increase in the amount of data in the media data in the media consumption queue to reach the threshold as soon as possible for decoding, which speeds up the decoding process of the third browser thread and effectively reduces the time delay.
- a binary code written in a low-level language is called to decode the first media data.
- the decoding of the first media data is accelerated by calling a binary code written in a low-level language.
- a terminal device in a second aspect, includes a browser and a processor, the browser is loaded with a script, and the processor runs the script to: receive first media data sent by a cloud phone; Decode the first media data to obtain the first audio and the first video; play the first audio and the first video in the browser; receive the operation of the cloud application input by the user in the browser Command to send the operation command to the cloud mobile phone, wherein the first media data is generated when the cloud mobile phone runs the cloud application.
- the processor runs the script to: receive the second media data sent by the cloud phone; decode the second media data to obtain the second audio and the second video; The second audio and second video are played in the browser, wherein the second media data is generated when the cloud mobile phone runs the cloud application according to the operation command.
- the processor runs the script to generate a first browser thread, a second browser thread, and a third browser thread
- the first processing core of the processor runs the first browser thread to receive the first media data sent by the cloud mobile phone;
- the second processing core of the processor runs the third browser thread to decode the first media data to obtain the first audio and the first video;
- the first processing core of the processor runs the second browser thread to play the first audio and first video in the browser; and receives input from the user in the browser for the cloud application Send the operation command to the cloud phone.
- decoding the first media data includes:
- the second processing core of the processor runs the third browser thread to force the decoding of the first media data, wherein the media consumption The queue is used to store the first media data.
- decoding the first media data includes:
- the second processing core of the processor runs the third browser thread to add pseudo frames to the media consumption queue, so that the media consumption
- the data amount of the media data including the pseudo frame in the queue is greater than or equal to a threshold
- the first media data is decoded when the data amount of the media data is greater than or equal to the threshold.
- a binary code written in a low-level language is called to decode the first media data.
- a computer-readable storage medium including instructions, which when run on a terminal device, cause the terminal device to execute the method according to any one of the first aspect.
- a terminal device including a processor and a memory, and the processor executes the code in the memory to execute the method according to any one of the first aspect.
- a computer program product including a computer program, when the computer program is read and executed by a computing device, the computing device is caused to execute the method according to any one of the first aspect.
- the decoding of the media data of the application sent by the cloud phone is realized by loading the script in the browser of the terminal device, without being limited to a personal computer, and cross-platform audio and video display of the cloud phone application can be realized.
- FIG. 1 is a schematic structural diagram of a media data processing system of a cloud mobile phone involved in this application;
- 2A-2B exemplarily show an exemplary user interface in which two different terminal devices open a game page in a browser to play a game
- 3A-3B exemplarily show a comparison diagram of the original browser structure and the modified browser structure
- FIG. 4 is a flow interaction diagram of a media data processing method based on a cloud mobile phone provided by the present application
- FIG. 5 is a schematic diagram of the structure of the WebSocket protocol message involved in this application.
- Fig. 6 is a schematic structural diagram of a terminal device provided by the present application.
- Fig. 7 is a schematic structural diagram of another terminal device provided by the present application.
- Fig. 1 is a schematic structural diagram of a media data processing system of a cloud mobile phone involved in the present application.
- the media data processing system of the cloud mobile phone in this embodiment includes a terminal device 110 and a cloud data center 120.
- the terminal device 110 may communicate with the cloud data center 120 through a network.
- the terminal device 110 may be a smart phone, a cloud terminal, a thin terminal, or the like.
- the terminal device 110 may be a terminal device used in conjunction with a cloud mobile phone, that is, the terminal device 110 has a strong network communication capability, but may weaken the computing capability and storage capability.
- a browser is installed in the terminal device 110, and the browser engine used by the browser may be Trident, Gecko, Presto, or Webkit, etc., which is not specifically limited here.
- the operating system supported by the terminal device 110 may be an IOS system, an Android system (Android), a macOS system, a Windows system, a Linux system, and so on. In the game system, different terminal devices 110 can respectively support different operating systems.
- terminal device 1 supports Android system
- terminal 2 supports macOS system
- terminal device 3 supports IOS system
- terminal device 4 supports Windows system
- terminal 5 supports Linux system.
- different terminal devices 110 may also support the same operating system, which is not specifically limited here.
- the cloud data center 120 may include a service node 121 and a cloud mobile phone management node 125.
- the service node 121 may be a general physical server, for example, a physical server, such as an X86 server or an ARM server.
- the cloud mobile phone management node 125 may be a server used to manage cloud mobile phones in a public cloud, and may be a general physical server, or a virtual machine (Virtual Machine, VM) based on a general physical server combined with NFV technology.
- VM Virtual Machine
- a virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment, and this application does not specifically limit it.
- the service node 121 includes a cloud phone management agent node 124, hardware resources, an operating system (Operating System, OS) 122, and at least one cloud phone 123, and each cloud phone 123 is in the form of a container. Share hardware resources and operating systems with other cloud phones on the server.
- a virtualized cloud server with an operating system and a virtual mobile phone function is essentially to transfer applications on the mobile phone to a virtual mobile phone on the public cloud to run.
- Hardware resources may include computing resources, storage resources, and network resources, such as processors, memory, network cards, routers, databases, etc., and may also include hardware resources that may be required by other cloud phones, which are not specifically limited in this application.
- the operating system 122 may be an operating system applicable to cloud phones, such as an Android operating system, which is not specifically limited in this application. It should be noted that the operating system 122 may be an official complete operating system, or it may be an operating system modified to individual driver modules of the official complete operating system in order to adapt to the operating mode of the service node 121, and this application does not specifically limit it. .
- Cloud phone 123 shares hardware resources and operating systems with other cloud phones on the server in the form of a container.
- Each container can include the cloud applications required by the cloud phone and the dependent resources required by each cloud application.
- Dependent resources can be operating system core libraries and system libraries, such as functional function libraries, three-dimensional graphics processing libraries (such as OpenGLES), media libraries (Media Libraries), input managers (Input Manager), and so on.
- the container may include a game application and dependent resources required by the game application.
- the container in which each cloud mobile phone 123 is located uses hardware resources and operating system 122, but does not monopolize the hardware resources, but shares hardware resources and operating system 122 with the containers in which other cloud mobile phones are located. In other words, each container does not have its own kernel, and the application process in the container runs directly on the kernel of the service node 121.
- the cloud mobile phone management agent node 124 can be used to monitor and collect the service information of the service node 121, and report the service information to the cloud mobile phone management node 125 in real time, and is also used to according to the received cloud mobile phone specification information, then, Create a container on the service node 121, and divide the resources from the hardware resources to set the hardware and software required by the specification information of the cloud phone for the container.
- the process of creating a cloud phone in the cloud data center 120 may be: the terminal device 110 sends cloud phone creation information to the cloud phone management node 125.
- the cloud phone management node 125 determines that the server 1 creates the cloud phone 1, and the server 2 creates the cloud phone 2, then the server 1
- the cloud phone management agent node 1 can receive the specification information of the cloud phone 1 sent by the cloud phone management node 125, and complete the creation of the cloud phone 1 according to the specification information, and the cloud phone management agent node 2 on the server 2 can receive the cloud phone management node
- the specification information of the cloud phone 2 sent by 125, and the creation of the cloud phone 2 is completed according to the specification information.
- cloud phone management node 125 and the cloud phone management agent node 124 deployed on each service node 121 can be implemented based on container management systems such as Kubernetes (K8S) and Docker, which are not specifically limited in this application.
- container management systems such as Kubernetes (K8S) and Docker, which are not specifically limited in this application.
- cloud mobile phone Based on the media data processing system of the cloud mobile phone shown in FIG. 1, users can play games with low latency through the browser in the terminal device without installing the cloud application in the terminal device.
- a detailed description will be given below by taking the terminal devices as an example of a smart phone and a thin terminal respectively.
- the following examples all use cloud applications as game applications as an example for description, but in other examples, cloud applications may also be other applications, which should not be specifically limited here.
- the terminal device is a smart phone.
- Fig. 2A exemplarily shows an exemplary user interface for opening a game page in a browser to play a game.
- the user interface may include: a status bar, a calendar indicator, a weather indicator, a tray with commonly used application icons, a navigation bar, and other application icons. in:
- the status bar may include: one or more signal strength indicators for mobile communication signals (also called cellular signals), one or more signal strength indicators for wireless fidelity (Wi-Fi) signals, and battery status Indicator, time indicator.
- signal strength indicators for mobile communication signals also called cellular signals
- Wi-Fi wireless fidelity
- battery status Indicator time indicator
- the calendar indicator can be used to indicate the current time, such as date, day of the week, hour and minute information, etc.
- the weather indicator can be used to indicate the type of weather, such as cloudy to clear, light rain, etc., and can also be used to indicate information such as temperature.
- a tray with icons of commonly used applications can display: phone icons, contact icons, text messages, and camera icons.
- the navigation bar may include system navigation keys such as the return key, the home screen key, and the multitasking key.
- system navigation keys such as the return key, the home screen key, and the multitasking key.
- the smartphone can display the previous page of the current page.
- the smart phone displays the home interface.
- the smart phone can display the task that the user has recently opened.
- the naming of each navigation key can also be other, which is not limited in this application. Not limited to virtual keys, each navigation key in the navigation bar can also be implemented as a physical key.
- Other application icons may be, for example, icons for mutual transfer, icons for gallery, icons for music, icons for applications, icons for mailboxes, icons 212 for browsers, icons for memos, and icons for settings.
- the user interface 210 may also include a page indicator.
- Other application icons can be distributed on multiple pages, and the page indicator can be used to indicate which application the user is currently browsing. The user can swipe the area of other application icons left and right to browse application icons in other pages.
- the user interface 210 exemplarily shown in FIG. 2A may be a home screen (Home screen). It is understandable that FIG. 2A only exemplarily shows the user interface on the smart phone, and should not constitute a limitation to the embodiment of the present application.
- the user may click the icon 212 of the browser on the user interface 210, the smart phone detects the above-mentioned user operation, and in response to the above-mentioned user operation, the smart phone opens the browser 220.
- the browser 220 may include: a search box 222, a scan control, a tab bar, multiple recommended directories, and a tray of commonly used controls, among which:
- the search box 222 can be used to search for a game webpage matching the character according to the character input by the user.
- the scan control can be used to scan the QR code or barcode, so as to quickly open the game webpage corresponding to the QR code or barcode.
- the title bar can be used to indicate various types of topics, such as recommendations, games, hotspots, and entertainment.
- the presentation form of the title bar can be text information, icons or other forms.
- the control 302 may receive a user operation (for example, a touch operation), and in response to the detected user operation, the anchor terminal 120 may display a page for logging in or switching a cloud live broadcast account.
- a user operation for example, a touch operation
- the tray of commonly used controls can display: previous page control icons, next page control icons, home page control icons, opened webpage icons, and so on.
- the aforementioned control icons can all accept user operations (such as touch operations).
- the smart phone can display a response page.
- the previous page control icon can be used to display the previous page display.
- the previous page control icon can be used to display the web page displayed on the next page
- the home page control icon can be used for the home page of the browser.
- the browser can be user-defined, or the navigation page preset by the browser ,
- the icon of the opened webpage can be used to display multiple pages that are currently opened.
- a plurality of recommended directories may, for example, display a title and a display picture 224, the display title shows game related information, and the display picture 224 shows game related pictures.
- the display picture 224 is associated with a hyperlink of the game page. When the user clicks the display picture 224, the browser can jump to the game page 230.
- the game page 230 is used to display the screen content of the game and play the sound of the game.
- the game page can include game titles, game screens, and game controls.
- the game title is optional, that is, the user can choose to display the game title or not to display the game title, or the game page can display the game tag by default, or the game title is not displayed by default.
- the image quality, definition, resolution, size, and color of the game screen can be set according to the user's needs.
- the user can set the game screen to be full screen or non-full screen.
- the game screen can also be set on top of other applications in a floating form, so that users can handle other things while playing the game.
- the game screen can be a two-dimensional screen or a three-dimensional screen.
- the specific process of the user opening the game page in the browser to play the game is: the user clicks the browser icon 212 on the user interface 210 (UI) of the smart phone with a finger to open the browser 220.
- the user enters the Uniform Resource Locator (URL) of the game webpage 230 in the search bar 222 of the browser 120, or clicks the hyperlink 224 recommended by the browser 220 (the hyperlink points to the game webpage 230 and includes the The URL of the game web page 230), thereby opening the game web page 230.
- the user can play the game on the game page 230.
- FIG. 2A only exemplarily shows various user interfaces for opening the game page on the smart phone, and should not constitute a limitation to the embodiment of the present application.
- the terminal device is a thin terminal.
- Fig. 2B exemplarily shows an exemplary desktop where a game page in a browser is opened to play a game.
- the desktop may include: a calendar indicator, an application tray has been opened, and a start button. in:
- the calendar indicator located in the lower right corner of the desktop, can be used to indicate the current time, such as date, day of the week, hour and minute information, etc.
- the opened application tray located at the bottom of the desktop, is used to indicate the applications that have been opened. For example, when the browser is opened, the browser icon will be displayed in the opened application tray, and when the browser is closed When the browser icon disappears from the open application tray. When the browser is opened multiple times, multiple overlapping browser icons may be displayed to indicate that the browser has been opened multiple times.
- the start button located in the lower left corner of the desktop, is used to display one-level or multi-level menus.
- Each level of the menu can display the entrances of multiple applications, such as control panels, devices and printers, default programs, security, and help.
- Multiple application icons may be displayed on the desktop, such as cloud application icons, camera icons, time icons, calendar icons, application icons, browser icons 310, settings icons, and so on.
- the user can click on the icon 310 of the browser on the desktop, the thin terminal detects the above-mentioned user operation, and in response to the above-mentioned user operation, the thin terminal opens the browser 320.
- the browser 320 may include: a search box 322, a previous page control, a next page control, a reload control, a title bar, and multiple recommended directories. Among them:
- the search box 322 can be used to search for a game webpage matching the character according to the character input by the user.
- the previous page control can be used to display the web page displayed on the previous page
- the previous page control icon can be used to display the web page displayed on the next page
- the reload control can be used to refresh the current page to reload the current page .
- the title bar can be used to indicate various types of topics, such as recommendations, games, hotspots, and entertainment.
- the presentation form of the title bar can be text information, icons or other forms.
- a plurality of recommended directories may, for example, display a title and a display picture 324, the display title shows game related information, and the display picture 324 shows game related pictures.
- the display picture 324 is associated with a hyperlink of the game page. When the user clicks the display picture 324, the browser can jump to the game page 330.
- the game page 330 is used to display the screen content of the game and play the game sound.
- the game page can include game titles, game screens, and game controls.
- the game title is optional, that is, the user can choose to display the game title or not to display the game title, or the game page can display the game tag by default, or the game title is not displayed by default.
- the picture quality, definition, resolution, size, and color of the game screen can be set according to the needs of the user.
- the user can set the game screen to be full screen or non-full screen.
- the game screen can also be set on top of other applications in a floating form, so that users can handle other things while playing the game.
- the game screen can be a two-dimensional screen or a three-dimensional screen.
- the specific process of the user opening the game page in the browser to play the game is: the user clicks the browser icon 312 on the interface 310 of the display with the mouse, thereby opening the browser 320.
- the user enters the Uniform Resource Locator (URL) of the game webpage 330 in the search bar 322 of the browser 320, or clicks the hyperlink 324 recommended by the browser 320 (the hyperlink points to the game webpage 330 and includes the The URL of the game web page 330), thereby opening the game web page 330.
- the user can play the game on the game page 330.
- the interface 310 can be used to display not only browser icons, but also music application icons, mail application icons, gallery application icons, settings icons, etc., which are not specifically limited here.
- FIG. 2B only exemplarily shows various user interfaces for opening the game page on the thin terminal, and should not constitute a limitation to the embodiment of the present application.
- the terminal device may also be a virtual device, etc., which is not specifically limited here.
- the browser includes a rendering engine and a JavaScript (JS) engine, where the rendering engine is used to convert resource files (HTML/CSS/JavaScript text and corresponding resource files) into User-visible results.
- the rendering engine usually includes CSS, SVG, layout, render tree, HTML, DOM, inspector, and so on.
- the JS engine is used to read the JavaScript in the file, process and execute it, and the JS engine is single-threaded.
- Webkit also includes WebKit embedded interface and corresponding WebKit binding, WebKit2 embedded interface and corresponding WebKit2 binding, WebKitPorts.
- WebKitPorts can include modules such as grid segment, video, text, hardware acceleration, and image decoding.
- the database and operating system that WebKit depends on can also be included.
- the database may include a 2D graphics library, a 3D graphics library, a network library, a storage, an audio library, a video library, and so on.
- multiple browser threads including a first browser thread, a second browser thread, and a third browser thread may be added to the JS engine of the existing browser.
- the browser thread can be WebWorker. WebWorker is used to enable the browser to run a script operation in a background thread (worker) separate from the main execution thread, thereby creating a multi-threaded runtime environment for the JS engine, that is, the main thread of the browser creates a browser thread and assigns tasks For the browser thread, the browser thread is also running while the main thread is running, without interfering with each other, and the result is returned to the main thread after the browser thread runs.
- the first browser thread may also be referred to as a network thread.
- the network thread adopts the WebSocket protocol, which can realize two-way communication of game data (including media data and control data) between the terminal device and the cloud phone.
- the second browser thread may also be referred to as the main control thread, which is responsible for the overall operation of the game.
- the third browser thread may also be referred to as a decoding thread, which is responsible for decoding the media data of the game.
- Fig. 4 is a flow interaction diagram of a game running method provided by the present application.
- the game running method in this embodiment includes the following steps:
- the browser engine used by the browser may be Trident, Gecko, Presto, or Webkit, etc., which is not specifically limited here.
- the terminal device detects whether the user enters the URL of the game webpage in the search bar through the main control thread in the browser, or whether the user clicks the hyperlink recommended by the browser. Enter the URL of the game webpage in the search bar, or click the hyperlink recommended by the browser, the main control thread generates a media data request, and sends the media data request to the network thread through shared memory or pipeline communication, etc. .
- S102 The browser of the terminal device sends the media data request to the cloud mobile phone.
- the cloud mobile phone receives the media data request sent by the terminal device.
- the network thread in the browser sends the media data request to the cloud phone through the WebSocket protocol.
- the network thread is an exclusive Webwork. Therefore, the network thread can realize the data transmission and reception between the browser and the cloud phone.
- S103 The cloud mobile phone runs a game application to generate first media data.
- the cloud mobile phone after receiving the media data request sent by the browser of the terminal device, the cloud mobile phone obtains the URL of the game webpage from the media data request, determines the corresponding game application according to the URL of the game webpage, and runs the game application , And generate the first media data. Then, the cloud mobile phone encodes the generated first media data through an encoding method, thereby reducing the amount of data transmission.
- S104 The cloud mobile phone sends the first media data to the terminal device.
- the terminal device receives the first media data sent by the cloud mobile phone.
- the network thread in the browser of the terminal device receives the first media data sent by the cloud phone through the WebSocket protocol. After the main control thread in the browser monitors the first media data sent by the network thread, it pushes the first media data to the media data queue. The main control thread in the browser sends the data in the media data queue to the decoding thread for decoding in a real-time manner through shared memory or pipeline communication, etc., thereby effectively reducing the delay of the game.
- the terminal device decodes the first media data, so as to obtain the first audio and/or the first video.
- the decoding thread in the browser in the terminal device decodes the first media data, thereby obtaining the first audio and/or the first video. Then, the decoding thread in the browser sends the first media data to the main control thread through methods such as shared memory or pipe communication.
- the decoding method adopted by the decoding thread corresponds to the encoding method adopted by the cloud phone.
- the decoding method adopted by the terminal device is also lossless compression.
- the decoding method adopted by the terminal device is also lossy compression.
- the terminal device plays the first audio and/or the first video in the first game page generated by the browser.
- the main control thread in the browser of the terminal device receives the game operation command input by the user through the external input device on the game page of the browser.
- the external input device can be a touch screen, a mouse, a keyboard, a camera, a scanner, a light pen, a handwriting input board, a joystick, a microphone, and so on.
- the operation commands of the game can include forward, backward, turn left, turn right, move left, move right, jump, sit down, stand up, retract/take arms, walk/run, etc.
- Terminal devices and cloud phones have different definitions of operations. Therefore, the browser needs to convert the operation commands input by the user into game operations that the cloud phone can recognize. Then, the main control thread in the browser sends game operations to the network thread through shared memory or pipe communication.
- the terminal device sends a game operation to the cloud mobile phone.
- the cloud mobile phone receives the game operation sent by the terminal device.
- the terminal device sends the game operation to the cloud phone through the WebSocket protocol.
- S109 The cloud mobile phone runs the game application according to the game operation, thereby generating second media data.
- the cloud mobile phone continues to run the game application, and generates the second media data according to the game operation. Then, the cloud mobile phone encodes the generated second media data through an encoding method, thereby reducing the amount of data transmission.
- the cloud mobile phone sends the second media data to the terminal device.
- the terminal device receives the second media data sent by the cloud mobile phone.
- the network thread in the browser of the terminal device receives the second media data sent by the cloud phone through the WebSocket protocol. After the main control thread in the browser monitors the second media data sent by the network thread, it pushes the second media data to the media data queue. The main control thread in the browser sends the data in the media data queue to the decoding thread for decoding in a real-time manner through shared memory or pipeline communication, etc., thereby effectively reducing the delay of the game.
- S111 The terminal device decodes the second media data, so as to obtain the second audio and/or the second video.
- the decoding thread in the browser in the terminal device decodes the second media data, thereby obtaining the second audio and/or the second video. Then, the decoding thread in the browser sends the second media data to the main control thread through methods such as shared memory or pipe communication.
- the terminal device plays the second audio and/or the second video in the second game page generated by the browser.
- the media data request, the first audio and/or the first video, the game operation, and the second audio and/or the second video are all encapsulated in the WebSocket protocol format.
- the WebSocket protocol format includes 1-bit FIN, 1-bit RSV1, RSV2, RSV3, 4-bit Opcode, 1-bit mask (MASK), and 7-bit data payload length ( payload len), a mask key value (Masking-key) of 0 to 4 bytes, and a multi-byte payload data (payload).
- the media data request, the first audio and/or the first video, the game operation, and the second audio and/or the second video load are in the payload.
- the terminal device receives the first media data sent by the cloud phone, and needs to decode the first media data into the first audio and/or the first video as soon as possible, and display it in the first game page generated by the browser. Play the first audio and/or the first video.
- terminal devices can be divided into at least the following two methods:
- the terminal device uses a video component to decode the first media data into the first audio and/or the first video as soon as possible, and play the first video in the first game page generated by the browser.
- Audio and/or first video can be implemented by using modules in WebKitPorts, for example, video, hardware acceleration, and so on.
- the terminal device generally plays a video in the browser through a video component, so the video component is not sensitive to time delay. After the network thread receives the media data, the video component will cache the media data first, and will not decode the media data until the number of cached media data exceeds the threshold, and play it out in the browser. Ensure the smoothness of the playback, but this will cause a very large delay.
- the game is very sensitive to delay and cannot accept such a large delay.
- the video component can be improved to reduce the time delay.
- improvements to the video component include at least the following aspects: (1) The video component issues a mandatory command, which instructs the decoding thread to immediately decode the received first media data, thereby obtaining The first video and the first audio, and the main control thread will immediately play the first video and the first audio in the browser without buffering the first media data. (2) The video component instructs the main control thread to add pseudo frames to the media consumption queue, so that the media data in the buffered media consumption queue reaches the threshold as soon as possible.
- the video component instructs the decoding thread to treat the first media data Perform decoding to obtain the first video and the first audio, and the video component instructs the main control thread to play the first video and the first audio in the browser.
- the dummy frame may be pre-stored, the dummy frame may be a data frame completely unrelated to the first media data, and the dummy frame may also be referred to as a transparent frame.
- the video component instructs the main control thread to forcefully play the video and audio of the last frame of the decoded first video and first audio to Reduce time delay.
- the video component can also process the media data by skipping frames. When the media data is processed by skipping frames, the media data can be sampled, and the closer the data is The denser the frame sampling, the sparser the sampling of the farther data frame.
- the terminal device uses the Canvas component to decode the first media data into the first audio and/or the first video as soon as possible, and play the first audio and/or in the first game page generated by the browser. Or the first video.
- the Canvas component can be implemented using modules in WebKitPorts, for example, video, hardware acceleration, and so on.
- the decoding thread is decoded by files written in JavaScript semantics, and the decoding efficiency is very low. For this reason, the Canvas component can instruct the decoding thread to call the binary code written in a low-level language, for example, WebAssembly for decoding, thereby increasing the decoding rate.
- decoding A single thread can independently occupy the core of a processor for decoding, and it can also significantly increase the decoding rate.
- the terminal device provided in this application may include a processor and a browser as shown in FIG. 3B.
- the browser includes a JS engine, the browser is loaded with a script, and the processor runs the script to make the JS engine generate the first The browser thread, the second browser thread, and the third browser thread.
- the first processing core of the processor runs the first browser thread to receive first media data sent by the cloud mobile phone, the first media data being generated when the cloud mobile phone runs a game;
- the second processing core of the processor runs the third browser thread to decode the first media data to obtain the first audio and the first video;
- the first processing core of the processor runs the second browser thread to play the first audio and the first video in the browser;
- the first processing core of the processor runs the second browser thread to receive an operation command for the game input by a user in the browser, and send the operation command to the cloud mobile phone.
- the first processing core of the processor runs the first browser thread to receive the second media data sent by the cloud mobile phone, and the second media data is executed on the cloud mobile phone according to the operation Generated when the command is running the game;
- the second processing core of the processor runs the third browser thread to decode the second media data to obtain second audio and second video;
- the second processing core of the processor runs the third browser thread to play the second audio and second video in the browser.
- the second processing core of the processor runs the third browser thread to force the decoding of the first media data , wherein the media consumption queue is used to store the first media data.
- the second processing core of the processor runs the third browser thread to add pseudo frames to the media consumption queue , So that the data amount of the media data including the pseudo frame in the media consumption queue is greater than or equal to a threshold, and when the data amount of the media data is greater than or equal to the threshold, the first media data To decode.
- a binary code written in a low-level language is called to decode the first media data.
- FIG. 3B is an exemplary division method, which is not specifically limited in this application.
- the terminal device supports browsers running multiple webpage tags.
- the browser can use different input and output devices, for example, the input device can be a keyboard and a mouse, and the output device can be a display screen. Or, the browser uses a common input and output device: touch screen.
- the touch screen is used to receive the user's touch operation and display the output content of the browser.
- Fig. 6 is a structural block diagram of an implementation manner of a terminal device.
- the terminal device may be a thin terminal, including a host 410, an output device 420, and an input device 430.
- the host 410 may integrate: one or more processors, a clock module, and a power management module.
- the clock module integrated in the host 410 is mainly used to generate a clock required for data transmission and timing control for the processor.
- the power management module integrated in the host 410 is mainly used to provide a stable, high-precision voltage for the processor, the output device 420, and the input device 430.
- the host 410 also integrates a memory for storing various software programs and/or multiple sets of instructions.
- the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
- the memory does not need to install an operating system and a large number of application programs.
- the memory only needs to store some necessary application programs, such as an input and output program, which can be used to communicate with one or more input devices or output devices.
- the communication program can be used to communicate with cloud phones.
- the memory can also store a user interface program, which can vividly display the content of the browser through a graphical operation interface, and receive user control operations on the browser through input controls such as menus, dialog boxes, and buttons.
- the output device 420 mainly includes a display, and the display may include a cathode ray tube display (Cathode Ray Tube, CRT), a plasma display (Plasma Display Panel, PDP), a liquid crystal display (Liquid Crystal Display, LCD), and so on.
- the liquid crystal display includes a liquid crystal panel and a backlight module.
- the liquid crystal display panel includes a polarizing film, a glass substrate, a black matrix, a color filter, a protective film, a common electrode, a calibration layer, and a liquid crystal layer (liquid crystal , Spacer, sealant), capacitor, display electrode, prism layer, light scattering layer.
- the backlight module includes: illuminating light source, reflecting plate, light guide plate, diffuser, brightness enhancement film (prism sheet), frame and so on.
- the input device 430 may include a keyboard and a mouse. Keyboard and mouse are the most commonly used and most important input devices. Through the keyboard, English letters, numbers, punctuation marks, etc. can be input into the computer, so as to issue commands to the computer, input data, etc., and quickly locate the vertical and horizontal coordinates through the mouse. This simplifies the operation.
- the keyboard may include a mechanical keyboard, a plastic film keyboard (Mechanical), a conductive rubber keyboard (Membrane), a contactless electrostatic capacitor keyboard (Capacitives), etc.
- the mouse may include a roller ball mouse, an optical mouse, and a wireless mouse.
- the input device 430 is configured to receive first media data sent by a cloud mobile phone, the first media data being generated when the cloud mobile phone runs a cloud application;
- the host 410 is configured to decode the first media data to obtain the first audio and the first video;
- the output device 420 is used to play the first audio and the first video in the browser
- the input device 430 is configured to receive an operation command for the cloud application input by a user in the browser, so as to send the operation command to the cloud phone through a communication module.
- FIG. 6 For the sake of brevity, the terminal device shown in FIG. 6 has not been introduced in detail. For details, please refer to FIGS. 1 to 5 and related descriptions, which will not be described again this time.
- Fig. 7 is a structural block diagram of another implementation manner of a terminal device.
- the terminal device may be a smart phone, including: a baseband chip 510, a memory 515, including one or more computer-readable storage media, a radio frequency (RF) module 516, and a peripheral system 517. These components may communicate on one or more communication buses 514.
- RF radio frequency
- the peripheral system 517 is mainly used to implement the interactive function between the terminal device 510 and the user/external environment, and mainly includes the input and output devices of the terminal device.
- the peripheral system 517 may include: a touch screen controller 518, a camera controller 519, an audio controller 520, and a sensor management module 521.
- each controller can be coupled with its corresponding peripheral devices, such as a touch screen 523, a camera 524, an audio circuit 525, and a sensor 526.
- the gesture sensor in the sensor 526 may be used to receive gesture control operations input by the user.
- the pressure sensor in the sensor 526 can be disposed under the touch screen 523, and can be used to collect the touch pressure acting on the touch screen 523 when the user inputs a touch operation through the touch screen 523. It should be noted that the peripheral system 517 may also include other I/O peripherals.
- the baseband chip 510 may integrate: one or more processors 511, a clock module 512, and a power management module 513.
- the clock module 512 integrated in the baseband chip 510 is mainly used to generate a clock required for data transmission and timing control for the processor 511.
- the power management module 513 integrated in the baseband chip 510 is mainly used to provide a stable and high-precision voltage for the processor 511, the radio frequency module 516, and peripheral systems.
- the memory 515 is used to store various software programs and/or multiple sets of instructions.
- the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
- the memory does not need to install an operating system and a large number of application programs.
- the memory only needs to store some necessary application programs, such as an input and output program, which can be used to communicate with one or more input devices or output devices.
- the communication program can be used to communicate with cloud phones.
- the memory can also store desktop programs.
- the radio frequency (RF) module 516 is used to receive and transmit radio frequency signals, and mainly integrates the receiver and transmitter of the terminal device.
- the radio frequency (RF) module 516 communicates with the communication network and other communication devices through radio frequency signals.
- the radio frequency (RF) module 516 may include, but is not limited to: an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC chip, a SIM card 5161 And storage media.
- the radio frequency module can also include WIFI 5162, Bluetooth and other short-range wireless communication modules.
- the radio frequency (RF) module 516 may be implemented on a separate chip.
- the radio frequency (RF) module 516 is configured to receive first media data sent by a cloud mobile phone, and the first media data is generated when the cloud mobile phone runs a cloud application;
- the baseband chip 510 is configured to decode the first media data to obtain the first audio and the first video;
- the touch screen 523 is used to play the first video in the browser, and the audio circuit 525 is used to play the first audio;
- the touch screen 523 is configured to receive an operation command for the cloud application input by a user in the browser, so as to send the operation command to the cloud phone through a radio frequency (RF) module 516.
- RF radio frequency
- FIG. 7 For the sake of brevity, the terminal device shown in FIG. 7 has not been introduced in detail. For details, please refer to FIGS. 1 to 5 and related descriptions, which will not be further described this time.
- the decoding of the media data of the game sent by the cloud mobile phone is realized by loading a script in the browser of the terminal device, without being limited to a personal computer, and a cross-platform cloud mobile phone game audio and video display can be realized.
- this application can be implemented by means of software plus necessary general hardware.
- it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memory, Dedicated components and so on to achieve.
- all functions completed by computer programs can be easily implemented with corresponding hardware.
- the specific hardware structures used to achieve the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. Circuit etc.
- software program implementation is a better implementation in more cases.
- the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, training device, or network device, etc.) execute the various embodiments described in this application method.
- a computer device which can be a personal computer, training device, or network device, etc.
- the computer program product includes one or more computer instructions.
- the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions may be transmitted from a website, computer, training device, or data.
- the center transmits to another website, computer, training equipment, or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
- wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
- wireless such as infrared, wireless, microwave, etc.
- the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center integrated with one or more available media.
- the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephonic Communication Services (AREA)
Abstract
Description
本申请涉及云技术领域,尤其涉及一种基于云手机的媒体数据处理方法以及终端设备。This application relates to the field of cloud technology, and in particular to a media data processing method and terminal equipment based on a cloud mobile phone.
云手机在运行云应用过程中,会将媒体数据通过网络发送至个人电脑的浏览器,个人电脑的浏览器内安装有flash插件,flash插件用于对媒体数据进行处理,产生音频和视频,以在浏览器中向用户呈现云应用的画面和声音。In the process of running cloud applications, the cloud phone will send media data to the browser of the personal computer via the network. The browser of the personal computer is equipped with a flash plug-in. The flash plug-in is used to process the media data and generate audio and video. The picture and sound of the cloud application are presented to the user in the browser.
Flash插件需安装于个人电脑的浏览器中,且Flash插件只支持个人电脑的操作系统,不适用于手机的操作系统。The Flash plug-in needs to be installed in the browser of the personal computer, and the Flash plug-in only supports the operating system of the personal computer, not applicable to the operating system of the mobile phone.
发明内容Summary of the invention
本申请提供了一种基于云手机的媒体数据处理方法以及终端设备,通过在终端设备的浏览器中加载脚本实现对云手机发送的云应用的媒体数据的解码,无需受限于个人电脑,可实现跨平台的云手机应用音视频展示。This application provides a cloud mobile phone-based media data processing method and a terminal device. By loading a script in the browser of the terminal device to decode the media data of the cloud application sent by the cloud mobile phone, it does not need to be limited to a personal computer. Realize cross-platform audio and video display of cloud mobile phone applications.
第一方面,提供了一种基于云手机的媒体数据处理方法,所述方法应用于终端设备,所述终端设备包括浏览器和处理器,所述浏览器加载有脚本,所述处理器运行所述脚本以执行以下步骤:In the first aspect, a cloud-based mobile phone-based media data processing method is provided. The method is applied to a terminal device. The terminal device includes a browser and a processor, the browser is loaded with a script, and the processor runs all Describe the script to perform the following steps:
接收云手机发送的第一媒体数据,所述第一媒体数据在所述云手机运行云应用时产生;Receiving first media data sent by a cloud mobile phone, the first media data being generated when the cloud mobile phone runs a cloud application;
对所述第一媒体数据进行解码,以获取第一音频和第一视频;Decoding the first media data to obtain first audio and first video;
在所述浏览器中播放所述第一音频和第一视频;Playing the first audio and the first video in the browser;
接收用户在所述浏览器输入的针对所述云应用的操作命令,将所述操作命令发送至所述云手机。An operation command for the cloud application input by a user in the browser is received, and the operation command is sent to the cloud mobile phone.
在上述方案中,通过在终端设备的浏览器中加载脚本实现对云手机发送的应用的媒体数据的解码,无需受限于个人电脑,可实现跨平台的云手机应用音视频展示。In the above solution, the decoding of the media data of the application sent by the cloud phone is realized by loading the script in the browser of the terminal device, without being limited to a personal computer, and cross-platform audio and video display of the cloud phone application can be realized.
在一些可能的设计中,在将所述操作命令发送至所述云手机之后,所述处理器运行所述脚本以执行以下步骤:In some possible designs, after sending the operation command to the cloud phone, the processor runs the script to perform the following steps:
接收所述云手机发送的第二媒体数据,所述第二媒体数据是所述云手机根据所述操作命令运行所述云应用时产生;Receiving second media data sent by the cloud mobile phone, where the second media data is generated when the cloud mobile phone runs the cloud application according to the operation command;
对所述第二媒体数据进行解码,以获取第二音频和第二视频;Decoding the second media data to obtain second audio and second video;
在所述浏览器中播放所述第二音频和第二视频。Playing the second audio and the second video in the browser.
在上述方案中,用户在终端设备上的操作命令也将会被发送到云手机上进行运 行,云手机产生的媒体数据再通过在终端设备的浏览器中加载脚本进行解码,能够进一步减少终端设备的资源消耗,同时也无需受限于个人电脑,可实现跨平台的云手机应用音视频展示。In the above solution, the user's operation commands on the terminal device will also be sent to the cloud phone for operation. The media data generated by the cloud phone is then decoded by loading a script in the browser of the terminal device, which can further reduce the number of terminal devices. Without being limited to personal computers, it can achieve cross-platform audio and video display of cloud mobile phone applications.
在一些可能的设计中,所述处理器运行所述脚本以产生第一浏览器线程、第二浏览器线程以及第三浏览器线程;In some possible designs, the processor runs the script to generate a first browser thread, a second browser thread, and a third browser thread;
所述处理器的第一处理核运行所述第一浏览器线程以接收所述第一媒体数据;The first processing core of the processor runs the first browser thread to receive the first media data;
所述处理器的第二处理核运行所述第三浏览器线程以对所述第一媒体数据进行解码,获取第一音频和第一视频;The second processing core of the processor runs the third browser thread to decode the first media data and obtain the first audio and the first video;
所述处理器的第一处理核运行所述第二浏览器线程以在所述浏览器中播放所述第一音频和第一视频;并接收用户在所述浏览器输入的针对所述游戏的操作命令,将所述操作命令发送至所述云手机。The first processing core of the processor runs the second browser thread to play the first audio and the first video in the browser; and receives the user’s input in the browser for the game Operation command, sending the operation command to the cloud mobile phone.
在上述方案中,用于进行解码的第三浏览器线程可以单独占用第二处理核,从而提高解码的速度。In the above solution, the third browser thread used for decoding can separately occupy the second processing core, thereby increasing the decoding speed.
在一些可能的设计中,对所述第一媒体数据进行解码包括:In some possible designs, decoding the first media data includes:
在媒体消费队列中的媒体数据的数据量小于阈值时,所述处理器的第二处理核运行所述第三浏览器线程以强制对所述第一媒体数据进行解码,其中,所述媒体消费队列用于存储所述第一媒体数据。When the data volume of the media data in the media consumption queue is less than the threshold, the second processing core of the processor runs the third browser thread to force the decoding of the first media data, wherein the media consumption The queue is used to store the first media data.
在上述方案中,第三浏览器线程可以在媒体消费队列中的媒体数据的数据量小于阈值时就强制对所述第一媒体数据进行解码,而无需慢慢等待媒体消费队列中的媒体数据的数据量大于或者等于阈值时才进行解码,加快了第三浏览器线程解码的过程,有效地减少时延。In the above solution, the third browser thread can force the decoding of the first media data when the data volume of the media data in the media consumption queue is less than the threshold, without slowly waiting for the media data in the media consumption queue. Decoding is performed only when the amount of data is greater than or equal to the threshold, which speeds up the decoding process of the third browser thread and effectively reduces the time delay.
在一些可能的设计中,对所述第一媒体数据进行解码包括:In some possible designs, decoding the first media data includes:
在媒体消费队列中的媒体数据的数据量小于阈值时,所述处理器的第二处理核运行所述第三浏览器线程以在所述媒体消费队列中添加伪帧,以使得所述媒体消费队列中包括所述伪帧在内的媒体数据的数据量大于或者等于阈值,并在所述媒体数据的数据量大于或者等于阈值的情况下对所述第一媒体数据进行解码。When the data volume of the media data in the media consumption queue is less than the threshold, the second processing core of the processor runs the third browser thread to add pseudo frames to the media consumption queue, so that the media consumption The data amount of the media data including the pseudo frame in the queue is greater than or equal to a threshold, and the first media data is decoded when the data amount of the media data is greater than or equal to the threshold.
在上述方案中,通过添加伪帧的方法加快媒体消费队列中的媒体数据中的数据量的增加以尽快达到阈值进行解码,加快了第三浏览器线程解码的过程,有效地减少时延。In the above solution, the method of adding pseudo frames accelerates the increase in the amount of data in the media data in the media consumption queue to reach the threshold as soon as possible for decoding, which speeds up the decoding process of the third browser thread and effectively reduces the time delay.
在一些可能的设计中,所述处理器的第二处理核运行所述第三浏览器线程的过程中,调用低级语言编写的二进制代码对所述第一媒体数据进行解码。In some possible designs, when the second processing core of the processor runs the third browser thread, a binary code written in a low-level language is called to decode the first media data.
在上述方案中,通过调用低级语言编写的二进制代码加快对第一媒体数据进行解码。In the above solution, the decoding of the first media data is accelerated by calling a binary code written in a low-level language.
第二方面,提供了一种终端设备,所述终端设备包括浏览器和处理器,所述浏览器加载有脚本,所述处理器运行所述脚本以:接收云手机发送的第一媒体数据;对所述第一媒体数据进行解码,获取第一音频和第一视频;在所述浏览器中播放所述第一音频和第一视频;接收用户在所述浏览器输入的针对云应用的操作命令,将所述操作命令发送至所述云手机,其中,所述第一媒体数据在所述云手机运行所述云应用时产生。In a second aspect, a terminal device is provided, the terminal device includes a browser and a processor, the browser is loaded with a script, and the processor runs the script to: receive first media data sent by a cloud phone; Decode the first media data to obtain the first audio and the first video; play the first audio and the first video in the browser; receive the operation of the cloud application input by the user in the browser Command to send the operation command to the cloud mobile phone, wherein the first media data is generated when the cloud mobile phone runs the cloud application.
在一些可能的设计中,所述处理器运行所述脚本以:接收所述云手机发送的第二媒体数据;对所述第二媒体数据进行解码,以获取第二音频和第二视频;在所述浏览器中播放所述第二音频和第二视频,其中所述第二媒体数据是所述云手机根据所述操作命令运行所述云应用时产生。In some possible designs, the processor runs the script to: receive the second media data sent by the cloud phone; decode the second media data to obtain the second audio and the second video; The second audio and second video are played in the browser, wherein the second media data is generated when the cloud mobile phone runs the cloud application according to the operation command.
在一些可能的设计中,所述处理器运行所述脚本以产生第一浏览器线程、第二浏览器线程以及第三浏览器线程;In some possible designs, the processor runs the script to generate a first browser thread, a second browser thread, and a third browser thread;
所述处理器的第一处理核运行所述第一浏览器线程以接收云手机发送的第一媒体数据;The first processing core of the processor runs the first browser thread to receive the first media data sent by the cloud mobile phone;
所述处理器的第二处理核运行所述第三浏览器线程以对所述第一媒体数据进行解码,以获取所述第一音频和所述第一视频;The second processing core of the processor runs the third browser thread to decode the first media data to obtain the first audio and the first video;
所述处理器的第一处理核运行所述第二浏览器线程以在所述浏览器中播放所述第一音频和第一视频;并接收用户在所述浏览器输入的针对所述云应用的操作命令,将所述操作命令发送至所述云手机。The first processing core of the processor runs the second browser thread to play the first audio and first video in the browser; and receives input from the user in the browser for the cloud application Send the operation command to the cloud phone.
在一些可能的设计中,对所述第一媒体数据进行解码包括:In some possible designs, decoding the first media data includes:
在媒体消费队列中的媒体数据的数据量小于阈值时,所述处理器的第二处理核运行所述第三浏览器线程以强制对所述第一媒体数据进行解码,其中,所述媒体消费队列用于存储所述第一媒体数据。When the data volume of the media data in the media consumption queue is less than the threshold, the second processing core of the processor runs the third browser thread to force the decoding of the first media data, wherein the media consumption The queue is used to store the first media data.
在一些可能的设计中,对所述第一媒体数据进行解码包括:In some possible designs, decoding the first media data includes:
在媒体消费队列中的媒体数据的数据量小于阈值时,所述处理器的第二处理核运行所述第三浏览器线程以在所述媒体消费队列中添加伪帧,以使得所述媒体消费队列中包括所述伪帧在内的媒体数据的数据量大于或者等于阈值,并在所述媒体数据的数据量大于或者等于阈值的情况下对所述第一媒体数据进行解码。When the data volume of the media data in the media consumption queue is less than the threshold, the second processing core of the processor runs the third browser thread to add pseudo frames to the media consumption queue, so that the media consumption The data amount of the media data including the pseudo frame in the queue is greater than or equal to a threshold, and the first media data is decoded when the data amount of the media data is greater than or equal to the threshold.
在一些可能的设计中,所述处理器的第二处理核运行所述第三浏览器线程的过程中,调用低级语言编写的二进制代码对所述第一媒体数据进行解码。In some possible designs, when the second processing core of the processor runs the third browser thread, a binary code written in a low-level language is called to decode the first media data.
第三方面,提供了一种计算机可读存储介质,包括指令,当所述指令在终端设备上运行时,使得所述终端设备执行如第一方面任一项所述的方法。In a third aspect, a computer-readable storage medium is provided, including instructions, which when run on a terminal device, cause the terminal device to execute the method according to any one of the first aspect.
第四方面,提供了一种终端设备,包括处理器和存储器,所述处理器执行所述存储器中的代码执行如第一方面任一项所述的方法。In a fourth aspect, a terminal device is provided, including a processor and a memory, and the processor executes the code in the memory to execute the method according to any one of the first aspect.
第五方面,提供了一种计算机程序产品,包括计算机程序,当所述计算机程序被计算设备读取并执行时,使得所述计算设备执行如第一方面任一项所述的方法。In a fifth aspect, a computer program product is provided, including a computer program, when the computer program is read and executed by a computing device, the computing device is caused to execute the method according to any one of the first aspect.
在上述方案中,通过在终端设备的浏览器中加载脚本实现对云手机发送的应用的媒体数据的解码,无需受限于个人电脑,可实现跨平台的云手机应用音视频展示。In the above solution, the decoding of the media data of the application sent by the cloud phone is realized by loading the script in the browser of the terminal device, without being limited to a personal computer, and cross-platform audio and video display of the cloud phone application can be realized.
图1是本申请涉及的云手机的媒体数据处理系统的结构示意图;FIG. 1 is a schematic structural diagram of a media data processing system of a cloud mobile phone involved in this application;
图2A-图2B示例性示出了两种不同的终端设备打开浏览器中游戏页面来玩游戏的示例性用户界面;2A-2B exemplarily show an exemplary user interface in which two different terminal devices open a game page in a browser to play a game;
图3A-图3B示例性示出了原来的浏览器结构和修改后的浏览器结构的对比图;3A-3B exemplarily show a comparison diagram of the original browser structure and the modified browser structure;
图4是本申请提供的一种基于云手机的媒体数据处理方法的流程交互图;FIG. 4 is a flow interaction diagram of a media data processing method based on a cloud mobile phone provided by the present application;
图5是本申请涉及的WebSocket协议报文的结构示意图;Figure 5 is a schematic diagram of the structure of the WebSocket protocol message involved in this application;
图6是本申请提供的一种终端设备的结构示意图;Fig. 6 is a schematic structural diagram of a terminal device provided by the present application;
图7是本申请提供的另一种终端设备的结构示意图。Fig. 7 is a schematic structural diagram of another terminal device provided by the present application.
参见图1,图1是本申请涉及的云手机的媒体数据处理系统的结构示意图。本实施方式的云手机的媒体数据处理系统包括终端设备110以及云数据中心120。其中,终端设备110可以与云数据中心120通过网络进行通信。Refer to Fig. 1, which is a schematic structural diagram of a media data processing system of a cloud mobile phone involved in the present application. The media data processing system of the cloud mobile phone in this embodiment includes a
终端设备110可以是智能手机、云终端或者瘦终端等等。在一具体的实施例中,终端设备110可以是配合云手机使用的终端设备,即,终端设备110具有强大的网络通信能力,但是,可以弱化计算能力以及存储能力。终端设备110中安装了浏览器,浏览器采用的浏览器引擎可以是Trident、Gecko、Presto或者Webkit等等,此处不作具体限定。终端设备110支持的操作系统可以是IOS系统、安卓系统(Android)、macOS系统、Windows系统以及Linux系统等等。在游戏系统中,不同的终端设备110可以分别支持不同的操作系统,例如,终端设备1支持安卓系统,终端2支持macOS系统,终端设备3支持IOS系统,终端设备4支持Windows系统以及终端5支持Linux系统。当然,在该游戏系统中,不同的终端设备110也可以支持相同的操作系统,此处不作具体限定。The
云数据中心120可以包括服务节点121以及云手机管理节点125。其中,服务节点121可以是通用的物理服务器,例如,物理服务器,如X86服务器或ARM服务器等。云手机管理节点125可以是公有云中用于管理云手机的服务器,具体可以是通用的物理服务器,也可以是基于通用的物理服务器结合NFV技术实现的虚拟机(Virtual Machine,VM),所述虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统,本申请不作具体限定。The cloud data center 120 may include a service node 121 and a cloud mobile
在一具体的实施方式中,服务节点121包括云手机管理代理节点124、硬件资源、操作系统(Operating System,OS)122以及至少一个云手机123,每一个云手机123以容器(Container)的形式与服务器上其他的云手机共享硬件资源和操作系统。其中,一种虚拟出带有操作系统,同时具有虚拟手机功能的云服务器,其本质是将手机上的应用转移到公有云上的虚拟手机来运行。In a specific embodiment, the service node 121 includes a cloud phone
硬件资源可以包括计算资源、存储资源以及网络资源,比如处理器、存储器、网卡、路由、数据库等等,还可以包括其他云手机可能需要的硬件资源,本申请不作具体限定。Hardware resources may include computing resources, storage resources, and network resources, such as processors, memory, network cards, routers, databases, etc., and may also include hardware resources that may be required by other cloud phones, which are not specifically limited in this application.
操作系统122可以是云手机适用的操作系统,比如安卓(Android)操作系统,本申请不作具体限定。需要说明的是,操作系统122可以是官方完整的操作系统,也可以是为了适应服务节点121的运行方式对官方完整的操作系统的个别驱动模块进行修改后的操作系统,本申请不做具体限定。The
云手机123以一个容器的形式与服务器上其他的云手机共享硬件资源和操作系统,每个容器可以包括云手机所需的云应用和每个云应用所需的依赖资源,云应用所需的依赖资源可以是操作系统核心库和系统库,比如功能函数库、三维图形处理库(如OpenGLES)、媒体库(Media Libraries)、输入管理器(Input Manager)等等。在一实施方式中,容器可以包括游戏应用以及游戏应用所需要的依赖资源。其中,每个云手机123所处的容器使 用硬件资源和操作系统122,但是不会对硬件资源进行独占,而是和其他云手机所处的容器共享硬件资源和操作系统122。换句话说,各个容器没有自己的内核,容器内的应用程序进程直接运行在服务节点121的内核上。
云手机管理代理节点124可以用于监控和收集服务节点121的服务信息,并将该服务信息实时上报至云手机管理节点125,并且,还用于根据接收到的云手机的规格信息,接着,在服务节点121上创建容器,并从硬件资源中划分资源为容器设置上述云手机的规格信息所要求的硬件和软件。The cloud mobile phone
在云数据中心120创建云手机的过程可以是:终端设备110向云手机管理节点125发送云手机创建信息。云手机管理节点125根据云手机创建信息中云手机123的规格信息和各个云手机管理代理节点124发送的服务信息,确定由服务器1创建云手机1,服务器2创建云手机2,那么服务器1上的云手机管理代理节点1可以接收云手机管理节点125发送的云手机1的规格信息,根据该规格信息完成云手机1的创建,服务器2上的云手机管理代理节点2可以接收云手机管理节点125发送的云手机2的规格信息,根据该规格信息完成云手机2的创建。可以理解,云手机管理节点125和部署在每个服务节点121上的云手机管理代理节点124可以基于Kubernetes(K8S)、Docker等容器管理系统实现,本申请不做具体限定。The process of creating a cloud phone in the cloud data center 120 may be: the
在图1所示的云手机的媒体数据处理系统的基础上,用户可以通过终端设备中的浏览器来低时延玩游戏,而无需在终端设备中安装该云应用。下面将分别以终端设备分别为智能手机和瘦终端为例进行详细的说明。为了简便起见,下面的例子中均以云应用为游戏应用为例进行说明,但是在其他的例子中,云应用也可以是其他应用,此处不应具体限定。Based on the media data processing system of the cloud mobile phone shown in FIG. 1, users can play games with low latency through the browser in the terminal device without installing the cloud application in the terminal device. A detailed description will be given below by taking the terminal devices as an example of a smart phone and a thin terminal respectively. For the sake of simplicity, the following examples all use cloud applications as game applications as an example for description, but in other examples, cloud applications may also be other applications, which should not be specifically limited here.
终端设备为智能手机。图2A示例性示出了打开浏览器中游戏页面来玩游戏的示例性用户界面。如图2A的左上角所示:用户界面可包括:状态栏,日历指示符,天气指示符,具有常用应用程序图标的托盘,导航栏,以及其他应用程序图标。其中:The terminal device is a smart phone. Fig. 2A exemplarily shows an exemplary user interface for opening a game page in a browser to play a game. As shown in the upper left corner of FIG. 2A: the user interface may include: a status bar, a calendar indicator, a weather indicator, a tray with commonly used application icons, a navigation bar, and other application icons. in:
状态栏可包括:移动通信信号(又可称为蜂窝信号)的一个或多个信号强度指示符、无线高保真(wireless fidelity,Wi-Fi)信号的一个或多个信号强度指示符,电池状态指示符、时间指示符。The status bar may include: one or more signal strength indicators for mobile communication signals (also called cellular signals), one or more signal strength indicators for wireless fidelity (Wi-Fi) signals, and battery status Indicator, time indicator.
日历指示符可用于指示当前时间,例如日期、星期几、时分信息等。The calendar indicator can be used to indicate the current time, such as date, day of the week, hour and minute information, etc.
天气指示符可用于指示天气类型,例如多云转晴、小雨等,还可以用于指示气温等信息。The weather indicator can be used to indicate the type of weather, such as cloudy to clear, light rain, etc., and can also be used to indicate information such as temperature.
具有常用应用程序图标的托盘可展示:电话图标、联系人图标、短信图、相机图标。A tray with icons of commonly used applications can display: phone icons, contact icons, text messages, and camera icons.
导航栏可包括:返回键、主屏幕键、多任务键等系统导航键。当检测到用户点击返回键时,智能手机可显示当前页面的上一个页面。当检测到用户点击主屏幕键时,智能手机显示主界面。当检测到用户点击多任务键时,智能手机可显示用户最近打开的任务。各导航键的命名还可以为其他,本申请对此不做限制。不限于虚拟按键,导航栏中的各导航键也可以实现为物理按键。The navigation bar may include system navigation keys such as the return key, the home screen key, and the multitasking key. When it is detected that the user clicks the return button, the smartphone can display the previous page of the current page. When it is detected that the user taps the home button, the smart phone displays the home interface. When it is detected that the user clicks on the multitasking button, the smart phone can display the task that the user has recently opened. The naming of each navigation key can also be other, which is not limited in this application. Not limited to virtual keys, each navigation key in the navigation bar can also be implemented as a physical key.
其他应用程序图标可例如:互传的图标、图库的图标、音乐的图标、应用的图标、邮箱的图标、浏览器的图标212、备忘录的图标、设置的图标。用户界面210还 可包括页面指示符。其他应用程序图标可分布在多个页面,页面指示符可用于指示用户当前浏览的是哪一个页面中的应用程序。用户可以左右滑动其他应用程序图标的区域,来浏览其他页面中的应用程序图标。Other application icons may be, for example, icons for mutual transfer, icons for gallery, icons for music, icons for applications, icons for mailboxes, icons 212 for browsers, icons for memos, and icons for settings. The
在一些实施例中,图2A示例性所示的用户界面210可以为主界面(Home screen)。可以理解的是,图2A仅仅示例性示出了智能手机上的用户界面,不应构成对本申请实施例的限定。In some embodiments, the
示例性的,用户可点击用户界面210上浏览器的图标212,智能手机检测到上述用户操作,响应于上述用户操作,智能手机打开浏览器220。Exemplarily, the user may click the icon 212 of the browser on the
如图2A的右上角所示:浏览器220可包括:搜索框222,扫描控件,标签栏、多个推荐目录以及常用控件的托盘,其中:As shown in the upper right corner of FIG. 2A: the
搜索框222可用于根据用户输入的字符,搜索与该字符匹配的游戏网页。The
扫描控件可用于对二维码或者条形码进行扫描,从而快速打开该二维码或者条形码对应的游戏网页。The scan control can be used to scan the QR code or barcode, so as to quickly open the game webpage corresponding to the QR code or barcode.
标题栏可用于指示各个类型的主题,例如,推荐、游戏、热点以及娱乐等等。应标题栏的表现形式可以为文本信息、图标或其他形式。The title bar can be used to indicate various types of topics, such as recommendations, games, hotspots, and entertainment. The presentation form of the title bar can be text information, icons or other forms.
控件302可接收用户操作(例如触摸操作),响应于检测到的该用户操作,主播终端120可以显示登录或切换云直播账号的页面。The control 302 may receive a user operation (for example, a touch operation), and in response to the detected user operation, the anchor terminal 120 may display a page for logging in or switching a cloud live broadcast account.
常用控件的托盘可展示:上一页控件图标,下一页控件图标,首页控件图标,已打开网页图标等等。其中,上述控件图标均可接受用户操作(例如触摸操作),相应于检测到的该用户操作,智能手机可显示响应的页面,具体地,上一页控件图标可以用于显示上一页显示的网页页面,上一页控件图标可以用于显示下一页显示的网页页面,首页控件图标可用于浏览器的首页,浏览器的首要可以是用户自定义的,或者,浏览器预先设置的导航页面,已打开网页图标可以用于展示当前已经打开的多个页面。The tray of commonly used controls can display: previous page control icons, next page control icons, home page control icons, opened webpage icons, and so on. Among them, the aforementioned control icons can all accept user operations (such as touch operations). Corresponding to the detected user operations, the smart phone can display a response page. Specifically, the previous page control icon can be used to display the previous page display. For web pages, the previous page control icon can be used to display the web page displayed on the next page, and the home page control icon can be used for the home page of the browser. The browser can be user-defined, or the navigation page preset by the browser , The icon of the opened webpage can be used to display multiple pages that are currently opened.
多个推荐目录可例如:显示标题和显示图片224,显示标题显示了游戏的相关信息,显示图片224显示了游戏的相关图片。显示图片224关联了游戏页面的超链接,当用户点击显示图片224时,浏览器可以跳转到游戏页面230。A plurality of recommended directories may, for example, display a title and a
如图2A的下图所示,游戏页面230用于显示游戏的画面内容,并,播放游戏的声音。游戏页面可以包括游戏标题、游戏画面以及游戏控件。As shown in the lower diagram of FIG. 2A, the
游戏标题是可选项,即,用户可以选择显示游戏标题或者不显示游戏标题,或者,游戏页面可以默认显示游戏标签,或者,默认不显示游戏标题。The game title is optional, that is, the user can choose to display the game title or not to display the game title, or the game page can display the game tag by default, or the game title is not displayed by default.
游戏画面的画质、清晰度、分辨率、大小以及色彩均可以是根据用户的需要自行设置的,例如,用户可以设置游戏的画面为全屏,也可以是非全屏。此外,游戏画面还可以以悬浮的形式设置在其他应用之上,以便于用户一边玩游戏,一边处理其他事项。游戏画面可以是二维画面,也可以是三维画面。The image quality, definition, resolution, size, and color of the game screen can be set according to the user's needs. For example, the user can set the game screen to be full screen or non-full screen. In addition, the game screen can also be set on top of other applications in a floating form, so that users can handle other things while playing the game. The game screen can be a two-dimensional screen or a three-dimensional screen.
用户打开浏览器中游戏页面来玩游戏的具体过程是:用户用手指点击智能手机的用户界面210(User Interface,UI)上的浏览器图标212,从而打开浏览器220。用户在浏览器120的搜索栏222中输入游戏网页230的统一资源定位符(Uniform Resource Locator,URL),或者,点击浏览器220推荐的超链接224(该超链接指向 游戏网页230,并包括该游戏网页230的URL),从而打开游戏网页230。然后,用户就可以在游戏页面230上玩游戏了。The specific process of the user opening the game page in the browser to play the game is: the user clicks the browser icon 212 on the user interface 210 (UI) of the smart phone with a finger to open the
可以理解的是,图2A仅仅示例性示出了智能手机上的打开游戏页面的各个用户界面,不应构成对本申请实施例的限定。It is understandable that FIG. 2A only exemplarily shows various user interfaces for opening the game page on the smart phone, and should not constitute a limitation to the embodiment of the present application.
终端设备为瘦终端。图2B示例性示出了打开浏览器中游戏页面来玩游戏的示例性桌面。如图2B的左上角所示:桌面可包括:日历指示符,已打开应用程序托盘,开始按键。其中:The terminal device is a thin terminal. Fig. 2B exemplarily shows an exemplary desktop where a game page in a browser is opened to play a game. As shown in the upper left corner of Figure 2B: the desktop may include: a calendar indicator, an application tray has been opened, and a start button. in:
日历指示符,位于桌面的右下角,可用于指示当前时间,例如日期、星期几、时分信息等。The calendar indicator, located in the lower right corner of the desktop, can be used to indicate the current time, such as date, day of the week, hour and minute information, etc.
已打开应用程序托盘,位于桌面的底部,用于指示已经打开了的应用程序,例如,当浏览器被打开时,浏览器的图标就会显示在已打开应用程序托盘中,当浏览器被关闭时,浏览器的图标就会从已打开应用程序托盘中消失。当浏览器被多次打开时,可以显示多个重叠的浏览器的图标,以表示浏览器被多次打开。The opened application tray, located at the bottom of the desktop, is used to indicate the applications that have been opened. For example, when the browser is opened, the browser icon will be displayed in the opened application tray, and when the browser is closed When the browser icon disappears from the open application tray. When the browser is opened multiple times, multiple overlapping browser icons may be displayed to indicate that the browser has been opened multiple times.
开始按键,位于桌面的左下角,用于显示一级或者多级菜单,每级菜单可以显示多个应用程序的入口,例如,控制面板、设备和打印机、默认程序、安全以及帮助等等。The start button, located in the lower left corner of the desktop, is used to display one-level or multi-level menus. Each level of the menu can display the entrances of multiple applications, such as control panels, devices and printers, default programs, security, and help.
桌面上可以显示多个应用程序图标,例如:云应用的图标、相机的图标、时间的图标、日历的图标、应用的图标、浏览器的图标310、设置的图标等等。Multiple application icons may be displayed on the desktop, such as cloud application icons, camera icons, time icons, calendar icons, application icons,
示例性的,如图2B的左上图所示,用户可点击桌面上浏览器的图标310,瘦终端检测到上述用户操作,响应于上述用户操作,瘦终端打开浏览器320。Exemplarily, as shown in the upper left diagram of FIG. 2B, the user can click on the
如图2B的右上角所示:浏览器320可包括:搜索框322,上一页控件,下一页控件、重新加载控件、标题栏以及多个推荐目录其中:As shown in the upper right corner of FIG. 2B, the
搜索框322可用于根据用户输入的字符,搜索与该字符匹配的游戏网页。The
上一页控件可以用于显示上一页显示的网页页面,上一页控件图标可以用于显示下一页显示的网页页面,重新加载控件可以用于将当前页面进行刷新,以重新加载当前页面。The previous page control can be used to display the web page displayed on the previous page, the previous page control icon can be used to display the web page displayed on the next page, and the reload control can be used to refresh the current page to reload the current page .
标题栏可用于指示各个类型的主题,例如,推荐、游戏、热点以及娱乐等等。应标题栏的表现形式可以为文本信息、图标或其他形式。The title bar can be used to indicate various types of topics, such as recommendations, games, hotspots, and entertainment. The presentation form of the title bar can be text information, icons or other forms.
多个推荐目录可例如:显示标题和显示图片324,显示标题显示了游戏的相关信息,显示图片324显示了游戏的相关图片。显示图片324关联了游戏页面的超链接,当用户点击显示图片324时,浏览器可以跳转到游戏页面330。A plurality of recommended directories may, for example, display a title and a
如图2B的下图所示,游戏页面330用于显示游戏的画面内容,并,播放游戏的声音。游戏页面可以包括游戏标题、游戏画面以及游戏控件。As shown in the lower diagram of FIG. 2B, the
游戏标题是可选项,即,用户可以选择显示游戏标题或者不显示游戏标题,或者,游戏页面可以默认显示游戏标签,或者,默认不显示游戏标题。The game title is optional, that is, the user can choose to display the game title or not to display the game title, or the game page can display the game tag by default, or the game title is not displayed by default.
游戏画面的画质、清晰度、分辨率、大小以及色彩均可以是根据用户的需要自行设置的,例如,用户可以设置游戏的画面为全屏,也可以是非全屏。此外,游戏画面还可以以悬浮的形式设置在其他应用之上,以便于用户一边玩游戏,一边处理其他事 项。游戏画面可以是二维画面,也可以是三维画面。The picture quality, definition, resolution, size, and color of the game screen can be set according to the needs of the user. For example, the user can set the game screen to be full screen or non-full screen. In addition, the game screen can also be set on top of other applications in a floating form, so that users can handle other things while playing the game. The game screen can be a two-dimensional screen or a three-dimensional screen.
用户打开浏览器中游戏页面来玩游戏的具体过程是:用户用鼠标点击显示器的界面310上的浏览器图标312,从而打开浏览器320。用户在浏览器320的搜索栏322中输入游戏网页330的统一资源定位符(Uniform Resource Locator,URL),或者,点击浏览器320推荐的超链接324(该超链接指向游戏网页330,并包括该游戏网页330的URL),从而打开游戏网页330。然后,用户就可以在游戏页面330上玩游戏了。其中,界面310除了用于显示浏览器图标之外,还可以用于显示音乐应用图标、邮件应用图标、图库应用图标以及设置图标等等,此处不作具体限定。The specific process of the user opening the game page in the browser to play the game is: the user clicks the browser icon 312 on the
可以理解的是,图2B仅仅示例性示出了瘦终端上的打开游戏页面的各个用户界面,不应构成对本申请实施例的限定。It can be understood that FIG. 2B only exemplarily shows various user interfaces for opening the game page on the thin terminal, and should not constitute a limitation to the embodiment of the present application.
除了上述例子之外,在实际应用中,终端设备还可以是虚拟设备等等,此处不作具体限定。In addition to the above examples, in actual applications, the terminal device may also be a virtual device, etc., which is not specifically limited here.
下面将对本申请涉及的浏览器的内部结构进行具体的介绍。The internal structure of the browser involved in this application will be specifically introduced below.
如图3A所示,以浏览器为WebKit为例,浏览器包括渲染引擎以及JavaScript(JS)引擎,其中,渲染引擎用于将资源文件(HTML/CSS/JavaScript文本及相应的资源文件)转化为用户可见的结果。渲染引擎通常包括CSS、SVG、布局、渲染树、HTML、DOM以及inspector等等。JS引擎用于读取文件中的JavaScript,处理并执行它,JS引擎是单线程的。此外,Webkit还包括WebKit嵌入式接口以及对应的WebKit绑定,WebKit2嵌入式接口以及对应的WebKit2绑定,WebKitPorts。其中,WebKitPorts可以包括网格段、视频、文字、硬件加速、图片解码等等模块。此外,还可以包括WebKit依赖的数据库和操作系统。其中,数据库可以包括2D图形库、3D图形库、网络库、存储、音频库以及视频库等等。As shown in Figure 3A, taking the browser as WebKit as an example, the browser includes a rendering engine and a JavaScript (JS) engine, where the rendering engine is used to convert resource files (HTML/CSS/JavaScript text and corresponding resource files) into User-visible results. The rendering engine usually includes CSS, SVG, layout, render tree, HTML, DOM, inspector, and so on. The JS engine is used to read the JavaScript in the file, process and execute it, and the JS engine is single-threaded. In addition, Webkit also includes WebKit embedded interface and corresponding WebKit binding, WebKit2 embedded interface and corresponding WebKit2 binding, WebKitPorts. Among them, WebKitPorts can include modules such as grid segment, video, text, hardware acceleration, and image decoding. In addition, the database and operating system that WebKit depends on can also be included. Among them, the database may include a 2D graphics library, a 3D graphics library, a network library, a storage, an audio library, a video library, and so on.
如图3B的虚线框部分所示,可以在现有浏览器的JS引擎基础上增加了包括第一浏览器线程、第二浏览器线程以及第三浏览器线程在内的多个浏览器线程。其中,浏览器线程可以是WebWorker。WebWorker用于使得浏览器可以在与主执行线程分离的后台线程(worker)中运行一个脚本操作,从而为JS引擎创造多线程运行环境,即,浏览器的主线程创建浏览器线程,并且分配任务给浏览器线程,主线程运行的同时浏览器线程也在运行,相互不干扰,在浏览器线程运行结束后把结果返回给主线程。其中,第一浏览器线程也可以称之为网络线程,网络线程采用了WebSocket协议,能够实现终端设备与云手机之间的游戏数据(包括媒体数据以及控制数据)的双向通讯。第二浏览器线程也可以称之为主控线程,用于负责游戏的整体运行。第三浏览器线程也可以称之为解码线程,用于负责对游戏的媒体数据进行解码。As shown in the dashed box part of FIG. 3B, multiple browser threads including a first browser thread, a second browser thread, and a third browser thread may be added to the JS engine of the existing browser. Among them, the browser thread can be WebWorker. WebWorker is used to enable the browser to run a script operation in a background thread (worker) separate from the main execution thread, thereby creating a multi-threaded runtime environment for the JS engine, that is, the main thread of the browser creates a browser thread and assigns tasks For the browser thread, the browser thread is also running while the main thread is running, without interfering with each other, and the result is returned to the main thread after the browser thread runs. Among them, the first browser thread may also be referred to as a network thread. The network thread adopts the WebSocket protocol, which can realize two-way communication of game data (including media data and control data) between the terminal device and the cloud phone. The second browser thread may also be referred to as the main control thread, which is responsible for the overall operation of the game. The third browser thread may also be referred to as a decoding thread, which is responsible for decoding the media data of the game.
下面将结合图3B所示的浏览器对用户可以通过终端设备中的浏览器来低时延玩游戏的实现过程进行详细的介绍。如图4所示,图4是本申请提供的一种游戏运行方法的流程交互图。本实施方式中的游戏运行方法,包括如下步骤:In the following, in conjunction with the browser shown in FIG. 3B, the implementation process that the user can play the game with low latency through the browser in the terminal device will be introduced in detail. As shown in Fig. 4, Fig. 4 is a flow interaction diagram of a game running method provided by the present application. The game running method in this embodiment includes the following steps:
S101:在用户在浏览器的搜索栏中输入游戏网页的URL,或者,点击浏览器推荐的超链接的情况下,终端设备的浏览器生成媒体数据请求,其中,所述媒体数据请求用于生成所述游戏网页的媒体数据,所述媒体数据请求包含URL,所述URL对应于游戏。S101: When the user enters the URL of the game webpage in the search bar of the browser, or clicks the hyperlink recommended by the browser, the browser of the terminal device generates a media data request, wherein the media data request is used to generate For the media data of the game webpage, the media data request includes a URL, and the URL corresponds to the game.
在一具体的实施例中,浏览器采用的浏览器引擎可以是Trident、Gecko、Presto或者Webkit等等,此处不作具体限定。In a specific embodiment, the browser engine used by the browser may be Trident, Gecko, Presto, or Webkit, etc., which is not specifically limited here.
在一具体的实施例中,终端设备通过浏览器中的主控线程检测用户是否在搜索栏中输入游戏网页的URL,或者,用户是否点击了浏览器推荐的超链接。在搜索栏中输入游戏网页的URL,或者,点击了浏览器推荐的超链接的情况下,主控线程生成媒体数据请求,并通过共享内存或者管道通信等等方法将媒体数据请求发送给网络线程。In a specific embodiment, the terminal device detects whether the user enters the URL of the game webpage in the search bar through the main control thread in the browser, or whether the user clicks the hyperlink recommended by the browser. Enter the URL of the game webpage in the search bar, or click the hyperlink recommended by the browser, the main control thread generates a media data request, and sends the media data request to the network thread through shared memory or pipeline communication, etc. .
S102:终端设备的浏览器将媒体数据请求发送给云手机。相应地,云手机接收终端设备发送的媒体数据请求。S102: The browser of the terminal device sends the media data request to the cloud mobile phone. Correspondingly, the cloud mobile phone receives the media data request sent by the terminal device.
在一具体的实施例中,浏览器中的网络线程通过WebSocket协议将媒体数据请求发送给云手机。其中,网络线程是独享的Webwork,因此,网络线程能够实现浏览器和云手机之间的数据收发。In a specific embodiment, the network thread in the browser sends the media data request to the cloud phone through the WebSocket protocol. Among them, the network thread is an exclusive Webwork. Therefore, the network thread can realize the data transmission and reception between the browser and the cloud phone.
S103:云手机运行游戏应用产生第一媒体数据。S103: The cloud mobile phone runs a game application to generate first media data.
在一具体的实施例中,云手机在接收到终端设备的浏览器发送的媒体数据请求之后,从媒体数据请求中获取游戏网页的URL,根据游戏网页的URL确定对应的游戏应用,运行游戏应用,并产生第一媒体数据。然后,云手机将产生的第一媒体数据通过编码方法进行编码,从而降低数据传输的数量。In a specific embodiment, after receiving the media data request sent by the browser of the terminal device, the cloud mobile phone obtains the URL of the game webpage from the media data request, determines the corresponding game application according to the URL of the game webpage, and runs the game application , And generate the first media data. Then, the cloud mobile phone encodes the generated first media data through an encoding method, thereby reducing the amount of data transmission.
S104:云手机将所述第一媒体数据发送给终端设备。相应地,终端设备接收云手机发送的第一媒体数据。S104: The cloud mobile phone sends the first media data to the terminal device. Correspondingly, the terminal device receives the first media data sent by the cloud mobile phone.
在一具体的实施例中,终端设备的浏览器中的网络线程通过WebSocket协议接收云手机发送的第一媒体数据。浏览器中的主控线程监听到网络线程发送的第一媒体数据之后,将第一媒体数据推送到媒体数据队列中。浏览器中的主控线程以即时的方式将媒体数据队列中的数据通过共享内存或者管道通信等等方法发送给解码线程进行解码,从而有效降低游戏的时延。In a specific embodiment, the network thread in the browser of the terminal device receives the first media data sent by the cloud phone through the WebSocket protocol. After the main control thread in the browser monitors the first media data sent by the network thread, it pushes the first media data to the media data queue. The main control thread in the browser sends the data in the media data queue to the decoding thread for decoding in a real-time manner through shared memory or pipeline communication, etc., thereby effectively reducing the delay of the game.
S105:终端设备对第一媒体数据进行解码,从而获得第一音频和/或第一视频。S105: The terminal device decodes the first media data, so as to obtain the first audio and/or the first video.
在一具体的实施例中,终端设备中的浏览器中的解码线程对第一媒体数据进行解码,从而获得第一音频和/或第一视频。然后,浏览器中的解码线程通过共享内存或者管道通信等等方法将第一媒体数据发送给主控线程。其中,解码线程采用的解码方法和云手机采用的编码方法是相对应的,当云手机采用的编码方法是无损压缩的时候,终端设备采用的解码方法也是无损压缩的,当云手机采用的编码方法是有损压缩的时候,终端设备采用的解码方法也是有损压缩的。In a specific embodiment, the decoding thread in the browser in the terminal device decodes the first media data, thereby obtaining the first audio and/or the first video. Then, the decoding thread in the browser sends the first media data to the main control thread through methods such as shared memory or pipe communication. Among them, the decoding method adopted by the decoding thread corresponds to the encoding method adopted by the cloud phone. When the encoding method adopted by the cloud phone is lossless compression, the decoding method adopted by the terminal device is also lossless compression. When the method is lossy compression, the decoding method adopted by the terminal device is also lossy compression.
S106:终端设备在浏览器生成的第一游戏页面中播放第一音频和/或第一视频。S106: The terminal device plays the first audio and/or the first video in the first game page generated by the browser.
S107:在用户在浏览器的游戏页面上对游戏进行操作的情况下,接收用户在浏览器的游戏页面输入的游戏的操作命令,并转化为云手机能够识别的游戏操作。S107: When the user operates the game on the game page of the browser, receive the game operation command input by the user on the game page of the browser, and convert it into a game operation that can be recognized by the cloud mobile phone.
在一具体的实施例中,终端设备的浏览器中的主控线程接收用户通过外部输入设备在浏览器的游戏页面输入的游戏的操作命令。其中,外部输入设备可以是触摸屏、鼠标、键盘、摄像头,扫描仪,光笔,手写输入板,游戏杆以及麦克风等等。游戏的操作命令可以包括前进、后退、左转、右转、左移、右移、跳、坐下、起立、收/拿武器、走路/跑步等等。终端设备和云手机对操作的定义并不相同,因此,浏览器需要将用户输入的操作命令转化为云手机能够识别的游戏操作。然后,浏览器中的主控线程通过共享内存或者管道 通信等等方法将游戏操作发送给网络线程。In a specific embodiment, the main control thread in the browser of the terminal device receives the game operation command input by the user through the external input device on the game page of the browser. Among them, the external input device can be a touch screen, a mouse, a keyboard, a camera, a scanner, a light pen, a handwriting input board, a joystick, a microphone, and so on. The operation commands of the game can include forward, backward, turn left, turn right, move left, move right, jump, sit down, stand up, retract/take arms, walk/run, etc. Terminal devices and cloud phones have different definitions of operations. Therefore, the browser needs to convert the operation commands input by the user into game operations that the cloud phone can recognize. Then, the main control thread in the browser sends game operations to the network thread through shared memory or pipe communication.
S108:终端设备向云手机发送游戏操作。相应地,云手机接收终端设备发送的游戏操作。S108: The terminal device sends a game operation to the cloud mobile phone. Correspondingly, the cloud mobile phone receives the game operation sent by the terminal device.
在一具体的实施例中,终端设备通过WebSocket协议将游戏操作发送给云手机。In a specific embodiment, the terminal device sends the game operation to the cloud phone through the WebSocket protocol.
S109:云手机根据游戏操作运行游戏应用,从而生成第二媒体数据。S109: The cloud mobile phone runs the game application according to the game operation, thereby generating second media data.
在一具体的实施例中,云手机继续运行游戏应用,并根据游戏操作生成第二媒体数据。然后,云手机将产生的第二媒体数据通过编码方法进行编码,从而降低数据传输的数量。In a specific embodiment, the cloud mobile phone continues to run the game application, and generates the second media data according to the game operation. Then, the cloud mobile phone encodes the generated second media data through an encoding method, thereby reducing the amount of data transmission.
S110:云手机向终端设备发送第二媒体数据。相应地,终端设备接收云手机发送的第二媒体数据。S110: The cloud mobile phone sends the second media data to the terminal device. Correspondingly, the terminal device receives the second media data sent by the cloud mobile phone.
在一具体的实施例中,终端设备的浏览器中的网络线程通过WebSocket协议接收云手机发送的第二媒体数据。浏览器中的主控线程监听到网络线程发送的第二媒体数据之后,将第二媒体数据推送到媒体数据队列中。浏览器中的主控线程以即时的方式将媒体数据队列中的数据通过共享内存或者管道通信等等方法发送给解码线程进行解码,从而有效降低游戏的时延。In a specific embodiment, the network thread in the browser of the terminal device receives the second media data sent by the cloud phone through the WebSocket protocol. After the main control thread in the browser monitors the second media data sent by the network thread, it pushes the second media data to the media data queue. The main control thread in the browser sends the data in the media data queue to the decoding thread for decoding in a real-time manner through shared memory or pipeline communication, etc., thereby effectively reducing the delay of the game.
S111:终端设备对第二媒体数据进行解码,从而获得第二音频和/或第二视频。S111: The terminal device decodes the second media data, so as to obtain the second audio and/or the second video.
在一具体的实施例中,终端设备中的浏览器中的解码线程对第二媒体数据进行解码,从而获得第二音频和/或第二视频。然后,浏览器中的解码线程通过共享内存或者管道通信等等方法将第二媒体数据发送给主控线程。In a specific embodiment, the decoding thread in the browser in the terminal device decodes the second media data, thereby obtaining the second audio and/or the second video. Then, the decoding thread in the browser sends the second media data to the main control thread through methods such as shared memory or pipe communication.
S112:终端设备在浏览器生成的第二游戏页面中播放第二音频和/或第二视频。S112: The terminal device plays the second audio and/or the second video in the second game page generated by the browser.
在一具体的实施例中,媒体数据请求、第一音频和/或第一视频、游戏操作以及第二音频和/或第二视频均采用WebSocket协议格式进行封装。如图5所示,WebSocket协议格式包括1比特的FIN,各占1比特的RSV1、RSV2、RSV3,4个比特的Opcode,1个比特的掩码(MASK),7个比特的数据负载长度(payload len),0至4字节的掩码键值(Masking-key),多字节的载荷数据(payload)。这里,媒体数据请求、第一音频和/或第一视频、游戏操作以及第二音频和/或第二视频负荷在载荷数据(payload)中。In a specific embodiment, the media data request, the first audio and/or the first video, the game operation, and the second audio and/or the second video are all encapsulated in the WebSocket protocol format. As shown in Figure 5, the WebSocket protocol format includes 1-bit FIN, 1-bit RSV1, RSV2, RSV3, 4-bit Opcode, 1-bit mask (MASK), and 7-bit data payload length ( payload len), a mask key value (Masking-key) of 0 to 4 bytes, and a multi-byte payload data (payload). Here, the media data request, the first audio and/or the first video, the game operation, and the second audio and/or the second video load are in the payload.
在一具体的实施例中,终端设备接收云手机发送的第一媒体数据,需要尽快将第一媒体数据解码为第一音频和/或第一视频,并在浏览器生成的第一游戏页面中播放第一音频和/或第一视频。终端设备根据浏览器能力的不同,可以至少分成以下两种方式:In a specific embodiment, the terminal device receives the first media data sent by the cloud phone, and needs to decode the first media data into the first audio and/or the first video as soon as possible, and display it in the first game page generated by the browser. Play the first audio and/or the first video. According to different browser capabilities, terminal devices can be divided into at least the following two methods:
在第一种方式中,终端设备是通过视频(video)组件来实现尽快将第一媒体数据解码为第一音频和/或第一视频,并在浏览器生成的第一游戏页面中播放第一音频和/或第一视频。这里,视频(video)组件可以是利用WebKitPorts中模块,例如,视频、硬件加速等等模块来实现的。终端设备一般是通过视频(video)组件来在浏览器中播放视频的,因此,视频(video)组件对时延并不敏感。在网络线程将接收到的媒体数据之后,视频(video)组件会先对媒体数据进行缓存,直到缓存的媒体数据的数量超过阈值之后,才对媒体数据进行解码,并在浏览器中播放出来以确保播放的流畅度,但是,这样会导致时延非常大。然而,游戏对时延的敏感度非常高,无法接受如此大的时延。为了解决时延大的问题,可以对视频(video)组件进行改进,从而降低时延。具体地,对视频(video)组件进行改进至少包括以下几个方面:(1)视频(video)组件发出强制命令,该强制命令指示解码线程立刻将接收到的第一媒体数据进行解码,从而得到第一视频以及第一音频,并且,主控 线程立刻将在浏览器中将第一视频以及第一音频播放出来,而无需对第一媒体数据进行缓存。(2)视频(video)组件指示主控线程在媒体消费队列中增加伪帧,以使得缓存媒体消费队列中的媒体数据尽快到达阈值,在到达阈值时,视频组件指示解码线程对第一媒体数据进行解码从而得到第一视频和第一音频,并且,视频组件指示主控线程将第一视频和第一音频在浏览器中播放出来。其中,伪帧可以预先存储的,伪帧可以是和第一媒体数据完全不相关的数据帧,伪帧也可以称之为透明帧。(3)在解码出第一媒体数据的多帧视频和音频之后,视频(video)组件指示主控线程强制播放解码出的第一视频和第一音频中的最后一帧的视频和音频,以减少时延。为了进一步减少时延,视频(video)组件还可以以跳帧的方式对媒体数据进行处理,当以跳帧的方式对媒体数据进行处理时,可以对媒体数据进行采样,并且,越近的数据帧采样越密集,越远的数据帧的采样越稀疏。In the first way, the terminal device uses a video component to decode the first media data into the first audio and/or the first video as soon as possible, and play the first video in the first game page generated by the browser. Audio and/or first video. Here, the video (video) component can be implemented by using modules in WebKitPorts, for example, video, hardware acceleration, and so on. The terminal device generally plays a video in the browser through a video component, so the video component is not sensitive to time delay. After the network thread receives the media data, the video component will cache the media data first, and will not decode the media data until the number of cached media data exceeds the threshold, and play it out in the browser. Ensure the smoothness of the playback, but this will cause a very large delay. However, the game is very sensitive to delay and cannot accept such a large delay. In order to solve the problem of large time delay, the video component can be improved to reduce the time delay. Specifically, improvements to the video component include at least the following aspects: (1) The video component issues a mandatory command, which instructs the decoding thread to immediately decode the received first media data, thereby obtaining The first video and the first audio, and the main control thread will immediately play the first video and the first audio in the browser without buffering the first media data. (2) The video component instructs the main control thread to add pseudo frames to the media consumption queue, so that the media data in the buffered media consumption queue reaches the threshold as soon as possible. When the threshold is reached, the video component instructs the decoding thread to treat the first media data Perform decoding to obtain the first video and the first audio, and the video component instructs the main control thread to play the first video and the first audio in the browser. Among them, the dummy frame may be pre-stored, the dummy frame may be a data frame completely unrelated to the first media data, and the dummy frame may also be referred to as a transparent frame. (3) After decoding the multi-frame video and audio of the first media data, the video component instructs the main control thread to forcefully play the video and audio of the last frame of the decoded first video and first audio to Reduce time delay. In order to further reduce the time delay, the video component can also process the media data by skipping frames. When the media data is processed by skipping frames, the media data can be sampled, and the closer the data is The denser the frame sampling, the sparser the sampling of the farther data frame.
在第二种方式中,终端设备是通过Canvas组件来实现尽快将第一媒体数据解码为第一音频和/或第一视频,并在浏览器生成的第一游戏页面中播放第一音频和/或第一视频。这里,Canvas组件可以是利用WebKitPorts中模块,例如,视频、硬件加速等等模块来实现的。解码线程是通过JavaScript语义编写的文件进行解码的,解码的效率非常低,为此,Canvas组件可以指示解码线程调用低级语言编写的二进制代码,例如,WebAssembly进行解码,从而提高解码速率,另外,解码线程单可以独占用一个处理器的内核进行解码,也能明显提高解码速率。In the second way, the terminal device uses the Canvas component to decode the first media data into the first audio and/or the first video as soon as possible, and play the first audio and/or in the first game page generated by the browser. Or the first video. Here, the Canvas component can be implemented using modules in WebKitPorts, for example, video, hardware acceleration, and so on. The decoding thread is decoded by files written in JavaScript semantics, and the decoding efficiency is very low. For this reason, the Canvas component can instruct the decoding thread to call the binary code written in a low-level language, for example, WebAssembly for decoding, thereby increasing the decoding rate. In addition, decoding A single thread can independently occupy the core of a processor for decoding, and it can also significantly increase the decoding rate.
上述详细阐述了本申请实施例的方法,为了便于更好的实施本申请实施例上述方案,相应地,下面还提供用于配合实施上述方案的相关设备。The foregoing describes the methods of the embodiments of the present application in detail. In order to facilitate better implementation of the above-mentioned solutions of the embodiments of the present application, correspondingly, the following provides related equipment for cooperating with the implementation of the foregoing solutions.
本申请提供的终端设备可以包括处理器以及如图3B所示的浏览器所述浏览器包括JS引擎,所述浏览器加载有脚本,所述处理器运行所述脚本以令JS引擎产生第一浏览器线程、第二浏览器线程以及第三浏览器线程。The terminal device provided in this application may include a processor and a browser as shown in FIG. 3B. The browser includes a JS engine, the browser is loaded with a script, and the processor runs the script to make the JS engine generate the first The browser thread, the second browser thread, and the third browser thread.
所述处理器的第一处理核运行所述第一浏览器线程以接收云手机发送的第一媒体数据,所述第一媒体数据在所述云手机运行游戏时产生;The first processing core of the processor runs the first browser thread to receive first media data sent by the cloud mobile phone, the first media data being generated when the cloud mobile phone runs a game;
所述处理器的第二处理核运行所述第三浏览器线程以对所述第一媒体数据进行解码,以获取第一音频和第一视频;The second processing core of the processor runs the third browser thread to decode the first media data to obtain the first audio and the first video;
所述处理器的第一处理核运行所述第二浏览器线程以在所述浏览器中播放所述第一音频和第一视频;The first processing core of the processor runs the second browser thread to play the first audio and the first video in the browser;
所述处理器的第一处理核运行所述第二浏览器线程以接收用户在所述浏览器输入的针对所述游戏的操作命令,将所述操作命令发送至所述云手机。The first processing core of the processor runs the second browser thread to receive an operation command for the game input by a user in the browser, and send the operation command to the cloud mobile phone.
在一些可能的设计中,所述处理器的第一处理核运行所述第一浏览器线程以接收云手机发送的第二媒体数据,所述第二媒体数据在所述云手机根据所述操作命令运行游戏时产生;In some possible designs, the first processing core of the processor runs the first browser thread to receive the second media data sent by the cloud mobile phone, and the second media data is executed on the cloud mobile phone according to the operation Generated when the command is running the game;
所述处理器的第二处理核运行所述第三浏览器线程以对所述第二媒体数据进行解码,以获取第二音频和第二视频;The second processing core of the processor runs the third browser thread to decode the second media data to obtain second audio and second video;
所述处理器的第二处理核运行所述第三浏览器线程以在所述浏览器中播放所述第二音频和第二视频。The second processing core of the processor runs the third browser thread to play the second audio and second video in the browser.
在一些可能的设计中,在媒体消费队列中的媒体数据的数据量小于阈值时,所述 处理器的第二处理核运行所述第三浏览器线程以强制对所述第一媒体数据进行解码,其中,所述媒体消费队列用于存储所述第一媒体数据。In some possible designs, when the data volume of the media data in the media consumption queue is less than the threshold, the second processing core of the processor runs the third browser thread to force the decoding of the first media data , Wherein the media consumption queue is used to store the first media data.
在一些可能的设计中,在媒体消费队列中的媒体数据的数据量小于阈值时,所述处理器的第二处理核运行所述第三浏览器线程以在所述媒体消费队列中添加伪帧,以使得所述媒体消费队列中包括所述伪帧在内的媒体数据的数据量大于或者等于阈值,并在所述媒体数据的数据量大于或者等于阈值的情况下对所述第一媒体数据进行解码。In some possible designs, when the data volume of the media data in the media consumption queue is less than the threshold, the second processing core of the processor runs the third browser thread to add pseudo frames to the media consumption queue , So that the data amount of the media data including the pseudo frame in the media consumption queue is greater than or equal to a threshold, and when the data amount of the media data is greater than or equal to the threshold, the first media data To decode.
在一些可能的设计中,所述处理器的第二处理核运行所述第三浏览器线程的过程中,调用低级语言编写的二进制代码对所述第一媒体数据进行解码。In some possible designs, when the second processing core of the processor runs the third browser thread, a binary code written in a low-level language is called to decode the first media data.
应理解,图3B所示的终端设备的内部的单元模块也可以有多种划分,各个模块可以是软件模块,也可以是硬件模块,也可以是部分软件模块部分硬件模块,本申请不对其进行限制。图3B是一种示例性的划分方式,本申请不作具体限定。It should be understood that the internal unit modules of the terminal device shown in FIG. 3B may also be divided into various types. Each module may be a software module, a hardware module, or a part of a software module and a part of a hardware module. limit. FIG. 3B is an exemplary division method, which is not specifically limited in this application.
下面介绍本发明实施例涉及的终端设备的一种实现方式。该终端设备支持运行多个网页标签的浏览器。浏览器可以分别使用不同的输入输出设备,例如,输入设备可以是键盘和鼠标,输出设备可以是显示屏。或者,浏览器使用公共的输入输出设备:触摸屏。触摸屏用于接收用户的触控操作,而且显示浏览器的输出内容。The following describes an implementation manner of the terminal device involved in the embodiment of the present invention. The terminal device supports browsers running multiple webpage tags. The browser can use different input and output devices, for example, the input device can be a keyboard and a mouse, and the output device can be a display screen. Or, the browser uses a common input and output device: touch screen. The touch screen is used to receive the user's touch operation and display the output content of the browser.
图6是终端设备的一种实现方式的结构框图。如图6所示,终端设备可以是瘦终端,包括:主机410、输出设备420以及输入设备430。Fig. 6 is a structural block diagram of an implementation manner of a terminal device. As shown in FIG. 6, the terminal device may be a thin terminal, including a
主机410可集成包括:一个或多个处理器、时钟模块以及电源管理模块。集成于主机410中的时钟模块主要用于为处理器产生数据传输和时序控制所需要的时钟。集成于主机410中的电源管理模块主要用于为处理器、输出设备420以及输入设备430提供稳定的、高精确度的电压。主机410还集成了存储器,用于存储各种软件程序和/或多组指令。具体实现中,存储器可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器可以无需安装操作系统以及大量的应用程序,存储器只需要存储一些必须的应用程序即可,例如,输入输出程序,该输入输出程序可用于与一个或多个输入设备或者输出设备进行通信。通信程序,可以用于与云手机进行通信。存储器还可以存储用户界面程序,该用户界面程序可以通过图形化的操作界面将浏览器的内容形象逼真的显示出来,并通过菜单、对话框以及按键等输入控件接收用户对浏览器的控制操作。The
输出设备420主要包括显示器,显示器可包括阴极射线管显示器(Cathode Ray Tube,CRT),等离子显示器(Plasma Display Panel,PDP),液晶显示器(Liquid Crystal Display,LCD)等等。以显示器为LCD为例,液晶显示包括液晶面板以及背光模组,其中,液晶显示面板包括偏振膜、玻璃基板、黑色矩阵、彩色滤光片、保护膜、普通电极、校准层、液晶层(液晶、间隔、密封剂)、电容、显示电极、棱镜层、散光层。背光模组包括:照明光源、反射板、导光板、扩散片、增亮膜(棱镜片)及框架等等。The
输入设备430可以包括键盘和鼠标。键盘和鼠标是最常用也是最主要的输入设备,通 过键盘可以将英文字母、数字、标点符号等输入到计算机中,从而向计算机发出命令、输入数据等,通过鼠标可以快速地进行纵横坐标定位,从而简化操作。其中,键盘可以包括机械键盘、塑料薄膜式键盘(Mechanical)、导电橡胶式键盘(Membrane),无接点静电电容键盘(Capacitives)等等,鼠标可以包括滚球鼠标、光电鼠标以及无线鼠标等等。The
输入设备430用于接收云手机发送的第一媒体数据,所述第一媒体数据在所述云手机运行云应用时产生;The
主机410用于对所述第一媒体数据进行解码,以获取第一音频和第一视频;The
输出设备420用于在所述浏览器中播放所述第一音频和第一视频;The
输入设备430用于接收用户在所述浏览器输入的针对所述云应用的操作命令,以通过通信模块将所述操作命令发送至所述云手机。The
为了简便起见,图6所示的终端设备并没有进行详细的介绍,具体请参见图1至图5以及相关描述,此次不再展开描述。For the sake of brevity, the terminal device shown in FIG. 6 has not been introduced in detail. For details, please refer to FIGS. 1 to 5 and related descriptions, which will not be described again this time.
图7是终端设备的另一种实现方式的结构框图。如图7所示,终端设备可以是智能手机,包括:基带芯片510、存储器515,包括一个或多个计算机可读存储介质、射频(RF)模块516、外围系统517。这些部件可在一个或多个通信总线514上通信。Fig. 7 is a structural block diagram of another implementation manner of a terminal device. As shown in FIG. 7, the terminal device may be a smart phone, including: a
外围系统517主要用于实现终端设备510和用户/外部环境之间的交互功能,主要包括终端设备的输入输出装置。具体实现中,外围系统517可包括:触摸屏控制器518、摄像头控制器519、音频控制器520以及传感器管理模块521。其中,各个控制器可与各自对应的外围设备,例如触摸屏523、摄像头524、音频电路525以及传感器526,耦合。在一些实施例中,传感器526中的手势传感器可用于接收用户输入的手势控制操作。传感器526中的压力传感器可设置于触摸屏523的下方,可用于采集用户通过触摸屏523输入触控操作时作用于触摸屏523上的触控压力。需要说明的,外围系统517还可以包括其他I/O外设。The
基带芯片510可集成包括:一个或多个处理器511、时钟模块512以及电源管理模块513。集成于基带芯片510中的时钟模块512主要用于为处理器511产生数据传输和时序控制所需要的时钟。集成于基带芯片510中的电源管理模块513主要用于为处理器511、射频模块516以及外围系统提供稳定的、高精确度的电压。The
存储器515用于存储各种软件程序和/或多组指令。具体实现中,存储器可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器可以无需安装操作系统以及大量的应用程序,存储器只需要存储一些必须的应用程序即可,例如,输入输出程序,该输入输出程序可用于与一个或多个输入设备或者输出设备进行通信。通信程序,可以用于与云手机进行通信。存储器还可以存储桌面程序。The
射频(RF)模块516用于接收和发送射频信号,主要集成了终端设备的接收器和发射器。射频(RF)模块516通过射频信号与通信网络和其他通信设备通信。具体实现中,射频(RF)模块516可包括但不限于:天线系统、RF收发器、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC芯片、SIM卡5161和存储介质等。此外,射 频模块还可以包括WIFI 5162,蓝牙等等短距离无线通信模块。在一些实施例中,可在单独的芯片上实现射频(RF)模块516。The radio frequency (RF)
射频(RF)模块516用于接收云手机发送的第一媒体数据,所述第一媒体数据在所述云手机运行云应用时产生;The radio frequency (RF)
基带芯片510用于对所述第一媒体数据进行解码,以获取第一音频和第一视频;The
触摸屏523用于在所述浏览器中播放第一视频,音频电路525用于播放第一音频;The
触摸屏523用于接收用户在所述浏览器输入的针对所述云应用的操作命令,以通过射频(RF)模块516将所述操作命令发送至所述云手机。The
为了简便起见,图7所示的终端设备并没有进行详细的介绍,具体请参见图1至图5以及相关描述,此次不再展开描述。For the sake of brevity, the terminal device shown in FIG. 7 has not been introduced in detail. For details, please refer to FIGS. 1 to 5 and related descriptions, which will not be further described this time.
在上述方案中,通过在终端设备的浏览器中加载脚本实现对云手机发送的游戏的媒体数据的解码,无需受限于个人电脑,可实现跨平台的云手机游戏音视频展示。In the above solution, the decoding of the media data of the game sent by the cloud mobile phone is realized by loading a script in the browser of the terminal device, without being limited to a personal computer, and a cross-platform cloud mobile phone game audio and video display can be realized.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memory, Dedicated components and so on to achieve. Under normal circumstances, all functions completed by computer programs can be easily implemented with corresponding hardware. Moreover, the specific hardware structures used to achieve the same function can also be diverse, such as analog circuits, digital circuits or special-purpose circuits. Circuit etc. However, for this application, software program implementation is a better implementation in more cases. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a computer floppy disk. , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, training device, or network device, etc.) execute the various embodiments described in this application method.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地生成按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, training device, or data. The center transmits to another website, computer, training equipment, or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
Claims (13)
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010367883 | 2020-04-30 | ||
| CN202010367883.5 | 2020-04-30 | ||
| CN202010444415.3 | 2020-05-22 | ||
| CN202010444415.3A CN113672293B (en) | 2020-04-30 | 2020-05-22 | A media data processing method and terminal device based on cloud phone |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021218751A1 true WO2021218751A1 (en) | 2021-11-04 |
Family
ID=78332126
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/088845 Ceased WO2021218751A1 (en) | 2020-04-30 | 2021-04-22 | Cloud phone-based media data processing method and terminal device |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2021218751A1 (en) |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114090247A (en) * | 2021-11-22 | 2022-02-25 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for processing data |
| CN114157584A (en) * | 2021-12-01 | 2022-03-08 | 北京百度网讯科技有限公司 | Cloud mobile phone monitoring method and device, electronic equipment and storage medium |
| CN114401300A (en) * | 2022-01-10 | 2022-04-26 | 北京百度网讯科技有限公司 | Cloud application control method, device, equipment, medium and program product |
| CN114422808A (en) * | 2022-01-07 | 2022-04-29 | 北京百度网讯科技有限公司 | Cloud mobile phone interaction method and device, electronic equipment and storage medium |
| CN114500718A (en) * | 2021-12-27 | 2022-05-13 | 天翼云科技有限公司 | Cloud mobile phone management method and device |
| CN114567659A (en) * | 2022-02-25 | 2022-05-31 | 北京百度网讯科技有限公司 | Cloud mobile phone control method, device, equipment and storage medium |
| CN114827356A (en) * | 2022-04-13 | 2022-07-29 | 广东悦伍纪网络技术有限公司 | Method and system for realizing call records of cloud mobile phone |
| CN114866542A (en) * | 2022-04-20 | 2022-08-05 | 广东悦伍纪网络技术有限公司 | System and method for realizing real machine simulation on cloud mobile phone |
| CN114900507A (en) * | 2022-04-29 | 2022-08-12 | 阿里巴巴(中国)有限公司 | RTC audio data processing method, device, equipment and storage medium |
| CN116208622A (en) * | 2023-04-28 | 2023-06-02 | 江苏北弓智能科技有限公司 | Batch cloud mobile phone synchronous operation method |
| CN116737404A (en) * | 2022-09-28 | 2023-09-12 | 荣耀终端有限公司 | Method and terminal equipment for application connection |
| CN117692681A (en) * | 2023-12-21 | 2024-03-12 | 广州开得联智能科技有限公司 | Video stream playing method, device, equipment and readable storage medium |
| WO2024145862A1 (en) * | 2023-01-05 | 2024-07-11 | 华为技术有限公司 | Data transmission method and related apparatus |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170064372A1 (en) * | 2015-08-28 | 2017-03-02 | Streamray Inc. | Method and system for display of mixed media content on devices without standard video |
| CN108521581A (en) * | 2018-03-05 | 2018-09-11 | 西安万像电子科技有限公司 | Multi-medium data display methods, terminal and system |
| CN110784525A (en) * | 2019-10-14 | 2020-02-11 | 广州微算互联信息技术有限公司 | Cloud mobile phone control method, system and storage medium based on H5 webpage technology |
-
2021
- 2021-04-22 WO PCT/CN2021/088845 patent/WO2021218751A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170064372A1 (en) * | 2015-08-28 | 2017-03-02 | Streamray Inc. | Method and system for display of mixed media content on devices without standard video |
| CN108521581A (en) * | 2018-03-05 | 2018-09-11 | 西安万像电子科技有限公司 | Multi-medium data display methods, terminal and system |
| CN110784525A (en) * | 2019-10-14 | 2020-02-11 | 广州微算互联信息技术有限公司 | Cloud mobile phone control method, system and storage medium based on H5 webpage technology |
Cited By (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114090247A (en) * | 2021-11-22 | 2022-02-25 | 北京百度网讯科技有限公司 | Method, apparatus, device and storage medium for processing data |
| CN114157584A (en) * | 2021-12-01 | 2022-03-08 | 北京百度网讯科技有限公司 | Cloud mobile phone monitoring method and device, electronic equipment and storage medium |
| CN114500718B (en) * | 2021-12-27 | 2023-11-03 | 天翼云科技有限公司 | A cloud mobile phone management method and device |
| CN114500718A (en) * | 2021-12-27 | 2022-05-13 | 天翼云科技有限公司 | Cloud mobile phone management method and device |
| CN114422808A (en) * | 2022-01-07 | 2022-04-29 | 北京百度网讯科技有限公司 | Cloud mobile phone interaction method and device, electronic equipment and storage medium |
| CN114401300A (en) * | 2022-01-10 | 2022-04-26 | 北京百度网讯科技有限公司 | Cloud application control method, device, equipment, medium and program product |
| CN114401300B (en) * | 2022-01-10 | 2023-11-14 | 北京百度网讯科技有限公司 | Cloud application control methods, devices, equipment, media and program products |
| CN114567659A (en) * | 2022-02-25 | 2022-05-31 | 北京百度网讯科技有限公司 | Cloud mobile phone control method, device, equipment and storage medium |
| CN114567659B (en) * | 2022-02-25 | 2023-11-14 | 北京百度网讯科技有限公司 | Cloud mobile phone control method, device, equipment and storage medium |
| CN114827356A (en) * | 2022-04-13 | 2022-07-29 | 广东悦伍纪网络技术有限公司 | Method and system for realizing call records of cloud mobile phone |
| CN114866542B (en) * | 2022-04-20 | 2023-08-18 | 广东悦伍纪网络技术有限公司 | System and method for realizing true mobile phone simulation on cloud mobile phone |
| CN114866542A (en) * | 2022-04-20 | 2022-08-05 | 广东悦伍纪网络技术有限公司 | System and method for realizing real machine simulation on cloud mobile phone |
| CN114900507A (en) * | 2022-04-29 | 2022-08-12 | 阿里巴巴(中国)有限公司 | RTC audio data processing method, device, equipment and storage medium |
| CN116737404A (en) * | 2022-09-28 | 2023-09-12 | 荣耀终端有限公司 | Method and terminal equipment for application connection |
| WO2024145862A1 (en) * | 2023-01-05 | 2024-07-11 | 华为技术有限公司 | Data transmission method and related apparatus |
| CN116208622A (en) * | 2023-04-28 | 2023-06-02 | 江苏北弓智能科技有限公司 | Batch cloud mobile phone synchronous operation method |
| CN117692681A (en) * | 2023-12-21 | 2024-03-12 | 广州开得联智能科技有限公司 | Video stream playing method, device, equipment and readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2021218751A1 (en) | Cloud phone-based media data processing method and terminal device | |
| US11868586B2 (en) | Floating window user interface display method and apparatus, device, and storage medium | |
| US11301131B2 (en) | Method for split-screen display, terminal, and non-transitory computer readable storage medium | |
| US8775844B1 (en) | Dynamic information adaptation for a computing device having multiple power modes | |
| US10205985B2 (en) | Management of the channel bar | |
| WO2021057830A1 (en) | Information processing method and electronic device | |
| US11693531B2 (en) | Page display position jump method and apparatus, terminal device, and storage medium | |
| CN113613064B (en) | Video processing method, device, storage medium and terminal | |
| CN108279966A (en) | Webpage capture method, apparatus, terminal and storage medium | |
| WO2016048310A1 (en) | Management of the channel bar | |
| WO2018223558A1 (en) | Data processing method and electronic device | |
| CN111602107B (en) | Display method and terminal when application exits | |
| CN109656445B (en) | Content processing method, device, terminal and storage medium | |
| WO2021254201A1 (en) | Page display method and apparatus, storage medium, and electronic device | |
| TWI646835B (en) | Television program playing method and related terminal device | |
| US11314391B2 (en) | Navigation bar controlling method and terminal | |
| US9754391B2 (en) | Webpage display method and apparatus | |
| CN113672293B (en) | A media data processing method and terminal device based on cloud phone | |
| EP3835967A1 (en) | Card data display method and apparatus, and storage medium | |
| CN108780400A (en) | Data processing method and electronic equipment | |
| CN107562324B (en) | Data display control method and terminal | |
| US20190369827A1 (en) | Remote data input framework | |
| CN115048597A (en) | Page display method and device and electronic equipment | |
| CN112528177B (en) | Method, electronic device and storage medium for switching content pages from connection waiting pages | |
| WO2021052488A1 (en) | Information processing method and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21797613 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21797613 Country of ref document: EP Kind code of ref document: A1 |