Character string screen display method and device and electronic equipment

By initializing the string state of each string to be superimposed in the string screen display method, and determining the target state according to the string state generates task data, the problem of large resource occupancy in multiple string screen display scenarios is solved, and a low-cost hardware implementation is realized.

CN119629401APending Publication Date: 2025-03-14BEIJING ESWIN COMPUTING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411748426.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the screen display scenario of multiple strings, since each string needs to be allocated two buffers separately, the resource usage is large and the hardware cost is increased.

Method used

After receiving the frame synchronization signal, the string state of each character string to be superimposed is initialized, and the target state is determined from the string state based on the position to be superimposed of the string state, the task data is generated based on the target state, the video input data is obtained for image superimposition processing, and the video output data is obtained.

Benefits of technology

It realizes the effect of low resource occupancy and low cost in multi-string screen display scenarios, avoiding the need to allocate two buffers for each string separately, and reducing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629401A_ABST
    Figure CN119629401A_ABST
Patent Text Reader

Abstract

The invention discloses a character string screen display method and device, electronic equipment and a storage medium, and the method comprises the steps: initializing the character string state of each to-be-superposed character string after receiving a frame synchronization signal; based on the to-be-superposed position of the character string state, determining a target state from the character string state, and generating task data according to the target state; and obtaining video input data corresponding to the frame synchronization signal, and carrying out image superposition processing on the video input data based on the task data to obtain video output data. Therefore, the target state corresponds to the to-be-superposed character string which firstly needs to be superposed, so that each to-be-superposed character string is sequenced, and therefore, only one to-be-superposed character string corresponding to the current target state needs to be processed during each superposition, and two buffers do not need to be separately distributed for each to-be-superposed character string at the same time, so that the superposition efficiency is improved. The cache resource consumption in the character string screen display process is greatly reduced, and the hardware cost is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing, and specifically relates to a method, device and electronic device for displaying a character string on a screen. Background Art

[0002] String screen display technology refers to superimposing corresponding characters on video data to achieve the effect of expressing information. For example, the video data shot by the monitoring equipment will be superimposed with corresponding strings through string screen display technology to express information such as shooting time and shooting location.

[0003] like Figure 1 As shown, when a line of character string "AB" needs to be displayed on the screen, the dot matrix data of the characters "A" and "B" need to be obtained in advance. The length and width of the dot matrix data are both 32 pixels. Then, when displaying the pixels of the character string "AB" to be superimposed, the dot matrix data at the corresponding position is superimposed.

[0004] In the prior art, a character line buffering character string screen display method can be adopted, using a main buffer and an auxiliary buffer to alternately buffer the dot matrix data of the character string to be superimposed. Figure 1 For example, the main buffer first caches the first line of dot matrix data of the character "A". When the superimposed pixel points corresponding to the first line of character "A" are executed, the corresponding dot matrix data in the main buffer is read for superimposition. At the same time, the auxiliary buffer starts to cache the first line of dot matrix data of the character "B". After the superimposed pixel points corresponding to the first line of character "A" are processed, the first line of dot matrix data of the character "B" stored in the auxiliary buffer is assigned to the main buffer. After that, the main buffer participates in the superimposition of the first line of character "B", and the auxiliary buffer reads the second line of dot matrix data of character "A". The above steps are repeated until the dot matrix data of the character string "AB" are all superimposed.

[0005] However, the above-mentioned string screen display method has a good implementation effect only in the screen display scenario of a single string. In the screen display scenario of multiple strings, since each string needs to be allocated two buffers separately, it will cause a large resource occupation, resulting in a significant increase in the hardware cost of the string screen display method. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a method, device and electronic device for displaying a string on the screen, which can solve the problem in the prior art that in the screen display scenario of multiple strings, since each string needs to be individually allocated two buffers, it will cause a large resource occupation, resulting in a greatly increased hardware cost of the string screen display method.

[0007] In a first aspect, an embodiment of the present application provides a method for displaying a character string on a screen, comprising:

[0008] After receiving the frame synchronization signal, the string state of each string to be superimposed is initialized;

[0009] Based on the position to be superimposed of the string state, determining a target state from the string state, and generating task data according to the target state;

[0010] The video input data corresponding to the frame synchronization signal is acquired, and based on the task data, image overlay processing is performed on the video input data to obtain video output data.

[0011] Optionally, after generating task data according to the target state, the method further includes:

[0012] The character string to be superimposed corresponding to the target state is used as the target character string, and based on the display direction of the target character string, the position to be superimposed of the target state and the index information of the target state are updated.

[0013] Optionally, the updating of the to-be-superimposed position and index information of the target state based on the display direction of the target character string includes:

[0014] Determining a reference position based on a display direction of the target character string;

[0015] Determine whether the position to be superimposed of the target state is the reference position, and obtain a determination result;

[0016] According to the display direction and the determination result, the position to be superimposed of the target state and the index information are updated.

[0017] Optionally, determining the reference position based on the display direction of the target character string includes:

[0018] When the display direction of the target character string is horizontal, the end of each row of the pixel matrix of the target character string except the last row is used as a reference position;

[0019] In the case that the display direction of the target character string is the vertical direction, the last row of any character in the pixel matrix of the target character string is used as the reference position.

[0020] Optionally, generating task data according to the target state includes:

[0021] Determining whether the first buffer is full, the storage depth of the first buffer being not less than 2;

[0022] If the first buffer is not full, generating task data according to the target state, and storing the task data in the first buffer;

[0023] If the first buffer is full, the process returns to the step of determining whether the first buffer is full.

[0024] Optionally, performing image overlay processing on the video input data based on the task data to obtain video output data includes:

[0025] Determining pixel data corresponding to the task data;

[0026] Acquire video input data corresponding to the frame synchronization signal;

[0027] Based on the task data and the corresponding pixel data that match the position information of the video input data, image superposition processing is performed on the video input data to obtain video output data.

[0028] Optionally, before determining the pixel data corresponding to the task data, the method further includes:

[0029] Determine whether the first buffer is empty and whether the second buffer is full, the storage depth of the first buffer and the second buffer being no less than 2;

