WO2020156035A1 - 弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质 - Google Patents

弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2020156035A1
WO2020156035A1 PCT/CN2020/070315 CN2020070315W WO2020156035A1 WO 2020156035 A1 WO2020156035 A1 WO 2020156035A1 CN 2020070315 W CN2020070315 W CN 2020070315W WO 2020156035 A1 WO2020156035 A1 WO 2020156035A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
thread
processing
asynchronous
loaded
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
Application number
PCT/CN2020/070315
Other languages
English (en)
French (fr)
Inventor
李应鹏
丁力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201910099987.XA external-priority patent/CN109788334A/zh
Priority claimed from CN201910099986.5A external-priority patent/CN109801210A/zh
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Publication of WO2020156035A1 publication Critical patent/WO2020156035A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB

Definitions

  • the present disclosure relates to the technical field of application software, in particular to a barrage processing method, device, electronic equipment, and computer-readable storage medium, and the present disclosure also relates to an image processing method, device, electronic equipment, and computer-readable storage medium .
  • a bullet screen includes many view levels (sub-views), such as a user’s avatar, multiple pictures, multiple text, background, special effects and other different view levels, even the simplest bullet screen , Also includes 3 view levels: an avatar, a sentence, and a background.
  • the present disclosure provides a barrage processing method, device, electronic equipment, and computer-readable storage medium, so as to realize the timely display of the barrage and avoid the occurrence of the jam phenomenon.
  • a method for processing barrage which is applied to an electronic device with a main thread and an asynchronous thread created on the electronic device, and the method includes:
  • the rendered image is displayed through the display interface.
  • the rasterizing the barrage to be processed by the asynchronous thread to obtain an image includes:
  • the performing rasterization processing on the to-be-processed barrage by the asynchronous thread to obtain an image includes:
  • a preset loop recursive method is selected by the asynchronous thread to rasterize the to-be-processed barrage to obtain an image.
  • the asynchronous thread is stored in a thread pool created on the electronic device
  • the selection of the asynchronous thread includes any one of the following:
  • An idle asynchronous thread is selected in the thread pool according to a preset order.
  • a barrage processing device has a main thread and an asynchronous thread created on the device, and the device includes:
  • the processing unit is configured to perform rasterization processing on the barrage to be processed through the asynchronous thread to obtain an image
  • a rendering unit configured to perform rendering processing on the image through the main thread to obtain a rendered image
  • the display unit is configured to display the rendered image through a display interface.
  • the processing unit is configured to perform rasterization processing on the barrage to be processed through the asynchronous thread, and draw multiple view levels of the barrage to be processed into one image.
  • the processing unit is configured to select a preset loop recursive method through the asynchronous thread to rasterize the to-be-processed barrage to obtain an image.
  • the asynchronous thread is stored in a thread pool created on the device,
  • the processing unit is used to select any idle asynchronous thread in the thread pool; or, used to select an idle asynchronous thread in the thread pool in a preset order.
  • an electronic device including: a processor and a memory;
  • the memory is used to store operation instructions
  • the processor is configured to execute the above-mentioned barrage processing method by calling the operation instruction.
  • a computer-readable storage medium is provided, the computer storage medium is used to store computer instructions, which when run on a computer, cause the computer to execute the above-mentioned barrage processing method.
  • the barrage to be processed is rasterized by the asynchronous thread to obtain an image; the drawn image is rendered by the main thread to obtain the rendered image; the rendered image is displayed through a display interface The rendered image.
  • the above-mentioned processing provided by the present disclosure realizes the timely display of the bullet screen. Through the division and cooperation of the main thread and the asynchronous thread, the processing efficiency is improved, the stuttering phenomenon in the UI interface is avoided, and the user experience is increased, and Through the introduction of asynchronous threads, the processing speed of the main thread is improved, thereby effectively improving the fluency of the display.
  • the present disclosure also provides an image processing method, device, electronic equipment, and computer-readable storage medium, so as to realize the timely display of graphics and text and avoid the occurrence of jams.
  • an image processing method is provided, which is applied to a business device, where a main thread is created on the business device, and the method includes:
  • the rendered image is displayed through the display interface.
  • the asynchronous thread is stored in a thread pool created on the service device,
  • the selection of asynchronous threads includes any of the following:
  • An asynchronous thread is selected in the thread pool according to a preset sequence.
  • the trigger processing for drawing the image to be loaded includes:
  • the corresponding relationship between the cell corresponding to the image to be loaded and the display interface includes any one of the following:
  • the cell corresponding to the image to be loaded is in the display interface
  • the cell corresponding to the image to be loaded is a preset number of cells adjacent to the cell currently displayed on the display interface.
  • the performing rendering processing on the drawn image by the main thread to obtain the rendered image includes:
  • the drawn image is rendered by the main thread to obtain the rendered image.
  • an image processing device wherein a main thread is created on the device, and the device includes:
  • the drawing unit is used to draw the image to be loaded based on the selected asynchronous thread to obtain the drawn image
  • a rendering unit configured to perform rendering processing on the drawn image through the main thread to obtain a rendered image
  • the display unit is configured to display the rendered image through a display interface.
  • the asynchronous thread is stored in a thread pool created on the device,
  • the drawing unit is used to select any asynchronous thread in the thread pool; or, to select an asynchronous thread in the thread pool in a preset order.
  • it also includes:
  • a processing unit configured to draw the image to be loaded based on the correspondence between the cell corresponding to the image to be loaded and the display interface;
  • the corresponding relationship between the cell corresponding to the image to be loaded and the display interface includes any one of the following:
  • the cell corresponding to the image to be loaded is in the display interface
  • the cell corresponding to the image to be loaded is a preset number of cells adjacent to the cell currently displayed on the display interface.
  • the rendering unit is configured to perform rendering processing on the drawn image through the main thread when the cell corresponding to the image to be loaded is moved to the display interface to obtain rendering After the image.
  • an electronic device including: a processor and a memory;
  • the memory is used to store operation instructions
  • the processor is configured to execute the above-mentioned image processing method by calling the operation instruction.
  • a computer-readable storage medium is provided, the computer storage medium is used to store computer instructions, which when run on a computer, cause the computer to execute the above-mentioned image processing method.
  • the image to be loaded is drawn based on the selected asynchronous thread to obtain the drawn image; the drawn image is rendered by the main thread to obtain the rendered image; the rendered image is displayed through the display interface After the image.
  • the above-mentioned processing provided by the present disclosure realizes the timely display of the image, improves the processing efficiency by separately performing the image drawing and rendering processing, avoids the occurrence of jams in the UI interface, and increases the user experience.
  • FIG. 1 is a schematic flowchart of a barrage processing method provided by an embodiment of the disclosure
  • FIG. 2 is a schematic diagram of a specific processing flow of an implementation of the barrage processing method provided by an embodiment of the disclosure
  • FIG. 3 is a schematic structural diagram of a barrage processing device provided by an embodiment of the disclosure.
  • FIG. 4 is a schematic flowchart of an image processing method provided by an embodiment of the disclosure.
  • FIG. 5 is a schematic diagram of a specific processing flow of a possible implementation of the image processing method provided by the embodiments of the disclosure.
  • FIG. 6 is a schematic structural diagram of an image processing device provided by an embodiment of the disclosure.
  • FIG. 7 is a schematic structural diagram of an electronic device of the bullet screen processing method and the image processing method provided by the embodiments of the disclosure.
  • the present disclosure provides a barrage processing method, device, electronic equipment, and computer-readable storage medium.
  • the specific embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
  • the electronic device may be a terminal device or a server, which is not specifically limited in the present disclosure.
  • FIG. 1 is a schematic flow chart of a method for processing barrage provided by the present disclosure.
  • the method can be applied to an electronic device, and a main thread is created on the electronic device.
  • the method may include the following steps:
  • Step S101 drawing the barrage to be processed to obtain a drawn image
  • Step S102 performing rendering processing on the drawn image through the main thread to obtain the rendered image
  • Step S103 displaying the rendered image through the display interface.
  • the barrage to be processed is rasterized by the asynchronous thread to obtain an image; the drawn image is rendered by the main thread to obtain the rendered image; the rendered image is displayed through a display interface The rendered image.
  • the above-mentioned processing provided by the present disclosure realizes the timely display of the bullet screen. Through the division and cooperation of the main thread and the asynchronous thread, the processing efficiency is improved, the stuttering phenomenon in the UI interface is avoided, and the user experience is increased, and Through the introduction of asynchronous threads, the processing speed of the main thread is improved, thereby effectively improving the fluency of the display.
  • FIG. 2 is a specific processing flow chart of an implementation of the barrage processing method provided by the present disclosure.
  • the technical solution can be applied to use scenarios such as live broadcast rooms and video playback.
  • the processing of the aforementioned step S101 specifically includes the processing of the following steps S201 to S202.
  • Step S201 Select an asynchronous thread.
  • a thread pool is created on the electronic device, and multiple asynchronous threads are stored in the thread pool.
  • an idle asynchronous thread is randomly selected from the thread pool to perform the following rasterization processing in the subsequent;
  • the selection can be based on the multiple asynchronous threads in the thread pool.
  • the preset arrangement order is not limited to the sequential arrangement in the above-mentioned examples, but can also be other arrangement orders, and the corresponding arrangement order can be configured as required.
  • live broadcast is currently being performed in a live broadcast room, and there are 16 asynchronous threads in the thread pool.
  • a barrage task arrives, 5 asynchronous threads out of the 16 asynchronous threads in the thread pool In the idle state, one asynchronous thread is randomly selected from the five idle asynchronous threads.
  • Step S202 rasterize the barrage to be processed through the selected asynchronous thread.
  • the barrage to be processed can be rasterized through the selected asynchronous thread.
  • the barrage to be processed when the barrage to be processed is rasterized through an asynchronous thread, the barrage to be processed can be rasterized through the asynchronous thread, and multiple view levels of the barrage to be processed can be drawn into one image;
  • rasterization processing it is not limited to the rasterization processing based on the cyclic recursion method, and other methods that can realize the rasterization processing can also be used; and for the above-mentioned cyclic recursion method, it is not Limited to this method, any method that can solve the same or similar technical problems and achieve the same or similar technical effects is within the protection scope of the present disclosure.
  • the processing of the foregoing step S102 specifically includes the processing of the following step S203.
  • Step S203 Perform rendering processing on the image through the main thread.
  • the aforementioned main thread may be used to perform rendering processing on the rasterized image to obtain a rendered image.
  • the processing of the aforementioned step S103 specifically includes the processing of the following step S204.
  • Step S204 Display the rendered image through the display interface.
  • the rendered image is given to a display interface (for example, a UI interface), and the rendered image is displayed through the display interface.
  • a display interface for example, a UI interface
  • the present disclosure provides a schematic structural diagram of a barrage processing device. As shown in FIG. 3, a main thread is created on the barrage processing device 30 of the present disclosure.
  • the device 30 may include a processing unit 31, a rendering unit 32, and a display unit. 33, of which,
  • the processing unit 31 is configured to perform rasterization processing on the barrage to be processed through the asynchronous thread to obtain an image
  • the rendering unit 32 is configured to perform rendering processing on the image through the main thread to obtain a rendered image
  • the display unit 33 is configured to display the rendered image through the display interface.
  • the processing unit 31 is configured to perform rasterization processing on the barrage to be processed through an asynchronous thread, and draw multiple view levels of the barrage to be processed into one image.
  • the processing unit 31 is configured to select a preset loop recursive method through an asynchronous thread to perform rasterization processing on the barrage to be processed to obtain an image.
  • the asynchronous thread is stored in a thread pool created on the device.
  • the processing unit 31 is used to select any idle asynchronous thread in the thread pool; or, used to select an idle asynchronous thread in the thread pool according to a preset order.
  • the present disclosure also provides an image processing method, device, electronic equipment, and computer-readable storage medium.
  • the specific embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
  • FIG. 4 a schematic flow diagram of the image processing method provided by the present disclosure is applied to a business device, and a main thread is created on the business device.
  • the method includes the following steps:
  • Step S401 drawing the image to be loaded based on the selected asynchronous thread to obtain the drawn image
  • Step S402 performing rendering processing on the drawn image through the main thread to obtain the rendered image
  • Step S403 Display the rendered image through the display interface.
  • the image to be loaded is drawn based on the selected asynchronous thread to obtain the drawn image; the drawn image is rendered by the main thread to obtain the rendered image; the rendered image is displayed through the display interface.
  • FIG. 5 a specific processing flow chart of an implementation of the image processing method provided by this disclosure, for this technical solution, It is applied to usage scenarios such as web browsing and comment area browsing.
  • the processing of the foregoing step S401 specifically includes the processing of the following step S501.
  • step S501 the image to be loaded is drawn through the asynchronous thread.
  • the above-mentioned drawing processing can be performed through an asynchronous thread.
  • a thread pool is created on the business device, and at least one asynchronous thread is stored in the thread pool.
  • one asynchronous thread can be selected according to the arrangement order among the multiple asynchronous threads in the thread pool. Draw processing.
  • the arrangement order setting among asynchronous threads in the thread pool may be configured in advance, and the arrangement order setting does not make any specific restrictions.
  • the trigger operation may include:
  • the image to be loaded is drawn.
  • the correspondence between the cell corresponding to the image to be loaded and the display interface may include any of the following:
  • the above loading method may be called a real-time loading method, that is, as long as the cell corresponding to the image to be loaded is moved to the current display interface, the image to be loaded corresponding to the cell will be drawn accordingly.
  • the cell corresponding to the image to be loaded is a preset number of cells adjacent to the cell currently displayed on the display interface.
  • the above loading method can be referred to as the preloading method, that is, when the cell in the current display interface and the cell corresponding to the image to be loaded have a certain positional relationship, such as the cell A in the current display interface The position is 1, and the position of cell B corresponding to the image to be loaded is 4, that is, the cell A is the fourth cell adjacent to cell B. At this time, the corresponding pre-loaded image will be performed. Load processing, so that the pre-loaded image can be directly extracted to the main thread for rendering processing later.
  • the above-mentioned cells may be stored in a cell list, and all the cells in the cell list may also be arranged in a predetermined order.
  • processing of the foregoing step S402 specifically includes the processing of the following step S502.
  • Step S502 Perform rendering processing on the drawn image through the main thread.
  • the drawn image when the cell corresponding to the image to be loaded is moved to the display interface, the drawn image can be rendered through the above-mentioned main thread to obtain the rendered image.
  • the image to be loaded adopts the above-mentioned real-time loading method
  • the image to be loaded is drawn through the selected asynchronous thread, and the image is drawn.
  • the obtained image is given to the main thread, and the main thread performs rendering processing on the drawn image.
  • the drawing image corresponding to the image to be loaded is directly extracted, and the The obtained image is given to the main thread, and the main thread performs rendering processing on the drawn image.
  • the processing of the aforementioned step S403 specifically includes the processing of the following step S503.
  • Step S503 Display the rendered image through the display interface.
  • the rendered image is displayed on the UI interface.
  • the image to be loaded is drawn based on the selected asynchronous thread to obtain the drawn image; the drawn image is rendered by the main thread to obtain the rendered image; the rendered image is displayed through the display interface.
  • the above-mentioned processing provided by the present disclosure realizes the timely display of the image, improves the processing efficiency by separately drawing and rendering the image, avoids the occurrence of jams in the UI interface, and increases the user’s experience.
  • the introduction of asynchronous threads improves the processing speed of the main thread, which effectively improves the fluency of the display.
  • the present disclosure also provides a schematic structural diagram of an image processing device. As shown in FIG. 6, a main thread is created on the image processing device 60 of the present disclosure.
  • the device 60 may include: a drawing unit 61, a rendering unit 62, and a display unit 63. And a processing unit 64, in which,
  • the drawing unit 61 is configured to draw the image to be loaded based on the selected asynchronous thread to obtain the drawn image
  • the rendering unit 62 is configured to perform rendering processing on the drawn image through the main thread to obtain the rendered image
  • the display unit 63 is configured to display the rendered image through the display interface.
  • asynchronous threads are stored in a thread pool created on the device
  • the drawing unit 61 is used to select any asynchronous thread in the thread pool; or, used to select an asynchronous thread in the thread pool in a preset order.
  • it also includes:
  • the processing unit 64 is configured to draw the image to be loaded based on the correspondence between the cell corresponding to the image to be loaded and the display interface;
  • the corresponding relationship between the cell corresponding to the image to be loaded and the display interface includes any of the following:
  • the cell corresponding to the image to be loaded is in the display interface
  • the cell corresponding to the image to be loaded is a preset number of cells adjacent to the cell currently displayed on the display interface.
  • the rendering unit 62 is configured to perform rendering processing on the drawn image through the main thread when the cell corresponding to the image to be loaded is moved to the display interface to obtain the rendered image.
  • the image to be loaded is drawn based on the selected asynchronous thread to obtain the drawn image; the drawn image is rendered by the main thread to obtain the rendered image; the rendered image is displayed through the display interface.
  • the above-mentioned processing provided by the present disclosure realizes the timely display of the image, improves the processing efficiency by separately drawing and rendering the image, avoids the occurrence of jams in the UI interface, and increases the user’s experience.
  • the introduction of asynchronous threads improves the processing speed of the main thread, which effectively improves the fluency of the display.
  • FIG. 7 shows a schematic structural diagram of an electronic device (for example, the terminal device or the server in FIG. 1) 700 suitable for implementing the embodiments of the present disclosure.
  • Terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals ( For example, mobile terminals such as car navigation terminals and fixed terminals such as digital TVs and desktop computers.
  • the electronic device shown in FIG. 7 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the electronic device 700 may include a processing device (such as a central processing unit, a graphics processor, etc.) 701, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 702 or from a storage device 708.
  • the program in the memory (RAM) 703 executes various appropriate actions and processing.
  • various programs and data required for the operation of the electronic device 700 are also stored.
  • the processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704.
  • An input/output (I/O) interface 705 is also connected to the bus 704.
  • the following devices can be connected to the I/O interface 705: including input devices 706 such as touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, liquid crystal display (LCD), speakers, vibration An output device 707 such as a device; a storage device 708 such as a magnetic tape and a hard disk; and a communication device 709.
  • the communication device 709 may allow the electronic device 700 to perform wireless or wired communication with other devices to exchange data.
  • FIG. 7 shows an electronic device 700 having various devices, it should be understood that it is not required to implement or have all the illustrated devices. It may alternatively be implemented or provided with more or fewer devices.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702.
  • the processing device 701 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the aforementioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the above, for example. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device obtains at least two Internet protocol addresses; and sends to the node evaluation device including the at least two A node evaluation request for an Internet Protocol address, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein, the obtained The Internet Protocol address indicates the edge node in the content distribution network.
  • the aforementioned computer-readable medium carries one or more programs, and when the aforementioned one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses; Among the at least two Internet Protocol addresses, select the Internet Protocol address; return the selected Internet Protocol address; wherein, the received Internet Protocol address indicates the edge node in the content distribution network.
  • the computer program code used to perform the operations of the present disclosure may be written in one or more programming languages or a combination thereof.
  • the above-mentioned programming languages include object-oriented programming languages-such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user’s computer through any kind of network including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function Executable instructions.
  • the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Wherein, the name of the unit does not constitute a limitation on the unit itself under certain circumstances.
  • the first obtaining unit can also be described as "a unit for obtaining at least two Internet Protocol addresses.”
  • the present disclosure provides a computer-readable storage medium for storing computer instructions, which when run on a computer, cause the computer to execute the above-mentioned barrage processing method or image processing method.
  • the computer-readable storage medium provided in the present disclosure is applicable to any embodiment of the above method, and will not be repeated here.
  • the various modules of the device of the present disclosure can be integrated or deployed separately.
  • the above modules can be combined into one module or further divided into multiple sub-modules.
  • modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed to be located in one or more devices different from this embodiment.
  • the modules of the above-mentioned embodiments can be combined into one module, or further divided into multiple sub-modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本公开涉及一种弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质。该弹幕处理方法应用于电子设备上,所述电子设备上创建有主线程以及异步线程,该方法包括:通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示所述渲染后的图像。本公开实现了对弹幕的及时显示,通过主线程与异步线程的分工合作,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验,并且通过异步线程的引入,提升了主线程的处理速度,进而有效提升了显示的流畅性。

Description

弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质
相关申请的交叉引用
本申请要求2019年01月31日在中国知识产权局提交的中国专利申请No.201910099987X以及2019年01月31日在中国知识产权局提交的中国专利申请No.2019100999865的优先权,通过引用将中国专利申请公开的全部内容并入本文。
技术领域
本公开涉及应用软件技术领域,特别是涉及一种弹幕处理方法、装置、电子设备及计算机可读存储介质,并且本公开还涉及一种图像处理方法、装置、电子设备及计算机可读存储介。
背景技术
在现有技术中,一个弹幕(view)包括很多个视图层级(子view),如用户的头像、多个图片、多个文字、背景、特效等不同视图层级,即使是最简单的弹幕,也包括一个头像、一句话、一个背景这3个视图层级。
对于直播间等场景来说,简单的弹幕不能满足用户的需求,需要多样化的视图层级。当系统要显示一个弹幕时,主线程要对每个视图层级分别进行渲染,这样的渲染处理效率很低,尤其当有成千上万的用户同时发弹幕时,导致出现明显的卡顿现象,影响了用户的使用体验。
此外,在现有技术中,用户触发UI(User Interface,用户界面)的图文显示时,通常是通过主线程来读取、解码、渲染图片,但是由于读取、解码的过程非常耗时,并且非常占用较多的CPU资源,导致可能无法及时地对用户的操作做出响应,导致图文无法随着用户的操作实时地显示出来,从而使得用户 看来,该UI界面就产生了卡顿现象,影响了用户的使用体验。
发明内容
本公开提供了一种弹幕处理方法、装置、电子设备及计算机可读存储介质,以实现对弹幕的及时显示,避免卡顿现象的发生。
第一方面,提供了一种弹幕处理方法,应用于电子设备上,所述电子设备上创建有主线程以及异步线程,所述方法包括:
通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;
通过所述主线程对所述图像进行渲染处理,得到渲染后的图像;以及
通过显示界面显示所述渲染后的图像。
在一个实现方式中,所述通过所述异步线程对待处理弹幕进行栅格化处理,得到图像,包括:
通过所述异步线程对所述待处理弹幕进行栅格化处理,将所述待处理弹幕的多个视图层级绘制成一个图像。
在一个实现方式中,所述通过所述异步线程对所述待处理弹幕进行栅格化处理,得到图像,包括:
通过所述异步线程选取预设的循环递归方法对所述待处理弹幕进行栅格化处理,得到图像。
在一个实现方式中,所述异步线程存储于所述电子设备上创建的线程池中,
所述异步线程的选取,包括如下任一项:
在所述线程池中选取任一空闲的异步线程;
在所述线程池中按照预设顺序选取一个空闲的异步线程。
第二方面,提供了一种弹幕处理装置,所述装置上创建有主线程以及异步线程,所述装置包括:
处理单元,用于通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;
渲染单元,用于通过所述主线程对所述图像进行渲染处理,得到渲染后的图像;以及
显示单元,用于通过显示界面显示所述渲染后的图像。
在一个实现方式中,所述处理单元,用于通过所述异步线程对所述待处理弹幕进行栅格化处理,将所述待处理弹幕的多个视图层级绘制成一个图像。
在一个实现方式中,所述处理单元,用于通过所述异步线程选取预设的循环递归方法对所述待处理弹幕进行栅格化处理,得到图像。
在一个实现方式中,所述异步线程存储于所述装置上创建的线程池中,
所述处理单元,用于在所述线程池中选取任一空闲的异步线程;或,用于在所述线程池中按照预设顺序选取一个空闲的异步线程。
第三方面,提供了一种电子设备,包括:处理器和存储器;
所述存储器,用于存储操作指令;
所述处理器,用于通过调用所述操作指令,执行上述的弹幕处理方法。
第四方面,提供了一种计算机可读存储介质,所述计算机存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机执行上述的弹幕处理方法。
借由上述技术方案,本公开提供的技术方案至少具有下列优点:
本公开中,通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示所述渲染后的图像。本公开提供的上述处理,实现了对弹幕的及时显示,通过主线程与异步线程的分工合作,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验,并且通过异步线程的引入,提升了主线程的处理速度,进而有效提升了显示的流畅性。
本公开还提供了一种图像处理方法、装置、电子设备及计算机可读存储介质,以实现对图文的及时显示,避免卡顿现象的发生。
第五方面,提供了一种图像处理方法,应用于业务设备上,所述业务设备上创建有主线程,所述方法包括:
基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;
通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;
通过显示界面显示所述渲染后的图像。
在一个实现方式中,所述异步线程存储于所述业务设备上创建的线程池中,
所述选取异步线程,包括如下任一项:
在所述线程池中选取任一异步线程;
在所述线程池中按照预设顺序选取一个异步线程。
在一个实现方式中,所述对待加载图像进行绘制的触发处理,包括:
基于所述待加载图像对应的单元格与显示界面的对应关系,对所述待加载图像进行绘制;
所述待加载图像对应的单元格与显示界面的对应关系,包括如下任一项:
所述待加载图像对应的单元格处于所述显示界面中;
所述待加载图像对应的单元格为所述显示界面当前所显示的单元格相邻的预设个数的单元格。
在一个实现方式中,所述通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像,包括:
当所述待加载图像对应的单元格移动到所述显示界面中时,通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像。
第六方面,提供了一种图像处理装置,其中,所述装置上创建有主线程,所述装置包括:
绘制单元,用于基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;
渲染单元,用于通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;
显示单元,用于通过显示界面显示所述渲染后的图像。
在一个实现方式中,所述异步线程存储于所述装置上创建的线程池中,
所述绘制单元,用于在所述线程池中选取任一异步线程;或,用于在所述线程池中按照预设顺序选取一个异步线程。
在一个实现方式中,还包括:
处理单元,用于基于所述待加载图像对应的单元格与显示界面的对应关系,对所述待加载图像进行绘制;
所述待加载图像对应的单元格与显示界面的对应关系,包括如下任一项:
所述待加载图像对应的单元格处于所述显示界面中;
所述待加载图像对应的单元格为所述显示界面当前所显示的单元格相邻的预设个数的单元格。
在一个实现方式中,所述渲染单元,用于当所述待加载图像对应的单元格移动到所述显示界面中时,通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像。
第七方面,提供了一种电子设备,包括:处理器和存储器;
所述存储器,用于存储操作指令;
所述处理器,用于通过调用所述操作指令,执行上述的图像处理方法。
第八方面,提供了一种计算机可读存储介质,所述计算机存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机执行上述的图像处理方法。
借由上述技术方案,本公开提供的技术方案至少具有下列优点:
本公开中,基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示所述渲染后的图像。本公开提供的上述处理,实现了对图像的及时显示,通过分开进行图像的绘制与渲染处理,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本公开的实施例的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1为本公开的实施例提供的弹幕处理方法的流程示意图;
图2为本公开的实施例提供的弹幕处理方法的一种实现方式的具体处理流程示意图;
图3为本公开的实施例提供的弹幕处理装置的结构示意图;
图4为本公开的实施例提供的图像处理方法的流程示意图;
图5为本公开的实施例提供的图像处理方法的一种可能实现方式的具体处理流程示意图;
图6为本公开的实施例提供的图像处理装置的结构示意图;以及
图7为本公开的实施例提供的弹幕处理方法以及图像处理方法的电子设备的结构示意图。
具体实施方式
本公开提供了一种弹幕处理方法、装置、电子设备及计算机可读存储介质,下面结合附图,对本公开具体实施方式进行详细说明。
下面详细描述本公开的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本公开,而不能解释为对本公开的限制。
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本公开的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件 时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。
本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本公开所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开的实施例作进一步地详细描述。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。在本公开中,该电子设备可以是终端设备,也可以是服务器,在本公开中并不做具体限定。
图1为本公开提供的弹幕处理方法的流程示意图,该方法可以应用于电子设备上,电子设备上创建有主线程,该方法可以包括如下步骤:
步骤S101,对待处理弹幕进行绘制,得到绘制后的图像;
步骤S102,通过主线程对绘制后的图像进行渲染处理,得到渲染后的图像;以及
步骤S103,通过显示界面显示渲染后的图像。
本公开中,通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示所述渲染后的图像。本公开提供的上述处理,实现了对弹幕的及时显示,通过主线程与异步线程的分工合作,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验,并且通过异步线程的引入,提升了主线程的处理速度,进而有效提升了显示的流畅性。
基于上述本公开所提供的技术方案,下面对该技术方案进行详尽阐释。图2为本公开提供的弹幕处理方法的一个实现方式的具体处理流程图,对于本技术方案,可以应用于直播间、视频播放等使用场景。
在一个实现方式中,前述步骤S101的处理具体包括下述步骤S201~步骤S202的处理。
步骤S201,选取异步线程。
对于本公开,在电子设备上创建有一个线程池,且在该线程池中存储有多个异步线程。
对于本公开,在进行异步线程选取时,可以包括如下两种方式:
1)在线程池中选取任一空闲的异步线程;
具体地,从该线程池中随机选取一个空闲的异步线程,以在后续进行下述的栅格化处理;
2)在线程池中按照预设顺序选取一个空闲的异步线程。
具体地,该线程池中存储有多个异步线程,且这些异步线程中,有的异步线程当前处于空闲状态,有的可能处于工作状态,因此在选取时,可以基于线程池中该多个异步线程间具有预设的排列顺序,来选取一个空闲的异步线程进行上述的绘制处理。如果预设的排列顺序为顺次排列,则可以按照顺次排列顺序依次选取首个空闲的异步线程。当然,该预设的排列顺序并不仅局限于上述所举实例中的顺次排列,还可以是其他的排列顺序,可以根据需要配置相应的排列顺序。
在一个具体实施例中,在一个直播间中当前进行直播,线程池中有16个异步线程,当有一个弹幕任务到来时,此时线程池中的16个异步线程中有5个异步线程处于空闲状态,则在这5个空闲的异步线程中随机选取1个异步线程。
步骤S202,通过选取的异步线程对待处理弹幕进行栅格化处理。
对于本公开,在选取到合适的异步线程后,可以通过该选取的异步线程对待处理的弹幕进行栅格化处理。
对于本公开,在通过异步线程对待处理的弹幕进行栅格化处理时,可以通过异步线程对待处理弹幕进行栅格化处理,将待处理弹幕的多个视图层级绘制成一个图像;
其中,要将待处理弹幕的多个视图层级绘制成一个图像,可以根据预设的循环递归方法来进行相应的栅格化处理操作来实现。
其中,对于上述的栅格化处理,其并不局限于采用基于循环递归方法的栅格化处理,还可以采用其他可以实现栅格化处理的方法;且对于上述的循环递归方法,也并不局限于该方法,对于任意能够解决与其具有相同或相似的技术问题,且能够达到相同或相似的技术效果的方法均在本公开的保护范围之内。
在一个实现方式中,前述步骤S102的处理具体包括下述步骤S203的处理。
步骤S203,通过主线程对图像进行渲染处理。
对于本公开,当待处理弹幕经过上述栅格化处理得到图像后,可以通过上述的主线程来对经栅格化处理后的图像进行渲染处理,从而得到渲染后的图像。
在一个实现方式中,前述步骤S103的处理具体包括下述步骤S204的处理。
步骤S204,通过显示界面显示渲染后的图像。
对于本公开,在由主线程对图像渲染后,将渲染后的图像给到显示界面(例如,UI界面)上,通过显示界面对该渲染后的图像进行显示。
其中,在本公开中,无论是上述的图像栅格化处理过程,还是图像渲染过程,或者是图像的显示过程,均可以采用现有的对应操作进行处理,故在本公开技术方案中不对具体的图像栅格化处理过程、图像渲染过程以及图像显示过程做具体阐释。
本公开提供了一种弹幕处理装置的结构示意图,如图3所示,本公开的弹幕处理装置30上创建有主线程,该装置30可以包括:处理单元31、渲染单元32以及显示单元33,其中,
处理单元31,用于通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;
渲染单元32,用于通过主线程对图像进行渲染处理,得到渲染后的图像;以及
显示单元33,用于通过显示界面显示渲染后的图像。
在一个实现方式中,处理单元31,用于通过异步线程对待处理弹幕进行栅格化处理,将待处理弹幕的多个视图层级绘制成一个图像。
在一个实现方式中,处理单元31,用于通过异步线程选取预设的循环递归方法对待处理弹幕进行栅格化处理,得到图像。
在一个实现方式中,所述异步线程存储于所述装置上创建的线程池中。
所述处理单元31,用于在线程池中选取任一空闲的异步线程;或,用于在所述线程池中按照预设顺序选取一个空闲的异步线程。
本公开还提供了一种图像处理方法、装置、电子设备及计算机可读存储介质,下面结合附图,对本公开的具体实施方式进行详细说明。
如图4所示,为本公开提供的图像处理方法的流程示意图,应用于业务设备上,业务设备上创建有主线程,该方法包括如下步骤:
步骤S401,基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;
步骤S402,通过主线程对绘制后的图像进行渲染处理,得到渲染后的图像;
步骤S403,通过显示界面显示渲染后的图像。
本公开中,基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;通过主线程对绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示渲染后的图像。本公开提供的上述处理,实现了对图像的及时显示,通过分开进行图像的绘制与渲染处理,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验。
基于上述本公开所提供的技术方案,下面对该技术方案进行详尽阐释,如图5所示,为本公开提供的图像处理方法的一个实现方式的具体处理流程图,对于本技术方案,可以应用于网页浏览、评论区浏览等使用场景。
在一个实现方式中,前述步骤S401的处理具体包括下述步骤S501的处理。
步骤S501,通过异步线程对待加载图像进行绘制。
对于本公开,在需要对待加载图像进行绘制时,可以通过异步线程来进行上述绘制处理。
在一个实现方式中,对于上述的异步线程选取,可以包括如下两种方式:
在业务设备上创建有一个线程池,且在该线程池中存储有至少一个异步线程。
1)在线程池中选取任一异步线程;
具体地,从该线程池中随机选取一个异步线程来进行上述的绘制处理;
2)在线程池中按照预设顺序选取一个异步线程。
具体地,该线程池中存储有多个异步线程,且该多个异步线程间具有一定的排列顺序,则可以按照线程池中该多个异步线程间的排列顺序来选取一个异步线程进行上述的绘制处理。
其中,对于线程池中异步线程间的排列顺序设置,可以是预先进行配置的,且该排列顺序的设置不做任何具体限定。
在一个实现方式中,对于对待加载图像进行绘制的处理,其触发操作可以包括:
基于待加载图像对应的单元格与显示界面的对应关系,对待加载图像进行绘制。
其中,待加载图像对应的单元格与显示界面的对应关系,可以包括如下任一种:
1)待加载图像对应的单元格处于显示界面中;
对于本公开,上述加载方式可以称之为实时加载方式,即只要待加载图像对应的单元格移动到当前的显示界面中,就会对该单元格对应的待加载图像进行相应的绘制处理。
2)待加载图像对应的单元格为显示界面当前所显示的单元格相邻的预设个数的单元格。
对于本公开,上述加载方式可以称之为预加载方式,即当前显示界面中的单元格与该待加载图像所对应的单元格具有一定的位置关系时,如当前显 示界面中的单元格A的位置为1,待加载图像对应的单元格B的位置为4,也即该单元格A为该单元格B相邻的第4个单元格,此时也会对该待加载图像进行相应的预加载处理,以在后续可以直接提取该预加载得到的图像给到主线程进行渲染处理。
其中,上述的单元格可以是存储于一个单元格列表中,且该单元格列表中的所有单元格同样可以按照一个预定的顺序进行排列。
在一个实现方式中,前述步骤S402的处理具体包括下述步骤S502的处理。
步骤S502,通过主线程对绘制后的图像进行渲染处理。
对于本公开,当待加载图像对应的单元格移动到显示界面中时,即可以通过上述的主线程来对绘制后的图像进行渲染处理,从而得到渲染后的图像。
在一个实现方式中,当对待加载图像采用上述的实时加载方式时,则当待加载图像对应的单元格移动到显示界面中时,通过选择的异步线程对该待加载图像进行绘制,并将绘制得到的图像给到主线程,由主线程来对该绘制得到的图像进行渲染处理。
在一个实现方式中,当对待加载图像采用上述的预加载方式时,则当待加载图像对应的单元格移动到显示界面中时,直接提取该待加载图像对应的绘制后的图像,并将绘制得到的图像给到主线程,由主线程来对该绘制得到的图像进行渲染处理。
在一个实现方式中,前述步骤S403的处理具体包括下述步骤S503的处理。
步骤S503,通过显示界面显示渲染后的图像。
对于本公开,在由主线程对图像渲染后,将渲染后的图像给到UI界面上进行显示。
其中,在本公开中,无论是上述的图像绘制过程,还是图像渲染过程,或者是图像的显示过程,均可以采用现有的对应的操作进行处理,故在本公 开的技术方案中不对具体的图像绘制过程、图像渲染过程以及图像显示过程做具体阐释。
本公开中,基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;通过主线程对绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示渲染后的图像。本公开提供的上述处理,实现了对图像的及时显示,通过分开进行图像的绘制与渲染处理,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验,并且通过异步线程的引入,提升了主线程的处理速度,进而有效提升了显示的流畅性。
本公开还提供了一种图像处理装置的结构示意图,如图6所示,本公开的图像处理装置60上创建有主线程,该装置60可以包括:绘制单元61、渲染单元62、显示单元63以及处理单元64,其中,
绘制单元61,用于基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;
渲染单元62,用于通过主线程对绘制后的图像进行渲染处理,得到渲染后的图像;
显示单元63,用于通过显示界面显示渲染后的图像。
在一个实现方式中,异步线程存储于装置上创建的线程池中,
绘制单元61,用于在线程池中选取任一异步线程;或,用于在线程池中按照预设顺序选取一个异步线程。
在一个实现方式中,还包括:
处理单元64,用于基于待加载图像对应的单元格与显示界面的对应关系,对待加载图像进行绘制;
待加载图像对应的单元格与显示界面的对应关系,包括如下任一项:
待加载图像对应的单元格处于显示界面中;
待加载图像对应的单元格为显示界面当前所显示的单元格相邻的预设个数的单元格。
在一个实现方式中,渲染单元62,用于当待加载图像对应的单元格移动到显示界面中时,通过主线程对绘制后的图像进行渲染处理,得到渲染后的图 像。
本公开中,基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;通过主线程对绘制后的图像进行渲染处理,得到渲染后的图像;通过显示界面显示渲染后的图像。本公开提供的上述处理,实现了对图像的及时显示,通过分开进行图像的绘制与渲染处理,提高了处理效率,避免了UI界面中卡顿现象的发生,增加了用户的使用体验,并且通过异步线程的引入,提升了主线程的处理速度,进而有效提升了显示的流畅性。
下面参考图7,其示出了适于实现本公开的实施例的电子设备(例如图1中的终端设备或服务器)700的结构示意图。本公开的实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等的移动终端以及诸如数字TV、台式计算机等的固定终端。图7示出的电子设备仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储装置708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有电子设备700操作所需的各种程序和数据。处理装置701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。
通常,以下装置可以连接至I/O接口705:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置706;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许电子设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM 702被安装。在该计算机程序被处理装置701执行时,执行本公开的实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等,或者上述的任意合适的组合。
上述计算机可读介质可以包括在上述电子设备中;也可以单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程 序被该电子设备执行时,使得该电子设备:获取至少两个网际协议地址;向节点评价设备发送包括所述至少两个网际协议地址的节点评价请求,其中,所述节点评价设备从所述至少两个网际协议地址中,选取网际协议地址并返回;接收所述节点评价设备返回的网际协议地址;其中,所获取的网际协议地址指示内容分发网络中的边缘节点。
或者,上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:接收包括至少两个网际协议地址的节点评价请求;从所述至少两个网际协议地址中,选取网际协议地址;返回选取出的网际协议地址;其中,接收到的网际协议地址指示内容分发网络中的边缘节点。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言-诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这由所涉及的功能决定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合, 可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开的实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
本公开提供的电于设备,适用于上述方法的任一实施例,在此不再赘述。
本公开提供了一种计算机可读存储介质,该计算机可读存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机执行上述的弹幕处理方法或图像处理方法。
本公开提供的计算机可读存储介质,适用于上述方法的任一实施例,在此不再赘述。
本技术领域技术人员可以理解,可以用计算机程序指令来实现这些结构图和/或框图和/或流图中的每个框以及这些结构图和/或框图和/或流图中的框的组合。本技术领域技术人员可以理解,可以将这些计算机程序指令提供给通用计算机、专业计算机或其他可编程数据处理方法的处理器来实现,从而通过计算机或其他可编程数据处理方法的处理器来执行本公开公开的结构图和/或框图和/或流图的框或多个框中指定的方案。
其中,本公开装置的各个模块可以集成于一体,也可以分离部署。上述模块可以合并为一个模块,也可以进一步拆分成多个子模块。
本领域技术人员可以理解附图只是一个优选实施例的示意图,附图中的 模块或流程并不一定是实施本公开所必须的。
本领域技术人员可以理解实施例中的装置中的模块可以按照实施例描述进行分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。
上述本公开序号仅仅为了描述,不代表实施例的优劣。
以上公开的仅为本公开的几个具体实施例,但是,本公开并非局限于此,任何本领域的技术人员能思之的变化都应落入本公开的保护范围。

