Method, device, medium and product for encoding and decoding marine three-dimensional scalar field data

By splitting ocean three-dimensional scalar field data and using adaptive binary arithmetic encoding, the problems of low compression efficiency and inability to stream archive in existing technologies are solved, achieving efficient data storage and compression that adapts to the physical characteristics and business needs of ocean data.

CN122496050APending Publication Date: 2026-07-31CHINA STATE SHIPBUILDING CORP NO 707 RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA STATE SHIPBUILDING CORP NO 707 RES INST
Filing Date
2026-07-02
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing marine data storage and compression technologies fail to effectively utilize the physical structured characteristics of marine data, resulting in low compression efficiency, inability to meet the needs of time-series incremental streaming archiving, and lossy compression research suffers from accuracy loss issues.

Method used

The three-dimensional scalar field data of the ocean is split into three coordinate arrays and one field value array. The consistency of the data is checked by equal spacing to determine the coordinate encoding result. The three-dimensional blocks are then combined into three-dimensional data blocks, and adaptive binary arithmetic encoding is used. The data is compressed and stored in combination with a preset layered file format.

Benefits of technology

It deeply adapts to the physical characteristics of marine data, improves data compression ratio, reduces storage volume, balances efficient random access and convenient business archiving, and significantly reduces storage and operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496050A_ABST
    Figure CN122496050A_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, medium, and product for encoding and decoding ocean three-dimensional scalar field data. The encoding method includes: splitting the raw ocean three-dimensional scalar field data into three coordinate arrays and one field value array; performing equal-interval consistency checks on each coordinate array to determine the coordinate encoding results corresponding to each coordinate array; dividing the three-dimensional blocks corresponding to each field value into multiple three-dimensional data blocks according to a preset three-dimensional size, determining the corresponding target prediction mode and calculating the corresponding residual array; performing adaptive binary arithmetic encoding on each residual array block; and storing the encoded multiple data block compression payloads and the coordinate encoding results as compressed ocean three-dimensional scalar field data according to a preset hierarchical file format. This technical solution can deeply adapt to the physical characteristics of ocean data, improve the data compression ratio, and balance efficient random access with convenient business archiving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data compression and storage technology, and in particular to a method, device, medium and product for encoding and decoding three-dimensional scalar field data of the ocean. Background Technology

[0002] With the continuous iteration and widespread application of marine numerical simulation, marine reanalysis, and operational forecasting technologies, massive amounts of four-dimensional spatiotemporal structured data are constantly being generated in the marine field. This type of data fully covers the three spatial dimensions of longitude, latitude, and depth, as well as the temporal dimension, and serves as the fundamental data support for core operations such as marine environmental analysis, numerical forecast assimilation, marine resource exploration, and marine disaster prevention and mitigation. The massive amount of marine four-dimensional spatiotemporal data places extremely high demands on core data processing aspects such as long-term secure archiving, high-speed transmission scheduling, and real-time random access. Traditional data storage and processing models are no longer suitable for the efficient processing needs of large-scale marine data. Efficient and adaptable dedicated storage and compression technologies tailored to the characteristics of marine data have become a core research need in the field of marine big data.

[0003] Currently, the marine industry has developed two main technical solutions for the storage and compression of four-dimensional spatiotemporal data. The first type is based on general scientific data formats, using common formats such as NetCDF-4 (Network Common Data Format version 4), HDF5 (Hierarchical Data Format version 5), or Zarr (Distributed Array Storage Format) as cores. This type of format supports a data block storage architecture, is compatible with mainstream general lossless compression algorithms such as gzip (a general lossless data compression algorithm) and zstd (a fast lossless compression algorithm), and enables basic random data access. It is currently the mainstream application solution for marine data storage. The second type is a custom binary storage solution. The basic version only performs simple serialization storage of data coordinate and field value information. Subsequent improvements, targeting the characteristics of regular grid data, simplify the cumbersome coordinate description into a parameterized expression of start value, end value, and step size. Combined with a general compression library, it compresses the field value data, thus optimizing the redundancy problem of the basic binary format to some extent. This type has limited application in marine data storage scenarios. Meanwhile, existing academic research focuses on the field of lossy compression of marine data, mainly using techniques such as wavelet transform and dimensionality reduction sampling to achieve data compression. There are only a few studies on lossless compression of marine data, and the relevant studies all use a single-dimensional general prediction model to complete the data compression process.

[0004] Existing marine data storage and compression technologies suffer from significant technical deficiencies. The core flaw of general scientific data formats lies in their treatment of marine data as a uniform, unstructured stream of bytes, failing to exploit the inherent physical structure of marine data. They cannot leverage the strong vertical correlations formed by the vertical mixing of marine elements along the depth direction, thermocline structure, and the stability characteristics of deep water, nor the spatial smoothness brought about by horizontal current fields. Custom binary storage schemes not only suffer from severe redundancy in coordinate information in the basic version, but even improved versions are merely simple superpositions of general compression techniques without customized optimization for the physical characteristics of marine data. Their compression efficiency is far lower than domain-specific solutions, and they generally do not support incremental appending to the time dimension; adding new time-series data requires rewriting the entire file, making them unsuitable for the streaming archiving requirements of operational forecasting systems. Furthermore, existing lossy compression research suffers from accuracy loss, making it unsuitable for core operations requiring full accuracy, such as marine reanalysis and numerical forecast assimilation. Summary of the Invention

[0005] This invention provides a method, device, medium, and product for encoding and storing three-dimensional scalar field data of the ocean, in order to solve the problems of existing ocean data storage and compression technologies that do not take into account the physical structured characteristics of ocean data, have low compression efficiency, limited lossless compression ratio, and cannot meet the needs of time-series incremental streaming archiving.

[0006] According to one aspect of the present invention, a method for encoding and storing three-dimensional scalar field data of the ocean is provided, comprising: The raw data of the three-dimensional scalar field of the ocean is split into three coordinate arrays and one field value array. Each data point in the raw data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of a set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates. Perform equal-interval consistency checks on each coordinate array, and determine the coordinate encoding results corresponding to each coordinate array based on the check results; The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to the preset three-dimensional size, and the target prediction mode corresponding to each three-dimensional data block is determined according to the field value corresponding to each three-dimensional data block. Based on the residual array calculated from the target prediction model of each 3D data block, adaptive binary arithmetic encoding is performed on each 3D data block, and the encoded multiple data block compression payloads and the coordinate encoding results are stored as ocean 3D scalar field compressed data according to the preset hierarchical file format.

[0007] According to another aspect of the present invention, a method for decoding and restoring three-dimensional scalar field data of the ocean is provided, comprising: Obtain the compressed data of the three-dimensional scalar field of the ocean to be decoded and restored; wherein, the compressed data of the three-dimensional scalar field of the ocean is obtained by compressing and encoding the original data of the three-dimensional scalar field of the ocean, and each data point in the original data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates; each field value in the field value array is associated with the set three-dimensional ocean coordinates; In the compressed data of the three-dimensional scalar field of the ocean, the coordinate encoding results corresponding to the coordinate arrays of the three dimensions are obtained, as well as the compressed payload of multiple data blocks. Each compressed payload of data blocks is obtained by using a three-dimensional data block composed of three-dimensional blocks corresponding to multiple field values ​​in the field value, and then performing adaptive binary arithmetic encoding using a matching target prediction mode. Based on the coordinate encoding results corresponding to the coordinate arrays in the three dimensions, the restored coordinate arrays in the three dimensions are obtained. Adaptive binary decoding is performed on the compressed payload of each data block to restore the residual array corresponding to the compressed payload of each data block. Based on the target prediction mode corresponding to each data block compression load and the residual array corresponding to each data block compression load, multiple field value restoration values ​​corresponding to each data block compression load are obtained, and the field value restoration values ​​are spliced ​​and fused to generate a restored field value array. The restored coordinate array and the restored field value array in the three dimensions are combined to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean.