[0030] If the first buffer is not empty and the second buffer is not full, reading the task data from the first buffer and writing the task data into the second buffer;

[0031] After acquiring the video input data corresponding to the frame synchronization signal, the method further includes:

[0032] The task data is read from the second buffer, and it is detected whether the position information of the task data matches the position information of the video input data.

[0033] Optionally, after determining the pixel data corresponding to the task data, the method further includes:

[0034] Writing the pixel data into a third buffer, wherein the storage depth of the third buffer is not less than 2;

[0035] After acquiring the video input data corresponding to the frame synchronization signal, the method further includes:

[0036] The pixel data is read from the third buffer.

[0037] Optionally, the determining the pixel data corresponding to the task data includes:

[0038] Calculating a first offset and a second offset based on the index information in the task data and the pre-acquired character library information;

[0039] Determining a target position corresponding to the task data in a preset character library according to the first offset and the second offset;

[0040] Pixel data is obtained from the preset character library according to the target position.

[0041] Optionally, performing image superposition processing on the video input data based on the task data matching the position information of the video input data and the corresponding pixel data to obtain the video output data includes:

[0042] Dequantizing the pixel data matching the position information of the video input data according to the bit width of the video input data to obtain font transparency;

[0043] Calculating the overlay transparency according to the character library transparency and the task data matched with the position information of the video input data;

[0044] Video output data is calculated based on the overlay transparency, the task data and the color channel data of the video input data.

[0045] Optionally, the determining the target state from the string state based on the position to be superimposed of the string state includes:

[0046] Comparing the position to be superimposed of each string state, the position to be superimposed being the position coordinate of the content to be superimposed in the corresponding string to be superimposed;

[0047] The priorities of the character string states are determined according to the order of the positions to be superimposed from small to large, and the character string state with the highest priority is used as the target state.

[0048] In a second aspect, an embodiment of the present application provides a string screen display device, comprising:

[0049] An initialization module, used to initialize the string state of each string to be superimposed after receiving a frame synchronization signal;

[0050] A determination module, configured to determine a target state from the string state based on a position to be superimposed of the string state, and generate task data according to the target state;

[0051] The superposition module is used to obtain the video input data corresponding to the frame synchronization signal, and based on the task data, perform image superposition processing on the video input data to obtain video output data.

[0052] Optionally, the determining module is further used for:

[0053] After generating task data according to the target state, the character string to be superimposed corresponding to the target state is used as the target character string, and based on the display direction of the target character string, the position to be superimposed of the target state and the index information of the target state are updated.

[0054] Optionally, the determining module is specifically used to:

[0055] Determining a reference position based on a display direction of the target character string;

[0056] Determine whether the position to be superimposed of the target state is the reference position, and obtain a determination result;

[0057] According to the display direction and the determination result, the position to be superimposed and the index information of the target state are updated.

[0058] Optionally, the determining module is specifically used to:

[0059] Comparing the position to be superimposed of each string state, the position to be superimposed being the position coordinate of the content to be superimposed in the corresponding string to be superimposed;

[0060] The priorities of the character string states are determined according to the order of the positions to be superimposed from small to large, and the character string state with the highest priority is used as the target state.

[0061] In a third aspect, an embodiment of the present application provides an electronic device for executing any of the above-mentioned string screen display devices.

[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the methods described above are implemented.

[0063] In the solution provided in the embodiment of the present application, after receiving the frame synchronization signal, the string state of each string to be superimposed is initialized; based on the position to be superimposed of the string state, the target state is determined from the string state, and task data is generated according to the target state; the video input data corresponding to the frame synchronization signal is obtained, and based on the task data, image superposition processing is performed on the video input data to obtain video output data.

[0064] In this way, based on the characteristic that a plurality of to-be-superimposed strings will not be repeatedly superimposed at the same position in the string screen display scenario, the string state of each to-be-superimposed string is initialized, and the to-be-superimposed position is included in the string state, that is, the position where the corresponding to-be-superimposed string currently needs to be superimposed, and then, the target state can be determined from the string states corresponding to the plurality of to-be-superimposed strings according to the to-be-superimposed position, and the target state corresponds to the to-be-superimposed string that needs to be superimposed first, thereby realizing the sorting of the to-be-superimposed strings, and therefore, only one to-be-superimposed string corresponding to the current target state needs to be processed each time superimposed, without the need to separately allocate two buffers for each to-be-superimposed string at the same time, which greatly reduces the buffer resource consumption in the string screen display process and effectively reduces the hardware cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 is a processing schematic diagram of a method for displaying a character string on a screen according to an exemplary embodiment;

[0066] Figure 2 is a flowchart of a method for displaying a character string on a screen according to an exemplary embodiment;

[0067] Figure 3 is a schematic diagram indicating a first position according to an exemplary embodiment;

[0068] Figure 4 is a schematic diagram indicating a second position according to an exemplary embodiment;

[0069] Figure 5 is an architectural diagram of a method for displaying a character string on a screen according to an exemplary embodiment;

[0070] Figure 6 is a schematic diagram of a character string screen display device according to an exemplary embodiment;

[0071] Figure 7 A schematic diagram of an electronic device is shown according to an exemplary embodiment. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0073] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0074] The character string screen display method provided by the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0075] like Figure 2 As shown, an embodiment of the present invention provides a method for displaying a character string on a screen, which is applied to a character string screen display, comprising:

[0076] Step S11: after receiving the frame synchronization signal, initializing the string state of each string to be superimposed.

[0077] The string screen display technology refers to superimposing corresponding characters on video data to achieve the effect of expressing information. In the related art, a character line cache string screen display method is adopted, and the dot matrix data of the string to be superimposed is alternately cached by the main buffer and the auxiliary buffer. However, in the screen display scenario of multiple strings, since each string needs to be allocated two buffers separately, it will cause a large resource occupation, resulting in a significant increase in the hardware cost of the string screen display method.

[0078] Based on this, the present application proposes a method for displaying a character string on the screen to solve the above-mentioned problem and achieve the effect of low resource occupation and low cost in the screen display scenario of multiple character strings.

