Frame buffer storage method and device

By determining the relationship between the current frame and the previous frame in the frame buffer and reasonably allocating storage space, the picture tearing problem caused by the out-of-synchronization of read and write in the frame buffer is solved, and efficient frame rate and smooth display are achieved.

CN119152790APending Publication Date: 2024-12-17MIDEA SMART TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310710416.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The high-resolution display is not synchronized in the frame buffer and the screen is tear, the refresh frame rate is low, and it cannot provide a smooth display effect.

Method used

By determining the relationship between the current frame and the previous frame, reasonably allocate the frame buffer storage space, accurately lock the target refresh data, ensure reading and writing synchronization, improve the read and write efficiency of the frame buffer, and avoid screen tearing.

Benefits of technology

It realizes the maximum time saving when reading and writing synchronization, ensuring smooth and no lag in each frame, and improving the picture fluency and refresh rate of the display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152790A_ABST
    Figure CN119152790A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a frame buffer storage method and device. The method comprises the following steps: acquiring a target refresh area of a current frame and refresh data of the target refresh area; determining target refresh data of the current frame based on a historical refresh area of a previous frame of the current frame, the target refresh area and refresh data of the target refresh area; and indicating a target frame buffer to store the target refresh data. According to the invention, the target refresh data required by the current frame can be accurately locked according to the relationship between the current frame and the previous frame, and the target frame buffer is indicated to store the target refresh data of the current frame, so that the read-write rate of the frame buffer is ensured, and the picture fluency of a display end is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a frame buffer storage method and device. Background Art

[0002] With the development of display technology, high-resolution display screens have been widely used in various fields. High-resolution display screens read screen data stored in the frame buffer by refreshing to complete the picture display. However, in the process of refreshing and reading screen data on the display end, if the read data and write data in the frame buffer are inconsistent, it is easy to cause screen tearing, that is, in the process of switching the entire frame, the residual writing will affect the read data, resulting in the problem of more than two adjacent pictures appearing on the same screen.

[0003] In the prior art, frame buffer processing is usually performed by one buffer A being responsible for receiving graphics library data and another buffer B being responsible for sending data. When data is updated in buffer A, the latest data in buffer A is updated to buffer B. When such processing is performed on a storage medium with a relatively low speed such as pseudo static random access memory (PSRAM) which is relatively synchronous dynamic random-access memory (SDRAM) or double data rate synchronous dynamic random access memory (DDR SDRAM), the PSRAM is read and written more frequently, resulting in a longer frame switching time, a lower refresh frame rate, and an inability to provide a high refresh rate for the display end, resulting in an unsmooth picture on the display end. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the related art. To this end, the present invention proposes a frame buffer storage method, which can reasonably allocate the storage space of the frame buffer, accurately lock the target refresh data required for the current frame according to the relationship between the current frame and the previous frame, and instruct the target frame buffer to store the target refresh data of the current frame, so as to ensure the read and write rate of the frame buffer and improve the picture smoothness of the display end.

[0005] The invention also provides a frame buffer storage device.

[0006] The invention also provides an electronic device.

[0007] The present invention also provides a non-transitory computer-readable storage medium.

[0008] The present invention also provides a computer program product.

[0009] A frame buffer storage method according to an embodiment of a first aspect of the present invention includes:

[0010] Acquire the target refresh area of ​​the current frame and the refresh data of the target refresh area of ​​the target refresh area;

[0011] Determine the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area;

[0012] Instruct the target frame buffer to store the target refresh data.

[0013] According to the frame buffer storage method of the embodiment of the present invention, firstly, a target frame buffer is selected for the data that needs to be refreshed for the current frame, and then the relationship between the target refresh area of ​​the current frame and the historical refresh area of ​​the previous frame is determined to further determine the data that needs to be refreshed for the current frame stored in the target frame buffer in combination with the refresh data of the target refresh area. The method of the present invention can save time to the greatest extent under the premise of storing data, i.e. writing data and satisfying read-write synchronization, and ensure that there is readable refresh data in the buffer when each read data instruction arrives. Under the premise of satisfying read-write synchronization, the read-write efficiency is effectively improved, and the switching of each frame of the screen can be smooth and without lag, and there will be no tearing.

