Image storage method and device, computer device and storage medium
By segmenting and stitching plant status images, and combining intelligent processing of image identification and location information, the problems of low storage efficiency and insufficient data integrity in traditional storage methods are solved, achieving efficient and flexible image storage management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DICUI INTELLIGENT TECH (SHANGHAI) CO LTD
- Filing Date
- 2025-09-28
- Publication Date
- 2026-06-16
Smart Images

Figure CN121300699B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image storage technology, and in particular to an image storage method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] With the development of smart agriculture and computer vision technology, plant status image acquisition technology based on target sensors has emerged. The core feature of this technology is that it can acquire high-definition images of plant growth status (such as leaf morphology, signs of pests and diseases, etc.) in real time and at high frequency, and associate key information such as acquisition time and plant location through image tags to provide data support for subsequent plant growth analysis, thus leading to the current traditional methods of plant status image storage and processing.
[0003] In traditional technologies, plant condition images acquired by target sensors are typically processed in two ways: one is to directly store the complete image along with its image identifier to the target disk; the other is to compress the image before storage if the image storage capacity is large, or discard some non-core areas to reduce the data volume. However, traditional technologies have a core problem: when dealing with large-capacity, high-definition plant condition images, direct storage can easily lead to high disk write pressure and low storage efficiency; simple compression or image discarding will result in the loss of key details, affecting the accuracy of subsequent growth analysis, making it impossible to balance storage efficiency while ensuring image integrity. Summary of the Invention
[0004] Therefore, it is necessary to provide an image storage method, apparatus, computer device, computer-readable storage medium, and computer program product to address the aforementioned technical problems.
[0005] Firstly, this application provides an image storage method. The method includes:
[0006] Acquire images of the plant states collected by the target sensor and their corresponding image labels;
[0007] If the storage capacity of the plant state image is greater than a preset first threshold, the plant state image is segmented to obtain sub-images corresponding to the plant state image.
[0008] Using the position information of each sub-image in the corresponding plant state image, and the image identifier of the corresponding plant state image, the sub-image identifier of each sub-image is determined;
[0009] Store each of the sub-images and the unsegmented plant state images in each plant state image into the target cache;
[0010] If the capacity occupied in the target cache reaches a preset second threshold, the sub-images are stitched together according to their image identifiers to obtain the corresponding target image.
[0011] Store the target image and the unsegmented plant state image to the target disk.
[0012] In one embodiment, storing the target image and the unsegmented plant state image to the target disk further includes:
[0013] Determine the current storage capacity of the target image;
[0014] If the current storage capacity of the target image is inconsistent with the storage capacity of the corresponding plant status image, a first alarm message is generated.
[0015] If the current storage capacity of the target image is the same as the storage capacity of the corresponding plant state image, store the target image and the unsegmented plant state image to the target disk.
[0016] In one embodiment, after acquiring the images of each plant state collected by the target sensor, the method further includes:
[0017] The plant state image is hashed to obtain the original hash identifier;
[0018] After obtaining the target image, the following steps are also included:
[0019] The target image is hashed to obtain the target hash identifier;
[0020] If the target hash identifier of the target image is inconsistent with the original hash identifier of the corresponding plant status image, a second warning message is generated.
[0021] In one embodiment, the method further includes:
[0022] If the sub-images or unsegmented plant state images are stored in the target cache, and the occupied capacity of the target cache does not reach the preset second threshold within a preset time period, the corresponding splicing or storage operations are performed on the sub-images or plant state images in the target cache.
[0023] In one embodiment, obtaining the second threshold includes:
[0024] Acquire the number of target sensors and the image acquisition interval for each target sensor;
[0025] The second threshold is determined based on the number of target sensors and the image acquisition interval.
[0026] In one embodiment, the method further includes:
[0027] Obtain the priority of each target sensor;
[0028] The priority of plant status images is determined based on the priority of the target sensors;
[0029] If the capacity occupied in the target cache reaches a preset second threshold, according to the priority of each plant state image, the corresponding splicing or storage operation is performed on each plant state image or sub-image of each plant state image in the target cache.
[0030] Secondly, this application also provides an image storage device. The device includes:
[0031] The image acquisition module is used to acquire images of various plant states collected by the target sensor and their corresponding image labels;
[0032] The image segmentation module is used to segment the plant state image to obtain sub-images corresponding to the plant state image when the storage capacity of the plant state image is greater than a preset first threshold.
[0033] The identifier determination module is used to determine the sub-image identifier of each sub-image by using the position information of each sub-image in the corresponding plant state image and the image identifier of the corresponding plant state image.
[0034] An image storage module is used to store each of the sub-images and the unsegmented plant state images in each plant state image into a target cache;
[0035] The image stitching module is used to stitch together the sub-images according to their image identifiers to obtain the corresponding target image when the capacity occupied in the target cache reaches a preset second threshold.
[0036] The image storage module is also used to store the target image and the unsegmented plant state image to the target disk.
[0037] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the image storage method as described in any of the embodiments of this disclosure.
[0038] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the image storage method as described in any of the embodiments of this disclosure.
[0039] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the image storage method as described in any of the embodiments of this disclosure.
[0040] The aforementioned image storage method, apparatus, computer equipment, storage medium, and computer program products effectively improve storage efficiency and management flexibility by acquiring plant state images and their identifiers collected by target sensors and combining intelligent segmentation and stitching operations. When storage capacity is limited, this method can dynamically adjust the image storage format, avoiding storage failures due to excessively large single images. Simultaneously, the association processing of sub-images using image identifiers and location information ensures data integrity and traceability. Furthermore, storing the processed target image and the unsegmented image to the target disk on demand further optimizes storage space utilization, meeting the high-efficiency storage requirements of practical applications. This method can also flexibly adjust the storage strategy according to actual needs to adapt to image management requirements in different scenarios. Attached Figure Description
[0041] Figure 1 This is an application environment diagram of an image storage method in one embodiment;
[0042] Figure 2 This is a flowchart illustrating an image storage method in one embodiment;
[0043] Figure 3 This is a structural block diagram of an image storage device in one embodiment;
[0044] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] The image storage method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 is responsible for front-end data acquisition and preliminary processing: directly acquiring plant state images and image identifiers collected by the target sensor, determining whether the image storage capacity exceeds a preset first threshold; if so, segmenting the image to obtain sub-images, and then combining the original image identifier with the sub-image location information to determine the sub-image identifier; subsequently, temporarily storing the sub-images and the unsegmented images in a local target cache. When the local cache capacity of terminal 102 reaches a preset second threshold, terminal 102 completes the sub-image stitching according to the sub-image identifier to obtain the target image, and then uploads the target image and the unsegmented plant state image together to server 104; after receiving them, server 104 stores these images uniformly to the target disk, achieving efficient temporary storage and stable archiving of images. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0047] In one embodiment, such as Figure 2 As shown, an image storage method is provided, including the following steps:
[0048] Step S200: Obtain the images of each plant state collected by the target sensor and the corresponding image labels.
[0049] The plant status images can include images for identifying plant diseases and pests, images of plant growth stages, etc. Specifically, they can include image information on various aspects such as leaf color changes, stem thickness, and fruit maturity. Image identifiers can be used to uniquely label each plant status image, facilitating subsequent processing and tracking. Target sensors can include high-definition cameras, infrared imaging devices, or other devices with image acquisition capabilities deployed in the plant planting area. Target sensors can acquire images at preset time intervals or event-triggered conditions and generate unique identifiers corresponding to each image. Specifically, image identifiers can be determined based on the acquired target sensor identifier and the acquisition time, thus forming unique identifiers for each image.
[0050] In one exemplary embodiment, the target sensor transmits the acquired plant state images to a terminal device. The terminal device can perform preliminary verification on the received images to ensure the integrity and accuracy of the image data. The verification process may include checking the image format, resolution, and whether key areas are missing. If anomalies are detected in the image data, such as blurred images or missing key areas, corresponding prompts can be generated and fed back to relevant operators or the system for re-acquisition.
[0051] Step S202: If the storage capacity of the plant state image is greater than a preset first threshold, the plant state image is segmented to obtain sub-images corresponding to the plant state image.
[0052] Storage capacity can include the size of the image file, typically measured in bytes. A preset first threshold is a fixed value set based on the target cache capacity and system performance, used to determine whether the plant state image needs to be segmented. When the storage capacity of the plant state image exceeds this threshold, a segmentation mechanism is automatically triggered, dividing the original image into multiple smaller sub-images for subsequent storage and processing. The segmentation process can be based on the image's content characteristics, such as dividing according to fixed pixel block sizes, semantic segmentation of image regions, or specific encoding methods, thereby ensuring that each sub-image has logical integrity and recoverability.
[0053] In one specific implementation, the segmentation operation can be implemented using a sliding window algorithm, which extracts sub-images step-by-step from the original image according to a set step size and window size. Each sliding window covers an area that constitutes a sub-image, and the window size can be dynamically adjusted based on a preset first threshold to ensure that the storage capacity of each sub-image does not exceed a limit. Furthermore, during the segmentation process, the positional information of each sub-image within the original image can be recorded, such as the coordinates of the top-left and bottom-right corners, so that the content and structure of the original image can be accurately restored during subsequent stitching. In addition, semantic information of the image can be incorporated to group regions with similar features into the same sub-image, thereby reducing the complexity of subsequent processing.
[0054] Step S204: Using the position information of each sub-image in the corresponding plant state image and the image identifier of the corresponding plant state image, determine the sub-image identifier of each sub-image.
[0055] The location information of a sub-image within the corresponding plant state image can include the specific coordinate range of the sub-image within the original plant state image, such as the pixel coordinates of the top-left and bottom-right corners. By combining the unique image identifier of the plant state image with the location information of the sub-image, a unique identifier can be generated for each sub-image. This identifier not only contains the labeling information of the original image but also includes the sub-image's positional encoding within the overall image, thereby ensuring accurate tracking and identification of the source of each sub-image and its location within the original image during subsequent processing.
[0056] In one exemplary embodiment, when determining the image identifier of a sub-image, an additional verification mechanism can be introduced, such as performing a hash operation on the identifier to generate a unique checksum. This checksum can be used to verify the integrity and correctness of the sub-image identifier, avoiding the loss or error of identifier information due to data corruption during transmission or storage. Furthermore, a hierarchical encoding approach can be adopted to integrate the image identifier, location information, and other metadata (such as acquisition time, sensor number, etc.) into a structured identifier system. In practical applications, the generated sub-image identifier can be stored in the target cache, saved together with the corresponding sub-image data. During subsequent stitching or retrieval, the required sub-image can be quickly located using the identifier, and the content of the original plant state image can be restored based on its location information. Simultaneously, this identifier mechanism also supports multi-threaded parallel processing, allowing different sub-images to be independently stored or analyzed on different computing nodes, thereby improving the overall system efficiency.
[0057] Step S206: Store each of the sub-images and the unsegmented plant state images in each of the plant state images into the target cache.
[0058] The target cache can be a dedicated storage area in the system for temporarily storing image data. Its capacity and performance are typically optimized to meet high-frequency read / write requirements. For example, the target cache may include data slots. When storing sub-images and unchopped plant state images to the target cache, allocation and management can be performed according to preset storage strategies. For example, smaller sub-images can be prioritized for storage in specific partitions of the cache, while unchopped images are arranged in order according to their original size and identification information. Furthermore, image data in the cache can be compressed to reduce space usage while maintaining image quality. Simultaneously, the cache management mechanism can monitor the usage of the target cache in real time, including used capacity, remaining capacity, and stored data types, and dynamically adjust the storage strategy based on this information to ensure efficient utilization of cache resources. When cache usage reaches a certain percentage, a corresponding scheduling mechanism can be triggered to prepare for subsequent stitching or storage operations.
[0059] Step S208: When the capacity occupied in the target cache reaches a preset second threshold, the sub-images are stitched together according to the image identifiers of each sub-image to obtain the corresponding target image.
[0060] The preset second threshold is a fixed value set based on the total capacity of the target cache and system performance. It is used to determine whether to perform a stitching operation on the sub-images in the cache. When the target cache's occupied capacity reaches this threshold, the stitching mechanism is automatically triggered, sequentially combining the cached sub-images according to the positional information contained in their image identifiers, thereby restoring the original plant state image or generating a new target image. The stitching process can perform precise alignment based on the coordinate range, semantic information, or other metadata of the sub-images to ensure that the final generated target image is consistent with the original image in content and structure. The target image is then stored on the target disk, etc.
[0061] In one exemplary embodiment, the stitching operation can be implemented through a multi-level algorithm. Sub-images can be classified and sorted according to their positional codes to form a complete stitching sequence. Image processing techniques are used to match and fuse the boundary regions of adjacent sub-images, eliminating potential stitching traces or errors. For example, edge detection algorithms can be used to identify the boundary features of sub-images, and interpolation methods can be used to smooth the pixel values of transition regions, making the stitched image more natural and smooth. Furthermore, semantic information of the images can be incorporated, prioritizing regions with similar features during the stitching process to improve efficiency and quality. In addition, a verification mechanism can be introduced after stitching. For example, the integrity of the stitched target image can be verified to ensure its content is consistent with the original plant state image. This can include comparing key region features of the target image, calculating image hash values, or checking the accuracy of metadata. If an anomaly is found in the stitching result, such as missing image content or stitching errors, corresponding prompts can be generated, triggering a re-stitching process until a satisfactory target image is generated.
[0062] Step S210: Store the target image and the unsegmented plant state image to the target disk.
[0063] The target disk can be a local storage device or a remote storage server, characterized by large capacity and high reliability, making it suitable for long-term storage of image data. When storing the target image and undivided plant state images to the target disk, they can be categorized and archived according to preset storage rules. For example, image data can be stored in a corresponding directory structure based on the timestamp or sensor number in the image identifier for subsequent retrieval and management. Furthermore, the stored image data can be encrypted to ensure data security and privacy.
[0064] In one exemplary embodiment, during the storage process, the storage status of the target disk can be monitored in real time, including indicators such as used space, remaining space, and storage performance. If insufficient disk space or degraded storage performance is detected, corresponding optimization strategies can be automatically triggered, such as cleaning up expired data, adjusting storage partitions, or migrating data to other storage devices. This effectively avoids storage failures caused by insufficient disk resources. In addition, incremental storage technology can be employed. For unchanged image data, the original storage address is directly referenced; while for newly added or modified image data, a new storage record is generated. Simultaneously, log information for each storage operation can be recorded, including storage time, storage path, and operation results, providing a basis for subsequent auditing and troubleshooting.
[0065] The aforementioned image storage method effectively improves storage efficiency and management flexibility by acquiring plant state images and their identifiers from target sensors and combining them with intelligent segmentation and stitching operations. When storage capacity is limited, this method can dynamically adjust the image storage format, avoiding storage failures due to excessively large single images. Simultaneously, it utilizes image identifiers and location information for sub-image association processing, ensuring data integrity and traceability. Furthermore, storing the processed target image and the unsegmented image to the target disk as needed further optimizes storage space utilization, meeting the high-efficiency storage requirements of practical applications. This method can also flexibly adjust the storage strategy according to actual needs to adapt to image management requirements in different scenarios.
[0066] In one embodiment, storing the target image and the unsegmented plant state image to the target disk further includes:
[0067] Determine the current storage capacity of the target image;
[0068] If the current storage capacity of the target image is inconsistent with the storage capacity of the corresponding plant status image, a first alarm message is generated.
[0069] If the current storage capacity of the target image is the same as the storage capacity of the corresponding plant state image, store the target image and the unsegmented plant state image to the target disk.
[0070] The current storage capacity can include the actual storage space occupied by the target image on the target disk, usually measured in bytes. When the current storage capacity of the target image differs from the original storage capacity of the corresponding plant state image, it may indicate data loss, over-compression, or other anomalies during the stitching or storage process. In this case, the generated first alarm message can include the specific difference value, possible cause analysis, and suggested corrective measures. For example, it can prompt operators to check the accuracy of boundary matching during the stitching process or verify whether an inappropriate compression algorithm was used during storage. Furthermore, the first alarm message can also be delivered to relevant personnel through visual interfaces, log records, or email notifications to facilitate timely corrective action.
[0071] In one exemplary embodiment, if the current storage capacity of the target image matches the storage capacity of the corresponding plant state image, a storage operation can be automatically performed, archiving the target image and the unsegmented plant state image to the target disk according to preset rules. During this process, the storage path can be optimized, for example, prioritizing the use of disk partitions with more remaining space or higher-performance storage devices to improve storage efficiency and reliability. Simultaneously, after storage is complete, the image data in the target disk can be verified for integrity, such as comparing hash values before and after storage or checking whether key area features match. If the verification result is correct, storage is confirmed as successful; otherwise, a second alarm message is triggered, and the storage operation is re-executed until the problem is resolved.
[0072] In this embodiment, precise monitoring of storage capacity effectively avoids data loss or corruption caused by storage anomalies. Simultaneously, the method introduces a dual verification mechanism of image identifiers and location information to ensure the uniqueness and accuracy of sub-images during segmentation and stitching, thereby improving the reliability and integrity of image storage. Furthermore, the design of automatically triggering the stitching operation when the target cache reaches a preset second threshold not only optimizes the utilization efficiency of storage resources but also reduces the need for manual intervention, further enhancing the system's automation level. This method is particularly suitable for large-scale plant state image acquisition and storage scenarios, meeting the processing requirements of high concurrency and large data volumes.
[0073] In one embodiment, after acquiring the images of each plant state collected by the target sensor, the method further includes:
[0074] The plant state image is hashed to obtain the original hash identifier;
[0075] After obtaining the target image, the following steps are also included:
[0076] The target image is hashed to obtain the target hash identifier;
[0077] If the target hash identifier of the target image is inconsistent with the original hash identifier of the corresponding plant status image, a second warning message is generated.
[0078] Hash processing is a method that calculates unique identifiers from image data, and the results can be used to verify the integrity and consistency of images. When the target hash identifier of a target image does not match the original hash identifier of the corresponding plant state image, it may indicate that data tampering, loss, or other anomalies have occurred during image segmentation, stitching, or storage. The generated secondary warning information can then include specific discrepancy analysis, potential risk warnings, and suggested solutions. For example, it can guide operators to recheck the alignment accuracy of the stitched areas or investigate whether there are transmission errors in the storage path.
[0079] In one exemplary embodiment, hash processing can employ various algorithms, such as MD5 (Message-DigestAlgorithm5) and SHA-256 (SecureHashAlgorithm256-bit), to ensure that the generated hash identifier has high uniqueness and collision resistance. Furthermore, when generating the second warning information, the source of the problem can be further confirmed through multi-dimensional data comparison. For example, by combining key region features of the image, metadata information, and storage log records, the specific link in the anomaly can be located. If it is found that the inconsistent hash values are due to boundary errors during the stitching process, a re-stitching process can be automatically triggered, and a new hash identifier can be generated for verification upon completion.
[0080] In another exemplary embodiment, a machine learning model can be introduced to predict and classify differences in hash identifiers. For example, by training the model to identify common splicing or storage anomaly patterns, potential problems can be identified in advance, and optimization strategies can be recommended. Furthermore, this method can be combined with other verification mechanisms, such as semantic analysis based on image content or statistical tests based on pixel distribution, to form a multi-layered verification system. In this way, not only can the reliability of image storage be improved, but a more reliable foundation can also be provided for subsequent data analysis and applications.
[0081] In this embodiment, by hashing the plant state image and the target image, the integrity and consistency of the images during storage and processing can be effectively verified. If the hash identifier of the target image is found to be inconsistent with that of the original image, it indicates that data loss or tampering may have occurred during image segmentation, stitching, or storage. In this case, generating a second warning message can promptly remind the user to take appropriate measures. This method not only improves the reliability of image storage but also provides higher-quality basic data support for subsequent data analysis and applications. Furthermore, by combining the first alarm message and the second warning message, a multi-layered security mechanism can be implemented, further reducing potential risks caused by data anomalies.
[0082] In one embodiment, the method further includes:
[0083] If the sub-images or unsegmented plant state images are stored in the target cache, and the occupied capacity of the target cache does not reach the preset second threshold within a preset time period, the corresponding splicing or storage operations are performed on the sub-images or plant state images in the target cache.
[0084] Within a preset time period, if the target cache's occupied capacity does not reach a preset second threshold, the operation strategy can be flexibly adjusted according to actual needs. For example, sub-images in the cache can be prioritized for stitching to free up more cache space for subsequent image data storage. This dynamic adjustment mechanism effectively avoids inefficiency caused by idle cache resources, while ensuring the system maintains high performance under different load conditions. Furthermore, before stitching or storage operations are performed, image data in the target cache can be prioritized based on timestamps, sensor numbers, or other metadata information in the image identifiers to determine which data needs to be processed first. This approach not only improves cache utilization but also further optimizes the overall system's task scheduling capabilities.
[0085] In one exemplary embodiment, when the occupied capacity of the target cache remains below a preset second threshold for an extended period, a cache cleanup mechanism can be automatically triggered to release underutilized resources and improve system efficiency. The cleanup process can be based on the time sensitivity or priority of image data, for example, prioritizing the removal of older, low-priority sub-images while retaining recently acquired or high-value data. This strategy not only avoids wasting cache space but also ensures that critical data always has sufficient storage support. Furthermore, after the cleanup operation is completed, the cache status can be reassessed, and storage and stitching strategies can be dynamically adjusted based on the current load, thereby further optimizing resource allocation.
[0086] In one exemplary embodiment, a predictive model can also be introduced to analyze the usage trends of the target cache. By learning from historical data, the predictive model can estimate changes in cache usage over a future period and formulate corresponding countermeasures in advance. For example, when the prediction results indicate that cache usage may remain below a preset second threshold, the splicing frequency can be proactively adjusted or the concurrency of storage tasks can be increased to fully utilize existing resources. Simultaneously, the predictive model can also combine external environmental factors (such as sensor data acquisition rates or network transmission bandwidth) for comprehensive judgment, thereby achieving more intelligent task scheduling and resource management.
[0087] In this embodiment, by dynamically monitoring and flexibly adjusting the target cache, efficient operation can be maintained under different scenarios. Whether the cache usage is lower than expected or close to the limit, resource utilization can be optimized through reasonable strategies to avoid performance problems caused by resource idleness or overload. This intelligent management method not only improves the overall efficiency of image storage but also provides stronger adaptability and stability for large-scale data processing scenarios.
[0088] In one embodiment, obtaining the second threshold includes:
[0089] Acquire the number of target sensors and the image acquisition interval for each target sensor;
[0090] The second threshold is determined based on the number of target sensors and the image acquisition interval.
[0091] The number of target sensors and the image acquisition interval are important factors influencing the setting of the second threshold. By analyzing the distribution density of the target sensors and their acquisition frequency, the amount of image data generated per unit time can be estimated, providing a basis for the rational allocation of buffer capacity. For example, when there are many sensors and short acquisition intervals, the amount of image data to be processed will increase significantly. In this case, the second threshold can be set higher to avoid data overflow due to insufficient buffer. Conversely, when there are few sensors or long acquisition intervals, the second threshold can be appropriately reduced to improve resource utilization efficiency.
[0092] In one exemplary embodiment, the second threshold can be dynamically calculated through mathematical modeling. For example, the number of target sensors and the image acquisition interval can be used as input variables, combined with the average storage size of a single image, to construct a linear or nonlinear prediction model. This model can automatically adjust the second threshold based on real-time sensor configuration and acquisition strategy, ensuring that the system maintains stable performance under different operating conditions. Furthermore, historical data can be incorporated to calibrate the model, further improving its prediction accuracy and adaptability.
[0093] In another exemplary embodiment, the setting of the second threshold can also take into account the influence of external environmental factors. For example, in high-concurrency scenarios, network transmission bandwidth may become a key bottleneck restricting data storage efficiency. In this case, the second threshold can be dynamically adjusted by monitoring network status and combining it with the sensor's acquisition capabilities. If high network latency or bandwidth utilization is detected as approaching its limit, the second threshold can be appropriately reduced to decrease cache pressure and ensure data transmission stability. Simultaneously, optimization suggestions can be generated based on actual operating conditions, such as prompting the user to adjust the sensor's acquisition frequency or upgrade network infrastructure.
[0094] In this embodiment, by comprehensively analyzing the number of target sensors and the image acquisition interval, a second threshold can be scientifically set, thereby achieving optimal resource allocation in cache management. This method not only improves the system's flexibility and adaptability but also provides a reliable guarantee for the efficient processing of large-scale image data.
[0095] In one embodiment, the method further includes:
[0096] Obtain the priority of each target sensor;
[0097] The priority of plant status images is determined based on the priority of the target sensors;
[0098] If the capacity occupied in the target cache reaches a preset second threshold, according to the priority of each plant state image, the corresponding splicing or storage operation is performed on each plant state image or sub-image of each plant state image in the target cache.
[0099] The priority of target sensors can be set based on various factors, such as the importance of the sensor's location, the criticality of the acquired data, or user-defined weight configurations. By evaluating the priority of target sensors, the priority of their corresponding plant status images can be further derived, thus providing a basis for cache management and task scheduling. When the target cache capacity reaches a preset second threshold, the operation order can be dynamically adjusted according to the priority of each plant status image. For example, high-priority image data can be processed first to ensure that key information can be stored or stitched in a timely manner, while low-priority data may be temporarily delayed or moved to a backup cache.
[0100] In one exemplary embodiment, the priority of plant status images can be comprehensively evaluated using multi-dimensional indicators. For example, a weighted scoring model can be constructed by combining factors such as time sensitivity, data integrity, and application requirements. This model can dynamically calculate the priority score of each image based on real-time operating status and task requirements, and use this score as the basis for decision-making. Furthermore, a conflict detection mechanism can be introduced during the priority ranking process to prevent low-priority tasks from being left unprocessed for extended periods due to an excessive number of high-priority tasks. If the delay time of some low-priority tasks exceeds a preset threshold, a compensation mechanism can be automatically triggered, such as temporarily increasing storage resources or adjusting the stitching strategy, to ensure the balanced completion of the overall tasks.
[0101] In another exemplary embodiment, machine learning algorithms can be used to optimize the priority allocation process. For example, by training a model to analyze historical task execution and cache usage records, the impact of different priority configurations on system performance can be predicted, and an optimal scheduling scheme can be generated. Simultaneously, this method can also incorporate real-time monitoring data to dynamically adjust priority weights, thereby adapting to constantly changing task demands and system load. For instance, when frequent occurrences of certain high-priority tasks are detected, the priority of relevant sensors can be automatically increased to accelerate data processing and reduce potential bottlenecks.
[0102] In this embodiment, by introducing a dynamic management mechanism based on target sensor priority, more efficient task scheduling and cache utilization can be achieved under limited resources. This method not only improves the processing efficiency of critical data but also effectively avoids task backlog caused by resource contention, thus providing stronger assurance for the real-time processing of large-scale image data.
[0103] The aforementioned image storage method employs a caching and stitching mechanism. First, data is written to a high-speed cache (memory), smoothing the write traffic. Once a certain amount is accumulated, it is then written to the disk in batches, avoiding intermittent impacts on disk I / O from frequent small write operations and resulting in a more stable system I / O load. By first storing sub-images and unsegmented plant state images in the target cache, the high-speed characteristics of the cache reduce frequent I / O operations directly to the target disk, lowering disk read / write pressure. When the cache capacity reaches a preset second threshold, the stitched target images and unsegmented images are written to the disk in batches, achieving centralized and batch processing of I / O operations and improving overall I / O efficiency. Simultaneously, through image segmentation and stitching management, and operation sorting combined with sensor priorities, the timing and order of data writing can be more rationally planned, avoiding the impact of large amounts of scattered data on disk I / O performance, reducing disk seek time and write latency, and optimizing the utilization of I / O resources.
[0104] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0105] Based on the same inventive concept, this application also provides an image storage device for implementing the image storage method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more image storage device embodiments provided below can be found in the limitations of the image storage method described above, and will not be repeated here.
[0106] In one embodiment, such as Figure 3 As shown, an image storage device 300 is provided, including: an image acquisition module 301, an image segmentation module 303, an identifier determination module 305, an image storage module 307, and an image stitching module 309, wherein:
[0107] The image acquisition module is used to acquire images of various plant states collected by the target sensor and their corresponding image labels;
[0108] The image segmentation module is used to segment the plant state image to obtain sub-images corresponding to the plant state image when the storage capacity of the plant state image is greater than a preset first threshold.
[0109] The identifier determination module is used to determine the sub-image identifier of each sub-image by using the position information of each sub-image in the corresponding plant state image and the image identifier of the corresponding plant state image.
[0110] An image storage module is used to store each of the sub-images and the unsegmented plant state images in each plant state image into a target cache;
[0111] The image stitching module is used to stitch together the sub-images according to their image identifiers to obtain the corresponding target image when the capacity occupied in the target cache reaches a preset second threshold.
[0112] The image storage module is also used to store the target image and the unsegmented plant state image to the target disk.
[0113] Each module in the aforementioned image storage device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0114] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image storage method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0115] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0116] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0118] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An image storage method, characterized in that, The methods include: Acquire images of the plant states collected by the target sensor and their corresponding image labels; If the storage capacity of the plant state image is greater than a preset first threshold, the plant state image is segmented to obtain sub-images corresponding to the plant state image. Using the location information of each sub-image in the corresponding plant state image, and the image identifier of the corresponding plant state image, the sub-image identifier of each sub-image is determined; wherein, the sub-image identifier is a unique identifier; Store each of the sub-images and the unsegmented plant state images in each plant state image into the target cache; If the capacity occupied in the target cache reaches a preset second threshold, the sub-images are stitched together according to their image identifiers to obtain the corresponding target image. Determine the current storage capacity of the target image; If the current storage capacity of the target image is inconsistent with the storage capacity of the corresponding plant status image, a first alarm message is generated. If the current storage capacity of the target image is the same as the storage capacity of the corresponding plant state image, store the target image and the unsegmented plant state image to the target disk.
2. The method according to claim 1, characterized in that, After acquiring the images of various plant states collected by the target sensor, the process also includes: The plant state image is hashed to obtain the original hash identifier; After obtaining the target image, the following steps are also included: The target image is hashed to obtain the target hash identifier; If the target hash identifier of the target image is inconsistent with the original hash identifier of the corresponding plant status image, a second warning message is generated.
3. The method according to claim 1, characterized in that, The method also includes: If the sub-images or unsegmented plant state images are stored in the target cache, and the occupied capacity of the target cache does not reach the preset second threshold within a preset time period, the corresponding splicing or storage operations are performed on the sub-images or plant state images in the target cache.
4. The method according to claim 1, characterized in that, The acquisition of the second threshold includes: Acquire the number of target sensors and the image acquisition interval for each target sensor; The second threshold is determined based on the number of target sensors and the image acquisition interval.
5. The method according to claim 1, characterized in that, The method also includes: Obtain the priority of each target sensor; The priority of plant status images is determined based on the priority of the target sensors; If the capacity occupied in the target cache reaches a preset second threshold, according to the priority of each plant state image, the corresponding splicing or storage operation is performed on each plant state image or sub-image of each plant state image in the target cache.
6. An image storage device, characterized in that, The device includes: The image acquisition module is used to acquire images of various plant states collected by the target sensor and their corresponding image labels; The image segmentation module is used to segment the plant state image to obtain sub-images corresponding to the plant state image when the storage capacity of the plant state image is greater than a preset first threshold. The identifier determination module is used to determine the sub-image identifier of each sub-image by using the position information of each sub-image in the corresponding plant state image and the image identifier of the corresponding plant state image; wherein, the sub-image identifier is a unique identifier; An image storage module is used to store each of the sub-images and the unsegmented plant state images in each plant state image into a target cache; The image stitching module is used to stitch together the sub-images according to their image identifiers to obtain the corresponding target image when the capacity occupied in the target cache reaches a preset second threshold. The image storage module is further configured to determine the current storage capacity of the target image; generate a first alarm message if the current storage capacity of the target image is inconsistent with the storage capacity of the corresponding plant state image; and store the target image and the unsegmented plant state image to the target disk if the current storage capacity of the target image is consistent with the storage capacity of the corresponding plant state image.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, The steps of implementing the method of any one of claims 1 to 5 when the processor executes a computer program.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the steps of the method of any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method of any one of claims 1 to 5.