[0079] In this step, you first need to receive a frame synchronization signal. The frame synchronization signal is a confirmation signal for the video input data. The arrival of the frame synchronization signal means that there will be video input data output. It can be understood that each video input data corresponds to a different video frame, and the character strings to be superimposed in different video frames will also be different. Therefore, it is necessary to obtain the string parameters of each character string to be superimposed corresponding to the frame synchronization signal after the frame synchronization signal arrives, and then initialize the string state corresponding to each character string to be superimposed according to the string parameters.

[0080] Among them, string parameters can be expressed as parameters ii∈[0, N), where N is the number of strings to be superimposed corresponding to the string parameter. i Including but not limited to the following parameters:

[0081] parameters i .vstart indicates the starting position of the string to be superimposed in the vertical direction;

[0082] parameters i .hstart indicates the horizontal starting position of the string to be superimposed;

[0083] parameters i .color indicates the color of the string to be superimposed;

[0084] parameters i .alpha indicates the transparency of the string to be superimposed;

[0085] parameters i .textid is an array, which stores the index of each character in the character string to be superimposed in the font library in sequence;

[0086] parameters i .vext indicates the display direction of the string to be superimposed. i When .vext=1, the string to be superimposed is displayed vertically. i When .vext=0, the string to be superimposed is displayed horizontally;

[0087] parameters i .interval represents the pixel interval between characters in the string to be superimposed.

[0088] The string state includes a position to be superimposed, which is the position coordinate of the content to be superimposed in the corresponding string to be superimposed. It can be understood that each character in the string to be superimposed corresponds to a pixel matrix, and each time superposition is performed, a row in the pixel matrix of a character is used as the content of the superposition, that is, each superimposed content is a row in a pixel matrix that has not been superimposed in the string to be superimposed, so the position to be superimposed in the string state is a row in a pixel matrix that needs to be superimposed first in the string to be superimposed.

[0089] In addition, the character string state may also include other parameters related to the next superposition in the corresponding character string to be superimposed, such as the specific content and superposition method of the next superposition, etc., so as to realize character display based on these parameters in subsequent steps.

[0090] For example, the initialized string state can be represented as state i , state i The parameters may include but are not limited to the following:

[0091] state i .nextvstart indicates the starting position of the content to be superimposed in the vertical direction;

[0092] state i .nextstart indicates the horizontal starting position of the content to be superimposed;

[0093] state i .color indicates the color of the content to be superimposed;

[0094] state i .alpha indicates the transparency of the content to be overlaid;

[0095] state i .textid indicates the index of the character to which the content to be superimposed belongs in the font library;

[0096] state i .rowid indicates the row index of the content to be overlaid in the pixel matrix;

[0097] state i .done indicates the completion flag of the corresponding string to be superimposed.

[0098] Initializing the string state means assigning values ​​to the various parameters in the string state according to the string parameters of the string to be superimposed. This process can be expressed as:

[0099] state i .nextvstart=parameters i .vstart

[0100] state i .nextstort=parameters i .hstart

[0101] state i .color=parameters i .color

[0102] state i .alpha=parameters i .alpha

[0103] state i.textid=0

[0104] state i .rowid=0

[0105] state i .done=0

[0106] That is to say, after the string state is initialized, state i .nextvstart, state i .nextstart, state i .color and state i .alpha has the same value as the corresponding parameter item in the string parameter, state i .textid, state i .rowid and state i .done is assigned 0 to indicate that the corresponding string to be superimposed has not yet begun to be superimposed.

[0107] Step S12: Based on the position to be superimposed of the character string state, determine the target state from the character string state, and generate task data according to the target state.

[0108] In the present application, steps S11 to S12 can be implemented by a string scheduling module. First, the priority of each string state is determined based on the position to be superimposed of the string state. The priority means the order in which the content to be superimposed corresponding to the string state is superimposed on the video input data. Then, the target state can be determined from multiple string states, and the content to be superimposed corresponding to the target state will be processed first.

[0109] In one implementation, based on the position of the string state to be superimposed, determining the target state from the string state includes:

[0110] Compare the position to be superimposed of each string state, where the position to be superimposed is the position coordinate of the content to be superimposed in the corresponding string to be superimposed;

[0111] The priority of the string state is determined according to the order of the positions to be superimposed from small to large, and the string state with the highest priority is used as the target state.

[0112] When it is necessary to overlay strings on a video frame, it is necessary to determine the order in which these strings are overlaid, that is, which string is overlaid first and which string is overlaid later. This process is achieved by determining the target state.

[0113] That is to say, the string state with the smallest value of the position to be superimposed can be determined according to the order of the positions to be superimposed corresponding to each string state from small to large. As the target state, the smallest value of the position to be superimposed means that the corresponding content to be superimposed is at the front and needs to be processed first.

[0114] In this way, by comparing the positions to be superimposed and determining the priority of the string states in order from small to large, the strings to be superimposed can be sorted, wherein the string state with the highest priority is used as the target state. Therefore, based on the target state, a row in the pixel matrix that needs to be superimposed first among multiple strings to be superimposed can be determined.

[0115] Once the target state is determined, task data related to the target state may be further generated, and the task data may be used for superimposing and displaying the character string to be superimposed with the video input data.

[0116] For example, the target state can be represented as state h , the calculation process is as follows:

[0117] state h =HPF(state j ), j∈[0,N), state j .done=0

[0118] Among them, HPF(·) refers to the highest priority parameter operation, that is, selecting the string state with the smallest value at the position to be superimposed as the target state.

[0119] The task data generated according to the target state can be represented as tasksin, which includes but is not limited to:

[0120] taskin.nextvstart=stateh.nextvstart

[0121] taskin.nextstart=state h .nextstart

[0122] taskin.Color=state h .color

[0123] taskin.alpha=state h .alpha

[0124] taskin.textid=parameters h .textid[state h .textid]

[0125] taskin.rowid=state h .rowid

[0126] Among them, taskin.nextvstart represents the starting position of the content to be superimposed in the target state in the vertical direction;

[0127] taskin.nextstart indicates the horizontal starting position of the content to be superimposed in the target state;

[0128] taskin.color indicates the color of the content to be superimposed in the target state;

[0129] taskin.alpha indicates the transparency of the content to be superimposed in the target state;