Claims (20)

  1. 一种弹幕处理方法,应用于电子设备上,所述电子设备上创建有主线程以及异步线程,所述方法包括:
    通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;
    通过所述主线程对所述图像进行渲染处理,得到渲染后的图像;以及
    通过显示界面显示所述渲染后的图像。
  2. 如权利要求1所述的方法,其中,所述通过所述异步线程对待处理弹幕进行栅格化处理,得到图像,包括:
    通过所述异步线程对所述待处理弹幕进行栅格化处理,将所述待处理弹幕的多个视图层级绘制成一个图像。
  3. 如权利要求1或2所述的方法,其中,所述通过所述异步线程对所述待处理弹幕进行栅格化处理,得到图像,包括:
    通过所述异步线程选取预设的循环递归方法对所述待处理弹幕进行栅格化处理,得到图像。
  4. 如权利要求1-3中任一项所述的方法,其中,所述异步线程存储于所述电子设备上创建的线程池中,
    所述异步线程的选取,包括如下任一项:
    在所述线程池中选取任一空闲的异步线程;
    在所述线程池中按照预设顺序选取一个空闲的异步线程。
  5. 一种弹幕处理装置,所述装置上创建有主线程以及异步线程,所述装置包括:
    处理单元,用于通过所述异步线程对待处理弹幕进行栅格化处理,得到图像;
    渲染单元,用于通过所述主线程对所述图像进行渲染处理,得到渲染后的图像;以及
    显示单元,用于通过显示界面显示所述渲染后的图像。
  6. 如权利要求5所述的装置,其中,所述处理单元,用于通过所述异步线程对所述待处理弹幕进行栅格化处理,将所述待处理弹幕的多个视图层级绘制成一个图像。
  7. 如权利要求5或6所述的装置,其中,所述处理单元,用于通过所述异步线程选取预设的循环递归方法对所述待处理弹幕进行栅格化处理,得到图像。
  8. 如权利要求5-7中任一项所述的装置,其中,所述异步线程存储于所述装置上创建的线程池中,
    所述处理单元,用于在所述线程池中选取任一空闲的异步线程;或,用于在所述线程池中按照预设顺序选取一个空闲的异步线程。
  9. 一种电子设备,包括:处理器和存储器;
    所述存储器,用于存储操作指令;
    所述处理器,用于通过调用所述操作指令,执行上述权利要求1至权利要求4中任一项所述的弹幕处理方法。
  10. 一种计算机可读存储介质,所述计算机存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机执行上述权利要求1至权利要求4中任一项所述的弹幕处理方法。
  11. 一种图像处理方法,应用于业务设备上,所述业务设备上创建有主线 程,所述方法包括:
    基于选取的异步线程对待加载图像进行绘制,得到绘制后的图像;
    通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;
    通过显示界面显示所述渲染后的图像。
  12. 如权利要求11所述的方法,其中,所述异步线程存储于所述业务设备上创建的线程池中,
    所述选取异步线程,包括如下任一项:
    在所述线程池中选取任一异步线程;
    在所述线程池中按照预设顺序选取一个异步线程。
  13. 如权利要求11或12所述的方法,其中,所述对待加载图像进行绘制的触发处理,包括:
    基于所述待加载图像对应的单元格与所述显示界面的对应关系,对所述待加载图像进行绘制;
    所述待加载图像对应的单元格与显示界面的对应关系,包括如下任一项:
    所述待加载图像对应的单元格处于所述显示界面中;
    所述待加载图像对应的单元格为所述显示界面当前所显示的单元格相邻的预设个数的单元格。
  14. 如权利要求13所述的方法,其中,所述通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像,包括:
    当所述待加载图像对应的单元格移动到所述显示界面中时,通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像。
  15. 一种图像处理装置,所述装置上创建有主线程,所述装置包括:
    绘制单元,用于基于选取的异步线程对待加载图像进行绘制,得到绘制后 的图像;
    渲染单元,用于通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像;
    显示单元,用于通过显示界面显示所述渲染后的图像。
  16. 如权利要求15所述的装置,其中,所述异步线程存储于所述装置上创建的线程池中,
    所述绘制单元,用于在所述线程池中选取任一异步线程;或,用于在所述线程池中按照预设顺序选取一个异步线程。
  17. 如权利要求15或16所述的装置,其中,还包括:
    处理单元,用于基于所述待加载图像对应的单元格与显示界面的对应关系,对所述待加载图像进行绘制;
    所述待加载图像对应的单元格与显示界面的对应关系,包括如下任一项:
    所述待加载图像对应的单元格处于所述显示界面中;
    所述待加载图像对应的单元格为所述显示界面当前所显示的单元格相邻的预设个数的单元格。
  18. 如权利要求17所述的装置,其中,所述渲染单元,用于当所述待加载图像对应的单元格移动到所述显示界面中时,通过所述主线程对所述绘制后的图像进行渲染处理,得到渲染后的图像。
  19. 一种电子设备,其中,包括:处理器和存储器;
    所述存储器,用于存储操作指令;
    所述处理器,用于通过调用所述操作指令,执行上述权利要求11至权利要求14中任一项所述的图像处理方法。
  20. 一种计算机可读存储介质,所述计算机存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机执行上述权利要求11至权利要求14中任一项所述的图像处理方法。
