A Trusted Data Storage Method and System Based on Supply Chain Collaboration
By using local probability to replace the overall probability in the supply chain collaborative data storage method to filter probability switching points, the data compression effect and the storage amount are improved, and the storage challenges caused by the difference in data distribution in the supply chain collaborative data storage are solved.
Patent Information
- Application Number
- CN202510621624.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-05-15
AI Technical Summary
In the supply chain collaborative data storage, in the supply chain, due to the large differences in data distributions of different parts, coding with unified probability will reduce the compression effect, and the proportion of recording segmentation increases the storage volume, resulting in severe challenges in data storage.
By obtaining the data density of the local area for clustering, determining the probability switching point, filtering out the probability value that needs to be switched, replacing the overall probability with local probability, and using arithmetic encoding for encoding compression, reducing local probability recording and reducing storage.
Improve data compression effect, reduce storage volume, save storage space, and optimize data storage efficiency.
Smart Images

Figure CN120128190B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular, to a method and system for storing trusted data based on supply chain collaboration. Background Art
[0002] The supply chain includes many participating entities such as suppliers, manufacturers, distributors, retailers, and customers. To achieve efficient collaborative operation, a large amount of supply chain collaboration data will be generated among the participating parties. These data widely involve multiple key fields such as product detailed information, real-time inventory levels, order progress status, and logistics transportation trajectories, and are important bases for supply chain collaborative management. Therefore, it is necessary to store these data.
[0003] With the continuous expansion of the supply chain scale and the continuous improvement of business complexity, the amount of data generated during the supply chain collaboration process has shown an explosive growth. Such a huge amount of data poses extremely severe challenges to data storage. In this situation, data compression technology has become one of the key means to solve the above problems.
[0004] As a commonly used data compression method, the arithmetic coding algorithm realizes data compression by dividing intervals according to the frequency of data occurrence. By setting a relatively large proportion of interval division for data with high occurrence frequency and a relatively small proportion of interval division for data with low occurrence frequency, the length of the final interval obtained based on this interval division is relatively large, and thus the length of the encoded data obtained by selecting in the interval is relatively short. The supply chain data contains various types of data, and the data distribution of each part in the supply chain data sequence to be compressed varies greatly. Therefore, the occurrence frequencies of the same-value data in different parts vary greatly. Setting the proportion of interval division of the same-value data in different parts to be the same will inevitably reduce the data compression effect. And to set different division proportions for each data, it is necessary to record them to achieve data decoding, and recording the division proportion will increase the storage amount. Therefore, how to set appropriate division proportions for data to improve the compression effect has become the research focus of the present invention. Summary of the Invention
[0005] To solve the problem of how to set appropriate division proportions for data to improve the compression effect, the present invention provides a method and system for storing trusted data based on supply chain collaboration.
[0006] In the first aspect, the present invention provides a method for storing trusted data based on supply chain collaboration, adopting the following technical solutions:
[0007] A method for storing trusted data based on supply chain collaboration includes the steps of:
[0008] Obtain a trusted data sequence of supply chain collaboration;
[0009] Taking any data in the trusted data sequence as the center to obtain a local region, obtaining the data density of each value in the local region, which is denoted as the local density of each value under this data, performing clustering processing according to the local density of each value under all data, and obtaining the classification boundary points of each value;
[0010] Determining the possibility that the classification boundary points of different values are probability switching points according to the distance between the classification boundary points of different values, and the possibility of the probability switching point is negatively correlated with the distance between the classification boundary points of different values; screening out the probability switching points according to the possibility of the probability switching point;
[0011] Obtaining the occurrence probability of each value in the trusted data sequence and the occurrence probability of each value between two adjacent probability switching points, which are respectively denoted as the overall probability and the local probability; calculating the probability switching feasibility of each value according to the difference between the coding length under the overall probability and the coding length under the local probability, and the probability switching feasibility is positively correlated with the coding length difference and negatively correlated with the length of the local probability value;
[0012] Screening out the values that need to switch probabilities according to the probability switching feasibility, switching the overall probability value of the values that need to switch probabilities to the local probability, and realizing coding compression based on the switched probability.
[0013] The present invention takes into account that there are differences in the occurrence probabilities of the data of each value in the trusted data sequence, and encoding each region with a unified probability will reduce the compression effect. Therefore, the local probability is used to replace the overall probability to control the coding compression of the trusted data sequence and improve the compression effect; further, considering that the probability will be used for subsequent decoding and recording the local probability will increase the storage amount, the number of local probabilities should be reduced. By obtaining the probability switching points, the data of one value between two probability switching points can all use the same local probability, thus reducing the number of local probabilities and reducing the data storage amount; further, considering that the increased storage amount of recording the local probability is more than the reduced storage amount of switching the local probability, switching the local probability cannot reduce the storage amount. Therefore, the necessity of switching the local probability is judged by calculating the probability switching feasibility, so as to screen out the probability values that need to be switched, effectively saving the storage amount.
[0014] Preferably, taking any data in the trusted data sequence as the center to obtain a local region includes:
[0015] Taking any data in the trusted data sequence as the center to obtain a region with a preset length, which is denoted as the local region of this data.
[0016] Preferably, obtaining the data density of each value in the local region, which is denoted as the local density of each value under this data, includes:
[0017] Obtain the number of data for each value in a local region of the data, and divide the number of data for each value by the length of the local region to obtain the local density of each value under the data.
[0018] Preferably, the clustering process is performed according to the local density of each value under all the data, and the classification boundary points of each value are obtained, including:
[0019] Perform a clustering process on all the data in the credible data sequence according to the local density of each value under each data to obtain several categories;
[0020] Group the same categories in one data segment. The credible data sequence is segmented into several data segments, and the last data in the previous data segment between two adjacent data segments is used as a classification boundary point to obtain several classification boundary points.
[0021] The present invention performs clustering according to density, realizes the separation of regions with different occurrence probabilities, and groups those with the same occurrence probability in one region, so that the obtained local probability can better represent the occurrence probability of the data within the region, providing a basis for the subsequent switching probability.
[0022] Preferably, the method for obtaining the possibility of the probability switching point includes:
[0023] Perform a clustering process on the classification boundary points of all values, and use the reciprocal of the mean of the distances between each classification boundary point and other classification boundary points in the category as the possibility that the classification boundary point is a probability switching point.
[0024] The present invention analyzes the distances between the classification boundary points and other classification boundary points within the category to show the situation of other classification boundary points within the category, thus providing a basis for subsequent screening of classification boundary points.
[0025] Preferably, the screening of the probability switching point according to the possibility of the probability switching point includes:
[0026] Use the classification boundary point with the greatest possibility of the probability switching point in a category as the probability switching point.
[0027] The present invention reduces the number of classification boundary points by only selecting one classification boundary point in each category, thereby reducing the number of local probability records and providing a basis for saving storage space.
[0028] Preferably, the calculation of the probability switching feasibility of each value includes:
[0029] Obtain the number of data for each value between two adjacent probability switching points, which is denoted as the local quantity for each value. Use the overall probability of each value as the base and the local quantity as the exponent for power calculation, and take the calculation result as the end point of the divided interval under the overall probability; use the local probability of each value as the base and the local quantity as the exponent for power calculation, and take the calculation result as the end point of the divided interval under the local probability; select a data with the shortest length in the interval from 0 to L1, and use the length of the selected data as the coding length under the overall probability, where L1 represents the end point of the divided interval under the overall probability. Select a data with the shortest length in the interval from 0 to L2, and use the length of the selected data as the coding length under the local probability, where L2 represents the end point of the divided interval under the local probability. Divide the coding length under the overall probability and the coding length under the local probability by the length of the local probability to obtain the local probability switching feasibility of each value under two adjacent probability switching points, and take the average value of the local probability switching feasibility of each value under all two adjacent probability switching points as the probability switching feasibility of each value.
[0030] Preferably, the step of screening out the values that need to switch probabilities according to the probability switching feasibility includes:
[0031] Take the values whose probability switching feasibility is greater than the preset switching probability threshold as the values that need to switch probabilities.
[0032] The present invention screens out some values for probability switching, so as to ensure that the switching probability can reduce the storage amount rather than increase the storage amount.
[0033] Preferably, the step of switching the overall probability value of the values that need to switch probabilities to the local probability and realizing coding compression based on the switched probability includes:
[0034] Denote the values that need to switch probabilities as the values to be switched. Replace the overall probability of the data of the values to be switched in the trusted data sequence with the corresponding local probability, and obtain the adjusted remaining probability by subtracting the sum of the local probabilities of all the values to be switched from 1; subtract the sum of the overall probabilities of all the values to be switched from 1 to obtain the remaining probability before adjustment. Multiply the overall probability of the data of the remaining values by the ratio of the adjusted remaining probability to the remaining probability before adjustment to obtain the adjusted probability of the data of the remaining values, and replace the overall probability of the data of the remaining values with the adjusted probability. Control the interval division of arithmetic coding based on the replaced probability, and perform coding compression on the trusted data sequence.
[0035] In a second aspect, the present invention provides a trusted data storage system based on supply chain collaboration, adopting the following technical solutions:
[0036] A trusted data storage system based on supply chain collaboration includes: a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned trusted data storage method based on supply chain collaboration is implemented.
[0037] By adopting the above technical solution, a computer program is generated according to the above-mentioned trusted data storage method based on supply chain collaboration and stored in the memory to be loaded and executed by the processor. Thus, a terminal device is manufactured based on the memory and the processor, which is convenient to use.
[0038] The present invention has the following technical effects:
[0039] The present invention takes into account that the occurrence probabilities of data with each value in the trusted data sequence are different in different regions, and encoding each region with a unified probability will reduce the compression effect. Therefore, local probabilities are used to replace the overall probability to control the encoding compression of the trusted data sequence, improving the compression effect.
[0040] Furthermore, considering that probabilities will be used for subsequent decoding and recording local probabilities will increase the storage amount, the number of local probabilities should be reduced. By obtaining probability switching points, data with a certain value between two probability switching points are all encoded with the same local probability, thus reducing the number of local probabilities and the data storage amount.
[0041] Furthermore, considering that the increased storage amount due to recording local probabilities is more than the reduced storage amount due to switching local probabilities, switching local probabilities cannot reduce the storage amount. Therefore, the necessity of switching local probabilities is judged by calculating the probability switching feasibility, so as to screen out the probability values that need to be switched, effectively saving the storage amount. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of the method in a trusted data storage method based on supply chain collaboration according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] An embodiment of the present invention discloses a trusted data storage method based on supply chain collaboration. Referring to Figure 1 , it includes steps S1 - S6:
[0044] S1: Obtain a trusted data sequence of supply chain collaboration.
[0045] Specifically, obtain the trusted data of supply chain collaboration. The trusted data of supply chain collaboration can be product detailed information data, real-time inventory level data, order progress status data, logistics transportation track data, or other data. This embodiment does not make specific limitations. The sequence composed of all the trusted data of supply chain collaboration is denoted as the trusted data sequence.
[0046] S2: Take any data in the trusted data sequence as the center to obtain a local region, obtain the data density of each value in the local region, which is denoted as the local density of each value under this data, perform clustering processing according to the local density of each value under all data, and obtain the classification boundary points of each value.
[0047] It should be noted that the traditional arithmetic coding algorithm statistically obtains the occurrence frequency of each value according to all data, and sets the interval segmentation ratio of the data of each value according to the occurrence frequency of each value to perform coding compression processing. When decoding, it is necessary to use the occurrence frequency of the data of each value to obtain the interval segmentation ratio of each value to perform data decoding. Therefore, in order to facilitate subsequent decoding, the interval segmentation ratio of the data of each value will be recorded. Since the data of each part of the trusted data sequence vary greatly, the occurrence frequencies of the data of each part vary greatly. If the actual occurrence frequencies of the data of each part are used to set the interval segmentation ratio of the data, a better effect can be achieved. However, this also results in differences in the interval segmentation ratios of the data of each part, so more storage space is required to record the interval segmentation ratios of each data. In order to improve the compression ratio, it is necessary to balance it.
[0048] It should be further noted that since the data in the trusted data sequence has regional similarity, the occurrence frequencies of the data within the region are similar. Therefore, the same interval segmentation ratio can be used within the region. First, it is necessary to perform regional division according to the similarity of the data distribution in the trusted data sequence.
[0049] S20: Take any data in the trusted data sequence as the center to obtain a local region.
[0050] Preferably, as an example, taking any data in the trusted data sequence as the center to obtain a local region includes:
[0051] Take any data in the trusted data sequence as the center to obtain a region with a preset length, which is denoted as the local region of this data.
[0052] S21: Obtain the data density of each value in the local region, which is denoted as the local density of each value under this data.
[0053] Preferably, as an example, obtaining the data density of each value in the local region, which is denoted as the local density of each value under this data, includes:
[0054] Obtain the data quantity of each value in the local region of this data, and divide the data quantity of each value by the length of the local region to obtain the local density of each value under this data.
[0055] S22: Perform clustering processing based on the local density of each value under all data, and obtain the classification boundary points of each value.
[0056] Preferably, as an example, performing clustering processing based on the local density of each value under all data, and obtaining the classification boundary points of each value, includes:
[0057] Perform clustering processing on all data in the credible data sequence according to the local density of each value under each data to obtain several categories;
[0058] Group the same category into one data segment. The credible data sequence is segmented into several data segments. Take the last data in the previous data segment between two adjacent data segments as a classification boundary point to obtain several classification boundary points.
[0059] It can be understood that the classification boundary point is the regional segmentation point of different distributions of one of the values. The occurrence frequencies of the data of one of the values in each region between two classification boundary points are similar. Therefore, the same interval segmentation ratio can be set for the data of one of the values between two classification boundary points.
[0060] S3: Determine the possibility that the classification boundary points of various values are probability switching points according to the distance between the classification boundary points of different values. The possibility of the probability switching point is negatively correlated with the distance between the classification boundary points of different values; Screen out the probability switching points according to the possibility of the probability switching point.
[0061] It should be noted that since the classification boundary points obtained from the data of different values may be different, if the classification boundary points of the data of each value are all retained, there will be a large number of classification boundary points, and thus the number of segmented segments will be relatively large. Since an interval segmentation ratio needs to be recorded for each segmented region, a large number of regional segmentation ratios will be recorded. Therefore, a large amount of storage space will be required to record the regional segmentation ratios. In order to reduce the number of segmented regions, some classification boundary points need to be screened and retained.
[0062] It should be further noted that if a classification boundary point does not coincide with other classification boundary points, but its distance is short, it can completely retain only one classification boundary point and remove the remaining classification boundary points. Therefore, some classification boundary points can be screened based on the distance between the classification boundary points.
[0063] S30: Determine the possibility that the classification boundary points of various values are probability switching points according to the distance between the classification boundary points of different values.
[0064] Preferably, as an example, determining the possibility that the classification boundary points of various values are probability switching points according to the distance between the classification boundary points of different values, includes:
[0065] Perform clustering processing on the classification boundary points for all values, and use the reciprocal of the mean of the distances between each classification boundary point and other classification boundary points in the category as the possibility that the classification boundary point is a probability switching point.
[0066] S31: Screen out the probability switching points according to the possibility of the probability switching points.
[0067] Preferably, as an example, screening out the probability switching points according to the possibility of the probability switching points includes:
[0068] Take the classification boundary point with the greatest possibility of the probability switching point in a category as the probability switching point.
[0069] It can be understood that in this way, a classification boundary point can be screened out and retained among some relatively close classification boundary points, effectively preventing the problem of retaining too many classification boundary points, and thus reducing the unnecessary data storage volume.
[0070] S4: Obtain the occurrence probability of each value in the credible data sequence and the occurrence probability of each value between two adjacent probability switching points, which are respectively recorded as the overall probability and the local probability; calculate the probability switching feasibility of each value according to the difference between the coding length under the overall probability and the coding length under the local probability, and the probability switching feasibility is positively correlated with the coding length difference and negatively correlated with the length of the local probability value.
[0071] It should be noted that although setting different interval segmentation ratios for each segment will reduce the coding length, recording the interval segmentation ratio requires storage space. If the storage amount of recording the interval segmentation ratio is greater than the reduction amount of the coding length caused by adjusting the interval segmentation ratio, it means that adjusting the interval segmentation ratio and increasing the compression amount, so at this time, do not adjust the interval segmentation ratio. Therefore, it is necessary to comprehensively analyze the reduction amount of the coding length caused by adjusting the interval segmentation ratio and the storage amount of recording the interval segmentation ratio to determine whether to adjust the interval segmentation ratio.
[0072] S40: Obtain the occurrence probability of each value in the credible data sequence and the occurrence probability of each value between two adjacent probability switching points, which are respectively recorded as the overall probability and the local probability.
[0073] Preferably, as an example, obtaining the occurrence probability of each value in the credible data sequence and the occurrence probability of each value between two adjacent probability switching points, which are respectively recorded as the overall probability and the local probability, includes:
[0074] Obtain the occurrence frequency of the data of each value in the credible data sequence, divide the occurrence frequency of the data of each value by the length of the credible data sequence to obtain the occurrence probability of the data of each value, and record it as the overall probability of each value;
[0075] Obtain the occurrence frequency of data with each value in the part of the trusted data sequence between two adjacent probability switching points. Divide the occurrence frequency of data with each value by the length of the part between two adjacent probability switching points to obtain the occurrence probability of data with each value, which is denoted as the local probability of each value.
[0076] S41: Calculate the probability switching feasibility of each value according to the difference in the coding length under the overall probability and the coding length under the local probability.
[0077] Preferably, as an example, calculate the probability switching feasibility of each value according to the difference in the data length after interval segmentation under the overall probability and the data length after interval segmentation under the local probability, including:
[0078] Obtain the number of data with each value between two adjacent probability switching points, which is denoted as the local quantity of each value. Take the overall probability of each value as the base and the local quantity as the exponent for power calculation, and use the calculation result as the end point of the segmented interval under the overall probability; take the local probability of each value as the base and the local quantity as the exponent for power calculation, and use the calculation result as the end point of the segmented interval under the local probability; select a data with the shortest length in the interval from 0 to L1, and use the length of the selected data as the coding length under the overall probability, where L1 represents the end point of the segmented interval under the overall probability. Select a data with the shortest length in the interval from 0 to L2, and use the length of the selected data as the coding length under the local probability, where L2 represents the end point of the segmented interval under the local probability. Divide the coding length under the overall probability and the coding length under the local probability by the length of the local probability to obtain the local probability switching feasibility of each value under two adjacent probability switching points, and take the average value of the local probability switching feasibility of each value under all two adjacent probability switching points as the probability switching feasibility of each value.
[0079] It can be understood that the coding length under the overall probability reflects the coding length obtained by encoding only using the overall probability of data with one of the values between two adjacent probability switching points; the coding length under the local probability reflects the coding length obtained by encoding only using the local probability of data with one of the values between two adjacent probability switching points. The probability switching possibility reflects the situation of the storage amount saved by adjusting the interval segmentation ratio compared to the increased storage amount for recording the adjustment of the interval segmentation ratio. The larger this value is, the more storage space can be saved by adjusting the interval segmentation ratio for coding compression, and thus the more necessary it is to adjust the interval segmentation ratio.
[0080] It should be noted that the method for obtaining coding compression is based on the basic principle technology of the arithmetic coding algorithm. The arithmetic coding algorithm is an existing technology and will not be elaborated here. Generally, the arithmetic coding algorithm takes the probability as the interval segmentation ratio, so adjusting the probability is also adjusting the interval segmentation ratio.
[0081] S5: Screen out the values for which the probability needs to be switched according to the probability switching feasibility, switch the overall probability value of the values for which the probability needs to be switched to a local probability, and implement coding compression based on the switched probability.
[0082] Preferably, as an example, screening out the values for which the probability needs to be switched according to the probability switching feasibility, switching the overall probability value of the values for which the probability needs to be switched to a local probability, and implementing coding compression based on the switched probability includes:
[0083] Take the values whose probability switching feasibility is greater than the preset switching probability threshold for each value as the values for which the probability needs to be switched.
[0084] Record the values for which the probability needs to be switched as the values to be switched. Replace the overall probability of the data of the values to be switched in the trusted data sequence with the corresponding local probability. Subtract the sum of the local probabilities of all values to be switched from 1 to obtain the adjusted remaining probability; subtract the sum of the overall probabilities of all values to be switched from 1 to obtain the remaining probability before adjustment. Multiply the overall probability of the data of the remaining values by the ratio of the adjusted remaining probability to the remaining probability before adjustment to obtain the adjusted probability of the data of the remaining values. Replace the overall probability of the data of the remaining values with the adjusted probability. Control the interval division of arithmetic coding based on the replaced probability, and perform coding compression on the trusted data sequence.
[0085] Obtain the ordinal number of the probability switching point in the trusted data sequence and the local probability between every two probability switching points, and store the obtained ordinal number, overall probability, local probability, and the coded sequence after coding compression.
[0086] It should be noted that for the convenience of subsequent decompression, a delimiter needs to be inserted between the ordinal number, local probability, and coded sequence during storage. Mark the values to be switched.
[0087] S6: Perform decompression processing.
[0088] Preferably, as an example, performing decompression processing includes:
[0089] Split out the ordinal number of the probability switching point and the local probability according to the delimiter, obtain the probability switching point based on the ordinal number of the probability switching point, and replace the overall probability of the values to be switched between every two probability switching points with the corresponding local probability.
[0090] Subtract the sum of the local probabilities of all values to be switched from 1 to obtain the adjusted remaining probability; subtract the sum of the overall probabilities of all values to be switched from 1 to obtain the pre-adjustment remaining probability, multiply the overall probability of the data of the remaining values by the ratio of the adjusted remaining probability to the pre-adjustment remaining probability to obtain the adjusted probability of the data of the remaining values, and replace the overall probability of the data of the remaining values with the adjusted probability.
[0091] Use the probability after replacement to control the interval division of arithmetic coding to achieve decompression of the coded sequence.
[0092] An embodiment of the present invention also discloses a trusted data storage system based on supply chain collaboration, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, a trusted data storage method based on supply chain collaboration according to the present invention is implemented.
[0093] The above system further includes a communication bus, a communication interface, and other components well-known to those skilled in the art. Their settings and functions are known in the art, so they will not be described in detail here.
[0094] In the present invention, the aforementioned memory can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or device. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, an enhanced dynamic random access memory, a high-bandwidth memory, a hybrid storage cube, etc., or any other medium that can be used to store the required information and can be accessed by an application program, a module, or both. Any such computer storage medium can be a part of the device or accessible or connectable to the device.
[0095] Although this specification has shown and described multiple embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided only by way of example. Those skilled in the art will think of many changes, alterations, and alternative ways without departing from the spirit and idea of the present invention. It should be understood that various alternative solutions to the embodiments of the present invention described herein can be adopted in the process of practicing the present invention.
[0096] The above are all preferred embodiments of the present invention. The protection scope of the present invention is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention should be covered within the protection scope of the present invention.
Claims
1. A trusted data storage method based on supply chain collaboration, characterized in that, Including steps: Obtain a trusted data sequence for supply chain collaboration; Take any data in the trusted data sequence as the center to obtain a local area, obtain the data density of each value in the local area, which is denoted as the local density of each value under this data, perform clustering processing according to the local density of each value under all data, and obtain the classification boundary points of each value; Determine the possibility of each value's classification boundary point being a probability switching point according to the distance between the classification boundary points of different values, and the possibility of the probability switching point is negatively correlated with the distance between the classification boundary points of different values; Screen out the probability switching points according to the possibility of the probability switching points; Obtain the occurrence probability of each value in the trusted data sequence and the occurrence probability of each value between two adjacent probability switching points, which are respectively denoted as the overall probability and the local probability; calculate the probability switching feasibility of each value according to the difference between the coding length under the overall probability and the coding length under the local probability, and the probability switching feasibility is positively correlated with the coding length difference and negatively correlated with the length of the local probability value; Screen out the values that need to switch probabilities according to the probability switching feasibility, switch the overall probability value of the values that need to switch probabilities to the local probability, and realize coding compression based on the switched probability.
2. The method for storing trusted data based on supply chain collaboration according to claim 1, wherein The obtaining of the local area with any data in the trusted data sequence as the center includes: Take any data in the trusted data sequence as the center to obtain a region with a preset length, which is denoted as the local area of this data.
3. A trusted data storage method based on supply chain collaboration according to claim 1, characterized in that The obtaining of the data density of each value in the local area, which is denoted as the local density of each value under this data, includes: Obtain the number of data of each value in the local area of this data, and divide the number of data of each value by the length of the local area to obtain the local density of each value under this data.
4. A trusted data storage method based on supply chain collaboration according to claim 1, characterized in that, The performing of clustering processing according to the local density of each value under all data and obtaining the classification boundary points of each value includes: Perform clustering processing on all data in the trusted data sequence according to the local density of each value under each data to obtain several categories; Group the same category into a data segment, the trusted data sequence is divided into several data segments, take the last data in the previous data segment between two adjacent data segments as a classification boundary point, and obtain several classification boundary points.
5. A trusted data storage method based on supply chain collaboration according to claim 1, characterized in that The method for obtaining the possibility of the probability switching point includes: Perform clustering processing on the classification boundary points of all values, and take the reciprocal of the mean of the distances between each classification boundary point and other classification boundary points in the category as the possibility of the classification boundary point being a probability switching point.
6. The trusted data storage method based on supply chain collaboration according to claim 5, wherein The screening out of the probability switching points according to the possibility of the probability switching points includes: Take the classification boundary point with the greatest possibility of the probability switching point in a category as the probability switching point.
7. A trusted data storage method based on supply chain collaboration according to claim 1, characterized in that The calculating of the probability switching feasibility of each value includes: Obtain the number of data for each value between two adjacent probability switching points, which is denoted as the local quantity for each value. Use the overall probability of each value as the base and the local quantity as the exponent for power calculation, and take the calculation result as the end point of the divided interval under the overall probability; use the local probability of each value as the base and the local quantity as the exponent for power calculation, and take the calculation result as the end point of the divided interval under the local probability; select a data with the shortest length in the interval from 0 to L1, and use the length of the selected data as the coding length under the overall probability, where L1 represents the end point of the divided interval under the overall probability. Select a data with the shortest length in the interval from 0 to L2, and use the length of the selected data as the coding length under the local probability, where L2 represents the end point of the divided interval under the local probability. Divide the coding length under the overall probability and the coding length under the local probability by the length of the local probability to obtain the local probability switching feasibility of each value under two adjacent probability switching points, and take the average value of the local probability switching feasibility of each value under all two adjacent probability switching points as the probability switching feasibility of each value.
8. A trusted data storage method based on supply chain collaboration according to claim 7, characterized in that, The screening of the values that need to switch probabilities according to the probability switching feasibility includes: Taking the values whose probability switching feasibility is greater than the preset switching probability threshold as the values that need to switch probabilities.
9. A trusted data storage method based on supply chain collaboration according to claim 1, characterized in that The switching of the overall probability value of the values that need to switch probabilities to the local probability and the realization of coding compression based on the switched probability include: Denote the values that need to switch probabilities as the values to be switched. Replace the overall probability of the data of the values to be switched in the credible data sequence with the corresponding local probability, and obtain the adjusted remaining probability by subtracting the sum of the local probabilities of all values to be switched from 1; obtain the remaining probability before adjustment by subtracting the sum of the overall probabilities of all values to be switched from 1. Multiply the overall probability of the data of the remaining values by the ratio of the adjusted remaining probability to the remaining probability before adjustment to obtain the adjusted probability of the data of the remaining values, and replace the overall probability of the data of the remaining values with the adjusted probability. Control the interval division of arithmetic coding based on the replaced probability to perform coding compression on the credible data sequence.
10. A trusted data storage system based on supply chain collaboration, characterized in that, It includes: A processor and a memory, where the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a credible data storage method according to any one of claims 1-9 is implemented.
Citation Information
Patent Citations
Code128 bar code automatic reading method based on global optimization
CN111368576A
Data management method and system of Internet of Things equipment based on big data
CN119917567A