[0014] According to an embodiment of the present invention, determining the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area includes:

[0015] Comparing the sizes of the historical refresh area and the target refresh area;

[0016] Based on the comparison result and the refresh data of the target refresh area, the target refresh data of the current frame is determined.

[0017] According to an embodiment of the present invention, determining the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area includes:

[0018] Based on the comparison result that the target refresh area covers the historical refresh area, it is determined that the refresh data of the target refresh area is the target refresh data of the current frame.

[0019] According to an embodiment of the present invention, determining the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area includes:

[0020] Based on the comparison result that the target refresh area does not cover the historical refresh area, the refresh data of the previous frame corresponding to the uncovered area in the historical refresh area and the refresh data of the target refresh area are determined as the target refresh data of the current frame.

[0021] According to one embodiment of the present invention, the comparison result that the target refresh area covers the historical refresh area includes the comparison result that the target refresh area and the historical refresh area are the same size and are the size of the entire screen, the comparison result that the target refresh area and the historical refresh area are the same size and are the same part of the screen, and one of the comparison results that the target refresh area is larger than the historical refresh area and the target refresh area covers the historical refresh area.

[0022] According to one embodiment of the present invention, the target buffer includes a first frame buffer and a second frame buffer;

[0023] Searching for refresh data of the previous frame in the first frame buffer and the second frame buffer;

[0024] The buffer in which the refresh data of the previous frame is found is determined as the target buffer.

[0025] According to an embodiment of the present invention, the target buffer is used to store the target refresh data, and send the target refresh data to the display end based on a sending thread.

[0026] According to an embodiment of the present invention, acquiring the target refresh area of ​​the current frame and the refresh data of the target refresh area of ​​the target refresh area includes:

[0027] Based on the transmission completion mark of the refresh data of the previous frame, the target refresh area of ​​the current frame and the refresh data of the target refresh area of ​​the target refresh area are acquired from a graphics library.

[0028] A frame buffer storage device according to an embodiment of a second aspect of the present invention comprises:

[0029] An input module, used for acquiring a target refresh area of ​​a current frame and refresh data of a target refresh area of ​​the target refresh area;

[0030] A refresh comparison module, configured to determine target refresh data of the current frame based on a historical refresh area of ​​a previous frame of the current frame, the target refresh area, and refresh data of the target refresh area;

[0031] The output module is used to instruct the target frame buffer to store the target refresh data.

[0032] According to the frame buffer storage device of the embodiment of the present invention, the output module selects the target frame buffer for the data that needs to be refreshed in the current frame, and the input module and the refresh comparison module determine the relationship between the target refresh area of ​​the current frame and the historical refresh area of ​​the previous frame, and further determine the data that needs to be refreshed in the current frame stored in the target frame buffer in combination with the refresh data of the target refresh area. The device of the present invention can save time to the greatest extent when storing data, and ensure that there is readable refresh data in the buffer when each read data instruction arrives. Under the premise of satisfying read-write synchronization, the read-write efficiency is effectively improved, and the switching of each frame of the screen can be smooth and without jamming, and there will be no tearing.

[0033] An electronic device according to an embodiment of the third aspect of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned frame buffer storage method when executing the program.

[0034] According to the non-transitory computer-readable storage medium of the fourth aspect of the present invention, a computer program is stored thereon, and when the computer program is executed by a processor, the steps of the frame buffer storage method as described above are implemented.

[0035] A computer program product according to an embodiment of the fifth aspect of the present invention comprises a computer program, which implements the steps of the above-mentioned frame buffer storage method when executed by a processor.

[0036] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: by alternating the operation of the first frame buffer and the second frame buffer, different frame buffers can be read alternately when reading data of the previous and next frames, thereby avoiding the time waste caused by locking the frames.

[0037] Furthermore, compared to the traditional frame buffer processing solution, when determining that there is data update in the buffer, all the latest data are updated to another buffer, the present invention needs to determine the relationship between the current frame and the previous frame, and does not need to copy the entire frame in all cases.

