Data processing method, apparatus, device, storage medium, and program product
Patent Information
- Application Number
- HK42023076405
- Authority / Receiving Office
- HK · HK
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2041-12-01
AI Technical Summary
The subtitle style in existing video playback terminals or applications cannot be adjusted as needed, resulting in a poor user experience.
The client obtains the target subtitle style, sends a glyph data request to the server, the server returns a set of matching glyph data, and the client displays the adjusted subtitles during video playback.
It enables on-demand adjustment of subtitle styles, improves subtitle processing efficiency, reduces font library download size, and lowers download time and data consumption.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to data processing methods, data processing apparatus, computer equipment, computer-readable storage media, and computer program products. Background Technology
[0002] Subtitles (of motion picture) refer to non-visual content such as dialogue in television, film, and stage productions, presented in text form. They also broadly refer to the text added during post-production of film and television works. Subtitles include narration and various texts appearing on the movie screen or video playback interface, such as the film title, cast and crew list, lyrics, dialogue, explanatory text, character introductions, place names, and dates.
[0003] Currently, the style of subtitles displayed on video playback terminals or applications is fixed and cannot be adjusted according to user needs. Summary of the Invention
[0004] This application provides a data processing method, apparatus, computer equipment, and storage medium that can adjust the style of subtitles on demand and has high processing efficiency.
[0005] On one hand, embodiments of this application provide a data processing method, the method comprising:
[0006] Get the target subtitle style;
[0007] Send a glyph data request to the server; wherein the glyph data request is determined based on the target subtitle style and the subtitle file of the target video, the subtitle file includes a set of subtitle characters, and the glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters;
[0008] The system receives the set of glyph data returned by the server and displays the subtitles corresponding to the subtitle file based on the set of glyph data during the playback of the target video.
[0009] On the one hand, embodiments of this application provide another data processing method, the method comprising:
[0010] Receive a glyph data request sent by the client; wherein the glyph data request is determined based on the target subtitle style and the subtitle file of the target video, and the subtitle file includes a set of subtitle characters;
[0011] In response to the glyph data request, obtain a set of glyph data that matches the target subtitle style and the subtitle character set;
[0012] The glyph data set is sent to the client so that the client can display the subtitles corresponding to the subtitle file based on the glyph data set while playing the target video.
[0013] On one hand, embodiments of this application provide a subtitle processing apparatus, the apparatus comprising:
[0014] The processing unit is used to obtain the target subtitle style;
[0015] A transceiver unit is used to send a glyph data request to a server; wherein the glyph data request is determined based on the target subtitle style and the subtitle file of the target video, the subtitle file includes a set of subtitle characters, and the glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters;
[0016] The transceiver unit is also used to receive the set of glyph data returned by the server;
[0017] The display unit is used to display the subtitles corresponding to the subtitle file according to the glyph data set during the playback of the target video.
[0018] In one embodiment, the processing unit is specifically configured to: display a video playback interface, and display one or more subtitle style options in the video playback interface;
[0019] In response to a selection operation for one or more subtitle style options, the subtitle style corresponding to the subtitle style option selected in the selection operation is determined as the target subtitle style.
[0020] In one embodiment, the processing unit is further configured to: display a subtitle style setting control in the video playback interface;
[0021] When a trigger operation is detected for the subtitle style setting control, one or more subtitle style options are displayed in the video playback interface.
[0022] In one embodiment, the processing unit is further configured to: determine a request character set based on the subtitle character set;
[0023] The glyph data request is determined based on the target subtitle style and the requested character set;
[0024] The glyph data request is used to request the server to return a glyph data set that matches the target subtitle style and the requested character set.
[0025] In one embodiment, the processing unit is further configured to: if there are redundant characters in the subtitle character set, perform redundancy removal processing on the subtitle character set;
[0026] The request character set is determined based on the set of subtitle characters after redundancy removal.
[0027] In one embodiment, the processing unit is further configured to: the subtitle character set includes one or more subtitle character segments, and the subtitle file further includes display rules for each subtitle character segment;
[0028] The step of displaying subtitles for the target video based on the glyph data set and the subtitle file includes:
[0029] For the first subtitle string, the glyph data of each character in the first subtitle string is obtained from the glyph data set, and a second subtitle string is generated based on the glyph data of each character; wherein, the style of the characters in the second subtitle string is the target subtitle style, and the first subtitle string is any segment of subtitle characters from the segment or multiple segments of subtitle characters;
[0030] The second subtitle string is displayed in the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
[0031] In one embodiment, the processing unit is further configured to: if a historical glyph data set corresponding to the target subtitle style is recorded, determine a request character set based on the historical glyph data set and the subtitle character set;
[0032] Wherein, the request characters in the request character set are included in the subtitle character set, and the historical glyph data set does not contain the glyph data corresponding to the request characters;
[0033] The step of displaying subtitles of the target video according to the glyph data set and the subtitle file during the playback of the target video includes:
[0034] During the playback of the target video, subtitles for the target video are displayed based on the glyph data set returned by the server, the historical glyph data set, and the subtitle file.
[0035] In one embodiment, the processing unit is further configured to: after obtaining the glyph data set that matches the target subtitle style and the requested character set, update the historical glyph data set according to the glyph data set that matches the target subtitle style and the requested character set.
[0036] On the one hand, embodiments of this application provide another subtitle processing apparatus, the apparatus comprising:
[0037] Transceiver unit: used to receive glyph data requests sent by the client; wherein the glyph data request is determined based on the target subtitle style and the subtitle file of the target video, and the subtitle file includes a set of subtitle characters;
[0038] Processing unit: used to respond to the glyph data request and obtain a set of glyph data that matches the target subtitle style and the subtitle character set;
[0039] The transceiver unit is further configured to send the glyph data set to the client, so that the client can display the subtitles corresponding to the subtitle file according to the glyph data set during the playback of the target video.
[0040] In one embodiment, the processing unit is specifically used to: query the glyph database corresponding to the target subtitle style and obtain the glyph data of each subtitle character in the subtitle character set;
[0041] Generate a set of glyph data that matches the target subtitle style and the set of subtitle characters based on the glyph data of each subtitle character.
[0042] In one embodiment, the processing unit is further configured to: before acquiring a glyph data set that matches the target subtitle style and the subtitle character set, if there are redundant characters in the subtitle character set, perform redundancy removal processing on the subtitle character set to obtain a new subtitle character set, and in response to the glyph data request, acquire a glyph data set that matches the target subtitle style and the new subtitle character set.
[0043] On one hand, embodiments of this application provide a computer device, including: a processor, a communication interface, and a memory, wherein the processor, the communication interface, and the memory are interconnected, wherein the memory stores executable program code, and the processor is used to call the executable program code to implement the data processing method provided in embodiments of this application.
[0044] Accordingly, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to implement the data processing method provided in embodiments of this application.
[0045] Accordingly, this application also provides a computer program product, which includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, they implement the steps of the data processing method provided in this application.
[0046] Accordingly, this application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to implement the data processing method provided in this application.
[0047] In this embodiment, the client obtains the target subtitle style and sends a glyph data request to the server. This glyph data request is determined based on the target subtitle style and the subtitle file of the target video. The subtitle file includes a set of subtitle characters. The glyph data request requests the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters. The server receives the glyph data request, responds, generates the glyph data set, and sends the glyph data set to the client. The client receives the glyph data set and, during playback of the target video, displays the subtitles corresponding to the subtitle file based on the glyph data set. Using this method, the subtitles of the target video can be displayed according to the target subtitle style, enabling on-demand adjustment of the subtitle style. Furthermore, only the glyph data corresponding to the subtitle characters needs to be downloaded. The subtitle characters of the target video are usually only a portion of the characters included in the font library, thus eliminating the need to download all characters in the font library. This solves the problem of long download times and high data consumption caused by large font library downloads, improving the efficiency of subtitle processing. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a Bézier quadratic curve provided in an embodiment of this application;
[0050] Figure 2 This is a schematic diagram of a data processing scheme provided in an embodiment of this application;
[0051] Figure 3 This is a schematic diagram of another data processing scheme provided in an embodiment of this application;
[0052] Figure 4 This is a schematic diagram of a font download guide interface provided in an embodiment of this application;
[0053] Figure 5This is a schematic diagram of another data processing scheme provided in the embodiments of this application;
[0054] Figure 6 This is a schematic diagram illustrating the display of characters in a dot matrix image and characters in a vector image, provided in an embodiment of this application.
[0055] Figure 7 This is a network architecture to which the data processing method provided in the embodiments of this application is applicable;
[0056] Figure 8 This is a schematic diagram of another data processing scheme provided in the embodiments of this application;
[0057] Figure 9 This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0058] Figure 10a This is a schematic diagram of a video playback interface provided in an embodiment of this application;
[0059] Figure 10b This is a schematic diagram of another video playback interface provided in an embodiment of this application;
[0060] Figure 11a This is a schematic diagram of yet another video playback interface provided in an embodiment of this application;
[0061] Figure 11b This is a schematic diagram of yet another video playback interface provided in an embodiment of this application;
[0062] Figure 11c This is a schematic diagram of yet another video playback interface provided in an embodiment of this application;
[0063] Figure 11d This is a schematic diagram of yet another video playback interface provided in an embodiment of this application;
[0064] Figure 11e This is a schematic diagram of yet another video playback interface provided in an embodiment of this application;
[0065] Figure 12 This is a schematic diagram of the characteristics of a vector character format along the x-axis.
[0066] Figure 13 This is a schematic diagram of the characteristics of a vector character format along the y-axis.
[0067] Figure 14 This is a flowchart illustrating another data processing method provided in an embodiment of this application;
[0068] Figure 15 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0069] Figure 16 This is a schematic diagram of another data processing device provided in an embodiment of this application;
[0070] Figure 17 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;
[0071] Figure 18 This is a schematic diagram of the structure of another computer device provided in an embodiment of this application. Detailed Implementation
[0072] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0073] To better understand the embodiments of this application, some terms involved in the embodiments of this application will be introduced below:
[0074] Character data: This is the data used to render text, commonly a description of vector graphics, such as drawing a horizontal line from point A to point B, or a Bézier curve from point C to point D, with parameters like X, Y, and Z. It can be understood that each glyph is described by a series of points on a grid. While two points on the curve are sufficient to describe a straight line, adding a third point outside the curve between two points on the curve can describe a parabola. In this case, each point on the curve represents the endpoint of the curve, and the point outside the curve is a control point. Changing the position of any of these three points will change the shape of the defined curve. Figure 1 This application provides a Bézier quadratic curve diagram, the definition of which is as follows: Figure 1 As shown: Given three points p0, p1, and p2, they define a curve from point p0 to point p2, where p1 is a point deviating from the curve. The control point p1 is located at the intersection of the tangents to the curve at points p0 and p2. Therefore, p0 and p1 are tangent to the curve at point p0. Similarly, p2 and p1 are tangent to the curve at point p2. The curve specified by these three points is defined by a parametric equation. For t in the range 0 to 1, the position of p(t) is shown below:
[0075] p(t)=(1-t)^2p0+2t(1-t)p1+t^2p2
[0076] A font library is a collection of glyph data containing a specific character set. It can be divided into bitmap fonts and vector fonts. Bitmap fonts divide each Chinese character into 16×16 or 24×24 dots, using the solidity and void of each dot to represent the character's outline. They are commonly used as display fonts. The biggest drawback of bitmap fonts is that they cannot be enlarged; once enlarged, jagged edges become visible. Vector fonts, on the other hand, break down each character's strokes into various straight lines and curves, recording the parameters of these lines and curves. During display, these lines are drawn according to the specific size, thus restoring the original character. Its advantage is that it can be scaled up or down arbitrarily without distortion, and the required storage is independent of the character size. There are many types of vector fonts, differing in the different mathematical models they use to describe the lines that make up the characters. As mentioned above, glyph data is mostly stored in vector fonts, such as the common TrueType Font (TTF) format.
[0077] To enable on-demand adjustment of subtitle styles, this application provides the following methods in its embodiments:
[0078] Method 1: Figure 2 This is a schematic diagram of a data processing scheme provided in an embodiment of this application, such as... Figure 2 As shown, after the system (Android / iOS, etc.) boots up, it performs a self-check on the device's existing font library, or a self-check on the system font library when the app starts, to determine if a new font library needs to be configured. If a new font library needs to be configured, this new font library can be one required for app startup, in which case a new font library file is downloaded; or it can be a font library already packaged during app installation, configured into the system or a location accessible to the app. If a new font library does not need to be configured, the existing font library is configured directly into the system or a location accessible to the app. For example, installing fonts in the Android system: Pre-installation of fonts in the Android system needs to be done during the Android system compilation phase. After system startup, these pre-installed fonts are provided to the app. If the app needs to use fonts other than the system fonts, it needs to go through its own font download and parsing logic.
[0079] Method 2: Figure 3 This is a schematic diagram of another data processing scheme provided in the embodiments of this application, such as... Figure 3As shown, when playing a video, the subtitle file is first parsed to check the required font library and determine whether the current system has the required font library file. If the required font library file is available, the system interface (Android / iOS) is directly called to display the subtitle file; if the required font library file is not available, the user is guided to download the font library file or download the required font library file from a specified server. After the download and configuration are completed, the subtitle file is displayed through the device's system interface.
[0080] This includes guiding users to download font files, such as... Figure 4 As shown, the video playback interface displays a message stating that "Application A" requires the download of the font "Microsoft YaHei," which is 3.7MB in size. Users can choose to "Skip" or "Download" to proceed to the next step.
[0081] Method 3: Figure 5 This is a schematic diagram of another data processing scheme provided in the embodiments of this application, such as... Figure 5 As shown, when playing a video, the subtitle file is first parsed to check the required font library and determine whether the current system has the required font library file. If the required font library file is available, the system interface is directly called to display the subtitles; if the required font library file is not available, the resources for the current subtitles are requested from the server. These resources can be packaged font files or images of the required characters, etc. The resources are downloaded to the local machine and the subtitles are displayed by calling the system interface.
[0082] Among them, image-type characters include two forms: raster images and vector images, such as... Figure 6 As shown, Figure 6 The characters on the left are from a raster image, and the characters on the right are from a vector image. Adjusting the characters in the raster image, such as scaling, will result in distortion, while adjusting the characters in the vector image will not.
[0083] The problems with the above methods are as follows:
[0084] Method 1 requires guiding users to install the necessary fonts in the operating system, which is too complicated and results in a poor user experience.
[0085] Method 2 involves temporary downloading, which delays the viewing time of the main feature and involves a large download volume.
[0086] Method 3 involves high server computational pressure and large download volume, making it impossible to adjust font size, color, or display effects such as hollow text or slant in real time.
[0087] Based on this, the embodiments of this application provide a data processing method that can be applied to Figure 7 The network architecture shown. Figure 7 The server 70 shown can be a server with data (such as glyph data and text data) processing capabilities. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Figure 7 The client 71 shown can be a mobile phone, tablet computer, laptop computer, desktop computer, vehicle terminal, etc., but is not limited to these.
[0088] See Figure 8 , Figure 8 This is a schematic diagram of another data processing scheme provided in the embodiments of this application, combined with Figure 7 The network architecture shown is Figure 8 The specific operations of the data processing scheme shown are as follows:
[0089] Client 71 parses the subtitles to obtain the target subtitle style. The subtitle style may include one or more of the following: subtitle font, subtitle size, subtitle character slant, subtitle character color, and subtitle character effects. Client 71 determines a glyph data request based on the target subtitle style and the target video's subtitle file. This subtitle file includes a set of subtitle characters, and the glyph data request is used to request the server to return a glyph data set that matches the target subtitle style and subtitle character set. Client 71 sends the glyph data request to server 70. Server 70 receives the glyph data request, generates a glyph data set based on the target subtitle style and subtitle character set, and returns the glyph data set to the client. Client 71 downloads the glyph data set returned by server 70 to its local machine. During playback of the target video, it displays the subtitles corresponding to the target video's subtitle file based on this glyph data set. Using the above method, the subtitles of the target video can be displayed according to the target subtitle style, realizing the adjustment of the subtitle style as needed. In addition, only the glyph data corresponding to the subtitle characters needs to be downloaded. The subtitle characters of the target video are usually only a part of the characters included in the font library. This eliminates the need to download all the characters in the font library, solving the problem of long download time and high data consumption caused by the large amount of font library download, and improving the efficiency of subtitle processing.
[0090] In feasible embodiments, the data processing method provided in this application can be implemented based on cloud technology. Specifically, it may involve one or more of cloud technologies, such as cloud storage, cloud database, and big data. For example, it may retrieve the data (e.g., glyph data) required to execute the data processing method from a cloud database.
[0091] The above provides a brief overview of the data processing method provided in the embodiments of this application. The specific implementation of this data processing method will be described in detail below.
[0092] Please see Figure 9 , Figure 9 This is a flowchart illustrating a data processing method provided in an embodiment of this application. The data processing method described in this embodiment can be applied to... Figure 7 In the network architecture shown, the data processing method includes, but is not limited to, the following steps:
[0093] S901. The client obtains the target subtitle style. The subtitle style may include one or more of the following: subtitle font, subtitle size, subtitle character slant, subtitle character color, and subtitle character effects.
[0094] In this embodiment, the client can display a video playback interface, which shows one or more subtitle style options. These options can correspond to a single subtitle style (e.g., subtitle font) or multiple subtitle styles (e.g., subtitle font, subtitle size, etc.). In response to a selection operation for one or more subtitle style options, the subtitle style corresponding to the selected option is determined as the target subtitle style. For example, taking a subtitle font as the subtitle style... Figure 10a As shown, the subtitle font options displayed in the video playback interface include "KaiTi", "SongTi", "FangSong", and "HeiTi". When the "KaiTi" option is selected, it will be set as the target subtitle font, i.e., the target subtitle style. For example, subtitle styles include subtitle font, subtitle size, and subtitle character slant, such as... Figure 10b As shown, the subtitle style options displayed in the video playback interface include subtitle font options, subtitle font size options, and subtitle character slant options. The target subtitle style is determined by the selection operation, such as... Figure 10b The final target subtitle styles shown include: "SimSun (the selected subtitle font)", "Small 4 (the selected subtitle font size)", and "0° (the selected subtitle character slant)".
[0095] In one embodiment, the client may display a subtitle style setting control on the video playback interface; upon detecting a trigger operation on the subtitle style setting control, one or more subtitle style options may be displayed on the video playback interface. The trigger operation may occur before or during the playback of the target video on the video playback interface.
[0096] Optionally, the client may display the subtitle style setting control in the video playback interface before the target video is played, or it may display the subtitle style setting control in the video playback interface during the playback of the target video.
[0097] In another embodiment, one or more subtitle style options may be displayed on the video playback interface when a target gesture operation is detected; the target gesture operation may be, for example, a gesture operation of "sliding a finger to the upper right corner". Alternatively, one or more subtitle style options may be displayed on the video playback interface when a first voice command is detected; the first voice command may be, for example, a voice command for "setting subtitle style"; furthermore, a second voice command may be input to determine the target subtitle style; the second voice command may be, for example, a voice command for "setting the subtitle style to KaiTi"; the second voice command may also be, for example, "setting the subtitle style to KaiTi, size 4, and tilted 5°". The above-mentioned requirement for inputting two voice commands is because the user may not know in advance which types of subtitle styles are available, and the above-mentioned first voice command can display the available subtitle style types to the user.
[0098] In other feasible embodiments, the style category contained in the third voice command can be determined as the target subtitle style when the third voice command is detected. For example, the third voice command could be a voice command to "set the subtitle style to KaiTi", in which case the style category "KaiTi" contained in the third voice command is directly determined as the target subtitle style. As another example, the third voice command could be "set the subtitle style to KaiTi, 12pt, and tilted 5°", in which case the subtitle style category "KaiTi, 12pt, 5°" contained in the third voice command is directly determined as the target subtitle style.
[0099] In one embodiment, the subtitle style includes subtitle font, subtitle font size, subtitle character slant, subtitle character color, and subtitle character effects (such as hollow characters). The client can display a subtitle style setting control in the video playback interface; when a trigger operation on the subtitle style setting control is detected, a subtitle style option area is displayed in the video playback interface, which includes font options, font size options, and slant options, etc. For example, as... Figure 11aAs shown, the video playback interface includes a video playback area and a subtitle style setting control located in the lower right corner of the video playback area. During video playback, if the client detects user interaction with the subtitle style setting control, an options area is displayed on the video playback interface. This options area includes font options, font size options, and tilt options. When a trigger action is detected on the font option, such as... Figure 11b As shown, multiple font options are displayed, such as: SimSun, KaiTi, HeiTi, FangSong, etc., for the user to choose from; when a trigger operation is detected for this font size option, such as... Figure 11c As shown, multiple font size options are displayed, such as: 12pt, 12pt, 12pt, 12pt, 12pt, etc., for the user to select; when a trigger operation targeting this tilt option is detected, such as... Figure 11d As shown, multiple tilt options are displayed, such as 0°, 5°, 10°, etc., for the user to select. The font, size, and style are not related and can be combined arbitrarily. If the user needs to make more settings for the subtitle style, they can trigger the ellipsis control on the far right of the options area. When a trigger operation on this ellipsis control is detected, such as... Figure 11e As shown, the options for displaying subtitle styles include: Chinese font options, Western font options, font size options, font shape options, character color options, character slant options, character effect options, etc. At the same time, you can set the above options as default values, and the videos played by the client will follow these default values. You can also directly click the OK or Cancel button to complete this operation.
[0100] In a feasible implementation, the client displays a subtitle style setting control in the video playback interface; when no trigger operation is detected for the subtitle style setting control, the client defaults to the target subtitle style. This default target subtitle style can be a client-side default style; a style inherent in the target video subtitle file; or a style pre-set by the user on the client side.
[0101] For ease of understanding, the method for selecting the above subtitle style is similar to selecting a font in office software. For example, in Word, fonts such as KaiTi, HeiTi, and FangSong are used.
[0102] The format of the subtitle file can include both graphic data format and text data format.
[0103] Graphical data format refers to characters in a subtitle file that are in image format, while text data format refers to characters in a subtitle file that are in text format.
[0104] For example, taking the text format Subripper (SRT) as an example, its extension is .srt, and it consists of: one line of subtitle number, one line of time code, and one line of subtitle data. For example, the time code corresponding to subtitle number "1" is "00:00:0, 500 to 00:00:3, 700", and the corresponding subtitle data is "Today's theme is everyone's best skill, 'dancing'"; the time code corresponding to subtitle number "2" is "00:00:4, 000 to 00:00:7, 300", and the corresponding subtitle data is "Great!"; the time code corresponding to subtitle number "3" is "00:00:8, 600 to 00:00:12, 000", and the corresponding subtitle data is "I think everyone practices dancing every day"; the time code corresponding to subtitle number "4" is "00:00:0, 500 to 00:00:3, 7 ... The corresponding time code is "00:00:12, 700 to 00:00:13, 500", and the corresponding subtitle data is "Teng Gu is"; the time code corresponding to subtitle number "5" is "00:00:13, 700 to 00:00:16, 500", and the corresponding subtitle data is "Do you remember what the first song you danced since joining Guinness was?" The above means that the first subtitle displays the data that today's theme is "dancing", which is everyone's best skill, within 0.5 seconds to 3.7 seconds. Similarly, the display rules for the second to fifth subtitles are the same.
[0105] In one embodiment, to obtain the subtitle file of the target video, first determine the address information of the storage location of the target video-related data (including subtitle file, video image file, and audio file), and obtain the subtitle file of the target video based on the address information. The address information can be a Uniform Resource Locator (URL), such as: http: / / 127.0.0.1:8080, or a local disk storage location, such as: test.mp4 / sdcard / test.flv.
[0106] S902, The client sends a glyph data request to the server.
[0107] In this embodiment of the application, the client sends a glyph data request to the server, which is determined based on the target subtitle style and the subtitle file of the target video. The subtitle file includes a set of subtitle characters. The glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters.
[0108] S903, The server receives a glyph data request sent by the client.
[0109] In this embodiment, after receiving the character data request sent by the client, the server determines whether there are redundant characters in the subtitle character set. If there are redundant characters in the subtitle character set, the server performs redundancy removal processing on the subtitle character set and determines a new subtitle character set based on the redundancy removal processing. If there are no redundant characters in the subtitle character set, step S904 is executed.
[0110] S904. The server responds to the glyph data request and obtains a glyph data set that matches the target subtitle style and subtitle character set.
[0111] In this embodiment, the server responds to a glyph data request by querying a glyph database corresponding to the target subtitle style, and obtains the glyph data of each subtitle character in the subtitle character set based on the glyph database. It then generates a glyph data set (hereinafter referred to as the matching glyph data set) that matches the target subtitle style and the subtitle character set based on the glyph data of each subtitle character. Alternatively, the server responds to the glyph data request by querying a glyph database corresponding to the target subtitle font style, and obtains the glyph data of each subtitle character in the new subtitle character set based on the glyph database. It then generates a glyph data set that matches the target subtitle font style and the new subtitle character set based on the glyph data of each subtitle character (this glyph data set matches the aforementioned matching glyph data set).
[0112] In one embodiment, the glyph database includes standard glyph data for characters corresponding to the target font. Characters for the target font can be generated based on this standard glyph data, and these characters satisfy one or more of the following conditions: font size is a preset font size, slant is a preset angle, color is a preset color, character effect is a preset character effect, etc. For example, based on the standard glyph data, standard KaiTi characters with a font size of 12pt, slant of 0°, color of black, and hollow character effect can be generated. The target font is consistent with the subtitle fonts included in the target subtitle style.
[0113] When the target subtitle style includes a subtitle font, the server retrieves the standard glyph data for each subtitle character in the subtitle character set corresponding to that subtitle font from the glyph database, thus obtaining a glyph data set that matches the target subtitle style and the subtitle character set. When the target subtitle style includes a reference subtitle style in addition to a subtitle font, and this reference subtitle style includes one or more of the following: subtitle font size, subtitle character slant, subtitle character color, and subtitle character effects, the server retrieves the standard glyph data for each subtitle character in the subtitle character set corresponding to that subtitle font from the glyph database. Then, based on the standard glyph data obtained from the reference subtitle style, the server adjusts the data to obtain a glyph data set that matches the target subtitle style and the subtitle character set. For example, the glyph data in this matching glyph data set can generate standard KaiTi characters with a font size of 4, a slant of 5°, a red color, and a hollow character effect. The target font is consistent with the subtitle font included in the target subtitle style. The glyph data in this matching glyph dataset is vector data. Therefore, both Android and iOS systems can use this vector data set to generate the subtitles needed for the subtitle file. The characteristic of vector data is that all characters are stored using mathematical formulas and different point data. The processing flow is the same across different systems, and the size can be flexibly changed. For example, a capital 'O' requires vector control of seven features. Figure 12 This is a schematic diagram of the characteristics of a vector character format along the x-axis, such as... Figure 12 As shown, the control features include the space on the left side of the character 1, the round stem 2, the forward width 3, and the body width 4; Figure 13 This is a schematic diagram of the characteristics of a vector character format along the y-axis, such as... Figure 13 As shown, the controlled features include cap height overlap 5, baseline overlap 6, and horizontal stem 7. The character format of the vector data is controlled by controlling these 7 features.
[0114] In one embodiment, the glyph data in the character library is sorted according to the order of the corresponding characters in the dictionary. For example, for Chinese, the characters in the dictionary can be arranged according to their phonetic order, where the first letter of the syllable is capitalized, i.e., according to the order of Pinyin. For English, the words in the dictionary are arranged in alphabetical order. After obtaining the requested data character set, the requested characters in the requested data character set can be sorted according to their order in the dictionary, and the corresponding sorted matching glyph data set can be obtained based on the sorted requested character set. In this way, when querying the character library, the query can be performed sequentially, which helps to improve query efficiency and thus improve the efficiency of obtaining glyph data.
[0115] S905, The server sends a set of glyph data to the client.
[0116] In one embodiment, the server can compress the glyph data set before sending it to the client, which facilitates the rapid transmission of glyph data.
[0117] S906. The client receives the returned glyph data set and displays the subtitles corresponding to the subtitle file based on the glyph data set during the playback of the target video.
[0118] In one embodiment, the client receives a returned set of matching glyph data, which is a compressed file that can be downloaded more quickly. The compressed file containing the matching glyph data is not stored in the system storage, thus improving system efficiency.
[0119] In one embodiment, the matching glyph data set returned by the server includes glyph data corresponding to each character in the subtitle character set. The subtitle character set includes one or more subtitle character segments, and the subtitle file also includes display rules for each subtitle character segment. These display rules include character display styles such as display time, display position, display size, display color, bold display, and highlight display. Specifically, the client, for a first subtitle string, retrieves the glyph data of each character in the first subtitle string from the matching glyph data set, and generates a second subtitle string based on the glyph data of each character. The style of the characters in the second subtitle string is the target subtitle style, and the first subtitle string is any segment of subtitle characters from one or more subtitle character segments. The second subtitle string is displayed on the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
[0120] In one embodiment, during the playback of the target video, the client parses the characters that need to be displayed, treating each character as an index, and searches within the matching glyph data set to retrieve and display the corresponding glyph data. The display method can be a system call to the drawing interface in the client. For example, in Android, drawing and display can be performed using the `onDraw` method of the `View` interface, as shown in the following drawing procedure:
[0121] protected void onDraw(Canvas canvas){
[0122] canvas.drawLine(0,0,0,0,new Paint()); / / Draw a straight line
[0123] canvas.drawArc(); / / Draw an arc
[0124] canvas.drawOval(); / / Draw an ellipse
[0125] …}
[0126] Using the data processing method provided in this application embodiment, the client obtains a target subtitle style and sends a glyph data request to the server. This glyph data request is determined based on the target subtitle style and the subtitle file of the target video. The subtitle file includes a set of subtitle characters, and the glyph data request requests the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters. The server responds to the glyph data request, generates a set of glyph data that matches the target subtitle style and the set of subtitle characters, and sends the matching glyph data set to the client. The client receives the matching glyph data set and, during playback of the target video, displays the subtitles corresponding to the subtitle file based on the matching glyph data set. Using this method, only the glyph data corresponding to the subtitle characters in the font library corresponding to the target subtitle style needs to be downloaded, eliminating the need to download the entire font library. This solves the problem of long download times and high data consumption caused by large font library download volumes, thus improving the efficiency of subtitle processing. Meanwhile, by preprocessing the text required for subtitles and compiling a set of necessary files, the system retrieves character data from the server as needed and renders it onto the screen, enabling on-demand processing and allowing for adjustments to the subtitle style at any time, thus enhancing the user experience.
[0127] Please see Figure 14 , Figure 14 This is a flowchart illustrating another data processing method provided in an embodiment of this application. The data processing method includes, but is not limited to, the following steps:
[0128] S1401. The client obtains the target subtitle style and the subtitle file of the target video. The subtitle style may include one or more of the following: subtitle font, subtitle font size, subtitle character slant, subtitle character color, and subtitle character effects. The subtitle file includes the subtitle character set of the target video.
[0129] For a detailed explanation of step S1401, please refer to the above. Figure 9 The details of step S901 in the data processing method shown will not be elaborated here.
[0130] S1402. The client determines the requested character set based on the subtitle character set included in the subtitle file, and determines the glyph data request based on the target subtitle style and the requested character set.
[0131] In an embodiment of the present application, after the client obtains the target subtitle style and the subtitle file of the target video, it obtains the subtitle character set of the target video from the subtitle file, and then determines the request character set according to the subtitle character set. After obtaining the request character set, it determines a glyph data request according to the target subtitle style and the request character set, where the glyph data request is used to request the server to return a glyph data set that matches the target subtitle style and the request character set.
[0132] In a feasible embodiment, the client determining the request character set according to the subtitle character set may include the following two methods:
[0133] Method 1: After the client obtains the subtitle character set, it determines whether there are redundant characters in the subtitle character set. If there are no redundant characters in the subtitle character set, it uses the subtitle character set as the request character set. If there are redundant characters in the subtitle character set, it performs redundancy removal processing on the subtitle character set; where the redundancy removal processing includes removing duplicate characters in the subtitle character set. For example, a string in the subtitle character set is "Please go out", and another string is "Please go out quickly", where characters such as "Please", "go", "out" are repeated, and these repeated characters are removed. Further, the client can directly determine the subtitle character set after redundancy removal processing as the request character set.
[0134] Method 2: In another embodiment, the client first queries whether it records the historical glyph data set corresponding to the target subtitle style. If it records the historical glyph data set corresponding to the target subtitle style, it determines the target character according to the historical glyph data set and the subtitle character set. The target character is included in the subtitle character set, and the historical glyph data set includes the glyph data corresponding to the target character; it deletes the target character from the subtitle character set to obtain a new subtitle character set, and determines the request character set according to the new subtitle character set. Where when the request character set is a non-empty set, the request characters in the request character set are included in the subtitle character set, and the historical glyph data set does not include the glyph data corresponding to the request characters.
[0135] For the request character set determined by the above two methods, according to the request character set and the target subtitle style, the glyph data request is determined. The glyph data request is used to request the server to return a glyph data set that matches the target subtitle style and the request character set. The glyph data in the glyph data set is included in the subtitle character set, reducing the amount of glyph data required for the client to obtain from the server and improving the efficiency of data processing.
[0136] In one embodiment, before determining the target character based on the historical glyph data set and the subtitle character set, the subtitle character set can be deredundanted first, and then the new subtitle character set can be directly used to determine the request character set.
[0137] In another embodiment, if the subtitle character set is not deredundant before determining the target character based on the historical glyph data set and the subtitle character set, then the new subtitle character set is deredundant, and the new subtitle character set after deredundant processing is determined as the request character set.
[0138] For example, if a subtitle character set contains 5000 characters, of which 3000 characters correspond to "KaiTi" (the target subtitle style) glyph data, which is included in the historical glyph data set corresponding to "KaiTi" characters, the client can delete these 3000 characters from the subtitle character set to obtain a new subtitle character set. If the new subtitle character set contains redundant characters, it undergoes redundancy removal to obtain the requested character set; otherwise, it is used as the requested character set. In this case, at most 2000 "KaiTi" glyph data characters need to be retrieved from the server, which effectively reduces the glyph data retrieval time and is more efficient than retrieving all 2000 "KaiTi" glyph data characters from the server.
[0139] For example, when the historical glyph data set corresponding to the target subtitle style contains a sufficiently large number of glyph data, the glyph data corresponding to all characters in the subtitle character set may be contained within this historical glyph data set. In this case, if the client determines that the requested character set is empty, it does not need to obtain glyph data from the server and can directly obtain it from the historical glyph data set. This reduces the process of obtaining glyph data from the server, resulting in higher efficiency.
[0140] S1403. The client sends a glyph data request to the server, carrying the target subtitle style and the requested character set.
[0141] S1404. The server receives a glyph data request sent by the client.
[0142] S1405. The server responds to the glyph data request and obtains a glyph data set (hereinafter referred to as the matching glyph data set) that matches the target subtitle style and the requested character set. In this embodiment, the server responds to the glyph data request, queries the glyph database corresponding to the target subtitle style, obtains the glyph data of each requested character in the requested character set based on the glyph database, and generates a glyph data set that matches the target subtitle style and the requested character set based on the glyph data of each requested character.
[0143] In one embodiment, the glyph database includes standard glyph data for characters corresponding to the target font. Characters for the target font can be generated based on this standard glyph data, and these characters satisfy one or more of the following conditions: font size is a preset font size, slant is a preset angle, color is a preset color, character effect is a preset character effect, etc. For example, based on the standard glyph data, standard KaiTi characters with a font size of 12pt, slant of 0°, color of black, and hollow character effect can be generated. The target font is consistent with the subtitle fonts included in the target subtitle style.
[0144] When the target subtitle style includes a subtitle font, the server retrieves the standard glyph data corresponding to the subtitle font for each requested character in the requested character set from the glyph database, thereby obtaining a glyph data set that matches the target subtitle style and the requested character set. When the target subtitle style includes a reference subtitle style in addition to a subtitle font, and the reference subtitle style includes one or more of the following: subtitle font size, subtitle character slant, subtitle character color, and subtitle character effects, the server retrieves the standard glyph data corresponding to the subtitle font for each requested character in the requested character set from the glyph database, and then adjusts the standard glyph data corresponding to the subtitle font for each subtitle character obtained from the reference subtitle style, thereby obtaining a glyph data set that matches the target subtitle style and the requested character set.
[0145] S1406, The server sends a set of glyph data to the client.
[0146] In one embodiment, the server can compress the glyph data set before sending it to the client, which facilitates the rapid transmission of glyph data.
[0147] S1407. The client receives the returned glyph data set and displays the subtitles corresponding to the subtitle file based on the glyph data set during the playback of the target video.
[0148] In one embodiment, when the request character set determined in step S1402 is determined using the method described above, the matching glyph data set returned by the server includes the glyph data corresponding to each character in the subtitle character set. The subtitle character set includes one or more subtitle character segments, and the subtitle file also includes display rules for each subtitle character segment. These display rules include character display styles such as display time, display position, display size, display color, bold display, and highlight display. Specifically, for the first subtitle string, the client obtains the glyph data of each character in the first subtitle string from the matching glyph data set, and generates a second subtitle string based on the glyph data of each character. The font style of the characters in the second subtitle string is the target subtitle font style, and the first subtitle string is any segment of subtitle characters from one or more subtitle character segments. The second subtitle string is displayed in the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
[0149] In another embodiment, when the request character set determined in step S1402 is determined using the method described above, and the target character (the target character is included in the subtitle character set, and the historical glyph data set contains the glyph data corresponding to the target character) exists, the matching glyph data set returned by the server only includes the glyph data corresponding to some characters in the subtitle character set. In this case, for each target character in the subtitle character set, it is necessary to obtain the glyph data of the target subtitle style corresponding to each target character from the historical glyph data set. The subtitle character set includes one or more subtitle character segments, and the subtitle file also includes display rules for each subtitle character segment. These display rules include character display styles such as display time, display position, display size, display color, bold display, and highlight display. Specifically, the client retrieves the glyph data of each character in the first subtitle string from the matching glyph data set and the historical glyph data set returned by the server, and generates a second subtitle string based on the glyph data of each character. The style of the characters in the second subtitle string is the target subtitle style, and the first subtitle string is any segment of subtitle characters from one or more subtitle character segments. The second subtitle string is displayed in the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
[0150] In a feasible implementation, the glyph data of each target character corresponding to the target subtitle style can be obtained from the historical glyph data set to obtain the glyph data set of the target characters. For the first subtitle string, the client can obtain the glyph data of each character in the first subtitle string from the matching glyph data set and the glyph data set of the target characters returned by the server. When the first subtitle string includes a target character, the glyph data of that target character can be directly obtained from the glyph data set of the target characters, which is more efficient than obtaining the glyph data of the target character from the historical glyph data set.
[0151] In one embodiment, during the playback of the target video, the client parses the characters that need to be displayed, treats each character as an index, and searches in the matching glyph data set and the historical glyph data set to retrieve and display the corresponding glyph data.
[0152] In another embodiment, during the playback of the target video, the client parses the characters that need to be displayed, treats each character as an index, and searches in the matching glyph data set and the glyph data set of the target character to retrieve and display the corresponding glyph data.
[0153] In one embodiment, after obtaining the set of glyph data that matches the target subtitle style and the requested character set, the client updates the set if a historical glyph data set corresponding to the target subtitle style exists. If no historical glyph data set exists, the matching glyph data set is saved. This way, when subsequently obtaining glyph data corresponding to the target subtitle style, the client can directly retrieve the overlapping portion from the historical glyph data set corresponding to the target subtitle style. Furthermore, when downloading the glyph data corresponding to the target subtitle style, the client will download less data, thereby improving data processing efficiency and user experience.
[0154] For details regarding the subtitle display in step S1407, please refer to the above. Figure 9 The relevant content displayed in the subtitles of step S906 in the data processing method shown will not be described in detail here.
[0155] Using the data processing method provided in this application embodiment, on the one hand, the client requests a set of characters for the subtitle character set after redundancy removal and a glyph data request determined by the target subtitle style. This glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the requested character set. The glyph data in this set is unique, reducing the amount of glyph data the client needs to obtain from the server and improving data processing efficiency. On the other hand, based on the new subtitle character set (the target character is determined based on the historical glyph data set and the subtitle character set, the target character is included in the subtitle character set, and the historical glyph data set contains the glyph data corresponding to the target character; the target character is deleted from the subtitle character set to obtain a new subtitle character set), the server returns a set of glyph data containing less required glyph data, further reducing the amount of required glyph data the client needs to obtain from the server and improving data processing efficiency.
[0156] Please see Figure 15 , Figure 15 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. The data processing apparatus described in this embodiment corresponds to the client mentioned above, and the apparatus includes:
[0157] Processing unit 1502 is used to obtain the target subtitle style;
[0158] The transceiver unit 1501 is used to send a glyph data request to the server; wherein the glyph data request is determined based on the target subtitle style and the subtitle file of the target video, the subtitle file includes a set of subtitle characters, and the glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters;
[0159] The transceiver unit 1501 is also used to receive the set of glyph data returned by the server;
[0160] Display unit 1503 is used to display subtitles corresponding to the subtitle file according to the glyph data set during the playback of the target video.
[0161] In one embodiment, when the processing unit 1502 acquires the target subtitle style, it is specifically used to: display a video playback interface, and display one or more subtitle style options in the video playback interface;
[0162] When a selection operation is detected for one or more subtitle style options, the subtitle style corresponding to the subtitle style option selected in the selection operation is determined as the target subtitle style.
[0163] In one embodiment, when the processing unit 1502 displays one or more subtitle style options in the video playback interface, it is specifically used to: display a subtitle style setting control in the video playback interface;
[0164] In response to a trigger operation on the subtitle style setting control, one or more subtitle style options are displayed in the video playback interface.
[0165] In one embodiment, the processing unit 1502 is further configured to: determine a request character set based on the subtitle character set;
[0166] The glyph data request is determined based on the target subtitle style and the requested character set;
[0167] The glyph data request is used to request the server to return a glyph data set that matches the target subtitle style and the requested character set.
[0168] In one embodiment, when the processing unit 1502 determines the request character set based on the subtitle character set, it is specifically used to: if there are redundant characters in the subtitle character set, then perform redundancy removal processing on the subtitle character set;
[0169] The request character set is determined based on the set of subtitle characters after redundancy removal.
[0170] In one embodiment, the subtitle character set includes one or more subtitle character segments, and the subtitle file also includes display rules for each subtitle character segment. When the processing unit 1502 displays the subtitle corresponding to the subtitle file according to the character data set, it is specifically used for:
[0171] For the first subtitle string, the glyph data of each character in the first subtitle string is obtained from the glyph data set, and a second subtitle string is generated based on the glyph data of each character; wherein, the style of the characters in the second subtitle string is the target subtitle style, and the first subtitle string is any segment of subtitle characters from the segment or multiple segments of subtitle characters;
[0172] The second subtitle string is displayed in the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
[0173] In one embodiment, when the processing unit 1502 determines the request character set based on the subtitle character set, it is further configured to: if a historical glyph data set corresponding to the target subtitle style is recorded, determine the request character set based on the historical glyph data set and the subtitle character set;
[0174] Wherein, the request characters in the request character set are included in the subtitle character set, and the historical glyph data set does not contain the glyph data corresponding to the request characters;
[0175] The step of displaying subtitles corresponding to the subtitle file based on the glyph data set during the playback of the target video includes:
[0176] During the playback of the target video, the subtitles corresponding to the subtitle file are displayed based on the set of glyph data returned by the server and the set of historical glyph data.
[0177] In one embodiment, the processing unit 1502 is further configured to: after obtaining the glyph data set that matches the target subtitle style and the requested character set, update the historical glyph data set according to the glyph data set that matches the target subtitle style and the requested character set.
[0178] It is understood that the functions of each functional unit of the data processing device provided in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the relevant description of the client in the above method embodiments, which will not be repeated here.
[0179] The data processing apparatus provided in this application embodiment, during or before the playback of a target video, responds to the triggering operation of a subtitle style control, displays one or more subtitle style options in the video playback interface, obtains the target subtitle style based on the subtitle style option, and sends a glyph data request to the server. The glyph data request is determined based on the target subtitle style and the subtitle file of the target video. The subtitle file includes a set of subtitle characters. The glyph data request requests the server to return a set of glyph data that matches the target subtitle style and the subtitle character set. The server responds to the glyph data request, generates a set of glyph data that matches the target subtitle style and the subtitle character set, and returns the glyph data set to the client. The client displays the subtitles corresponding to the subtitle file based on the glyph data set. Therefore, during or before video playback, the subtitle style options can be flexibly adjusted according to the user's intention, and the subtitles can be rendered, improving the user experience.
[0180] Please see Figure 16 , Figure 16 This is a schematic diagram of another data processing apparatus provided in an embodiment of this application. The data processing apparatus described in this embodiment corresponds to the server mentioned above, and the apparatus includes:
[0181] Transceiver unit 1601: used to receive character data requests sent by the client; wherein the character data request is determined based on the target subtitle style and the subtitle file of the target video, and the subtitle file includes a set of subtitle characters;
[0182] Processing unit 1602: Used to respond to the glyph data request and obtain a glyph data set that matches the target subtitle style and the subtitle character set;
[0183] The transceiver unit 1601 is further configured to send the glyph data set to the client, so that the client can display the subtitles corresponding to the subtitle file according to the glyph data set during the playback of the target video.
[0184] In one embodiment, the processing unit 1602 is specifically used to: query the glyph database corresponding to the target subtitle style and obtain the glyph data of each subtitle character in the subtitle character set;
[0185] Generate a set of glyph data that matches the target subtitle style and the set of subtitle characters based on the glyph data of each subtitle character.
[0186] In one embodiment, the processing unit 1602 is further configured to:
[0187] Before obtaining the glyph data set that matches the target subtitle style and the subtitle character set, if there are redundant characters in the subtitle character set, the subtitle character set is deredundant to obtain a new subtitle character set. In response to the glyph data request, the glyph data set that matches the target subtitle style and the new subtitle character set is obtained.
[0188] It is understood that the functions of each functional unit of the data processing device provided in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the relevant description of the server in the above method embodiments, which will not be repeated here.
[0189] In other feasible embodiments, the data processing device provided in this application embodiment can also be implemented in a combination of hardware and software. As an example, the data processing device provided in this application embodiment can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in this application embodiment. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0190] Please see Figure 17 , Figure 17This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 100 described in this embodiment includes: a processor 1701, a user interface 1702, a communication interface 1703, and a memory 1704. The processor 1701, user interface 1702, communication interface 1703, and memory 1704 can be connected via a bus or other means; this embodiment uses a bus connection as an example. The processor 1701 (or CPU (Central Processing Unit)) is the computing and control core of the computer device. It can parse various instructions within the computer device and process various data. For example, the CPU can parse power-on / off commands sent by the user to the computer device and control the computer device to perform power-on / off operations; furthermore, the CPU can transmit various interactive data between internal structures of the computer device, and so on. User interface 1702 is the medium for user interaction and information exchange with computer devices. Its specific manifestations may include a display screen and speakers for output, and a keyboard, touchscreen, and microphone for input. It should be noted that the keyboard here can be a physical keyboard, a virtual touchscreen keyboard, or a combination of both. Communication interface 1703 may optionally include standard wired interfaces and wireless interfaces (such as Wi-Fi, mobile communication interfaces, etc.), controlled by processor 1701 for sending and receiving data. Communication interface 1703 can also enable internal communication within the computer device. Memory 1604 is a storage device in the computer device used to store programs and data. It is understood that memory 1704 here may include the computer device's built-in memory, or it may include extended memory supported by the computer device. Memory 1704 provides storage space for the computer device's operating system, which may include, but is not limited to, Android, iOS, Windows Phone, etc., and this application does not limit this.
[0191] In this embodiment, the processor 1701 performs the following operations by running the executable program code in the memory 1704:
[0192] Obtain the target subtitle style; send a glyph data request to the server; wherein the glyph data request is determined based on the target subtitle style and the subtitle file of the target video, the subtitle file includes a set of subtitle characters, and the glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the set of subtitle characters; receive the glyph data set returned by the server, and display the subtitles corresponding to the subtitle file according to the glyph data set during the playback of the target video.
[0193] In one embodiment, the processor 1701 displays a video playback interface through a user interface 1702, in which one or more subtitle style options are displayed; when a selection operation for the one or more subtitle style options is detected, the subtitle style corresponding to the subtitle style option selected by the selection operation is determined as the target subtitle style.
[0194] In one embodiment, when the processor 1701 displays one or more subtitle style options in the video playback interface through the user interface 1702, it is specifically configured to: display a subtitle style setting control in the video playback interface; and display the one or more subtitle style options in the video playback interface when a trigger operation for the subtitle style setting control is detected.
[0195] In one embodiment, the processor 1701 is configured to: determine a request character set based on the subtitle character set; determine a glyph data request based on the target subtitle style and the request character set; wherein the glyph data request is used to request the server to return a glyph data set that matches the target subtitle style and the request character set.
[0196] In one embodiment, the processor 1701 is further configured to: if there are redundant characters in the subtitle character set, perform redundancy removal processing on the subtitle character set; and determine the request character set based on the redundancy removal subtitle character set.
[0197] In one embodiment, the subtitle character set includes one or more subtitle character segments, and the subtitle file further includes display rules for each subtitle character segment. When the processor 1701 displays the subtitle corresponding to the subtitle file through the user interface 1702 based on the glyph data set, it is specifically configured to: for a first subtitle string, obtain the glyph data of each character in the first subtitle string from the glyph data set, and generate a second subtitle string based on the glyph data of each character; wherein, the style of the characters in the second subtitle string is the target subtitle style, and the first subtitle string is any one of the subtitle character segments from the one or more subtitle character segments;
[0198] The second subtitle string is displayed in the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
[0199] In one embodiment, when the processor 1701 determines the request character set based on the subtitle character set, it is specifically configured to: if a historical glyph data set corresponding to the target subtitle style is recorded, then determine the request character set based on the historical glyph data set and the subtitle character set; wherein, the request character in the request character set is included in the subtitle character set, and the historical glyph data set does not contain glyph data corresponding to the request character; wherein, during the playback of the target video, displaying the subtitles corresponding to the subtitle file based on the glyph data set includes:
[0200] During the playback of the target video, the subtitles corresponding to the subtitle file are displayed based on the set of glyph data returned by the server and the set of historical glyph data.
[0201] In one embodiment, the processor 1701 is further configured to: after obtaining the glyph data set that matches the target subtitle style and the requested character set, update the historical glyph data set according to the glyph data set that matches the target subtitle style and the requested character set.
[0202] In specific implementations, the processor 1701, user interface 1702, communication interface 1703, and memory 1704 described in this application embodiment can execute the client implementation described in the data processing method provided in this application embodiment, and can also execute... Figure 15 The implementation described in the data processing apparatus 100 shown will not be repeated here.
[0203] The computer device provided in this application embodiment, by responding to the triggering operation of a subtitle style control during or before the playback of a target video, displays one or more subtitle style options in the video playback interface, obtains the target subtitle style according to the subtitle style option, and sends a glyph data request to the server. The glyph data request is determined based on the target subtitle style and the subtitle file of the target video. The subtitle file includes a set of subtitle characters. The glyph data request is used to request the server to return a set of glyph data that matches the target subtitle style and the subtitle character set. The server responds to the glyph data request, generates a set of glyph data that matches the target subtitle style and the subtitle character set, and returns the glyph data set to the client. The client displays the subtitles corresponding to the subtitle file according to the glyph data set. Therefore, during or before video playback, the subtitle style options can be flexibly adjusted and the subtitles rendered according to the user's intention, improving the user experience.
[0204] Please see Figure 18 , Figure 18 This is a schematic diagram of another computer device provided in an embodiment of this application. The computer device 200 described in this embodiment includes: a processor 1801, a communication interface 1802, and a memory 1803. The processor 1801, communication interface 1802, and memory 1803 can be connected via a bus or other means; this embodiment takes a bus connection as an example.
[0205] The processor 1801 (or CPU, Central Processing Unit) is the computing and control core of the computer device. It can parse various instructions and process various data within the computer device. For example, the CPU can parse power-on / off commands sent by the user and control the computer device to perform power-on / off operations; it can also transmit various interactive data between internal structures of the computer device. The communication interface 1802 may optionally include standard wired interfaces or wireless interfaces (such as Wi-Fi, mobile communication interfaces, etc.), controlled by the processor 1801 for sending and receiving data. The memory 1803 is the storage device in the computer device, used to store programs and data. It is understood that the memory 1803 here can include the computer device's built-in memory, or it can include extended memory supported by the computer device. The memory 1803 provides storage space for the computer device's operating system, which may include, but is not limited to, Android, iOS, Windows Phone, etc., and this application does not limit this. In this embodiment of the application, the processor 1801 performs the following operations by running the executable program code in the memory 1803:
[0206] The system receives a glyph data request sent by a client; wherein the glyph data request is determined based on a target subtitle style and a subtitle file of a target video, and the subtitle file includes a set of subtitle characters; in response to the glyph data request, the system obtains a set of glyph data that matches the target subtitle style and the set of subtitle characters; and sends the glyph data set to the client so that the client displays the subtitles corresponding to the subtitle file based on the glyph data set during the playback of the target video.
[0207] In one embodiment, the processor 1801 is further configured to: query the glyph database corresponding to the target subtitle style, obtain the glyph data of each subtitle character in the subtitle character set; and generate the glyph data set that matches the target subtitle style and the subtitle character set based on the glyph data of each subtitle character.
[0208] In one embodiment, the processing unit 1801 is further configured to: before acquiring a glyph data set that matches the target subtitle style and the subtitle character set, if there are redundant characters in the subtitle character set, perform redundancy removal processing on the subtitle character set to obtain a new subtitle character set, and in response to the glyph data request, acquire a glyph data set that matches the target subtitle style and the new subtitle character set.
[0209] In specific implementations, the processor 1801, communication interface 1802, and memory 1703 described in this application embodiment can execute the server implementation described in the data processing method provided in this application embodiment, and can also execute... Figure 16 The implementation described in the data processing device 200 shown will not be repeated here.
[0210] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to implement the data processing method described in this application. The specific implementation method can be found in the foregoing description and will not be repeated here.
[0211] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to implement the data processing method described in this application. Specific implementation details can be found in the foregoing description and will not be repeated here.
[0212] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0213] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0214] The above-disclosed embodiments are only some of the embodiments of this application, and should not be construed as limiting the scope of this application. Therefore, any equivalent changes made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method, characterized in that, The method includes: Obtain the target subtitle style, which includes one or more of the following: subtitle font, subtitle font size, and subtitle character color; and also includes one or more of the following: subtitle character slant and subtitle character effects. If a historical glyph data set corresponding to the target subtitle style is recorded, then a request character set is determined based on the historical glyph data set and the subtitle character set included in the subtitle file of the target video; wherein, the request character in the request character set is included in the subtitle character set, and the historical glyph data set does not contain the glyph data corresponding to the request character; The glyph data request is determined based on the target subtitle style and the requested character set. The glyph data request is used to request the server to return a matching glyph data set that matches the target subtitle style and the requested character set. Send the glyph data request to the server; Receive the matching glyph data set returned by the server, and display the subtitles corresponding to the subtitle file according to the matching glyph data set and the historical glyph data set during the playback of the target video; The historical glyph data set is updated based on the matching glyph data set.
2. The method as described in claim 1, characterized in that, The process of obtaining the target subtitle style includes: Display a video playback interface, and display one or more subtitle style options in the video playback interface; In response to a selection operation for one or more subtitle style options, the subtitle style corresponding to the subtitle style option selected in the selection operation is determined as the target subtitle style.
3. The method as described in claim 2, characterized in that, The option to display one or more subtitle style options in the video playback interface includes: Display subtitle style settings controls in the video playback interface; When a trigger operation is detected for the subtitle style setting control, one or more subtitle style options are displayed in the video playback interface.
4. The method according to any one of claims 1-3, characterized in that, The step of determining the requested character set based on the subtitle character set includes: If there are redundant characters in the subtitle character set, then the subtitle character set is deredundant. The request character set is determined based on the set of subtitle characters after redundancy removal.
5. The method according to any one of claims 1-3, characterized in that, The subtitle character set includes one or more subtitle character segments, and the subtitle file also includes the display rules for each subtitle character segment; The step of displaying the subtitles corresponding to the subtitle file based on the glyph data set includes: For the first subtitle string, the glyph data of each character in the first subtitle string is obtained from the glyph data set, and a second subtitle string is generated based on the glyph data of each character; wherein, the style of the characters in the second subtitle string is the target subtitle style, and the first subtitle string is any segment of subtitle characters from the segment or multiple segments of subtitle characters; The second subtitle string is displayed in the video playback interface according to the display rules corresponding to the first subtitle string included in the subtitle file.
6. A data processing method, characterized in that, The method includes: The system receives a glyph data request sent by a client. The glyph data request is determined based on a target subtitle style and a requested character set. The requested character set is determined by the client, given a historical glyph data set corresponding to the target subtitle style, based on the historical glyph data set and the subtitle character set included in the subtitle file of the target video. The requested character in the requested character set is included in the subtitle character set, and the historical glyph data set does not contain glyph data corresponding to the requested character. The target subtitle style includes one or more of the following: subtitle font, subtitle font size, and subtitle character color; it also includes one or more of the following: subtitle character tilt and subtitle character effects. In response to the glyph data request, obtain a set of matching glyph data that matches the target subtitle style and the subtitle character set; The matching glyph data set is sent to the client so that, during the playback of the target video, the client displays the subtitles corresponding to the subtitle file based on the matching glyph data set and the historical glyph data set, and the client updates the historical glyph data set based on the matching glyph data set.
7. A subtitle processing device, characterized in that, The apparatus includes a unit for implementing the data processing method as described in any one of claims 1-5, or includes a unit for implementing the data processing method as described in claim 6.
8. A computer device, characterized in that, include: The processor, the communication interface, and the memory are interconnected. The memory stores executable program code, and the processor is used to call the executable program code to implement the data processing method as described in any one of claims 1-5, or to implement the data processing method as described in claim 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to implement the data processing method as described in any one of claims 1-5, or to implement the data processing method as described in claim 6.
10. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the data processing method as described in any one of claims 1-5, or implement the data processing method as described in claim 6.