[0008] According to another aspect of the present invention, an encoding and storage device for three-dimensional scalar field data of the ocean is provided, comprising: The raw data parsing module is used to split the raw ocean three-dimensional scalar field data into three coordinate arrays and one field value array. Each data point in the raw ocean three-dimensional scalar field data is used to describe the scalar field value of a set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates. The coordinate array encoding mode confirmation module is used to perform equal-interval consistency checks on each coordinate array and determine the coordinate encoding result corresponding to each coordinate array based on the check results. The target prediction mode confirmation module is used to combine the three-dimensional blocks corresponding to each field value into multiple three-dimensional data blocks according to the preset three-dimensional size, and determine the target prediction mode corresponding to each three-dimensional data block according to the field value corresponding to each three-dimensional data block. The data compression module is used to perform adaptive binary arithmetic encoding on each three-dimensional data block based on the residual array calculated from the target prediction mode of each three-dimensional data block, and store the compressed payload of the encoded multiple data blocks and the coordinate encoding results as compressed ocean three-dimensional scalar field data according to a preset hierarchical file format.

[0009] According to another aspect of the present invention, a device for decoding and restoring three-dimensional scalar field data of the ocean is provided, comprising: The compressed data acquisition module is used to acquire the compressed data of the three-dimensional scalar field of the ocean to be decoded and restored. The compressed data of the three-dimensional scalar field of the ocean is obtained by compressing and encoding the original data of the three-dimensional scalar field of the ocean. Each data point in the original data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates. The compressed data parsing module is used to obtain the coordinate encoding results corresponding to the coordinate arrays of the three dimensions in the ocean three-dimensional scalar field compressed data, as well as the compressed payloads of multiple data blocks. Each compressed payload is obtained by using a three-dimensional data block composed of three-dimensional blocks corresponding to multiple field values ​​in the field value, and then performing adaptive binary arithmetic encoding using a matching target prediction mode. The coordinate array restoration module is used to restore the coordinate array in three dimensions based on the coordinate encoding results corresponding to the coordinate array in the three dimensions. The residual array restoration module is used to perform adaptive binary decoding on the compressed load of each data block and restore it to obtain the residual array corresponding to the compressed load of each data block. The field value array restoration module is used to restore multiple field value restoration values ​​corresponding to the compression load of each data block based on the target prediction mode corresponding to the compression load of each data block and the residual array corresponding to the compression load of each data block, and then splice and fuse the field value restoration values ​​to generate the restored field value array. The data stitching module is used to combine the restored coordinate array and the restored field value array in three dimensions to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean.

[0010] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which is executed by the at least one processor to enable the at least one processor to execute the encoding and storage method for ocean three-dimensional scalar field data according to any embodiment of the present invention, or the decoding and restoration method for ocean three-dimensional scalar field data.

[0011] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the encoding and storage method for ocean three-dimensional scalar field data, or the decoding and restoration method for ocean three-dimensional scalar field data, as described in any embodiment of the present invention.

[0012] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the method as described in any embodiment of the present invention.

[0013] In this invention, the original three-dimensional scalar field data of the ocean is parsed to obtain three coordinate arrays and one field value array. Each field value in the field value array is associated with a set three-dimensional ocean coordinate. Each coordinate array undergoes an equal-interval consistency check to determine the coordinate encoding result corresponding to each coordinate array. The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to a preset size. Based on the encoding cost calculated under each prediction mode for each field value corresponding to each three-dimensional data block, the target prediction mode corresponding to each three-dimensional data block is determined, thereby calculating the corresponding residual array. After performing adaptive binary arithmetic encoding on the residual array, the resulting multiple data block compression payloads and coordinate encoding results are stored as compressed ocean three-dimensional scalar field data according to a preset hierarchical file format. This technical solution can deeply adapt to the physical characteristics of ocean data, effectively reduce data information entropy through block-level adaptive multi-mode prediction, improve data compression ratio, reduce the storage volume of ocean time-series data, and balance efficient random access and convenient business archiving. The overall compression and storage effect is excellent, easy to integrate and implement, and significantly reduces storage and maintenance costs.

[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a method for encoding and storing three-dimensional scalar field data of the ocean according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the structure of a three-dimensional scalar field compression data for oceans applicable to embodiments of the present invention; Figure 3 This is a flowchart of a method for decoding and restoring three-dimensional scalar field data of the ocean according to Embodiment 2 of the present invention; Figure 4 This is a schematic diagram of the structure of an encoding and storage device for three-dimensional scalar field data of the ocean according to Embodiment 3 of the present invention; Figure 5 This is a schematic diagram of the structure of a decoding and storage device for three-dimensional scalar field data of the ocean according to Embodiment 4 of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device that implements the encoding and decoding method for ocean three-dimensional scalar field data according to an embodiment of the present invention. Detailed Implementation

[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0018] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0019] Example 1 Figure 1 This is a flowchart illustrating a method for encoding and storing three-dimensional scalar field data of the ocean, as provided in Embodiment 1 of the present invention. This embodiment is applicable to the encoding, compression, and storage of three-dimensional scalar field data of the ocean. This method can be executed by an encoding and storage device for the ocean three-dimensional scalar field data. This encoding and storage device can be implemented in hardware and / or software, and is generally configured in an electronic device that executes the encoding and storage method for the ocean three-dimensional scalar field data. Figure 1 As shown, the method includes: S110. Split the original data of the ocean three-dimensional scalar field into three coordinate arrays and one field value array.

[0020] In this context, each data point in the original data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates, and each field value in the field value array is associated with the set three-dimensional ocean coordinates.

[0021] The field value array can refer to the observed values ​​of marine environmental physical elements corresponding to each coordinate position in the three-dimensional space of the ocean. For example, it can be observed data such as temperature, salinity, zonal seawater current velocity, or meridional seawater current velocity. The raw data of the three-dimensional scalar field of the ocean can refer to the unprocessed raw data containing three-dimensional spatial coordinates of longitude, latitude, and depth, as well as the field values ​​of marine environmental elements corresponding to each coordinate position.

[0022] Understandably, after obtaining the raw data of the ocean's three-dimensional scalar field, it can be parsed and split into three coordinate arrays: a longitude array (Lon), a latitude array (Lat), and a depth array (Depth), as well as a field value array (V(x,y,z)). Each data point in the raw ocean three-dimensional scalar field data describes the scalar field value of a specified ocean feature under the corresponding three-dimensional ocean coordinates. Each field value in the field value array V(x,y,z) is associated with the corresponding three-dimensional ocean coordinates. Based on the obtained three coordinate arrays, the number of longitude dimensions (X), latitude dimensions (Y), and depth dimensions (Z) can be statistically determined. For example, when acquiring the raw data of the three-dimensional temperature scalar field at the first sampling time step, the number of longitude dimensions X=3600, the number of latitude dimensions Y=1800, and the number of depth dimensions Z=50 can be obtained through analysis. In this set of data, the longitude values ​​range from 0° to 360° and are arranged at a uniform interval of 0.1°. The latitude values ​​range from -90° to 90° and are also arranged at a uniform interval of 0.1°. The depth layer can be selected as a non-uniformly spaced sequence, with specific values ​​ranging from 5m, 15m, 30m, 50m, 75m to 5500m.

[0023] S120. Perform equal-interval consistency checks on each coordinate array and determine the coordinate encoding results corresponding to each coordinate array based on the check results.

[0024] Among them, the equal-interval consistency check refers to the process of calculating the difference between adjacent coordinate values ​​in the longitude, latitude, and depth arrays sequentially to determine whether the interval between adjacent values ​​in the entire coordinate sequence remains uniform and constant, thereby distinguishing whether the coordinate sequence is equal-interval or non-equal-interval. The coordinate encoding result refers to the final coordinate data encoding content obtained after performing corresponding encoding processing on the coordinate array based on the coordinate distribution type obtained from the equal-interval consistency check.