[0038] Furthermore, the existence of the target buffer area can ensure smooth switching of the display without any lag and screen tearing while ensuring strict frame synchronization.

[0039] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 is a flow chart of a frame buffer storage method provided by an embodiment of the present invention;

[0042] Figure 2 It is a flow chart of a display method for storing data in a frame buffer area provided by an embodiment of the present invention;

[0043] Figure 3 is a structural schematic diagram of a frame buffer storage device provided by an embodiment of the present invention;

[0044] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0047] Video memory generally refers to graphics card memory, also known as frame buffer. Its function is to store rendering data that has been processed or is about to be extracted by the graphics card chip. High-resolution display screen chips generally do not have video memory, and the main control needs to be responsible for refreshing the entire screen data. If the refresh process is not handled properly, it is easy to cause screen tearing. In some usage scenarios, the chip uses PSRAM as video memory. That is, control the read and write pointers so that the read pointer (that is, the video memory sends data to the screen) is twice the write pointer (that is, the graphics library writes data to the video memory), so as to achieve synchronous reading and writing and improve the screen tearing. However, due to the characteristics of PSRAM being between memory and flash, its hardware limitations result in a very slow rate of writing data to it. Therefore, in order to ensure consistent read and write speeds, the read speed will also be slow, thus affecting the frame rate, further affecting the smoothness of the display and the viewing experience.

[0048] In view of the above problems, the present invention proposes a frame buffer storage method, which runs on a processor and is used to control a frame buffer for data storage, such as Figure 1 As shown, the method comprises at least the following steps:

[0049] Step 101, obtaining a target refresh area and refresh data of the target refresh area of ​​the current frame;

[0050] Step 102, determining target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area;

[0051] Step 103: Instruct the target frame buffer to store the target refresh data.

[0052] Regarding step 101, it should be noted that certain preparations need to be made before refreshing the current frame: first, the target refresh area of ​​the current frame needs to be determined. The target refresh area is the area that needs to be updated in the display end screen corresponding to the current frame. Obtaining the target refresh area of ​​the current frame means obtaining the area edge coordinates of the target refresh area, or obtaining the size of the target refresh area and the relative position relationship with the display end screen, etc., which can indicate the position of the target refresh area. Secondly, it is necessary to retrieve the refresh data of the target refresh area in the graphics database, that is, the update data of the current frame.

[0053] It should be noted that the refresh data of the target refresh area is not necessarily the target refresh data of the current frame stored in the final target frame buffer, and further determination is required.

[0054] Regarding step 102, it should be noted that the historical refresh area is the refresh area corresponding to the previous frame data that has been transmitted to the display. To determine the refresh data of the target refresh area of ​​the current frame, it is necessary to combine the historical refresh area of ​​the previous frame and the target refresh area of ​​the current frame for judgment. The judgment logic is: determine whether the target refresh area of ​​the current frame contains or covers the historical refresh area of ​​the previous frame. If so, the target refresh data of the current frame can be determined without additional data. Otherwise, it is necessary to combine the refresh data of the previous frame to jointly determine the target refresh data of the current frame.

[0055] Regarding step 103, it should be noted that after determining the target refresh data of the current frame, the processor will send a control instruction to the buffer, instructing the target frame buffer to store the target refresh data. The target frame buffer is another frame buffer different from the frame buffer where the refresh data of the previous frame is stored. In the implementation environment of the present invention, the frame buffer is two independent areas in the PSRAM that do not affect each other. By alternating the frame buffer to store the refresh data of two adjacent frames, the read-write strategy of the dual display memory exchange is realized to avoid screen tearing.

[0056] The frame buffer storage method of the embodiment of the present invention not only selects a target frame buffer for the data that needs to be refreshed in the current frame, but also determines the relationship between the target refresh area of ​​the current frame and the historical refresh area of ​​the previous frame, and further determines the data that needs to be refreshed in the current frame stored in the target frame buffer in combination with the refresh data of the target refresh area. This method can save time to the greatest extent when storing data, i.e., writing data, and ensure that when the read data instruction of each frame that the display needs to display arrives, there is readable refresh data in the buffer.