[0130] taskin.textid indicates the index of the character in the font library to which the content to be superimposed belongs in the target state;

[0131] taskin.rowid indicates the row index of the pixel matrix to which the content to be overlaid in the target state belongs.

[0132] Furthermore, the target state needs to be updated so that the target state continues to be used to indicate the next content to be superimposed in the corresponding character string to be superimposed. In one implementation, after generating task data according to the target state, the method further includes:

[0133] The character string to be superimposed corresponding to the target state is taken as the target character string, and based on the display direction of the target character string, the position to be superimposed of the target state and the index information of the target state are updated.

[0134] That is, the position to be superimposed and the index information can be updated according to the display direction of the target character string. It can be understood that for the character strings to be superimposed including the same characters, different display directions will result in different starting superimposition positions and index information for the next superposition, which is crucial for determining the specific layout of the target character string on the screen.

[0135] For example, if the target string is horizontal, the width of the target string and the spacing between characters may be considered when updating the position to be superimposed; if the target string is vertical, the height of the target string and the vertical spacing between characters may be considered when updating the position to be superimposed, and so on.

[0136] Updating the position to be superimposed means adjusting the position to be superimposed of the target state according to the position coordinates of the next content to be superimposed in the target state, so that in the next iteration, the target state can be correctly re-determined according to the positions to be superimposed of each string state.

[0137] The purpose of updating the index information is to track the current processing progress of the target string, such as recording how many characters or how many rows of pixel matrices have been superimposed, which helps to realize the scrolling display or dynamic update of the string.

[0138] In one implementation, based on the display direction of the target character string, the target state's to-be-superimposed position and index information are updated, including:

[0139] Determine a reference position based on the display direction of the target character string;

[0140] Determine whether the position to be superimposed of the target state is a reference position, and obtain a determination result;

[0141] According to the display direction and the determination result, the position to be superimposed and the index information of the target state are updated.

[0142] The reference position refers to a specific position determined based on the display direction of the target character string, rather than a fixed coordinate. After determining the display direction of the target character string, the reference position corresponding to the display direction can be determined, and then, it is determined whether the position to be superimposed in the target state is the reference position to determine whether the content to be superimposed of the target character string has reached each pre-set specific position. Furthermore, the position to be superimposed in the target state and the index information can be updated according to the display direction and the determination result to ensure the correctness and continuity of subsequent processing.

[0143] For example, based on the display direction of the target character string, the reference position is determined, including:

[0144] When the display direction of the target character string is horizontal, the end of each row of the target character string pixel matrix except the last row is used as a reference position;

[0145] When the display direction of the target character string is the vertical direction, the last row of any character in the pixel matrix of the target character string is used as the reference position.

[0146] It can be understood that when the display direction is horizontal, if the position to be superimposed is the first row of the pixel matrix of the next character, the position to be superimposed is located to the upper right of the current position, and when the display direction is vertical, if the position to be superimposed is the first row of the pixel matrix of the next character, the position to be superimposed is located below the current position, and so on.

[0147] Therefore, when the display direction of the target string is horizontal, the ends of the target string pixel matrix rows except the last row are used as reference positions; when the display direction of the target string is vertical, the last row of any character in the target string pixel matrix is ​​used as a reference position to realize the recognition of a specific position in the pixel matrix, thereby correctly updating the position to be superimposed and the index information of the target state.

[0148] For example, in a specific embodiment, if the index information includes a character index and a row index, and the position to be superimposed includes a vertical superimposed position and a horizontal superimposed position; then, according to the display direction and the determination result, the position to be superimposed and the index information of the target state are updated, including:

[0149] When the display direction of the target character string is horizontal, if the judgment result is yes, the vertical overlay position and row index value of the target state are increased by 1 respectively; if the judgment result is no, the character index value of the target state is increased by 1, and the horizontal overlay position value of the target character string is added to the pre-acquired character width and character spacing.

[0150] When the display direction of the target character string is vertical, if the judgment result is yes, the vertical superimposed position value of the target state is added to the character interval and then increased by 1, and the character index value of the target state is increased by 1; if the judgment result is no, the vertical superimposed position and row index value of the target state are increased by 1 respectively.

[0151] The above process can be expressed as, when parameters i .vext=0, that is, when the superimposed string is displayed horizontally, the target state is updated as follows:

[0152]

[0153] When parameters i .vext=1, that is, when the superimposed string is displayed in the vertical direction, the target state is updated as follows:

[0154]

[0155] state h .nextstart=state h .nextstart

[0156]

[0157] The character width can be read from the font information font, expressed as font.width, and the state on the right side of the equation hIndicates the target state before updating. The state on the left side of the equation h Indicates the updated target state; Figure 3 As shown in , endofline indicates the end of any row of the target string pixel matrix except the last row; Figure 4 As shown, endofchar indicates the last row of any character in the pixel matrix of the target string; otherwise indicates other situations.

[0158] In addition, the string state may also include a string completion flag. Therefore, when initializing the string state of each string to be superimposed, the string completion flag included in the string state may be recorded as 0; correspondingly, when judging whether the position to be superimposed of the target state is the reference position, it may also be judged whether the position to be superimposed of the target state is the end of the last row in the corresponding pixel matrix of the string to be superimposed. If so, the string completion flag in the target state is recorded as 1.

[0159] That is to say, the string status also includes a string completion flag, which is used to indicate whether the corresponding string to be superimposed has been completed. If the corresponding string to be superimposed has been completed, the string completion flag in the string status is recorded as 1. If the corresponding string to be superimposed has not been completed, the string completion flag in the string status is set to 0. Until the string completion flags in the string statuses of all the strings to be superimposed are recorded as 1, that is, all the strings to be superimposed have been converted into task data.

[0160] The above process can be expressed as:

[0161]

[0162] Wherein, endofstring indicates that the position to be superimposed is located at the end of the last row of the pixel matrix of the last character of the string to be superimposed.

[0163] In one implementation, generating task data according to a target state includes:

[0164] Determine whether the first buffer is full, the storage depth of the first buffer is not less than 2;

[0165] If the first buffer is not full, generating task data according to the target state, and storing the task data in the first buffer;