[0025] Understandably, the longitude, latitude, and depth coordinate arrays are sequentially subjected to equal-spacing consistency checks, and encoding mode identifiers are generated for each dimension array. The coordinate encoding results for each coordinate array are determined based on the check results. If a coordinate array is determined to be in an equal-spacing mode, the coordinate encoding result for that dimension can record only the starting value and fixed step size of the corresponding coordinates. If it is determined to be in a non-equal-spacing mode, the coordinate encoding result for that dimension must record the complete original coordinate array.

[0026] Optionally, perform equal-interval consistency checks on each coordinate array, and determine the coordinate encoding results corresponding to each coordinate array based on the check results, including: Retrieve the current coordinate array from each coordinate array; Calculate the difference between adjacent coordinates in the current coordinate array to obtain the current coordinate difference sequence; The difference between the second element and the first element in the current coordinate array is used as the baseline difference. If the baseline difference is zero, the current dimension coordinate sequence is determined to be a non-equal spacing coordinate mode. If the baseline difference is not zero, calculate the relative deviation of each remaining coordinate difference in the current coordinate difference sequence relative to the baseline difference, and perform consistency verification on each relative deviation value according to the preset deviation threshold. If all relative deviation values ​​in the current dimension coordinate sequence are less than the preset deviation threshold, the current dimension coordinate sequence is determined to be an equidistant coordinate mode, and only the starting coordinate value and fixed step size parameter of that dimension are stored. If any relative deviation value is not less than the preset deviation threshold, the current dimension coordinate sequence is determined to be a non-equidistant coordinate mode, and all coordinate data of that dimension are fully stored.

[0027] Here, the current coordinate array can refer to the single coordinate array to be checked for uniform spacing during the process of traversing the longitude, latitude, and depth coordinate arrays. The current coordinate difference sequence can refer to the set of differences obtained by calculating the difference between each pair of adjacent coordinate values ​​in the current coordinate array. The baseline difference can refer to the difference obtained by subtracting the first coordinate element from the second coordinate element in the current coordinate array, used as a reference standard to determine whether the coordinate intervals are uniform. The preset deviation threshold can refer to a pre-set deviation critical value used to measure the degree of deviation of the coordinate interval from the baseline difference, thereby completing the uniform spacing consistency determination.

[0028] Specifically, longitude, latitude, and depth coordinate arrays are selected sequentially as the current coordinate array to be detected. The current coordinate array can be set to... Where N represents the number of coordinate elements in the corresponding dimension of the current coordinate array. The current coordinate array D is divided into groups of two adjacent elements, and the values ​​of each group of two adjacent elements are calculated. and The difference is used to obtain the difference between adjacent coordinates. (i∈[0,N-2]), and combine the differences between adjacent coordinates in order to form the current coordinate difference sequence. Extract the difference between the second element and the first element in the current coordinate array as the baseline difference. If the baseline difference is zero, the current coordinate array sequence is directly determined to be a non-equal spacing coordinate mode. If the baseline difference is not zero, then the formula is followed. (i∈[0,N-2]), calculate the remaining differences in the current coordinate difference sequence. relative to the benchmark difference relative deviation value And according to the preset relative deviation threshold A consistency check is performed. If all relative deviation values ​​for the current dimension are less than a preset deviation threshold, the dimension is determined to be in an equidistant coordinate mode, storing only the starting coordinate values ​​and fixed step size parameters of the current coordinate array. If any relative deviation value is greater than or equal to the preset deviation threshold, the dimension is determined to be in a non-equidistant coordinate mode, storing all coordinate data of the current coordinate array and generating a corresponding encoding mode identifier for the dimension array corresponding to the current coordinate array. For example, equidistant consistency checks are performed on the longitude, latitude, and depth arrays respectively, with the preset relative deviation threshold set to... If, after consistency verification, all relative deviation values ​​corresponding to the longitude and latitude arrays are less than the threshold, then they are determined to be in an equidistant coordinate mode. Only the starting longitude value of 0.0° and the corresponding fixed step size of 0.1°, and the starting latitude value of -90.0° and the corresponding fixed step size of 0.1° need to be recorded. If the relative deviation value of the depth array is not less than the relative deviation threshold, then it is determined to be in a non-equidistant coordinate mode. Therefore, all coordinate data in the coordinate array corresponding to the depth dimension are completely stored, and the corresponding encoding mode identifiers of the three dimension coordinate arrays are generated simultaneously to indicate whether they correspond to an equidistant or non-equidistant coordinate mode.

[0029] S130. The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to the preset three-dimensional size, and the target prediction mode corresponding to each three-dimensional data block is determined according to the field value corresponding to each three-dimensional data block.

[0030] Here, a three-dimensional data block can refer to a non-overlapping cubic data unit obtained by dividing the three-dimensional field value array parsed from the original three-dimensional scalar field data of the ocean according to a preset specification. A target prediction model can refer to an adapted prediction computation method selected from a pre-constructed candidate set of prediction models, combining the field value distribution within the three-dimensional data block with ocean physical characteristics.

[0031] Understandably, the field values ​​corresponding to each 3D coordinate data point are divided into three-dimensional blocks. Multiple adjacent, non-overlapping three-dimensional blocks are combined according to a pre-defined 3D size specification to form a 3D data block. If the number of three-dimensional blocks in the edge regions of the original ocean 3D scalar field data points does not reach the preset 3D size, the gaps in the 3D data block can be filled by mirroring. Based on the field value data contained in each 3D data block, corresponding ocean physical environment characteristics are matched, and target prediction modes suitable for each 3D data block are selected from a pre-constructed candidate set of prediction modes.

[0032] Optionally, based on the field values ​​corresponding to each 3D data block, a target prediction mode corresponding to each 3D data block is determined, including: The current three-dimensional data block is obtained from each three-dimensional data block, and the field value is predicted for the current three-dimensional data block by using each prediction mode in the preset prediction mode candidate set. Based on the field value prediction results and the field values ​​corresponding to the current three-dimensional data block, calculate the residual arrays corresponding to each prediction mode, and calculate the residual zero-order information entropy corresponding to each residual array. The zero-order information entropy of each residual is weighted according to the overall number of grids in the current 3D data block to obtain the coding value corresponding to each prediction mode. The prediction pattern with the lowest encoding cost is determined as the target prediction pattern for the current 3D data block.

[0033] Here, the current 3D data block can refer to a single 3D data block obtained by traversing all the partitioned 3D data blocks, used for the current prediction matching operation. The residual array can refer to an array of data consisting of all the differences obtained after performing a difference operation between the original field values ​​contained in the current 3D data block and the predicted field values ​​output by the corresponding prediction model. The zero-order residual entropy can refer to the zero-order information entropy calculated based on the occurrence probability of each residual value in the residual array, which can be used to characterize the degree of discreteness and disorder of the residual data. The coding cost can refer to a quantitative indicator used to characterize the size of the compression coding overhead of the corresponding prediction model after weighting the zero-order residual information entropy using the total number of grids in the current 3D data block.