[0057] It can be understood that the target refresh data of the current frame is determined based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area and the refresh data of the target refresh area, including:

[0058] Compare the area sizes of the historical refresh area and the target refresh area;

[0059] Based on the comparison result and the refresh data of the target refresh area, the target refresh data of the current frame is determined.

[0060] It should be noted that the comparison of the area sizes between the historical refresh area and the target refresh area can be subdivided into the following four types:

[0061] Case 1: The current frame target refresh area is the same size as the previous frame historical refresh area and both are the entire screen size. In this case, the current frame is fully refreshed.

[0062] Case 2: The target refresh area of ​​the current frame is the same size as the historical refresh area of ​​the previous frame and they are the same part of the screen. In this case, the current frame is a partial refresh of the same area as the previous frame.

[0063] Case 3: The current frame target refresh area is larger than the previous frame historical refresh area, and the current frame target refresh area covers the previous frame historical refresh area. In this case, the current frame is a partial refresh including the previous frame refresh area.

[0064] Case 4: The current frame refresh area does not cover or does not completely cover the previous frame refresh area. In this case, the current frame is a partial refresh that does not include or does not completely include the previous frame refresh area.

[0065] Based on the above four situations, in the first three situations, the refresh data of the previous frame does not affect the current frame, so the target refresh data can be obtained directly based on the original data in the graphics library. In situation 4, the refresh area of ​​the previous frame appears in the refresh area not included in the current frame. If the target refresh data is not determined in combination with the data of the previous frame, it is easy to make the picture transition not smooth and jumpy.

[0066] Therefore, the frame buffer storage method of the embodiment of the present invention can obtain the relationship between the current frame and the previous frame by comparing the area sizes, and determine whether it is necessary to merge the refresh data of the previous frame with the initial refresh data of the current frame based on the comparison result, thereby avoiding the waste caused by the need to completely copy each frame in the double-buffer scheme of the existing scheme. There is no need to copy all the data of the previous frame to determine the target refresh data of the current frame, thereby improving the refresh rate.

[0067] Specifically, determining the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area may include:

[0068] Based on the comparison result that the target refresh area covers the historical refresh area, the refresh data of the target refresh area is determined as the target refresh data of the current frame.

[0069] It can be understood that the comparison results of the target refresh area covering the historical refresh area include the comparison results that the target refresh area and the historical refresh area are the same size and are the size of the entire screen, the comparison results that the target refresh area and the historical refresh area are the same size and are the same part of the screen, and the target refresh area is larger than the historical refresh area and the target refresh area covers the historical refresh area.

[0070] Exemplarily, if the target refresh area and the historical refresh area are both fully refreshed, the initial refresh data of the current frame is directly stored; if the target refresh area and the historical refresh area are both partially refreshed, the initial refresh data of the current frame is directly stored; if the target refresh area exceeds the historical refresh area, the initial refresh data of the current frame is directly stored.

[0071] It should be noted that the case where the target refresh area covers the historical refresh area includes the three relative relationships between the previous and next frames in the above cases 1 to 3. In this case, no matter what the difference is between the historical refresh area and the current frame, the historical data will be overwritten by the data of the current frame, and will not affect the refresh of the target refresh area of ​​the current frame. Therefore, when the target refresh area covers the historical refresh area, the refresh data of the current frame sent by the graphics library can be directly used.

[0072] Specifically, determining the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area may also include:

[0073] Based on the comparison result that the target refresh area does not cover the historical refresh area, the refresh data of the previous frame corresponding to the uncovered area in the historical refresh area and the refresh data of the target refresh area are determined as the target refresh data of the current frame.

[0074] Exemplarily, if the target refresh area does not completely include the historical refresh area, the area not included in the historical refresh area and the initial refresh data of the current frame are stored together.

[0075] It should be noted that the situation where the target refresh area does not cover the historical refresh area includes the above-mentioned situation 4, that is, in this case, the refresh area of ​​the previous frame will appear in the area not covered by the current frame. At this time, it is necessary to copy back this part of the data from the graphics library, that is, partial copy back. After partial copy back, the target refresh data of the current frame will contain two parts of content, one is the original refresh data of the current frame, and the other is the refresh data of the previous frame that is not covered by the current frame after copying back. The original refresh data of the current frame provides the real refresh content for the display end, and the refresh data of the previous frame that is not covered by the current frame after copying back is used to ensure that the display content of the display end will not jump or flicker.