PCT/CN2020/070315 2019-01-31 2020-01-03 弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质 Ceased WO2020156035A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201910099986.5 2019-01-31
CN201910099987.XA CN109788334A (zh) 2019-01-31 2019-01-31 弹幕处理方法、装置、电子设备及计算机可读存储介质
CN201910099987.X 2019-01-31
CN201910099986.5A CN109801210A (zh) 2019-01-31 2019-01-31 图像处理方法、装置、电子设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020156035A1 true WO2020156035A1 (zh) 2020-08-06

Family

ID=71840805

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/070315 Ceased WO2020156035A1 (zh) 2019-01-31 2020-01-03 弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质

Country Status (1)

Country Link
WO (1) WO2020156035A1 (zh)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120321281A1 (en) * 2011-06-17 2012-12-20 Exclaim Mobility, Inc. Systems and Methods for Recording Content within Digital Video
CN105872679A (zh) * 2015-12-31 2016-08-17 乐视网信息技术(北京)股份有限公司 弹幕显示方法和装置
CN106792225A (zh) * 2016-11-09 2017-05-31 武汉斗鱼网络科技有限公司 前端弹幕控制方法及装置
CN107135427A (zh) * 2017-03-28 2017-09-05 武汉斗鱼网络科技有限公司 一种显示弹幕信息的方法和系统
CN107729094A (zh) * 2017-08-29 2018-02-23 口碑(上海)信息技术有限公司 一种用户界面渲染的方法及装置
CN107770563A (zh) * 2017-10-10 2018-03-06 武汉斗鱼网络科技有限公司 一种弹幕消息处理方法及装置
CN109788334A (zh) * 2019-01-31 2019-05-21 北京字节跳动网络技术有限公司 弹幕处理方法、装置、电子设备及计算机可读存储介质
CN109801210A (zh) * 2019-01-31 2019-05-24 北京字节跳动网络技术有限公司 图像处理方法、装置、电子设备及计算机可读存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120321281A1 (en) * 2011-06-17 2012-12-20 Exclaim Mobility, Inc. Systems and Methods for Recording Content within Digital Video
CN105872679A (zh) * 2015-12-31 2016-08-17 乐视网信息技术(北京)股份有限公司 弹幕显示方法和装置
CN106792225A (zh) * 2016-11-09 2017-05-31 武汉斗鱼网络科技有限公司 前端弹幕控制方法及装置
CN107135427A (zh) * 2017-03-28 2017-09-05 武汉斗鱼网络科技有限公司 一种显示弹幕信息的方法和系统
CN107729094A (zh) * 2017-08-29 2018-02-23 口碑(上海)信息技术有限公司 一种用户界面渲染的方法及装置
CN107770563A (zh) * 2017-10-10 2018-03-06 武汉斗鱼网络科技有限公司 一种弹幕消息处理方法及装置
CN109788334A (zh) * 2019-01-31 2019-05-21 北京字节跳动网络技术有限公司 弹幕处理方法、装置、电子设备及计算机可读存储介质
CN109801210A (zh) * 2019-01-31 2019-05-24 北京字节跳动网络技术有限公司 图像处理方法、装置、电子设备及计算机可读存储介质