[0166] If the first buffer is full, the process returns to the step of determining whether the first buffer is full.

[0167] That is to say, it is necessary to configure a first buffer with a storage depth of not less than 2 to store the generated task data, wherein the first buffer can be represented as Task FIFO, and the storage depth represents the amount of data that the first buffer can store, that is, at least two task data can be stored in the first buffer.

[0168] If the Task FIFO is not full, the task data is generated according to the target state and then stored in the Task FIFO. If the Task FIFO is full, the step of determining whether the Task FIFO is full is repeated until part of the task data in the Task FIFO is read out and there is remaining storage space in the Task FIFO.

[0169] In this way, only a first buffer with a storage depth of not less than 2 is needed, one storage depth is used to store task data that is currently being processed or waiting for the next step of processing, and the other storage depth is used to write task data corresponding to the target state, thereby realizing dynamic storage of task data and avoiding the loss of task data and waste of resources.

[0170] Step S14: acquiring video input data corresponding to the frame synchronization signal, and performing image overlay processing on the video input data based on the task data to obtain video output data.

[0171] This step can be implemented by a character reading module and an overlay module. After obtaining the frame synchronization signal, the video input data corresponding to the frame synchronization signal can be obtained. Then, the character reading module reads the task data and processes the task data accordingly. The overlay module then performs image overlay processing on the video input data based on the processed task data, and overlays the characters to be overlaid onto the video input data to obtain video output data.

[0172] In one implementation, based on the task data, image overlay processing is performed on the video input data to obtain video output data, including:

[0173] Determine pixel data corresponding to the task data;

[0174] Obtain video input data corresponding to the frame synchronization signal;

[0175] Based on the task data and corresponding pixel data that match the position information of the video input data, image superposition processing is performed on the video input data to obtain video output data.

[0176] That is to say, firstly, it is necessary to determine the pixel data pixelin corresponding to the task data according to the task data obtained above. Pixel data is an array with a length of character width, which stores information such as the color value or brightness value of a row of pixels in the pixel matrix of a character in the character string to be superimposed.

[0177] Specifically, the task data includes index information, and the pixel data corresponding to the task data can be determined by combining the pre-acquired font information and index information:

[0178] First, based on the index information in the task data and the pre-acquired font information, the target position of the content to be superimposed corresponding to the task data in the preset font is determined; then, pixel data is obtained from the preset font according to the target position.

[0179] Then, the frame currently being processed can be determined according to the frame synchronization signal, and the video input data of the frame can be obtained so as to correctly superimpose the character string to be superimposed on the frame. Furthermore, the video input data can be subjected to image superposition processing based on the task data and the corresponding pixel data that match the position information of the video input data.

[0180] For example, the position to be superimposed corresponding to the task data and the position information of the video input data can be matched. If the match is successful, it can be determined that the content to be superimposed corresponding to the acquired video input data is the content to be superimposed indicated in the task data.

[0181] In one implementation, before determining the pixel data corresponding to the task data, the method further includes:

[0182] Determine whether the first buffer is empty and whether the second buffer is full, and the storage depth of the first buffer and the second buffer is not less than 2;

[0183] If the first buffer is not empty and the second buffer is not full, reading the task data from the first buffer and writing the task data into the second buffer;

[0184] After obtaining the video input data corresponding to the frame synchronization signal, it also includes:

[0185] The task data is read from the second buffer, and it is detected whether the position information of the task data matches the position information of the video input data.

[0186] That is to say, in this embodiment, a second buffer with a storage depth of not less than 2 needs to be configured, and the second buffer can be represented as a Row FIFO. After obtaining the video input data and the task data, first determine whether the Task FIFO is empty and whether the Row FIFO is full. If the Task FIFO is not empty and the Row FIFO is not full, read a task data from the Task FIFO and write the task data to the Row FIFO. If the Task FIFO is empty or the Row FIFO is full, repeat the steps of determining whether the Task FIFO is empty and whether the Row FIFO is full.

[0187] In this way, only a second buffer with a storage depth of not less than 2 is needed, one storage depth is used to store task data that is currently being processed or waiting to be processed, and the other storage depth is used to write task data read from the first buffer, thereby realizing dynamic storage of task data and avoiding the loss of task data and waste of resources.

[0188] Among them, the second buffer can only store a part of the task data, including the starting position of the content to be superimposed in the vertical direction, the starting position of the content to be superimposed in the horizontal direction and attribute information, wherein the attribute information may include but is not limited to: the color of the string to be superimposed; the transparency of the string to be superimposed; the index of the character to which the content to be superimposed belongs in the font library; the row index of the content to be superimposed in the pixel matrix to which it belongs, and so on.

[0189] In one implementation, after determining the pixel data corresponding to the task data, the method further includes:

[0190] Writing the pixel data into a third buffer, wherein the storage depth of the third buffer is not less than 2;

[0191] After obtaining the video input data corresponding to the frame synchronization signal, it also includes:

[0192] The pixel data is read from the third buffer.

[0193] That is to say, it is also necessary to configure a third buffer with a storage depth of not less than 2, wherein the third buffer is used to store pixel data obtained from the preset font library, and the third buffer can be represented as a Pixel FIFO. In this way, only a third buffer with a storage depth of not less than 2 is needed, wherein one storage depth is used to store pixel data currently being processed or waiting to be processed, and the other storage depth is used to write pixel data corresponding to task data, thereby realizing dynamic storage of pixel data and avoiding loss of pixel data and waste of resources.

[0194] Then, when performing image overlay processing on the video input data, it is necessary to determine whether the Row FIFO is empty. If the Row FIFO is not empty, the task data is read from it and the pixel data is read from the Pixel FIFO at the same time. If the Row FIFO is empty, the step of determining whether the Row FIFO is empty is repeated until the task data stored in the Row FIFO is successfully read.

[0195] Thus, in the embodiment of the present application, with the help of three buffers Task FIFO, Row FIFO and Pixel FIFO, they are used to store the highest and second highest priority task data and pixel data respectively. In practical applications, it is only necessary to ensure that the depth of the three buffers is greater than or equal to 2 to realize the superposition of multiple characters to be superimposed, which greatly reduces the memory resource consumption in the process of superimposing multiple strings.