[0076] The frame buffer storage method of the embodiment of the present invention, under the premise of a dual frame buffer solution, determines the position relationship and size relationship between the current frame and the previous frame in order to improve the reading and writing speed, distinguishes two possible situations, reduces the time for copying data as much as possible, and improves the reading and writing speed, thereby ensuring clear, accurate and smooth display of the picture.

[0077] It can be understood that the target buffer includes a first frame buffer and a second frame buffer;

[0078] In the first frame buffer and the second frame buffer, searching for refresh data of the previous frame;

[0079] The buffer in which the refresh data of the previous frame is not found is determined as the target buffer.

[0080] It should be noted that the target buffer is used to store the refresh data of the current frame. However, each time the target buffer of the current frame is determined, it is necessary to find which of the two frame buffers stores the data of the previous frame and store the refresh data of the current frame in a buffer different from the previous frame.

[0081] Specifically, the frame buffer includes bufferA and bufferB, and the search process may include:

[0082] Check whether the n-th frame data is stored in bufferA and bufferB. If the n-th frame refresh data exists in bufferA, the refresh data of the current frame found in the graphics library is stored in bufferB.

[0083] The frame buffer storage method of the embodiment of the present invention can store the refresh data of the current frame and the refresh data of the previous frame separately by alternating the double buffers when the target refresh area covers the historical refresh area, so as to ensure that the residual data of the previous frame will not be sent by mistake during the process of sending the refresh data of the current frame (i.e., reading data) to the display, thus avoiding screen tearing caused by reading data errors. At the same time, it also avoids the waste of copying time caused by reading and writing separately in the double buffer solution of the prior art, effectively improves the data transmission efficiency, and ensures the refresh rate.

[0084] It is understood that the method further comprises:

[0085] A control instruction is sent to the target frame buffer, where the control instruction is used to instruct the target frame buffer to send the target refresh data to the display end.

[0086] It should be noted that this method runs on the processor and can instruct the target frame buffer to perform a read or write operation. Among them, sending the target refresh data to the display end is a read data operation. The target frame buffer sends data using DMA (Direct Memory Access), also known as grouped data transfer, and sometimes also called direct memory operation. After the transmission is completed, the refresh data of the current frame will be released from the target buffer. Figure 2 As shown, the method also discloses a display method based on the above frame buffer data storage, including:

[0087] Step 201, obtaining the flag of the DMA transfer completion interrupt;

[0088] It should be noted that the DMA transfer completion interrupt indicates that the refresh data transmission of the previous frame is completed, that is, the previous frame data has been refreshed, and at this time, the refresh work of the current frame can be started;

[0089] Step 202, determine whether the graphics library has updated the refresh data of the current frame. If so, exchange the frame buffer, determine the target frame buffer, and send a transmission notification to the graphics library; if not, continue to send the thread;

[0090] Step 203: Send a transmission notification based on the graphics library, determine the target refresh data of the current frame according to the historical refresh area, the target refresh area and the refresh data of the target refresh area of ​​the previous frame, and transmit the current real target refresh data to the target frame buffer;

[0091] Step 204: based on the transmission completion flag of the target frame buffer, start the sending thread;

[0092] It should be noted that the sending thread is awakened by releasing the corresponding control signal, and the target refresh data can be temporarily stored in the transmission pool before being sent. After the sending thread ends, the display screen of the display end will display the refresh data of the current frame.

[0093] The frame buffer storage method of the embodiment of the present invention can achieve both efficiency and smooth screen switching without interruption and tearing at the display end by setting the target buffer for alternating operation.

[0094] It can be understood that obtaining the refresh data of the target refresh area includes:

[0095] Based on the transmission completion flag of the refresh data of the previous frame and the target refresh area, the refresh data of the target refresh area is obtained from the graphics library.