[0034] Specifically, the encoded value of the current 3D data block is calculated in each 3D data block. A candidate set of prediction models adapted to ocean physical characteristics can be pre-constructed. This set can include no-prediction models, vertical upper neighbor prediction models, third-order vertical linear prediction models, and horizontal median edge prediction models. The no-prediction model is suitable for regions with severe gradients and extremely weak spatial correlation, such as ocean fronts and vortex cores. The prediction expression is: The corresponding residual array The value is equal to the field value array V(x,y,z). The vertical upper neighbor prediction mode adapts to the strong vertical stratification characteristics of water bodies. The prediction value of the first layer is set to zero, and the original field value of the next deeper layer at the same horizontal position is taken as the prediction value for the remaining depth layers. The expression is: The third-order vertical linear prediction model matches the linear gradient variation law of the thermocline. When the depth z is less than or equal to 2, the vertical upper neighbor prediction is reused; when the depth z is greater than or equal to 3, the predicted value is calculated by using the least squares fitting coefficients of the field values ​​of the first three layers. The corresponding expression is: , Among them, linear coefficients , , The solution was obtained by fitting the vertical variation sequence of the first three depth layers using the least squares method, with the fitting objective being to minimize... The horizontal median edge prediction model adapts to the smooth characteristics of the horizontal flow field. When zero exists in the horizontal and vertical coordinates, the vertical upper neighbor is used for prediction. For other points, the median of the field values ​​of the left, upper, and upper left neighboring points is used as the predicted value. The corresponding formula is as follows: ,in, and , For the median function, or The calculation method of the vertical upper neighbor prediction model is applicable to the case.

[0035] Each prediction mode from the preset candidate set is invoked to calculate the field value of the current 3D data block. Based on the field value prediction results output by each prediction mode, and combined with the original field values ​​corresponding to the current 3D data block, the difference between the predicted value and the original field value is calculated for each grid point, thus obtaining the residual array corresponding to each prediction mode. Based on the probability distribution of various residual values ​​in the residual array, the zero-order information entropy formula is used. Calculate the zeroth-order residual information entropy corresponding to each residual array, where, The residual array under the m-th prediction mode The zero-order information entropy, where K represents the number of different residual values ​​in the residual array. This represents the probability of the k-th residual value occurring. It also represents the total number of grid cells in the current 3D data block. The zero-order information entropy of each residual is weighted and calculated according to the formula. Solving for the encoding cost corresponding to the m-th prediction mode yields the value. The coding values ​​of all prediction modes are compared and selected. The prediction mode with the lowest coding value is selected as the target prediction mode of the current 3D data block, and the mode number corresponding to the target prediction mode is recorded simultaneously.

[0036] S140. Based on the residual array calculated from the target prediction mode of each three-dimensional data block, perform adaptive binary arithmetic encoding on each three-dimensional data block, and store the encoded multiple data block compression payloads and the coordinate encoding results as ocean three-dimensional scalar field compressed data according to the preset hierarchical file format.

[0037] Adaptive binary arithmetic coding can refer to a binary arithmetic coding method that dynamically adjusts the coding probability model based on the data context distribution characteristics to efficiently and losslessly compress residual data. Predefined hierarchical file format refers to a predefined hierarchical data organization and file encapsulation format to adapt to the structured storage requirements of ocean three-dimensional scalar field data. Data block compression payload refers to the main content of directly storable binary compressed data generated after the residual array of a single three-dimensional data block is compressed using adaptive binary arithmetic coding. Coordinate encoding result refers to simplified coordinate storage data generated according to the corresponding coordinate mode after the coordinate arrays of each dimension have undergone equal-interval consistency verification. Ocean three-dimensional scalar field compressed data can refer to complete ocean three-dimensional scalar field lossless compressed file data formed by uniformly encapsulating the compression payloads of each three-dimensional data block and the coordinate encoding results of each dimension according to a predefined hierarchical file format.

[0038] Understandably, based on the residual array that can be calculated from the target prediction mode corresponding to each 3D data block, adaptive compression encoding is performed on each 3D data block sequentially using a context-based adaptive binary arithmetic encoding method. This generates the data block compression payload corresponding to each 3D data block and records the byte length of each data block compression payload simultaneously. The compression payloads corresponding to all 3D data blocks and the coordinate encoding results corresponding to each dimension are then structured, encapsulated, and stored in an ordered manner according to a preset hierarchical file format. Finally, these are integrated to generate complete ocean 3D scalar field compression data.

[0039] Optionally, adaptive binary arithmetic coding is performed on each 3D data block based on the residual array calculated from the target prediction pattern of each 3D data block, including: Obtain the current 3D data block from each 3D data block, and obtain the current residual array calculated for the current 3D data block against the matched target prediction pattern; Calculate the magnitude characteristics of the three-dimensional neighborhood residuals corresponding to the current residual array; In the current residual array, retrieve one current residual at a time and obtain the binary bit stream that matches the current residual; Based on the context index dynamically matched by the residual magnitude features of the three-dimensional neighborhood, the probability value corresponding to each binary bit in the binary bit stream is calculated. Based on each probability value, adaptive binary arithmetic encoding is performed on the binary bit stream, and after the encoding is completed, the operation of retrieving a current residual from the current residual array is returned. After completing the binary arithmetic encoding of all residuals in the current residual array, the data block compression payload corresponding to the current 3D data block is obtained.

[0040] The three-dimensional neighborhood residual amplitude feature refers to the spatial features extracted using the distribution of residual amplitudes in the three-dimensional neighborhood of the current residual to be encoded, and is used to dynamically determine the context index required for encoding. The current residual array refers to the complete residual data array consisting of the difference between the original field value and the predicted field value after the current three-dimensional data block completes field value prediction through the matched target prediction pattern. The current residual can refer to a single residual data point obtained by sequentially traversing within the current residual array, representing the smallest processing unit for a single binary arithmetic encoding operation.

[0041] Specifically, after obtaining the current 3D data block from each 3D data block, the spatial distribution information of the current residual array, calculated using the matched target prediction pattern, is extracted. The corresponding 3D neighborhood residual amplitude features are then calculated, and the corresponding context index is determined based on these features. Individual current residuals are sequentially extracted from the current residual array, and the corresponding binary bitstream is obtained. The context index, dynamically matched based on the 3D neighborhood residual amplitude features, is then updated using an adaptive context probability formula. Calculate the probability value corresponding to each binary bit in the binary bit stream, where s is the current encoded bit, with a value of 0 or 1, and C is the context index. This is the count of occurrences of bit s under the corresponding context index C. For example, set the Laplace smoothing coefficient. It can track the distribution characteristics of residual data in real time. Based on the calculated probability values ​​of each bit, it performs context-based adaptive binary arithmetic encoding on the binary bit stream. After the single bit encoding is completed, it returns to continue the iterative operation of obtaining the next current residual in the current residual array in turn. The loop iterates until the binary arithmetic encoding of all residual data in the current residual array is completed, and finally the data block compressed payload corresponding to the current three-dimensional data block is obtained.

[0042] Optionally, the encoded multiple data blocks are compressed according to a preset layered file format, and the coordinate encoding results are stored as compressed ocean three-dimensional scalar field data, including: Create an initial target file according to the preset hierarchical file format. The target file includes: dimension data area, block directory area and block data area. In the configuration header of the target file, at least the version number, time step parameter information, number of coordinate arrays and size of each coordinate array are stored in the header. At least the coordinate encoding results corresponding to each coordinate array are stored in the dimension data area. At least the target prediction mode identifier, compressed payload length of each data block and offset information of each data block compressed payload in the target file are stored in the block directory area. The compressed payloads of the multiple data blocks obtained by encoding are stored in the block data area in sequence. The updated target file containing various information is stored as compressed data of a three-dimensional scalar field of the ocean.

[0043] The target file can refer to an encapsulated file carrier constructed according to a preset layered file format, which carries various data description information and data compression payloads, and is used to construct compressed data of the three-dimensional scalar field of the ocean.