[0196] In one implementation, determining pixel data corresponding to task data includes:

[0197] Calculate a first offset and a second offset based on the index information in the task data and the pre-acquired character library information;

[0198] Determine a target position corresponding to the task data in the preset character library according to the first offset and the second offset;

[0199] Get pixel data from the preset font library according to the target position.

[0200] Specifically, the font information usually includes character width, character height and the number of font pixel bits, and the index information includes character index and row index. Then, the product of the character index, character width, character height and the number of font pixel bits can be calculated as the first offset; the product of the row index, character width and the number of font pixel bits can be calculated as the second offset; the first offset and the second offset are added to obtain the target position of the task data in the preset font.

[0201] For example, the pre-acquired font information font includes the following parameters, namely, character width font.width, character height font.height, and font pixel bit font.bpp. The process of determining the target position corresponding to the task data in the preset font can be expressed as:

[0202] singlerow=font.width*font.bpp

[0203] singlechar=font.height*singlerow

[0204] charoffset=taskoutt.textid*singlechar

[0205] rowoffset=taskout.rowid*singlerow

[0206] offset = charoffset + rowoffset

[0207] Among them, taskout.textid represents the character index in the read task data, taskout.rowid represents the row index in the read task data, and their values ​​are the same as taskin.textid and taskin.rowid when the task data is generated. singlerow represents the byte size occupied by a row in the pixel matrix corresponding to the content to be superimposed, singlechar represents the byte size occupied by the character corresponding to the content to be superimposed, charoffset represents the first offset, that is, the starting offset of the character corresponding to the content to be superimposed in the preset font library, rowoffset represents the second offset, that is, the starting offset of a row in the pixel matrix corresponding to the content to be superimposed in the pixel matrix of the character to which it belongs, and offset represents the target position.

[0208] In one implementation, based on the task data and the corresponding pixel data that match the position information of the video input data, the video input data is subjected to image overlay processing to obtain the video output data, including:

[0209] According to the bit width of the video input data, the pixel data matching the position information of the video input data is dequantized to obtain the transparency of the font library;

[0210] Calculating the overlay transparency based on the transparency of the font library and the task data matched with the position information of the video input data;

[0211] The video output data is calculated based on the superimposed transparency, task data and color channel data of the video input data.

[0212] Specifically, first, the pixel data can be dequantized according to the bit width of the video input data, and the pixel data can be converted into the same bit width as the video input data, so that the pixel data and the video input data can be seamlessly combined for display, and then the information controlling the font transparency can be extracted therefrom to obtain the font transparency.

[0213] The above calculation process is as follows:

[0214]

[0215] Among them, fontalpha represents the font transparency, pixelout[x-rowout.hstart] represents the read pixel data, rowout.hstart represents the horizontal starting overlay position corresponding to the task data, x represents the horizontal position information of the video input data, and DW represents the bit width of the video input data.

[0216] Then, the superimposed transparency can be calculated based on the transparency of the font library and the transparency of the characters in the task data. The calculation process is as follows:

[0217]

[0218] Among them, max(rowout.alpha) refers to the preset maximum transparency value, rowout.alpha represents the character transparency in the task data, and mask represents the superimposed transparency.

[0219] Furthermore, the video output data can be calculated based on the superimposed transparency, the character color in the task data and the color channel data of the video input data, wherein the color channel data can be different according to the data format adopted by the video input data, which can be RGB (Red-Green-Blu e , Red-Green-Blue) color channel, CMYK (Cyan-Magenta-Yellow-Key, Cyan-Magenta-Yellow-Black) color channel, and so on, without specific limitation.

[0220] For example, if the color channel uses RGB channels, then the R, G, and B channels are superimposed in turn to obtain the final video output data. The calculation process is as follows:

[0221] videooutr.=((2 DW -1-mask)*videoin r +mask*rowout.color r )>>DWvideoout g =((2 DW -1-mask)*videoin g +mask*rowout.color g )>>DWvideoout b =((2 DW -1-mask)*videoin b +mask*rowout.color b )>>DW

[0222] Among them, videoout γRepresents the video output data of the red channel, videoout g Represents the video output data of the green channel, videoout b Represents the video output data of the blue channel, videoin r Represents the video input data of the red channel, videoin g Represents the video input data of the green channel, videoin b Represents the green channel of the video input data.

[0223] In one implementation, after obtaining the video input data corresponding to the frame synchronization signal, the method further includes:

[0224] Determine the character width range according to the position to be superimposed corresponding to the task data and the pre-acquired character library information;

[0225] According to the position information of the video input data, the position to be superimposed corresponding to the task data, and the character width range, it is determined whether the task data matches the position information of the video input data.

[0226] Specifically, the position information of the video input data includes horizontal position information and vertical position information, and the position to be superimposed includes a vertical superimposed position and a horizontal superimposed position; then, determining whether the task data matches the position information of the video input data includes:

[0227] The horizontal overlay position corresponding to the task data is taken as the minimum value, and the sum of the horizontal overlay position corresponding to the task data and the character width in the font information is calculated as the maximum value to obtain the character width range;

[0228] Determine whether the vertical position information is equal to the vertical superposition position corresponding to the task data, and whether the horizontal position information is within the character width range;

[0229] If the vertical position information is equal to the vertical superimposed position corresponding to the task data, and the horizontal position information is within the character width range, then the position information of the task data matches the position information of the video input data.

[0230] In other words, the position information of the video input data and the position to be superimposed corresponding to the task data can be matched. If the two match, it means that the task data and the video input data correspond to pixels at the same position. Then, the video input data can be further processed by image superposition based on the pixel data and the task data to obtain video output data.

[0231] Below Figure 5The specific embodiment shown illustrates the character string screen display method provided by the present application. The character string screen display method includes three submodules, namely a character string scheduling module, a character reading module and a superposition module.

[0232] Among them, the actual workflow of the string scheduling module is as follows:

[0233] After the frame synchronization signal arrives, obtain the string state of each string to be superimposed i ;

[0234] Determine whether the Task FIFO is full. If the Task FIFO is not full, compare the priorities of all the string states that have not been superimposed, and select the string state that needs to be superimposed first as the target state. h ;

