Image data storage method and device, image data reading method and device, equipment and medium
By splitting and storing the image data, the problem of insufficient continuous memory storage space in image data processing is solved, memory utilization is improved, and efficient image data storage and reading is achieved.
Patent Information
- Application Number
- CN202510111828.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-27
AI Technical Summary
In the field of image data processing technology, with the improvement of image clarity, there is often a problem of insufficient continuous storage space in memory, resulting in a low memory utilization rate.
By obtaining the total image data, resolution and memory storage space usage information of the current frame image, it is determined that the storage method is continuous storage or discontinuous storage. When it is impossible to store continuously, the total image data is split according to the storage space usage information, resolution and total data length, and multiple image data groups and their storage location information are obtained, and stored in memory.
By splitting and storing the total image data, memory utilization can be improved without continuous storage, ensuring that image data can be stored and read efficiently.
Smart Images

Figure CN120047306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to image data storage and reading methods, devices, equipment and media. Background Art
[0002] In the field of image data processing technology, a video graphics array (VGA) module, memory, and data compression module are integrated on the baseboard management controller of the server. After receiving the total image data of each frame of an image sent by the central processor, the VGA can directly transmit it to a local display device for display, or it can process the total image data and then transmit it to a remote display device.
[0003] The specific processing of VGA for total image data is: after receiving the total image data, first determine whether there is enough continuous storage space in the memory. If so, the total image data can be written to the continuous storage space in the memory. If not, it is necessary to wait for the storage space in the memory to be released and then obtain enough continuous storage space before storing.
[0004] With the development of technology, the clarity of images is getting higher and higher. Correspondingly, the amount of image data that needs to be transmitted is also relatively large (for example, the data volume corresponding to a 4K resolution image is 3840×2160×32 bits). The situation where there is insufficient continuous storage space in the memory is also relatively frequent, resulting in low memory utilization. Summary of the invention
[0005] In view of this, the present invention provides an image data storage and reading method, device, computer equipment, storage medium and program product to solve the problem of low memory utilization.
[0006] In a first aspect, the present invention provides a method for storing image data, the method comprising:
[0007] Obtaining total image data corresponding to the current frame image, resolution, total data length corresponding to the total image data, and storage space usage information of the memory;
[0008] Determining a storage mode corresponding to the total image data according to the storage space usage information and the total data length, wherein the storage mode includes continuous storage or discontinuous storage;
[0009] When the storage mode is determined to be discontinuous storage, the total image data is split according to the storage space usage information, the resolution, and the total data length to obtain a plurality of image data groups and grouping information corresponding to each image data group, wherein the grouping information includes storage location information;
[0010] The target image data group is stored in a storage location in the memory corresponding to the target storage location information, wherein the target image data group is any image data group among the multiple image data groups, and the target storage location information is the storage location information corresponding to the target image data group.
[0011] The image data storage method provided by the present invention has the following advantages:
[0012] When storing the total image data of each frame of image, firstly, an analysis is performed based on the acquired storage space usage information and the total data length corresponding to the total image data to determine whether the total image data can be stored continuously, that is, to determine whether the storage method corresponding to the total image data is continuous storage or discontinuous storage. When it is determined that the total image data cannot be stored continuously, the total image data is split according to the storage space usage information, resolution, and total data length to obtain multiple image data groups and storage location information corresponding to each image data group. Finally, the image data groups can be stored according to the storage location information. In this way, when the total image data cannot be stored continuously, the memory utilization rate can be improved by splitting and storing the total image data.
[0013] In an optional implementation, the grouping information also includes the ordering corresponding to the image data groups; and the method further includes:
[0014] generating an image descriptor table corresponding to the total image data according to the ranking corresponding to each image data group and the storage location information corresponding to each image data group;
[0015] The image descriptor table is stored.
[0016] Specifically, by generating an image descriptor table based on the sorting of image data groups and the storage location information of the image data groups, the exact storage location of each part of the image data in the total image data and the location (i.e., sorting) of each part of the image data in the total image data can be accurately recorded. In this way, by recording the image descriptor table, the total image data can be accurately split and stored, thereby improving memory utilization.
[0017] In an optional implementation, an image descriptor table corresponding to the total image data is generated according to the order corresponding to each image data group and the storage location information corresponding to each image data group, including:
[0018] generating end indication information corresponding to the target image data group according to the order corresponding to the target image data group and the number of the image data groups;
[0019] generating an image descriptor corresponding to the target image data group according to the end indication information corresponding to the target image data group and the target storage location information;
[0020] An image descriptor table corresponding to the total image data is generated according to the ranking corresponding to each image data group and the image descriptor corresponding to each image data group.
[0021] Specifically, according to the order of the image data groups and the number of the image data groups, the end indication information is generated, and the image descriptor is generated through the end indication information and the storage location information, and then, according to each image descriptor and the order, the image descriptor table is constructed. In this way, by recording the storage location information of each image data group and the end indication information through the image descriptor, the total image data can be accurately split and stored, thereby improving the memory utilization.
[0022] In an optional embodiment, each image data set includes image data of one row or a plurality of consecutive rows of pixels in the total image data;
[0023] According to the order corresponding to the target image data group and the number of the image data groups, generating end indication information corresponding to the target image data group, including:
[0024] determining whether the ranking corresponding to the target image data set is equal to the number of image data sets;
[0025] When it is determined that the ranking corresponding to the target image data group is less than the number of image data groups, determining the first preset indication information as the end indication information, wherein the first preset indication information is used to indicate that the target image data group is not the last image data group in the total image data;
[0026] or,
[0027] When it is determined that the order corresponding to the target image data group is equal to the number of image data groups, the second preset indication information is determined as the end indication information, wherein the second preset indication information is used to indicate that the target image data group is the image data group corresponding to the last pixel in the total image data.
[0028] Specifically, if the total image data includes the order of the image data groups and the number of image data groups, the recorded content is large and occupies a large space. When reading it later, complex analysis operations are required to determine whether the complete total image data has been read. However, this solution only records the first preset indication information and the second preset indication information in the image descriptor, which can reduce the recorded content and save memory space. When reading it later, only a simple judgment operation is required to determine whether the total image data has been read.
[0029] In a second aspect, the present invention provides an image data reading method, the method comprising:
[0030] When a trigger condition for displaying the current frame image is obtained, the total storage location information is obtained, wherein the total storage location information includes at least one storage location information;
[0031] According to each storage location information, read the image data group stored in the storage location corresponding to each storage location information;
[0032] According to the image data group stored in the storage position corresponding to each storage position information, the total image data corresponding to the current frame image is formed;
[0033] The total image data is sent to the display device to display the current frame image.
[0034] The image data reading method provided by the present invention has the following advantages:
[0035] When reading the total image data corresponding to each frame of image, the total storage location information may be read first, and one image data group may be read respectively according to at least one storage location information included in the total storage location information, and all the read image data groups constitute the total image data. In this way, different image data groups belonging to the total image data corresponding to the same frame of image may be distributed in a plurality of discontinuous storage locations in the memory, and when reading the image data, the image data may be read respectively according to each storage location information, which may improve the memory utilization.
[0036] In an optional implementation manner, obtaining total storage location information includes:
[0037] In the current processing round, obtain the target starting address;
[0038] Reading a target image descriptor according to a target start address and a preset data length, wherein the target image descriptor is an image descriptor corresponding to any image data group;
[0039] Parsing the target image descriptor to obtain target storage location information and target end indication information;
[0040] Determine whether to continue to perform the read operation according to the target end indication information;
[0041] When it is determined not to continue to perform the read operation, determining that the total storage location information has been read;
[0042] or,
[0043] When it is determined to continue to perform the read operation, enter the next processing round corresponding to the current processing round, until it is determined not to continue to perform the read operation in any processing round, and it is determined that the total storage location information is read;
[0044] The storage location information respectively parsed in all processing rounds executed together constitutes the total storage location information.
[0045] Specifically, in each processing round, the target start address is obtained, and according to the target start address, the image descriptor is read, and the storage location information and the end indication information are obtained by parsing the image descriptor. Then, the image data group can be read through the storage location information, and whether to read the next image descriptor can be determined through the end indication information. In this way, part of the image data in the total image data can be obtained from discontinuous storage locations, thereby improving the utilization rate of memory resources. Moreover, it is more convenient to determine whether to continue the reading operation (that is, to determine whether the total image data has been read) only through the end indication information, rather than through complex analysis operations, such as whether a sufficient number of image data groups have been read, or whether the length of the read image data is equal to the length of the total image data, and the amount of information recorded is less, which can save resources.
[0046] In an optional implementation, determining whether to continue to perform the read operation according to the target end indication information includes:
[0047] When it is determined that the target end indication information includes first preset indication information, determining not to continue to perform the reading operation, wherein the first preset indication information is used to indicate that the target image data group corresponding to the target image descriptor is not the last image data group in the total image data;
[0048] or,
[0049] When it is determined that the target end indication information includes the second preset indication information, it is determined to continue to perform the reading operation, wherein the second preset indication information is used to indicate that the target image data group is the last image data group in the total image data.
[0050] Specifically, by judging whether the end indication information is the first preset indication information or the second preset indication information, it is decided whether to continue the reading operation. Only a simple judgment operation is required, which can save resources and improve reading efficiency.
[0051] In a third aspect, the present invention provides an image data storage device, the device comprising:
[0052] A first acquisition module is used to acquire total image data corresponding to the current frame image, resolution, total data length corresponding to the total image data, and storage space usage information of the memory;
[0053] A determination module, used to determine a storage mode corresponding to the total image data according to the storage space usage information and the total data length, wherein the storage mode includes continuous storage or discontinuous storage;
[0054] a splitting module, for splitting the total image data according to the storage space usage information, the resolution, and the total data length to obtain a plurality of image data groups and grouping information corresponding to each image data group when the storage mode is determined to be discontinuous storage, wherein the grouping information includes storage location information;
[0055] The storage module is used to store the target image data group to a storage location in the memory corresponding to the target storage location information, wherein the target image data group is any image data group among multiple image data groups, and the target storage location information is the storage location information corresponding to the target image data group.
[0056] In a fourth aspect, the present invention provides an image data reading device, the device comprising:
[0057] A second acquisition module is used to acquire total storage location information when a trigger condition for displaying the current frame image is acquired, wherein the total storage location information includes at least one storage location information;
[0058] A reading module, used for reading the image data group stored in the storage position corresponding to each storage position information according to each storage position information;
[0059] A composition module, used to form total image data corresponding to the current frame image according to the image data group stored in the storage position corresponding to each storage position information;
[0060] The sending module is used to send the total image data to the display device for displaying the current frame image.
[0061] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the image data storage method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0062] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the image data reading method of the second aspect or any corresponding embodiment thereof by executing the computer instructions.
[0063] In a seventh aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image data storage method of the first aspect or any corresponding embodiment thereof.
[0064] In an eighth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the image data reading method of the second aspect or any corresponding embodiment thereof.
[0065] In a ninth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the image data storage method of the first aspect or any corresponding embodiment thereof.
[0066] In a tenth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the image data reading method of the second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are 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.
[0068] Figure 1 is a schematic diagram of the architecture of an image data processing system according to an embodiment of the present invention;
[0069] Figure 2 is a schematic flow chart of an image data storage method according to an embodiment of the present invention;
[0070] Figure 3 is a schematic diagram of the structure of an image descriptor according to an embodiment of the present invention;
[0071] Figure 4 is a schematic flow chart of an image data reading method according to an embodiment of the present invention;
[0072] Figure 5 is a schematic diagram of a process of reading an image descriptor and an image data group according to an embodiment of the present invention;
[0073] Figure 6 is a structural block diagram of an image data storage device according to an embodiment of the present invention;
[0074] Figure 7 is a structural block diagram of an image data reading device according to an embodiment of the present invention;
[0075] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0077] The embodiment of the present invention provides a baseboard management controller (Baseboard Management Controller, BMC), such as Figure 1 As shown, the BMC may include a video graphics array (VGA) module, a memory, a data capture module, a data compression module, a network module, a digital-to-analog converter (DAC), etc. Among them, the VGA module may include an image data processing submodule, an image descriptor generation submodule, and an image descriptor reading submodule, etc. The memory may be a double data rate (DDR) memory. The VGA module may communicate with the central processing unit through the peripheral component interconnect Express (PCIE) protocol to receive the total image data of each frame of the image sent by the central processing unit. The digital-to-analog converter module may be connected to a local display device. The network module may be connected to a remote display device.
[0078] The image data processing submodule can be used to send the total image data of a frame of image to the Digital-to-Analog Converter (DAC) module every time the total image data of a frame of image is received from the central processor, and the DAC module processes the total image data of the frame of image to generate a corresponding analog signal and sends it to the local display device for display. The local display device refers to a display device directly connected to the BMC via a cable.
[0079] Alternatively, the image data processing submodule may be used to process the total image data of each frame of image received and write it into the memory each time the total image data of a frame of image sent by the central processor is received. For example, determine whether to split the total image data of the frame of image, perform the splitting operation, write the split image data (i.e., image data group) into the memory, etc. The image descriptor generation submodule may be used to generate image descriptors, and generate an image descriptor table corresponding to the total image data, and write it into the memory. The image descriptor reading submodule may be used to read the image descriptor table from the memory, parse the image descriptors in the image descriptor table, and send the parsing result to the data capture module after obtaining it. For example, the parsing result may include storage location information. The data capture module may be used to read the total image data from the memory according to the storage location information in the parsing result after receiving the parsing result sent by the image descriptor reading submodule, and send it to the data compression module. The data compression module may be used to compress the total image data according to a preset compression algorithm, and then write it back into the memory. For example, the compression algorithm may be the Joint Photographic Experts Group (JPEG). The network module can be used to read the compressed total image data from the memory and send it to the remote display device. After the remote display device receives the compressed total image data, it parses the total image data and displays the corresponding image.
[0080] When reading and writing image data or image descriptors from the memory, each of the above modules may read and write through an Advanced eXtensible Interface (AXI) bus.
[0081] An embodiment of the present invention provides a method for storing and reading image data. The total image data corresponding to an image is split and stored in discontinuous storage locations in a memory. When reading, the total image data corresponding to the current frame image can be read from the discontinuous storage locations, thereby improving memory utilization.
[0082] According to an embodiment of the present invention, an embodiment of an image data storage method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0083] In this embodiment, a method for storing image data is provided, which can be executed by the above-mentioned BMC. Figure 2 is a flowchart of an image data storage method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0084] Step S201, obtaining total image data corresponding to the current frame image, resolution, total data length corresponding to the total image data, and storage space usage information of the memory.
[0085] The storage space usage information may include the length and start address of at least one continuous storage space in the memory, etc. The resolution may include horizontal resolution and / or vertical resolution.
[0086] Specifically, during the processing of the current frame image, the central processing unit can transmit image data in units of one pixel. When the BMC detects a vertical synchronization signal, it is determined that the image data transmission process of a new frame image is started. Whenever the BMC detects a horizontal synchronization signal, it is determined that the image data transmission process of a new row of pixels is started, and the pre-constructed first counter is increased by a preset value, and the pre-constructed second counter is cleared. In the process of transmitting the image data of each row of pixels, each time the image data of one pixel is received, the pre-constructed second counter can be increased by a preset value. When the horizontal synchronization signal is detected again, it is determined that the transmission process of the total image data of the current frame image is completed. At this time, the first count value is read from the first timer, and the second count value is read from the second timer. The first count value can be used as the longitudinal resolution, and the second count value can be used as the lateral resolution. The longitudinal resolution and the lateral resolution constitute the resolution corresponding to the current frame image. In addition, the BMC can determine the total data length of the total image data, and identify the storage space usage information of the memory.
[0087] Step S202, determining a storage method corresponding to the total image data according to the storage space usage information and the total data length.
[0088] The storage method may include continuous storage or discontinuous storage.
[0089] Specifically, step S202 may include:
[0090] Step 1: Determine whether the length of the remaining storage space in the memory is greater than or equal to the total data length based on the length corresponding to each continuous storage space and the total data length, and determine whether there is a target continuous storage space for storing the total image data in at least one continuous storage space.
[0091] Step 2: when it is determined that the length of the remaining storage space is greater than or equal to the total data length, and it is determined that there is no target continuous storage space in at least one continuous storage space, the storage mode is determined to be discontinuous storage.
[0092] Step three: when it is determined that the length of the remaining storage space is greater than or equal to the total data length, and it is determined that there is a target continuous storage space in at least one continuous storage space, the storage mode is determined to be continuous storage.
[0093] Step 4: When it is determined that the length of the remaining storage space is less than the total data length and it is determined that the target continuous storage space does not exist in at least one continuous storage space, it is determined that no storage operation is currently performed, and after waiting for a preset period of time to re-acquire the storage space usage information of the memory, the storage method is re-determined.
[0094] In some optional implementations, before step S202, it can be determined whether the resolution of the current frame image is within a preset resolution range. If yes, the storage mode can be directly determined as continuous storage. If no, the storage mode can be determined according to the above step S202. For example, for a resolution of 640×480, the storage mode can be directly determined as continuous storage. For a resolution of 3840×2160, the storage mode can be determined according to the above step S202.
[0095] Step S203, when it is determined that the storage mode is discontinuous storage, the total image data is split according to the storage space usage information, resolution, and total data length to obtain multiple image data groups and grouping information corresponding to each image data group.
[0096] The grouping information includes storage location information, which includes a start address and data length.
[0097] Specifically, step S203 may include:
[0098] Step 1: Determine the unit data length according to the preset grouping rules, resolution and total data length.
[0099] The preset grouping rule may include at least the number of pixels included in an image data group. The unit data length is used to indicate the data length of a preset number of pixels (e.g., the number of pixels indicated in the aforementioned preset grouping rule). For example, the preset number may be equal to the horizontal resolution.
[0100] Step 2: split the total image data according to the unit data length and the length corresponding to each continuous storage space to obtain multiple image data groups, and allocate a continuous storage space to each image data group.
[0101] The number of pixels corresponding to the image data included in each image data group is an integral multiple of the above-mentioned preset number, and the length allocated to the image data group is greater than or equal to the length of the image data group. For example, when the unit data length is the length of the image data of one row of pixels, each image data group may include image data of one row or multiple consecutive rows of pixels.
[0102] Step three: construct target storage location information according to the target start address of the continuous storage space corresponding to the target image data group and the target data length corresponding to the target image data group.
[0103] The target image data group is any one of the multiple image data groups, and the target storage location information is the storage location information corresponding to the target image data group.
[0104] Step S204, storing the target image data set into a storage location in the memory corresponding to the target storage location information.
[0105] Specifically, for each image data group, the image data group can be stored in the memory according to the storage location information corresponding to the image data group. Taking the target image data group as an example, the storage location corresponding to the target start address can be used as the start storage location, and the target image data group can be stored in the memory. In addition, the BMC can also store the storage location information corresponding to each image data group in the memory for subsequent reading operations.
[0106] In some optional implementations, the grouping information may further include the ordering of the image data groups, and the storage location information may be stored in the memory in the form of image descriptors. Accordingly, after step S203, the following steps may be further performed:
[0107] Step 1: Generate an image descriptor table corresponding to the total image data according to the order corresponding to each image data group and the storage location information corresponding to each image data group.
[0108] Step 1: Generate end indication information corresponding to the target image data group according to the order corresponding to the target image data group and the number of image data groups.
[0109] The end indication information may be an end symbol. The end indication information may include first preset indication information or second preset indication information. The first preset indication information is used to indicate that the target image data group is not the last image data group in the total image data, and the second preset indication information is used to indicate that the target image data group is the image data group corresponding to the last pixel in the total image data. For example, the first preset indication information is a value of "0", and the second preset indication information may be a value of "1".
[0110] Specifically, the BMC may determine whether the order corresponding to the target image data group is equal to the number of image data groups. When it is determined that the order corresponding to the target image data group is less than the number of image data groups, the first preset indication information is determined as the end indication information. Alternatively, when it is determined that the order corresponding to the target image data group is equal to the number of image data groups, the second preset indication information is determined as the end indication information.
[0111] Step 2: Generate an image descriptor corresponding to the target image data group according to the end indication information and the target storage location information corresponding to the target image data group.
[0112] Step 3: Generate an image descriptor table corresponding to the total image data according to the ranking corresponding to each image data group and the image descriptor corresponding to each image data group.
[0113] Step 2: Store the image descriptor table.
[0114] Specifically, the BMC may read a preset start address from its own configuration register, store the image descriptor table in the memory with the preset start address as the start storage position, and use it for subsequent read operations.
[0115] In some optional implementations, the end indication information may include a starting address in the memory of a next image descriptor corresponding to the current image descriptor to which it belongs.
[0116] In some optional embodiments, the BMC may determine the type of the total image data. For example, if the total image data comes from the central processing unit, the total image data is determined to be source image data. If the total image data comes from other components (for example, a data compression module inside the BMC), the total image data is determined to be non-source image data. Furthermore, when generating an image descriptor corresponding to the image data group ranked first, the BMC may generate an image descriptor based on the storage location information, the end indication information, and the image type. The image type may be indicated by a preset value, for example, "1" is used to indicate a source image type, and "0" is used to indicate a non-source image type.
[0117] In some optional embodiments, the BMC may determine the similarity between the current frame image and the previous frame image based on the total image data of the current frame image and the total image data of the previous frame image corresponding to the current frame image. When it is determined that the similarity is greater than a preset similarity threshold, the third preset indication information may be determined as a valid symbol corresponding to the current frame image, or, when it is determined that the similarity is less than or equal to the preset similarity threshold, the fourth preset indication information may be determined as a valid symbol corresponding to the current frame image. The third preset indication information is used to indicate that the current frame image is invalid, and the fourth preset indication information is used to indicate that the current frame image is valid. For example, the third preset indication information is a value "0", and the fourth preset indication information may be a value "1".
[0118] Alternatively, the BMC may process the current frame image through a pre-built quality assessment model to obtain a quality index value corresponding to the current frame image, and determine whether the quality index value is greater than a preset quality index value. When it is determined that the quality index value is greater than the preset quality index value, the fourth preset indication information may be determined as a valid symbol corresponding to the current frame image, or when it is determined that the quality index value is less than or equal to the preset quality index value, the third preset indication information may be determined as a valid symbol corresponding to the current frame image. The quality assessment model may be a No Reference (NR) model, such as a Natural Scene Statistics (NSS) model.
[0119] Furthermore, when generating the image descriptor corresponding to the first image data group, the BMC may generate the image descriptor according to the storage location information, the end indication information and the valid character. Alternatively, the BMC may generate the image descriptor according to the storage location information, the end indication information, the image type and the valid character.
[0120] In this way, by comparing the similarities of adjacent frames, frames with little or no changes can be effectively identified, thereby avoiding unnecessary processing of these frames, helping to reduce the amount of transmitted data, the consumption of computing resources, and significantly reducing the demand for network bandwidth, especially in application scenarios such as real-time video streaming.
[0121] For example, in Figure 3 In the image descriptor, each image descriptor may include the starting address of the corresponding image data group in the memory, as well as the data length, resolution, execution instruction information, image type, terminator, validator, etc. of the corresponding image data group. The BMC may pre-specify the storage location of the image descriptor table in the memory, as well as the length of each image descriptor in the image descriptor, and each item of information included in the image descriptor may be set to a fixed length. In this way, when the image descriptor is generated, the corresponding information may be filled into the corresponding position of the image descriptor.
[0122] The following table 1 Figure 3 For detailed explanation, Figure 3 The numerical values on the upper middle side represent bits, which are used to mark the length of each component in the image descriptor, and the numerical values on the right side represent the storage location in the memory. Specifically, the starting address of the image data group in the memory can be divided into two segments (high address and low address) and stored in "03-00h" and "07-04h" in the memory, each segment is 32 bits, that is, the starting address of the image data group occupies 64 bits of storage space in the memory. The data length of the image data group can be stored in "11-08h" in the memory, occupying 32 bits of storage space in the memory. The vertical resolution occupies 12 bits of storage space in the memory, the horizontal resolution occupies 12 bits of storage space in the memory, the execution instruction information 1 occupies 1 bit of storage space in the memory, the execution instruction information 2 occupies 1 bit of storage space in the memory, the image type occupies 1 bit of storage space in the memory, the end character occupies 1 bit of storage space in the memory, and the valid character occupies 1 bit of storage space in the memory. The vertical resolution, horizontal resolution, execution instruction information 1, execution instruction information 2, image type, terminator, and valid character can be stored in "15-12h" in the memory. Among them, both execution instruction information 1 and execution instruction information 2 can be represented by numerical values, and different combinations of the two can represent the execution method of the image data corresponding to the image descriptor.
[0123] Table 1
[0124]
[0125]
[0126] In some optional implementations, when the BMC determines that the storage mode is continuous storage, it can randomly select a target continuous storage space from the target continuous storage space to store the total image data, or it can also select the target continuous storage space with the shortest length to store the total image data. Then, according to the starting address and length of the selected target continuous storage space, the image descriptor corresponding to the total image data can be generated according to the above steps. Alternatively, it can also generate the image descriptor corresponding to the total image data according to the starting address, length and second preset indication information corresponding to the selected target continuous storage space.
[0127] The image data storage method provided in this embodiment, when storing the total image data of each frame of image, firstly, analyzes the acquired storage space usage information and the total data length corresponding to the total image data to determine whether the total image data can be stored continuously, that is, determines whether the storage method corresponding to the total image data is continuous storage or discontinuous storage. When it is determined that the total image data cannot be stored continuously, the total image data is split according to the storage space usage information, resolution, and total data length to obtain multiple image data groups and storage location information corresponding to each image data group. Finally, the image data groups can be stored according to the storage location information. In this way, when the total image data cannot be stored continuously, the memory utilization rate can be improved by splitting and storing the total image data.
[0128] According to an embodiment of the present invention, an embodiment of an image data reading method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0129] In this embodiment, a method for reading image data is provided, which can be executed by the above-mentioned BMC. Figure 4 is a flowchart of an image data reading method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0130] Step S401, when a trigger condition for displaying the current frame image is obtained, the total storage location information is obtained.
[0131] The total storage location information may include at least one storage location information.
[0132] Specifically, when the BMC determines that it is its turn to display the current frame image, the storage location information of each image data group may be read from the memory.
[0133] In some optional implementations, the storage location information of the image data group may be stored in the memory in the form of an image descriptor table. Accordingly, the BMC may obtain the total storage location information according to the following steps:
[0134] Step 1: In the current processing round, obtain the target starting address.
[0135] Wherein, when the current processing round is the first processing round, the target start address may be a preset start address read from the configuration register. When the current processing round is not the first processing round, the target start address may be a start address calculated based on the start address of the previous image descriptor in the memory and the preset data length.
[0136] Step 2: read the target image descriptor according to the target start address and the preset data length.
[0137] The target image descriptor is an image descriptor corresponding to any image data set.
[0138] Step three, parse the target image descriptor to obtain target storage location information and target end indication information.
[0139] In some optional implementations, when the current processing round is the first processing round, the image type can be obtained by parsing the target image descriptor, and the BMC can determine whether the parsed image type is the source image data type. When it is determined that the parsed image type is the source image data type, subsequent operations can be performed.
[0140] In some optional embodiments, when the current processing round is the first processing round, the target image descriptor can be parsed to obtain a target valid symbol, and the BMC can determine whether the parsed target valid symbol is the third preset indication information. When it is determined that the target valid symbol is the third preset indication information, subsequent operations can be stopped. When it is determined that the target valid symbol is the fourth preset indication information, subsequent operations can continue to be performed.
[0141] Alternatively, the BMC may continue to perform subsequent operations when determining that the parsed image type is the source image data type and the target valid symbol is the fourth preset indication information.
[0142] Step 4: Determine whether to continue the read operation according to the target end indication information.
[0143] Specifically, when it is determined that the target end indication information includes the first preset indication information, it is determined not to continue to perform the reading operation. Alternatively, when it is determined that the target end indication information includes the second preset indication information, it is determined to continue to perform the reading operation. The first preset indication information is used to indicate that the target image data group corresponding to the target image descriptor is not the last image data group in the total image data. The second preset indication information is used to indicate that the target image data group is the last image data group in the total image data.
[0144] Step 5: When it is determined not to continue the read operation, determine that the total storage location information has been read.
[0145] or,
[0146] Step six, when it is determined to continue the read operation, enter the next processing round corresponding to the current processing round, until it is determined not to continue the read operation in any processing round, and it is determined that the total storage location information is read.
[0147] The storage location information respectively parsed in all processing rounds executed together constitutes the total storage location information.
[0148] Step S402: according to each storage location information, read the image data group stored in the storage location corresponding to each storage location information.
[0149] The storage location information may include a start address and a data length.
[0150] Specifically, for each storage location information, the BMC takes the storage location corresponding to the starting address included in the storage location information as the starting reading position, reads data of the same length as the data included in the storage location information, that is, reads the image data group stored in the storage location corresponding to the storage location information.
[0151] For example, in Figure 5 In the image descriptor table, three image descriptors are included. The BMC can read image descriptor 1 according to a preset starting address and a preset data length, and read image data group 1 according to the storage location information parsed from image descriptor 1, and determine whether the read operation needs to be continued according to the end indication information parsed from image descriptor 1. The BMC can determine the first starting address according to the preset starting address and the preset data length, and read image descriptor 2 according to the first starting address and the preset data length. Then, the image data group 2 is read according to the storage location information parsed from image descriptor 2, and the read operation needs to be continued according to the end indication information parsed from image descriptor 2. The BMC can determine the second starting address according to the first starting address and the preset data length, and read image descriptor 3 according to the second starting address and the preset data length. Finally, the BMC reads image data group 3 according to the storage location information parsed from image descriptor 3, and determines not to continue the read operation according to the end indication information parsed from image descriptor 3. At this point, the operation of reading the total image data corresponding to the current frame image is completed, that is, the image data group 1, the image data group 2 and the image data group 3 constitute the total image data of the current frame image.
[0152] Step S403, constructing total image data corresponding to the current frame image according to the image data group stored in the storage location corresponding to each storage location information.
[0153] Specifically, the BMC may construct the total image data according to each image data group read and the reading order corresponding to each image data group.
[0154] Step S404: sending the total image data to a display device.
[0155] The display device may be a remote display device.
[0156] Specifically, the BMC may send the total image data to the display device, or, after compressing the total image data, send the compressed total image data to the display device. In this way, after receiving the total image data, or receiving the compressed total image data and performing a decompression operation, the display device may display the current frame image according to the total image data.
[0157] The image data storage method provided in this embodiment can first read the total image data corresponding to each frame image, and read an image data group according to at least one storage location information included in the total storage location information, and all the read image data groups constitute the total image data. In this way, different image data groups belonging to the total image data corresponding to the same frame image can be distributed in multiple discontinuous storage locations in the memory, and when reading the image data, the image data can be read according to each storage location information respectively, which can improve the memory utilization.
[0158] In some optional implementations, the image descriptor may include resolution. When the structure of the BMC is as follows Figure 1 As shown, since the data capture module can read data from the memory in units of pixels through the AXI bus, the data capture module can determine the total number of pixels according to the resolution. When it is determined that the number of pixels read is equal to the total number of pixels, it is determined that the total image data of the complete current frame image is read, and then sent to the data compression module. In this way, through the dual authentication of the image descriptor and the resolution, it can be guaranteed that the complete total image data is read. The current technology generally reads the total image data from the memory by the VGA module, and then sends the total image data to the data compression module to perform the compression operation. In this process, the VGA module needs to interact with the data compression module. The present solution sends the information parsed from the image descriptor to the data capture module, which can save the number of hardware signals between the VGA module and the data compression module.
[0159] In the present embodiment, an image data storage device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0160] This embodiment provides an image data storage device, such as Figure 6 As shown, including:
[0161] The first acquisition module 601 is used to acquire total image data corresponding to the current frame image, resolution, total data length corresponding to the total image data, and storage space usage information of the memory;
[0162] A determination module 602, configured to determine a storage mode corresponding to the total image data according to the storage space usage information and the total data length, wherein the storage mode includes continuous storage or discontinuous storage;
[0163] A splitting module 603 is used for, when it is determined that the storage mode is discontinuous storage, splitting the total image data according to the storage space usage information, the resolution, and the total data length to obtain a plurality of image data groups and grouping information corresponding to each image data group, wherein the grouping information includes storage location information;
[0164] The storage module 604 is used to store the target image data group to a storage location in the memory corresponding to the target storage location information, wherein the target image data group is any image data group among the multiple image data groups, and the target storage location information is the storage location information corresponding to the target image data group.
[0165] In some optional implementations, the grouping information also includes the ordering of the image data groups; the device also includes a generating module 605, which is used to:
[0166] generating an image descriptor table corresponding to the total image data according to the ranking corresponding to each image data group and the storage location information corresponding to each image data group;
[0167] The image descriptor table is stored.
[0168] In some optional implementations, the generating module 605 is specifically configured to:
[0169] generating end indication information corresponding to the target image data group according to the order corresponding to the target image data group and the number of the image data groups;
[0170] generating an image descriptor corresponding to the target image data group according to the end indication information corresponding to the target image data group and the target storage location information;
[0171] An image descriptor table corresponding to the total image data is generated according to the ranking corresponding to each image data group and the image descriptor corresponding to each image data group.
[0172] In some optional implementations, the generating module 605 is specifically configured to:
[0173] determining whether the ranking corresponding to the target image data set is equal to the number of image data sets;
[0174] When it is determined that the ranking corresponding to the target image data group is less than the number of image data groups, determining the first preset indication information as the end indication information, wherein the first preset indication information is used to indicate that the target image data group is not the last image data group in the total image data;
[0175] or,
[0176] When it is determined that the order corresponding to the target image data group is equal to the number of image data groups, the second preset indication information is determined as the end indication information, wherein the second preset indication information is used to indicate that the target image data group is the image data group corresponding to the last pixel in the total image data.
[0177] This embodiment provides an image data reading device, such as Figure 7 As shown, including:
[0178] The second acquisition module 701 is used to acquire total storage location information when a trigger condition for displaying the current frame image is acquired, wherein the total storage location information includes at least one storage location information;
[0179] A reading module 702, configured to read, according to each storage location information, an image data group stored in a storage location corresponding to each storage location information;
[0180] A forming module 703, configured to form total image data corresponding to the current frame image according to the image data group stored in the storage location corresponding to each storage location information;
[0181] The sending module 704 is used to send the total image data to the display device for displaying the current frame image.
[0182] In some optional implementations, the second acquisition module 701 is specifically configured to:
[0183] In the current processing round, obtain the target starting address;
[0184] Reading a target image descriptor according to a target start address and a preset data length, wherein the target image descriptor is an image descriptor corresponding to any image data group;
[0185] Parsing the target image descriptor to obtain target storage location information and target end indication information;
[0186] Determine whether to continue to perform the read operation according to the target end indication information;
[0187] When it is determined not to continue to perform the read operation, determining that the total storage location information has been read;
[0188] or,
[0189] When it is determined to continue to perform the read operation, enter the next processing round corresponding to the current processing round, until it is determined not to continue to perform the read operation in any processing round, and it is determined that the total storage location information is read;
[0190] The storage location information respectively parsed in all processing rounds executed together constitutes the total storage location information.
[0191] In some optional implementations, the second acquisition module 701 is specifically configured to:
[0192] When it is determined that the target end indication information includes first preset indication information, determining not to continue to perform the reading operation, wherein the first preset indication information is used to indicate that the target image data group corresponding to the target image descriptor is not the last image data group in the total image data;
[0193] or,
[0194] When it is determined that the target end indication information includes the second preset indication information, it is determined to continue to perform the reading operation, wherein the second preset indication information is used to indicate that the target image data group is the last image data group in the total image data.
[0195] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0196] The first acquisition module 601, determination module 602, splitting module 603, storage module 604, generation module 605 included in the image data storage device, and the second acquisition module 701, reading module 702, composition module 703, and sending module 704 included in the image data reading device can be modules that are re-divided and named after multiple modules such as the video graphics array module, data capture module, data compression module, network module, and digital-to-analog conversion module in the BMC.
[0197] The image data storage device and the image data reading device in this embodiment are presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0198] The embodiment of the present invention also provides a computer device having the above Figure 6 The image data storage device shown, or Figure 7 The image data reading device shown in FIG.
[0199] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0200] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0201] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0202] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0203] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0204] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0205] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0206] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0207] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for storing image data, characterized in that: The method comprises: Obtaining total image data corresponding to the current frame image, resolution, total data length corresponding to the total image data, and storage space usage information of the memory; Determining a storage mode corresponding to the total image data according to the storage space usage information and the total data length, wherein the storage mode includes continuous storage or discontinuous storage; When it is determined that the storage mode is the discontinuous storage, the total image data is split according to the storage space usage information, the resolution, and the total data length to obtain a plurality of image data groups and grouping information corresponding to each of the image data groups, wherein the grouping information includes storage location information; The target image data group is stored in a storage location in the memory corresponding to the target storage location information, wherein the target image data group is any one of the multiple image data groups, and the target storage location information is the storage location information corresponding to the target image data group.
2. The method according to claim 1, characterized in that: The grouping information also includes the order of the image data groups; the method also includes: generating an image descriptor table corresponding to the total image data according to the ranking corresponding to each of the image data groups and the storage location information corresponding to each of the image data groups; The image descriptor table is stored.
3. The method according to claim 2, characterized in that The step of generating an image descriptor table corresponding to the total image data according to the order corresponding to each of the image data groups and the storage location information corresponding to each of the image data groups comprises: generating end indication information corresponding to the target image data group according to the order corresponding to the target image data group and the number of the image data groups; generating an image descriptor corresponding to the target image data group according to the end indication information corresponding to the target image data group and the target storage location information; An image descriptor table corresponding to the total image data is generated according to the ranking corresponding to each of the image data groups and the image descriptor corresponding to each of the image data groups.
4. The method according to claim 3, characterized in that The step of generating end indication information corresponding to the target image data group according to the order corresponding to the target image data group and the number of the image data groups comprises: determining whether the ranking corresponding to the target image data set is equal to the number of the image data sets; When it is determined that the ranking corresponding to the target image data group is less than the number of the image data groups, determining first preset indication information as the end indication information, wherein the first preset indication information is used to indicate that the target image data group is not the last image data group in the total image data; or, When it is determined that the order corresponding to the target image data group is equal to the number of the image data groups, the second preset indication information is determined as the end indication information, wherein the second preset indication information is used to indicate that the target image data group is the image data group corresponding to the last pixel in the total image data.
5. A method for reading image data, characterized in that: The method comprises: When a trigger condition for displaying the current frame image is obtained, total storage location information is obtained, wherein the total storage location information includes at least one storage location information; According to each storage location information, read the image data group stored in the storage location corresponding to each storage location information; According to the image data group stored in the storage position corresponding to each storage position information, form the total image data corresponding to the current frame image; The total image data is sent to a display device for displaying the current frame image.
6. The method according to claim 5, characterized in that The obtaining of the total storage location information includes: In the current processing round, obtain the target starting address; Reading a target image descriptor according to the target start address and the preset data length, wherein the target image descriptor is an image descriptor corresponding to any one of the image data groups; Parsing the target image descriptor to obtain target storage location information and target end indication information; Determining whether to continue to perform the read operation according to the target end indication information; When it is determined not to continue to perform the read operation, determining that the total storage location information is read; or, When it is determined to continue to perform the read operation, enter the next processing round corresponding to the current processing round, until it is determined not to continue to perform the read operation in any of the processing rounds, and it is determined that the total storage location information is read; The storage location information respectively parsed and obtained in all the processing rounds executed together constitute the total storage location information.
7. The method according to claim 6, characterized in that The step of determining whether to continue to perform the read operation according to the target end indication information includes: When it is determined that the target end indication information includes first preset indication information, determining not to continue to perform the reading operation, wherein the first preset indication information is used to indicate that the target image data group corresponding to the target image descriptor is not the last image data group in the total image data; or, When it is determined that the target end indication information includes second preset indication information, it is determined to continue to perform the reading operation, wherein the second preset indication information is used to indicate that the target image data group is the last image data group in the total image data.
8. An image data storage device, characterized in that: include: A first acquisition module is used to acquire total image data corresponding to the current frame image, resolution, total data length corresponding to the total image data, and storage space usage information of the memory; a determination module, configured to determine a storage mode corresponding to the total image data according to the storage space usage information and the total data length, wherein the storage mode includes continuous storage or discontinuous storage; a splitting module, configured to, when determining that the storage mode is the discontinuous storage, split the total image data according to the storage space usage information, the resolution, and the total data length, to obtain a plurality of image data groups and grouping information corresponding to each of the image data groups, wherein the grouping information includes storage location information; A storage module is used to store a target image data group to a storage location in the memory corresponding to target storage location information, wherein the target image data group is any one of the multiple image data groups, and the target storage location information is storage location information corresponding to the target image data group.
9. An image data reading device, characterized in that: include: A second acquisition module is used to acquire total storage location information when a trigger condition for displaying the current frame image is acquired, wherein the total storage location information includes at least one storage location information; A reading module, used for reading the image data group stored in the storage position corresponding to each storage position information according to each storage position information; A composition module, used to form total image data corresponding to the current frame image according to the image data group stored in the storage position corresponding to each storage position information; The sending module is used to send the total image data to a display device for displaying the current frame image.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image data storage method according to any one of claims 1 to 4, or the image data reading method according to any one of claims 5 to 7 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the image data storage method according to any one of claims 1 to 4, or to execute the image data reading method according to any one of claims 5 to 7.