[0044] Specifically, an initial blank target file can be created based on a preset layered file format. The preset layered storage structure of the initialized target file is as follows: Figure 2 As shown, it can include three core data storage areas: dimensional data area, block directory area, and block data area. The configuration header area is located at the beginning of the target file, and all basic configuration parameters (i.e., file format identifier, version number, ocean data time step parameter information, number of coordinate arrays, size of each coordinate array dimension, encoding mode identifier for each dimension, 3D data block size parameters, and total number of data blocks) are written into the file header. Figure 2 The fixed-length header of the file contains information such as format, version number, number of dimensions, size of each dimension, encoding mode representation, block size parameter, total number of blocks, total number of time steps, and time extension offset. The dimension data area can store the coordinate encoding results corresponding to each coordinate array (i.e.,...). Figure 2 The mid-dimensional data area contains information on either equidistant or non-equidistant spacing patterns. For coordinate dimensions identified as equidistant, the starting coordinate value and fixed step size parameter for that dimension are stored. For coordinate dimensions identified as non-equidistant, the complete coordinate sequence data for that dimension is stored. The block directory area can sequentially store block-level metadata information such as the target prediction mode identifier number corresponding to each 3D data block, the byte length of each data block's compressed payload, and the offset of each data block's compressed payload within the target file. Figure 2 The block directory area, stored sequentially, organizes and stores prediction mode numbers, payload lengths, and file offsets using block element information. Data writing operations in the block data area can compress multiple data blocks (obtained after encoding all 3D data blocks) into a payload and store them sequentially and continuously within the block data area according to a preset sorting rule (i.e., ...). Figure 2 The block data area, stored sequentially, contains the context-adaptive arithmetic-coded bitstream that serves as the block compression payload. After completing the writing and data configuration of all information in the file header, dimension data area, block directory area, and block data area, the target file can be updated based on all storage information, and stored as standardized ocean three-dimensional scalar field compressed data. Before writing the assembled ocean three-dimensional scalar field compressed data to the storage medium for formal storage, the remaining available storage space of the storage medium can be pre-detected. By comparing the overall volume occupied by the compressed data with the remaining space, and confirming sufficient space, the writing operation can be performed.

[0045] Optionally, the target file may also include: a time extension region; Correspondingly, a time extension area is set at the end of the target file, and when new time-series data is added, the corresponding time dimension information, block directory area information and block data area information are obtained; The block directory area information and block data area information are written to the end of the time extension area in a preset order, and the number of coordinate arrays and time step parameter information in the target file header are updated according to the time dimension information.

[0046] Specifically, the constructed hierarchical target file structure can include a time extension area to accommodate the incremental storage requirements of multi-timestep ocean 3D scalar field data, enabling streaming appending of time-series data without overwriting existing file data. Therefore, a time extension area can be configured at the end of the target file; this area is a dynamically expandable optional data storage area used to accommodate subsequently added time-series ocean 3D scalar field compressed data. First, the complete time dimension information corresponding to the new time-series ocean 3D scalar field data can be collected, and the corresponding block directory area information and block data area information (i.e.,...) can be calculated. Figure 2 The optional time extension area can store time step metadata, time step block directory area, and time step block data area. The time step metadata includes timestamps, time encoding modes, block directory offsets, and block data offsets. The time step block directory area includes metadata for all blocks within that time step, and the time step block data area includes the compressed payload for all blocks within that time step. During data writing, there is no need to parse, modify, or rewrite the historical data already stored in the target file. Only the block directory area information and block data area information corresponding to the currently added time step are written to the end of the time extension area at the end of the target file, according to a preset file writing order. After the incremental data writing is complete, the file header parameters of the target file are synchronously updated based on the newly added time dimension information. This can update the number of coordinate arrays stored in the file header, the time step parameter information describing the total number of time steps, and the time dimension index offset, among other time step-related parameter information.

[0047] In this invention, the original three-dimensional scalar field data of the ocean is parsed to obtain three coordinate arrays and one field value array. Each field value in the field value array is associated with a set three-dimensional ocean coordinate. Each coordinate array undergoes an equal-interval consistency check to determine the coordinate encoding result corresponding to each coordinate array. The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to a preset size. Based on the encoding cost calculated under each prediction mode for each field value corresponding to each three-dimensional data block, the target prediction mode corresponding to each three-dimensional data block is determined, thereby calculating the corresponding residual array. After performing adaptive binary arithmetic encoding on the residual array, the resulting multiple data block compression payloads and coordinate encoding results are stored as compressed ocean three-dimensional scalar field data according to a preset hierarchical file format. This technical solution can deeply adapt to the physical characteristics of ocean data, effectively reduce data information entropy through block-level adaptive multi-mode prediction, improve data compression ratio, reduce the storage volume of ocean time-series data, and balance efficient random access and convenient business archiving. The overall compression and storage effect is excellent, easy to integrate and implement, and significantly reduces storage and maintenance costs.

[0048] Example 2 Figure 3 This is a flowchart of a method for decoding and restoring three-dimensional scalar field data of the ocean provided in Embodiment 2 of the present invention. This embodiment decompresses and restores the compressed three-dimensional scalar field data of the ocean obtained in the above embodiments. Figure 3 As shown, the method includes: S310. Obtain the compressed data of the three-dimensional scalar field of the ocean to be decoded and restored.

[0049] Among them, the compressed data of the three-dimensional scalar field of the ocean is obtained by compressing and encoding the original data of the three-dimensional scalar field of the ocean. Each data point in the original data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates.

[0050] It is understandable that when decompressing and restoring compressed ocean three-dimensional scalar field data, the target file generated after the original ocean three-dimensional scalar field data has been processed by the compression encoding process can be obtained. The original ocean three-dimensional scalar field data consists of a massive number of spatial data points. Each data point corresponds to a set of definite three-dimensional ocean spatial coordinates. Each data point can be used to characterize the scalar field value of ocean physical elements such as temperature or salinity at that coordinate location. All scalar field values ​​can be ordered to form a three-dimensional field value array. Each field value element in the array corresponds to a definite three-dimensional ocean coordinate location information.

[0051] S320. Obtain the coordinate encoding results corresponding to the coordinate arrays of the three-dimensional dimensions in the compressed ocean three-dimensional scalar field data, as well as the compressed payload of multiple data blocks.

[0052] The compressed payload of each data block is obtained by combining three-dimensional data blocks corresponding to multiple field values ​​in the field value values, and then performing adaptive binary arithmetic encoding using a matched target prediction mode.

[0053] Understandably, during the decoding and parsing operation, the header of the target file corresponding to the ocean three-dimensional scalar field compressed data can be read to extract parameters such as the number of coordinate arrays and the size of each coordinate array. The corresponding time step parameter information can be matched according to the user's decoding timing access request to calculate and determine the information of multiple three-dimensional data blocks to be restored corresponding to the access request. In the dimension data area of ​​the target file, the ocean three-dimensional scalar field compressed data can be obtained and parsed to obtain the coordinate encoding results corresponding to the coordinate arrays of longitude, latitude, and depth, respectively. In the block data area of ​​the target file, the data block compression payloads corresponding to all the three-dimensional data blocks to be restored can be obtained. The generation process of each data block compression payload involves first matching the field value data in the original field value array with the corresponding stereo blocks to form multiple three-dimensional data blocks. Then, an appropriate target prediction mode is selected for each three-dimensional data block to complete the prediction calculation. Adaptive binary arithmetic encoding is applied to the residual array obtained from the calculation, and the final encoded binary data is the corresponding data block compression payload.

[0054] S330. Based on the coordinate encoding results corresponding to the coordinate arrays in the three dimensions, the restored coordinate arrays in the three dimensions are obtained.

[0055] Understandably, based on the coordinate encoding results corresponding to the coordinate arrays of longitude, latitude, and depth obtained from the analysis, after determining the dimension encoding mode identifier corresponding to each coordinate array, coordinate reconstruction is performed according to the corresponding dimension encoding mode identifier. If the corresponding dimension encoding mode identifier is an equal-spacing mode, the stored starting coordinate values ​​and fixed step size parameters are retrieved, and the complete reconstructed coordinate array is generated step by step. If the corresponding dimension encoding mode identifier is a non-equal-spacing mode, the complete stored coordinate sequence is directly read as the reconstructed coordinate array. Finally, complete reconstructed coordinate arrays of the three dimensions can be obtained respectively.