[0096] It should be noted that the graphics library is a kind of refresh data required for storing the preset frames of rendering and synthesizing the final output screen in the memory. Due to the small memory space, the refresh data of each frame will be generated from the CPU in batches and stored in the memory. When receiving the data transmission instruction from the graphics library, the graphics library will send the partial refresh data and its coordinates that need to be partially refreshed, or the refresh data corresponding to the entire screen image that needs to be fully refreshed to the target frame buffer in batches. For example, the graphics library generally stores 20 lines in the memory, and when a frame of the screen image requires 480 lines of data, the graphics library will send the refresh data of the current frame to the target buffer in 24 times. When the target refresh area of ​​the current frame is small, such as an indicator box or a button, the required refresh data obtained from the graphics library may be transmitted in one transmission.

[0097] The frame buffer storage device provided by the present invention is described below. The frame buffer storage device described below and the frame buffer storage method described above can be referred to in correspondence with each other. Figure 3 As shown, the frame buffer storage device 300 is characterized by comprising:

[0098] An input module 301 is used to obtain a target refresh area and refresh data of the target refresh area of ​​a current frame;

[0099] A refresh comparison module 302, for determining target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area and the refresh data of the target refresh area;

[0100] The output module 303 is used to instruct the target frame buffer to store the target refresh data.

[0101] It should be noted that the frame buffer storage device may be composed of the following hardware environment:

[0102] 1. The processor uses an MCU microcontroller with a high main frequency, a 240M dual-core processor, built-in 2M PSRAM, and a peripheral bus frequency of more than 120MHz.

[0103] 2. External FLASH with relatively large capacity: generally more than 8M, connected to the MCU using QSPI.

[0104] 3. Small-sized TFT screen, generally with 360X480 resolution, uses QSPI interface.

[0105] 4. Other peripheral circuits required by the whole machine, such as serial port communication, circuit conversion, etc.

[0106] The frame buffer storage device of the embodiment of the present invention not only selects a target frame buffer for the data that needs to be refreshed in the current frame, but also determines the relationship between the target refresh area of ​​the current frame and the historical refresh area of ​​the previous frame, and further determines the data that needs to be refreshed in the current frame stored in the target frame buffer in combination with the refresh data of the target refresh area. The device can save time to the greatest extent when storing data, i.e., writing data, and ensure that when the read data instruction of each frame that the display needs to display arrives, there is readable refresh data in the buffer.

[0107] It can be understood that the refresh comparison module 302 determines the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area and the refresh data of the target refresh area, including:

[0108] Compare the area sizes of the historical refresh area and the target refresh area;

[0109] Based on the comparison result and the refresh data of the target refresh area, the target refresh data of the current frame is determined.

[0110] It can be understood that the refresh comparison module 302 determines the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area, including:

[0111] Based on the comparison result that the target refresh area covers the historical refresh area, the refresh data of the target refresh area is determined as the target refresh data of the current frame.

[0112] It can be understood that the refresh comparison module 302 determines the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area, including:

[0113] Based on the comparison result that the target refresh area does not cover the historical refresh area, the refresh data of the previous frame corresponding to the uncovered area in the historical refresh area and the refresh data of the target refresh area are determined as the target refresh data of the current frame.

[0114] It can be understood that the comparison results of the target refresh area covering the historical refresh area in the refresh comparison module 302 include the comparison results that the target refresh area and the historical refresh area are the same size and are the size of the entire screen, the comparison results that the target refresh area and the historical refresh area are the same size and are the same part of the screen, and the target refresh area is larger than the historical refresh area and the target refresh area covers the historical refresh area.

[0115] It can be understood that the target buffer includes a first frame buffer and a second frame buffer;

[0116] In the first frame buffer and the second frame buffer, searching for refresh data of the previous frame;

[0117] The buffer in which the refresh data of the previous frame is not found is determined as the target buffer.

[0118] It is understood that the device also includes:

[0119] The sending module is used to send a control instruction to the target frame buffer, and the control instruction is used to instruct the target frame buffer to send the target refresh data to the display end.

[0120] It can be understood that the refresh data of the target refresh area is obtained in the input module 301, including:

[0121] Based on the transmission completion flag of the refresh data of the previous frame and the target refresh area, the refresh data of the target refresh area is obtained from the graphics library.

[0122] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the following method:

[0123] Get the refresh data of the target refresh area of ​​the current frame and the target refresh area of ​​the target refresh area;

[0124] Determine the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area;

[0125] Instructs the destination frame buffer to store the destination refresh data.

[0126] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0127] On the other hand, an embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided by the above-mentioned method embodiments, for example, including:

[0128] Get the refresh data of the target refresh area of ​​the current frame and the target refresh area of ​​the target refresh area;

[0129] Determine the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area;

[0130] Instructs the destination frame buffer to store the destination refresh data.

[0131] In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the transmission method provided in the above embodiments, for example, including:

[0132] Get the refresh data of the target refresh area of ​​the current frame and the target refresh area of ​​the target refresh area;

[0133] Determine the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area;

[0134] Instructs the destination frame buffer to store the destination refresh data.

[0135] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0137] Finally, it should be noted that the above embodiments are only used to illustrate the present invention, rather than to limit the present invention. Although the present invention is described in detail with reference to the embodiments, it should be understood by those skilled in the art that various combinations, modifications or equivalent substitutions of the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and should all be included in the scope of the present invention.

Claims

1. A frame buffer storage method, characterized in that: include: Acquire a target refresh area of ​​a current frame and refresh data of the target refresh area; Determine the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area, and the refresh data of the target refresh area; Instruct the target frame buffer to store the target refresh data.

2. The frame buffer storage method according to claim 1, characterized in that: The determining the target refresh data of the current frame based on the historical refresh area of ​​the previous frame of the current frame, the target refresh area and the refresh data of the target refresh area comprises: Comparing the sizes of the historical refresh area and the target refresh area; Based on the comparison result and the refresh data of the target refresh area, the target refresh data of the current frame is determined.

3. The frame buffer storage method according to claim 2, characterized in that: The step of determining the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area includes: Based on the comparison result that the target refresh area covers the historical refresh area, the refresh data of the target refresh area is determined as the target refresh data of the current frame.

4. The frame buffer storage method according to claim 2, characterized in that: The step of determining the target refresh data of the current frame based on the comparison result and the refresh data of the target refresh area includes: Based on the comparison result that the target refresh area does not cover the historical refresh area, the refresh data of the previous frame corresponding to the uncovered area in the historical refresh area and the refresh data of the target refresh area are determined as the target refresh data of the current frame.

5. The frame buffer storage method according to claim 3, characterized in that: The comparison result that the target refresh area covers the historical refresh area includes the comparison result that the target refresh area and the historical refresh area are the same size and are the size of the entire screen, the comparison result that the target refresh area and the historical refresh area are the same size and are the same part of the screen, and one of the comparison results that the target refresh area is larger than the historical refresh area and the target refresh area covers the historical refresh area.

6. The frame buffer storage method according to any one of claims 1 to 5, characterized in that: The target buffer includes a first frame buffer and a second frame buffer; Searching for refresh data of the previous frame in the first frame buffer and the second frame buffer; The buffer in which the refresh data of the previous frame is not found is determined as the target buffer.

7. The frame buffer storage method according to any one of claims 1 to 5, characterized in that: The method further comprises: A control instruction is sent to the target frame buffer, where the control instruction is used to instruct the target frame buffer to send the target refresh data to the display end.

8. The frame buffer storage method according to any one of claims 1 to 5, characterized in that: Acquiring refresh data of the target refresh area includes: Based on the transmission completion mark of the refresh data of the previous frame and the target refresh area, the refresh data of the target refresh area is acquired from the graphics library.

9. A frame buffer storage device, characterized in that: include: An input module, used for acquiring a target refresh area of ​​a current frame and refresh data of the target refresh area; A refresh comparison module, configured to determine target refresh data of the current frame based on a historical refresh area of ​​a previous frame of the current frame, the target refresh area, and refresh data of the target refresh area; The output module is used to instruct the target frame buffer to store the target refresh data.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the frame buffer storage method according to any one of claims 1 to 8 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the frame buffer storage method according to any one of claims 1 to 8 is implemented.