Similar Documents

Publication Publication Date Title
CN109640188B (zh) 视频预览方法、装置、电子设备及计算机可读存储介质
EP3040804B1 (en) Electronic device for controlling power and method therefor
WO2020133373A1 (zh) 视频处理方法、装置、电子设备及计算机可读存储介质
US9177009B2 (en) Generation based update system
CN102521020A (zh) 用于移动终端的应用屏幕截图方法和装置
CN113761871B (zh) 富文本渲染方法、装置、电子设备以及存储介质
WO2020200173A1 (zh) 文档输入内容的处理方法、装置、电子设备和存储介质
CN105549820A (zh) 一种显示图形用户界面的方法及终端
US20240281491A1 (en) Method, apparatus, device and medium for rendering page components
CN111258736B (zh) 信息处理方法、装置和电子设备
CN112578897B (zh) 电子设备的控制方法、装置、终端和存储介质
US20230276079A1 (en) Live streaming room page jump method and apparatus, live streaming room page return method and apparatus, and electronic device
WO2021073205A1 (zh) 视频处理方法、装置、存储介质及电子设备
US20130152009A1 (en) Browsing Between Mobile and Non-Mobile Web Sites
CN111158820A (zh) 控件点击事件处理方法、装置、电子设备及存储介质
CN110866208B (zh) 一种页面的响应式布局方法、装置及设备
CN117492615A (zh) 信息展示方法、装置、电子设备和存储介质
CN114092362A (zh) 一种全景图片加载方法和装置
US11765108B2 (en) Method, computer device, and non-transitory computer readable recording medium to display grouped image message
WO2020192246A1 (zh) 终端界面的显示控制方法、装置、存储介质及电子设备
US11366613B2 (en) Method and apparatus for writing data
CN112068742A (zh) 控制应用窗口的方法、装置、终端及存储介质
CN112835671A (zh) 应用页面场景切换方法、装置及设备
WO2020156035A1 (zh) 弹幕处理方法、装置、电子设备及计算机可读存储介质、以及图像处理方法、装置、电子设备及计算机可读存储介质
CN109450993B (zh) 用于呈现信息的方法和设备

Legal Events

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

Ref document number: 20749245

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.12.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 20749245

Country of ref document: EP

Kind code of ref document: A1