[0235] Process the target state into task data, record it as tasksin, and store it in Task FIFO. At the same time, combine it with the font information font to update the target state.

[0236] Until the string completion flag in the string status of all the strings to be superimposed is 1, that is, all the contents to be superimposed of all the strings to be superimposed are stored in the Task FIFO.

[0237] The actual workflow of the character reading module is as follows:

[0238] Determine whether the Task FIFO is empty and whether the Row FIFO is full. If the Task FIFO is not empty and the Row FIFO is not full, read a task data from the Task FIFO, recorded as taskout. If the Task FIFO is empty or the Row FIFO is full, repeat the steps of determining whether the Task FIFO is empty and whether the Row FIFO is full.

[0239] According to the obtained taskout, the target position offset of the content to be superimposed in the preset font is calculated in combination with the font information;

[0240] Read the preset font library according to the calculated offset to obtain pixel data, which is recorded as pixelin;

[0241] The obtained position and attribute information to be superimposed in taskout is recorded as rowin and stored in RowFIFO; the obtained pixelin is stored in Pixel FIFO;

[0242] Repeat the steps of the above character reading module until all the information of the character strings to be superimposed is processed.

[0243] The actual workflow involved in the overlay module is as follows:

[0244] Determine whether the Row FIFO is empty. If the Row FIFO is not empty, read the position and attribute information of a task data to be superimposed, recorded as rowout, and read a pixel data from the Pixel FIFO, recorded as pixelout. If the Row FIFO is empty, repeat the step of determining whether the Row FIFO is empty.

[0245] Determine whether the position to be superimposed (vstart, hstart) in rowout matches the position information (x, y) of the video input data. If they match, perform image superposition processing on the video input data videoin, rowout and pixelout;

[0246] Specifically, first, the corresponding font information pixelout[x-rowout.hstart] is dequantized to be consistent with the bit width of the video input data to obtain the font transparency fontalpha; then, the final overlay transparency mask is calculated in combination with the overlay transparency rowout.alpha specified by the character string to be overlaid; and then, overlay is performed on each color channel in turn to obtain the final video output data videoout until the pixel data is exhausted;

[0247] If they do not match, the video input data is not processed and is directly output as video output data.

[0248] As can be seen from the above, the technical solution provided by the embodiment of the present application is based on the characteristic that in the string screen display scenario, multiple strings to be superimposed will not appear in repeated superposition at the same position, and the string state of each string to be superimposed is initialized, and the string state includes the position to be superimposed, that is, the position where the corresponding string to be superimposed currently needs to be superimposed. Then, according to the position to be superimposed, the target state can be determined from the string states corresponding to the multiple strings to be superimposed, and the target state corresponds to the string to be superimposed that needs to be superimposed first, thereby realizing the sorting of the strings to be superimposed. Therefore, each time superposition is performed, only one string to be superimposed corresponding to the current target state needs to be processed, without the need to allocate two buffers for each string to be superimposed at the same time, which greatly reduces the buffer resource consumption during the string screen display process and effectively reduces the hardware cost.

[0249] like Figure 6 As shown, an embodiment of the present invention further provides a string screen display device, comprising:

[0250] Initialization module 201, used for initializing the string state of each string to be superimposed after receiving the frame synchronization signal;

[0251] A determination module 202, configured to determine a target state from the string state based on a position to be superimposed of the string state, and generate task data according to the target state;

[0252] The superposition module 203 is used to obtain the video input data corresponding to the frame synchronization signal, and perform image superposition processing on the video input data based on the task data to obtain video output data.

[0253] In one implementation, the determining module 202 is further configured to:

[0254] After generating task data according to the target state, the character string to be superimposed corresponding to the target state is used as the target character string, and based on the display direction of the target character string, the position to be superimposed of the target state and the index information of the target state are updated.

[0255] In one implementation, the determining module 202 is specifically configured to:

[0256] Determining a reference position based on a display direction of the target character string;

[0257] Determine whether the position to be superimposed of the target state is the reference position, and obtain a determination result;

[0258] According to the display direction and the determination result, the position to be superimposed and the index information of the target state are updated.

[0259] In one implementation, the determining module 202 is specifically configured to:

[0260] Comparing the position to be superimposed of each string state, the position to be superimposed being the position coordinate of the content to be superimposed in the corresponding string to be superimposed;

[0261] The priorities of the character string states are determined according to the order of the positions to be superimposed from small to large, and the character string state with the highest priority is used as the target state.

[0262] As can be seen from the above, the technical solution provided by the embodiment of the present application is based on the characteristic that in the string screen display scenario, multiple strings to be superimposed will not appear in repeated superposition at the same position, and the string state of each string to be superimposed is initialized, and the string state includes the position to be superimposed, that is, the position where the corresponding string to be superimposed currently needs to be superimposed. Then, according to the position to be superimposed, the target state can be determined from the string states corresponding to the multiple strings to be superimposed, and the target state corresponds to the string to be superimposed that needs to be superimposed first, thereby realizing the sorting of the strings to be superimposed. Therefore, each time superposition is performed, only one string to be superimposed corresponding to the current target state needs to be processed, without the need to allocate two buffers for each string to be superimposed at the same time, which greatly reduces the buffer resource consumption during the string screen display process and effectively reduces the hardware cost.

[0263] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0264] Memory 703, used for storing computer programs;

[0265] The processor 701 is used to execute the program stored in the memory 703 to implement the following steps:

[0266] After receiving the frame synchronization signal, the string state of each string to be superimposed is initialized;

[0267] Based on the position to be superimposed of the string state, determining a target state from the string state, and generating task data according to the target state;

[0268] The video input data corresponding to the frame synchronization signal is acquired, and based on the task data, image overlay processing is performed on the video input data to obtain video output data.

[0269] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0270] The communication interface is used for communication between the above terminal and other devices.