[0056] S340. Perform adaptive binary decoding on the compressed payload of each data block to restore the residual array corresponding to the compressed payload of each data block.

[0057] Understandably, based on the offset position and payload length stored in the block directory area, the corresponding data block compressed payload can be read from the block data area, and the bit stream can be reverse-parsed using a context-adaptive binary arithmetic decoding algorithm consistent with the encoding process. The context index is determined using the three-dimensional neighborhood residual magnitude, and the dynamic probability model with Laplace smoothing is reused to decode bit by bit, recovering all residual values ​​layer by layer. Thus, the corresponding residual array generated in the encoding stage can be reverse-reconstructed based on the compressed payload of each data block.

[0058] S350. Based on the target prediction mode corresponding to the compression load of each data block and the residual array corresponding to the compression load of each data block, restore multiple field value restoration values ​​corresponding to the compression load of each data block, and splice and fuse the field value restoration values ​​to generate a restored field value array.

[0059] Understandably, based on the target prediction mode identifier stored in the block directory, the prediction mode used by the current 3D data block to be restored can be determined. Based on all the data points determined by the 3D coordinate information, the corresponding prediction field value can be calculated. The prediction field value is then superimposed with the residual array recovered by the adaptive binary decoding process to obtain the field value restoration value corresponding to each data point. Finally, according to the original spatial arrangement order of the current 3D data block to be restored, the field value restoration values ​​of all the 3D data blocks to be restored are sequentially spliced ​​and integrated to obtain a complete and continuous restored field value array.

[0060] S360. Combine the restored coordinate array and the restored field value array in the three dimensions to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean.

[0061] Understandably, based on the complete restored coordinate arrays of the three dimensions of longitude, latitude, and depth, as well as the restored field value arrays corresponding to all data points determined by the three-dimensional coordinate information, correlation matching and overall combination and encapsulation can be performed so that each data point determined by the three-dimensional coordinate information corresponds to a unique restored field value of the ocean element scalar field. This completes the entire decoding and restoration work, resulting in a complete, continuous ocean three-dimensional scalar field decoding and restoration result that is consistent with the original ocean three-dimensional scalar field data.

[0062] In this invention, the technical solution acquires compressed three-dimensional scalar field data of the ocean to be decoded and restored. Each data point in the original three-dimensional scalar field data describes the scalar field value of a set ocean test element under a set three-dimensional ocean coordinate system. Each field value in the field value array is associated with the set three-dimensional ocean coordinate system. The coordinate encoding results corresponding to the coordinate arrays of the three dimensions are acquired from the compressed three-dimensional scalar field data, along with multiple compressed data block payloads obtained after adaptive binary arithmetic encoding using a matching target prediction mode. Based on the coordinate encoding results corresponding to the coordinate arrays of the three dimensions, restored coordinate arrays in the three dimensions are obtained. Adaptive binary decoding is performed on each compressed data block payload to obtain residual arrays corresponding to each compressed data block payload. Based on the target prediction mode corresponding to each compressed data block payload and the residual arrays corresponding to each compressed data block payload, multiple restored field value values ​​corresponding to each compressed data block payload are obtained. These restored field value values ​​are then concatenated and fused to generate a restored field value array. The restored coordinate arrays and restored field value arrays in the three dimensions are combined to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean. This technical solution, through block prediction and adaptive arithmetic encoding and decoding mechanisms in the matching encoding stage, can accurately and completely reverse-engineer the original data of the three-dimensional scalar field of the ocean. While ensuring lossless decoding data and high restoration accuracy, it also relies on block indexing to adapt to efficient random access, meeting the application requirements for fast and accurate decoding of three-dimensional time-series scalar field data of the ocean.

[0063] Example 3 Figure 4 This is a schematic diagram of the structure of an encoding and storage device for three-dimensional scalar field data of the ocean provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a raw data parsing module 410, a coordinate array encoding mode confirmation module 420, a target prediction mode confirmation module 430, and a data compression module 440.

[0064] The raw data parsing module 410 is used to split the raw data of the three-dimensional scalar field of the ocean into three coordinate arrays and one field value array. Each data point in the raw data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates.

[0065] The coordinate array encoding mode confirmation module 420 is used to perform equal-interval consistency verification on each coordinate array and determine the coordinate encoding result corresponding to each coordinate array based on the verification result.

[0066] The target prediction mode confirmation module 430 is used to combine the three-dimensional blocks corresponding to each field value into multiple three-dimensional data blocks according to a preset three-dimensional size, and determine the target prediction mode corresponding to each three-dimensional data block according to each field value corresponding to each three-dimensional data block.

[0067] The data compression module 440 is used to perform adaptive binary arithmetic encoding on each three-dimensional data block according to the residual array calculated by the target prediction mode of each three-dimensional data block, and store the compressed payload of the multiple data blocks and the coordinate encoding results as ocean three-dimensional scalar field compressed data according to the preset hierarchical file format.

[0068] In this invention, the original three-dimensional scalar field data of the ocean is parsed to obtain three coordinate arrays and one field value array. Each field value in the field value array is associated with a set three-dimensional ocean coordinate. Each coordinate array undergoes an equal-interval consistency check to determine the coordinate encoding result corresponding to each coordinate array. The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to a preset size. Based on the encoding cost calculated under each prediction mode for each field value corresponding to each three-dimensional data block, the target prediction mode corresponding to each three-dimensional data block is determined, thereby calculating the corresponding residual array. After performing adaptive binary arithmetic encoding on the residual array, the resulting multiple data block compression payloads and coordinate encoding results are stored as compressed ocean three-dimensional scalar field data according to a preset hierarchical file format. This technical solution can deeply adapt to the physical characteristics of ocean data, effectively reduce data information entropy through block-level adaptive multi-mode prediction, improve data compression ratio, reduce the storage volume of ocean time-series data, and balance efficient random access and convenient business archiving. The overall compression and storage effect is excellent, easy to integrate and implement, and significantly reduces storage and maintenance costs.

[0069] Optionally, the coordinate array encoding mode confirmation module 420 can be specifically used to obtain the current coordinate array in each coordinate array, calculate the difference between adjacent coordinates in the current coordinate array to obtain the current coordinate difference sequence, take the difference between the second element and the first element in the current coordinate array as the reference difference, if the reference difference is zero, then the current dimension coordinate sequence is determined to be a non-equal spacing coordinate mode. If the reference difference is not zero, then the relative deviation values ​​of the remaining coordinate differences in the current coordinate difference sequence relative to the reference difference are calculated, and the consistency of each relative deviation value is checked according to the preset deviation threshold. If all relative deviation values ​​of the current dimension coordinate sequence are less than the preset deviation threshold, then the current dimension coordinate sequence is determined to be an equal spacing coordinate mode, and only the starting coordinate value and fixed step size parameter of the dimension are stored. If any relative deviation value is not less than the preset deviation threshold, then the current dimension coordinate sequence is determined to be a non-equal spacing coordinate mode, and all coordinate data of the dimension are fully stored.

[0070] Optionally, the target prediction mode confirmation module 430 can be specifically used to obtain the current 3D data block in each 3D data block, and use each prediction mode in the preset prediction mode candidate set to predict the field value of the current 3D data block. Based on the field value prediction results and the field values ​​corresponding to the current 3D data block, the residual array corresponding to each prediction mode is calculated, and the zero-order information entropy of the residuals corresponding to each residual array is calculated. The zero-order information entropy of each residual is weighted according to the total number of grids in the current 3D data block to obtain the encoding cost value corresponding to each prediction mode. The prediction mode with the lowest encoding cost value is determined as the target prediction mode for the current 3D data block.