[0271] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0272] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0273] As can be seen from the above, in the solution provided by the present application, based on the characteristic that multiple strings to be superimposed will not appear in the same position for repeated superposition in the string screen display scenario, the string state of each string to be superimposed is initialized, and the string state includes the position to be superimposed, that is, the position where the corresponding string to be superimposed currently needs to be superimposed. Then, the target state can be determined from the string states corresponding to the multiple strings to be superimposed according to the position to be superimposed, and the target state corresponds to the string to be superimposed that needs to be superimposed first, thereby realizing the sorting of the strings to be superimposed. Therefore, each time superposition is performed, only one string to be superimposed corresponding to the current target state needs to be processed, without the need to allocate two buffers for each string to be superimposed at the same time, which greatly reduces the buffer resource consumption during the string screen display process and effectively reduces the hardware cost.

[0274] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0275] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0276] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0277] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for displaying a character string on a screen, characterized in that: include: After receiving the frame synchronization signal, the string state of each string to be superimposed is initialized; Based on the position to be superimposed of the string state, determining a target state from the string state, and generating task data according to the target state; The video input data corresponding to the frame synchronization signal is acquired, and based on the task data, image overlay processing is performed on the video input data to obtain video output data.

2. The method for displaying a character string on a screen according to claim 1, characterized in that: After generating task data according to the target state, the method further includes: The character string to be superimposed corresponding to the target state is used as the target character string, and based on the display direction of the target character string, the position to be superimposed of the target state and the index information of the target state are updated.

3. The method for displaying a character string on a screen according to claim 2, characterized in that: The updating of the to-be-superimposed position and index information of the target state based on the display direction of the target character string includes: Determining a reference position based on a display direction of the target character string; Determine whether the position to be superimposed of the target state is the reference position, and obtain a determination result; According to the display direction and the determination result, the position to be superimposed of the target state and the index information are updated.

4. The method for displaying a character string on a screen according to claim 3, characterized in that: The determining of the reference position based on the display direction of the target character string includes: When the display direction of the target character string is horizontal, the end of each row of the pixel matrix of the target character string except the last row is used as a reference position; In the case that the display direction of the target character string is the vertical direction, the last row of any character in the pixel matrix of the target character string is used as the reference position.

5. The method for displaying a character string on a screen according to claim 1, characterized in that: The generating task data according to the target state includes: Determining whether the first buffer is full, the storage depth of the first buffer being not less than 2; If the first buffer is not full, generating task data according to the target state, and storing the task data in the first buffer; If the first buffer is full, the process returns to the step of determining whether the first buffer is full.

6. The method for displaying a character string on a screen according to claim 1, characterized in that: The step of performing image overlay processing on the video input data based on the task data to obtain video output data comprises: Determining pixel data corresponding to the task data; Acquire video input data corresponding to the frame synchronization signal; Based on the task data and the corresponding pixel data that match the position information of the video input data, image superposition processing is performed on the video input data to obtain video output data.

7. The method for displaying a character string on a screen according to claim 6, characterized in that: Before determining the pixel data corresponding to the task data, the method further includes: Determine whether the first buffer is empty and whether the second buffer is full, the storage depth of the first buffer and the second buffer being no less than 2; If the first buffer is not empty and the second buffer is not full, reading the task data from the first buffer and writing the task data into the second buffer; After acquiring the video input data corresponding to the frame synchronization signal, the method further includes: The task data is read from the second buffer, and it is detected whether the position information of the task data matches the position information of the video input data.

8. The method for displaying a character string on a screen according to claim 6, characterized in that: After determining the pixel data corresponding to the task data, the method further includes: Writing the pixel data into a third buffer, wherein the storage depth of the third buffer is not less than 2; After acquiring the video input data corresponding to the frame synchronization signal, the method further includes: The pixel data is read from the third buffer.

9. The method for displaying a character string on a screen according to claim 6, characterized in that: The determining the pixel data corresponding to the task data includes: Calculating a first offset and a second offset based on the index information in the task data and the pre-acquired character library information; Determining a target position corresponding to the task data in a preset character library according to the first offset and the second offset; Pixel data is obtained from the preset character library according to the target position.

10. The method for displaying a character string on a screen according to claim 6, characterized in that: The step of performing image superposition processing on the video input data based on the task data matching the position information of the video input data and the corresponding pixel data to obtain the video output data comprises: Dequantizing the pixel data matching the position information of the video input data according to the bit width of the video input data to obtain font transparency; Calculating the overlay transparency according to the character library transparency and the task data matched with the position information of the video input data; Video output data is calculated based on the overlay transparency, the task data and the color channel data of the video input data.

11. The method for displaying a character string on a screen according to any one of claims 1 to 10, characterized in that: The step of determining a target state from the string state based on the position to be superimposed of the string state includes: Comparing the position to be superimposed of each string state, the position to be superimposed being the position coordinate of the content to be superimposed in the corresponding string to be superimposed; The priorities of the character string states are determined according to the order of the positions to be superimposed from small to large, and the character string state with the highest priority is used as the target state.

12. A character string screen display device, characterized in that: include: An initialization module, used to initialize the string state of each string to be superimposed after receiving a frame synchronization signal; A determination module, configured to determine a target state from the string state based on a position to be superimposed of the string state, and generate task data according to the target state; The superposition module is used to obtain the video input data corresponding to the frame synchronization signal, and based on the task data, perform image superposition processing on the video input data to obtain video output data.

13. The character string screen display device according to claim 12, characterized in that: The determining module is also used for: After generating task data according to the target state, the character string to be superimposed corresponding to the target state is used as the target character string, and based on the display direction of the target character string, the position to be superimposed of the target state and the index information of the target state are updated.

14. The character string screen display device according to claim 13, characterized in that: The determination module is specifically used for: Determining a reference position based on a display direction of the target character string; Determine whether the position to be superimposed of the target state is the reference position, and obtain a determination result; According to the display direction and the determination result, the position to be superimposed and the index information of the target state are updated.

15. The character string screen display device according to any one of claims 12 to 14, characterized in that: The determination module is specifically used for: Comparing the position to be superimposed of each string state, the position to be superimposed being the position coordinate of the content to be superimposed in the corresponding string to be superimposed; The priorities of the character string states are determined according to the order of the positions to be superimposed from small to large, and the character string state with the highest priority is used as the target state.

16. An electronic device, characterized in that: include: The character string screen display device according to any one of claims 12 to 15.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.