[0071] Optionally, the data compression module 440 can be specifically used to obtain the current 3D data block in each 3D data block, and obtain the current residual array calculated for the current 3D data block against the matched target prediction mode. It calculates the 3D neighborhood residual magnitude features corresponding to the current residual array, sequentially obtains a current residual in the current residual array, and obtains the binary bitstream matching the current residual. Based on the context index dynamically matched by the 3D neighborhood residual magnitude features, it calculates the probability value corresponding to each binary bit in the binary bitstream. Based on each probability value, it performs adaptive binary arithmetic encoding on the binary bitstream. After encoding, it returns to execute the operation of sequentially obtaining a current residual in the current residual array. After completing the binary arithmetic encoding of all residuals in the current residual array, it obtains the data block compression payload corresponding to the current 3D data block.

[0072] Optionally, the data compression module 440 can also be specifically used to create an initial target file according to a preset hierarchical file format. The target file includes a dimension data area, a block directory area, and a block data area. In the target file header, at least the version number, time step parameter information, number of coordinate arrays, and size of each coordinate array are stored. At least the coordinate encoding results corresponding to each coordinate array are stored in the dimension data area. At least the identifier of the target prediction mode corresponding to each three-dimensional data block, the compression payload length of each data block, and the offset information of each data block's compression payload in the target file are stored in the block directory area. The encoded compression payloads of multiple data blocks are then sequentially stored in the block data area. The target file, updated with all the information, is then stored as compressed ocean three-dimensional scalar field data.

[0073] Optionally, the data compression module 440 can also be specifically used to set a time extension area at the end of the target file, and to obtain the corresponding time dimension information, block directory area information, and block data area information when adding new time-series data. The block directory area information and block data area information are written to the end of the time extension area in a preset order, and the number of coordinate arrays and time step parameter information in the header of the target file are updated according to the time dimension information.

[0074] The ocean three-dimensional scalar field data encoding and storage device provided in the embodiments of the present invention can execute the ocean three-dimensional scalar field data encoding and storage method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0075] Example 4 Figure 5 This is a schematic diagram of the structure of an encoding and storage device for three-dimensional scalar field data of the ocean provided in Embodiment 4 of the present invention. Figure 5 As shown, the device includes: a compressed data acquisition module 510, a compressed data parsing module 520, a coordinate array restoration module 530, a residual array restoration module 540, a field value array restoration module 550, and a restored data splicing module 560.

[0076] The compressed data acquisition module 510 is used to acquire the compressed data of the three-dimensional scalar field of the ocean to be decoded and restored. The compressed data of the three-dimensional scalar field of the ocean is obtained by compressing and encoding the original data of the three-dimensional scalar field of the ocean. Each data point in the original data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates.

[0077] The compressed data parsing module 520 is used to obtain the coordinate encoding results corresponding to the coordinate arrays of the three-dimensional dimensions in the compressed ocean three-dimensional scalar field data, as well as multiple data block compression payloads. Each data block compression payload is obtained by using a three-dimensional data block composed of three-dimensional blocks corresponding to multiple field values ​​in the field value values, and then performing adaptive binary arithmetic encoding using a matching target prediction mode.

[0078] The coordinate array restoration module 530 is used to restore the coordinate array in three dimensions based on the coordinate encoding results corresponding to the coordinate array in the three-dimensional dimensions.

[0079] The residual array restoration module 540 is used to perform adaptive binary decoding processing on the compressed load of each data block to restore the residual array corresponding to the compressed load of each data block.

[0080] The field value array restoration module 550 is used to restore multiple field value restoration values ​​corresponding to the compression load of each data block based on the target prediction mode corresponding to the compression load of each data block and the residual array corresponding to the compression load of each data block, and to splice and fuse the field value restoration values ​​to generate a restored field value array.

[0081] The data stitching module 560 is used to combine the restored coordinate array and the restored field value array in three dimensions to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean.

[0082] In this invention, the technical solution acquires compressed three-dimensional scalar field data of the ocean to be decoded and restored. Each data point in the original three-dimensional scalar field data describes the scalar field value of a set ocean test element under a set three-dimensional ocean coordinate system. Each field value in the field value array is associated with the set three-dimensional ocean coordinate system. The coordinate encoding results corresponding to the coordinate arrays of the three dimensions are acquired from the compressed three-dimensional scalar field data, along with multiple compressed data block payloads obtained after adaptive binary arithmetic encoding using a matching target prediction mode. Based on the coordinate encoding results corresponding to the coordinate arrays of the three dimensions, restored coordinate arrays in the three dimensions are obtained. Adaptive binary decoding is performed on each compressed data block payload to obtain residual arrays corresponding to each compressed data block payload. Based on the target prediction mode corresponding to each compressed data block payload and the residual arrays corresponding to each compressed data block payload, multiple restored field value values ​​corresponding to each compressed data block payload are obtained. These restored field value values ​​are then concatenated and fused to generate a restored field value array. The restored coordinate arrays and restored field value arrays in the three dimensions are combined to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean. This technical solution, through block prediction and adaptive arithmetic encoding and decoding mechanisms in the matching encoding stage, can accurately and completely reverse-engineer the original data of the three-dimensional scalar field of the ocean. While ensuring lossless decoding data and high restoration accuracy, it also relies on block indexing to adapt to efficient random access, meeting the application requirements for fast and accurate decoding of three-dimensional time-series scalar field data of the ocean.

[0083] The decoding and restoration device for ocean three-dimensional scalar field data provided in this embodiment of the invention can execute the decoding and restoration method for ocean three-dimensional scalar field data provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0084] Example 5 Figure 6 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0085] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0086] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0087] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as methods for encoding and storing three-dimensional scalar field data of the ocean, or methods for decoding and restoring three-dimensional scalar field data of the ocean.

[0088] In some embodiments, the method for encoding and storing three-dimensional ocean scalar field data, or the method for decoding and restoring three-dimensional ocean scalar field data, can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for encoding and storing three-dimensional ocean scalar field data, or the method for decoding and restoring three-dimensional ocean scalar field data, described above, can be performed. Alternatively, in other embodiments, processor 11 can be configured by any other suitable means (e.g., by means of firmware) to perform the method for encoding and storing three-dimensional ocean scalar field data, or the method for decoding and restoring three-dimensional ocean scalar field data.

[0089] The encoding and storage method for ocean three-dimensional scalar field data involves splitting the raw ocean three-dimensional scalar field data into three coordinate arrays and one field value array. Each data point in the raw ocean three-dimensional scalar field data is used to describe the scalar field value of a set ocean test element under a set three-dimensional ocean coordinate system. Each field value in the field value array is associated with a set three-dimensional ocean coordinate system. Perform equal-interval consistency checks on each coordinate array, and determine the coordinate encoding results corresponding to each coordinate array based on the check results; The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to the preset three-dimensional size, and the target prediction mode corresponding to each three-dimensional data block is determined according to the field value corresponding to each three-dimensional data block. Based on the residual array calculated from the target prediction model of each 3D data block, adaptive binary arithmetic encoding is performed on each 3D data block, and the encoded multiple data block compression payloads and the coordinate encoding results are stored as ocean 3D scalar field compressed data according to the preset hierarchical file format.

[0090] The method for decoding and restoring three-dimensional scalar field data of the ocean is to obtain compressed three-dimensional scalar field data of the ocean to be decoded and restored. The compressed three-dimensional scalar field data of the ocean is obtained by compressing and encoding the original three-dimensional scalar field data of the ocean. Each data point in the original three-dimensional scalar field data of the ocean is used to describe the scalar field value of a set ocean test element under a set three-dimensional ocean coordinate. Each field value in the field value array is associated with the set three-dimensional ocean coordinate. In the compressed data of the three-dimensional scalar field of the ocean, the coordinate encoding results corresponding to the coordinate arrays of the three dimensions are obtained, as well as the compressed payload of multiple data blocks. Each compressed payload of data blocks is obtained by using a three-dimensional data block composed of three-dimensional blocks corresponding to multiple field values ​​in the field value, and then performing adaptive binary arithmetic encoding using a matching target prediction mode. Based on the coordinate encoding results corresponding to the coordinate arrays in the three dimensions, the restored coordinate arrays in the three dimensions are obtained. Adaptive binary decoding is performed on the compressed payload of each data block to restore the residual array corresponding to the compressed payload of each data block. Based on the target prediction mode corresponding to each data block compression load and the residual array corresponding to each data block compression load, multiple field value restoration values ​​corresponding to each data block compression load are obtained, and the field value restoration values ​​are spliced ​​and fused to generate a restored field value array. The restored coordinate array and the restored field value array in the three dimensions are combined to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean.

[0091] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0092] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0093] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0095] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0096] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0097] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0098] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for encoding and storing three-dimensional scalar field data of the ocean, characterized in that, include: The raw data of the three-dimensional scalar field of the ocean is split into three coordinate arrays and one field value array. Each data point in the raw data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of a set ocean test element under the set three-dimensional ocean coordinates. Each field value in the field value array is associated with the set three-dimensional ocean coordinates. Perform equal-interval consistency checks on each coordinate array, and determine the coordinate encoding results corresponding to each coordinate array based on the check results; The three-dimensional blocks corresponding to each field value are combined into multiple three-dimensional data blocks according to the preset three-dimensional size, and the target prediction mode corresponding to each three-dimensional data block is determined according to the field value corresponding to each three-dimensional data block. Based on the residual array calculated from the target prediction model of each 3D data block, adaptive binary arithmetic encoding is performed on each 3D data block, and the encoded multiple data block compression payloads and the coordinate encoding results are stored as ocean 3D scalar field compressed data according to the preset hierarchical file format.

2. The method according to claim 1, characterized in that, Perform equal-interval consistency checks on each coordinate array, and determine the coordinate encoding results corresponding to each coordinate array based on the check results, including: Retrieve the current coordinate array from each coordinate array; Calculate the difference between adjacent coordinates in the current coordinate array to obtain the current coordinate difference sequence; The difference between the second element and the first element in the current coordinate array is used as the baseline difference. If the baseline difference is zero, the current dimension coordinate sequence is determined to be a non-equal spacing coordinate mode. If the baseline difference is not zero, calculate the relative deviation of each remaining coordinate difference in the current coordinate difference sequence relative to the baseline difference, and perform consistency verification on each relative deviation value according to the preset deviation threshold. If all relative deviation values ​​in the current dimension coordinate sequence are less than the preset deviation threshold, the current dimension coordinate sequence is determined to be an equidistant coordinate mode, and only the starting coordinate value and fixed step size parameter of that dimension are stored. If any relative deviation value is not less than the preset deviation threshold, the current dimension coordinate sequence is determined to be a non-equidistant coordinate mode, and all coordinate data of that dimension are fully stored.

3. The method according to claim 1, characterized in that, Based on the field values ​​corresponding to each 3D data block, the target prediction mode corresponding to each 3D data block is determined, including: The current three-dimensional data block is obtained from each three-dimensional data block, and the field value is predicted for the current three-dimensional data block by using each prediction mode in the preset prediction mode candidate set. Based on the field value prediction results and the field values ​​corresponding to the current three-dimensional data block, calculate the residual arrays corresponding to each prediction mode, and calculate the residual zero-order information entropy corresponding to each residual array. The zero-order information entropy of each residual is weighted according to the overall number of grids in the current 3D data block to obtain the coding value corresponding to each prediction mode. The prediction pattern with the lowest encoding cost is determined as the target prediction pattern for the current 3D data block.

4. The method according to claim 3, characterized in that, Based on the residual array calculated from the target prediction patterns of each 3D data block, adaptive binary arithmetic coding is performed on each 3D data block, including: Obtain the current three-dimensional data block from each three-dimensional data block, and obtain the current residual array calculated by the current three-dimensional data block for the matched target prediction mode; Calculate the magnitude characteristics of the three-dimensional neighborhood residuals corresponding to the current residual array; In the current residual array, obtain one current residual in sequence, and obtain the binary bit stream that matches the current residual; Based on the context index dynamically matched by the three-dimensional neighborhood residual magnitude features, the probability value corresponding to each binary bit in the binary bit stream is calculated. Based on each probability value, the binary bit stream is subjected to adaptive binary arithmetic encoding, and after the encoding is completed, the operation of sequentially retrieving a current residual from the current residual array is returned; After completing the binary arithmetic encoding of all residuals in the current residual array, the data block compression payload corresponding to the current 3D data block is obtained.

5. The method according to claim 4, characterized in that, The compressed payloads of multiple data blocks obtained by encoding according to the preset layered file format, along with the coordinate encoding results, are stored as compressed ocean three-dimensional scalar field data, including: Create an initial target file according to a preset hierarchical file format, wherein the target file includes: a dimension data area, a block directory area, and a block data area; In the configuration header of the target file, at least the version number, time step parameter information, number of coordinate arrays and size of each coordinate array are stored in the header. At least the coordinate encoding results corresponding to each coordinate array are stored in the dimension data area. At least the target prediction mode identifier, compressed payload length of each data block and offset information of each data block compressed payload in the target file are stored in the block directory area. The compressed payloads of the multiple data blocks obtained by encoding are stored in the block data area in sequence. The updated target file containing various information is stored as compressed data of a three-dimensional scalar field of the ocean.

6. The method according to claim 5, characterized in that, The target file also includes: a time extension region; Accordingly, the method further includes: A time extension area is set at the end of the target file, and when new time-series data is added, the corresponding time dimension information, block directory area information and block data area information are obtained. The block directory area information and block data area information are written to the end of the time extension area in a preset order, and the number of coordinate arrays and time step parameter information in the target file header are updated according to the time dimension information.

7. A method for decoding and restoring three-dimensional scalar field data of the ocean, characterized in that, include: Obtain the compressed data of the three-dimensional scalar field of the ocean to be decoded and restored; wherein, the compressed data of the three-dimensional scalar field of the ocean is obtained by compressing and encoding the original data of the three-dimensional scalar field of the ocean, and each data point in the original data of the three-dimensional scalar field of the ocean is used to describe the scalar field value of the set ocean test element under the set three-dimensional ocean coordinates; each field value in the field value array is associated with the set three-dimensional ocean coordinates; In the compressed data of the three-dimensional scalar field of the ocean, the coordinate encoding results corresponding to the coordinate arrays of the three dimensions are obtained, as well as the compressed payload of multiple data blocks. Each compressed payload of data blocks is obtained by using a three-dimensional data block composed of three-dimensional blocks corresponding to multiple field values ​​in the field value, and then performing adaptive binary arithmetic encoding using a matching target prediction mode. Based on the coordinate encoding results corresponding to the coordinate arrays in the three dimensions, the restored coordinate arrays in the three dimensions are obtained. Adaptive binary decoding is performed on the compressed payload of each data block to restore the residual array corresponding to the compressed payload of each data block. Based on the target prediction mode corresponding to each data block compression load and the residual array corresponding to each data block compression load, multiple field value restoration values ​​corresponding to each data block compression load are obtained, and the field value restoration values ​​are spliced ​​and fused to generate a restored field value array. The restored coordinate array and the restored field value array in the three dimensions are combined to obtain the decoding and restoration result of the compressed three-dimensional scalar field data of the ocean.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the encoding and storage method for ocean three-dimensional scalar field data according to any one of claims 1-6, or to perform the decoding and restoration method for ocean three-dimensional scalar field data according to claim 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the encoding and storage method for ocean three-dimensional scalar field data as described in any one of claims 1-6, or implement the decoding and restoration method for ocean three-dimensional scalar field data as described in claim 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the encoding and storage method for ocean three-dimensional scalar field data according to any one of claims 1-6, or implements the decoding and restoration method for ocean three-dimensional scalar field data according to claim 7.