Water quality pollution tracing method, device, equipment and medium based on privacy computing
Through the privacy-based computing method, the RSA public key algorithm and water flow model are used to solve the problem of low traceability accuracy of water quality pollution, and the accurate traceability of water quality pollution sources is achieved, ensuring data security and avoiding the inadequate manual monitoring.
Patent Information
- Application Number
- CN202510238254.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In the prior art, there is a problem of low accuracy in tracing water quality pollution, and it is impossible to accurately determine whether the upstream point is the pollution source of the current point.
A privacy-based calculation method is used to assume that the upstream point causes pollution to the current point, and the water quality pollution concentration value is calculated and predicted based on the excessive concentration threshold, water flow velocity and distance. The random number is encrypted using the RSA public key algorithm, and the decryption data string determines whether the actual water pollution concentration value at the upstream point is greater than the predicted value to determine whether it is a source of pollution.
It is realized that the upstream point is a source of pollution without obtaining the real water pollution concentration at the upstream point, avoiding the defects of exposure of private data and manual monitoring, and improving the accuracy and convenience of traceability of water quality pollution.
Smart Images

Figure CN119740254B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality monitoring, and particularly relates to a water quality pollution traceability method, device, equipment and medium based on privacy computing. Background Art
[0002] In order to better manage and protect water resources, it is particularly important to conduct water quality pollution traceability. By collecting and analyzing various indicators and data in water bodies, the water quality status and development trends can be grasped in a timely manner, providing a scientific basis for water resources management, pollution control and environmental planning. At the same time, water quality pollution traceability can also guide the rational allocation and use of water resources, and promote the sustainable utilization of water resources and the improvement of the ecological environment. Therefore, conducting water quality pollution traceability is of great significance for protecting water resources, ensuring public health, promoting ecological balance and achieving sustainable development.
[0003] Calculating water quality pollution traceability requires obtaining the upstream pollutant concentration. However, water quality data in different regions are private data of each region. In this case, it is impossible to obtain the upstream water quality data. Currently, manual methods need to be used to monitor the real-time concentration by oneself, which has the problems of time-consuming, laborious and poor timeliness, thus making it impossible to accurately conduct water quality pollution traceability. Summary of the Invention
[0004] In view of this, an embodiment of the present invention provides a water quality pollution traceability method based on privacy computing to solve the technical problem of low accuracy in water quality pollution traceability in the prior art. The method includes:
[0005] In the case where the water quality pollution concentration value at the current point is greater than the over-standard concentration threshold, it is assumed that the upstream point of the current point causes pollution to the water quality of the current point, and the predicted water quality pollution concentration value of the upstream point is calculated according to the over-standard concentration threshold, the water flow velocity and the distance between the current point and the upstream point;
[0006] Select a random number, and based on the RSA public key algorithm, encrypt the random number with the public key concentration of the upstream point to obtain encrypted data, where the order of magnitude of the random number is a preset multiple larger than the water quality pollution concentration value of the current point;
[0007] Carry the encrypted data in a request and send it to obtain a returned decrypted data string, where the decrypted data string includes multiple numerical values and a prime number, and the multiple numerical values are obtained by decrypting the encrypted data based on the RSA decryption algorithm of the upstream point and performing a modulo operation with the prime number;
[0008] Perform a modulo operation on the random number and the prime number to obtain a modulo result numerical value;
[0009] Among the multiple numerical values, select the numerical value whose ranking ordinal number is the same as the water quality pollution concentration value of the current point. Determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value based on whether the selected numerical value is equal to the modulo result numerical value, so as to determine whether the upstream point is the pollution source of the current point.
[0010] An embodiment of the present invention also provides a water quality pollution traceability device based on privacy computing to solve the technical problem of low accuracy in water quality pollution traceability in the prior art. The device includes:
[0011] A calculation module, configured to assume that the upstream point of the current point pollutes the water quality of the current point when the water quality pollution concentration value of the current point is greater than the over-standard concentration threshold, and calculate the predicted water quality pollution concentration value of the upstream point according to the over-standard concentration threshold, the water flow velocity, and the distance between the current point and the upstream point;
[0012] An encryption module, configured to select a random number, encrypt the random number based on the RSA public key algorithm using the public key concentration of the upstream point to obtain encrypted data, where the order of magnitude of the random number is larger than the water quality pollution concentration value of the current point by a preset multiple;
[0013] A data acquisition module, configured to send the encrypted data in a request to obtain a returned decrypted data string, where the decrypted data string includes multiple numerical values and a prime number, and the multiple numerical values are obtained by decrypting the encrypted data based on the RSA decryption algorithm of the upstream point and performing a modulo operation with the prime number;
[0014] A modulo calculation module, configured to perform a modulo operation on the random number and the prime number to obtain a modulo result numerical value;
[0015] A judgment module, configured to select the numerical value whose ranking ordinal number is the same as the water quality pollution concentration value of the current point among the multiple numerical values, and determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value based on whether the selected numerical value is equal to the modulo result numerical value, so as to determine whether the upstream point is the pollution source of the current point.
[0016] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned water quality pollution traceability methods based on privacy computing to solve the technical problem of low accuracy in water quality pollution traceability in the prior art.
[0017] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing any of the above-mentioned water quality pollution tracing methods based on privacy computing, so as to solve the technical problem of low accuracy in water quality pollution tracing in the prior art.
[0018] Compared with the prior art, the beneficial effects that can be achieved by at least one of the above technical solutions adopted in the embodiments of this specification at least include: when the water quality pollution concentration value at the current point is greater than the over-standard concentration threshold, it is assumed that the upstream point of the current point pollutes the water quality of the current point, and the predicted water quality pollution concentration value of the upstream point is calculated according to the over-standard concentration threshold, the water flow velocity, and the distance between the current point and the upstream point; at the same time, based on the RSA public key algorithm, the public key concentration of the upstream point is used to encrypt the random number to obtain encrypted data, and based on the encrypted data, a decryption data string returned by the RSA (asymmetric encryption algorithm) decryption algorithm based on the upstream point is requested to be obtained, and the modulo result value of the prime number and the random number in the decryption data string is calculated, and among the multiple values, the value with the ranking ordinal number consistent with the water quality pollution concentration value at the current point is taken out. Finally, by judging whether the taken-out value is equal to the modulo result value, it can be determined whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value, so as to determine whether the upstream point is the pollution source of the current point. It realizes that in the case of combining the predicted water quality pollution concentration value of the upstream point and the obtained decryption data string of the RSA decryption algorithm based on the upstream point, it is not necessary to obtain the real and actual water quality pollution concentration of the upstream point, and it can be determined whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value, which not only avoids the problem of exposing the private water quality pollution data of each place, but also avoids the problems brought by manual monitoring of the real-time concentration, and can also realize accurate tracing of the water quality situation, so that it can ensure data security and achieve water quality pollution tracing conveniently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 is a flowchart of a water quality pollution tracing method based on privacy computing provided by an embodiment of the present invention;
[0021] Figure 2 is a structural block diagram of a computer device provided by an embodiment of the present invention;
[0022] Figure 3 It is a structural block diagram of a water quality pollution traceability device based on privacy computing provided by an embodiment of the present invention. Specific embodiments
[0023] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0024] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0025] In an embodiment of the present invention, a water quality pollution traceability method based on privacy computing is provided. As Figure 1 shown, the method includes:
[0026] Step S101: When the water quality pollution concentration value at the current point is greater than the over-standard concentration threshold, assume that the upstream point of the current point pollutes the water quality of the current point, and calculate the predicted water quality pollution concentration value of the upstream point according to the over-standard concentration threshold, the water flow velocity, and the distance between the current point and the upstream point;
[0027] Step S102: Select a random number, and encrypt the random number based on the RSA public key algorithm using the public key concentration of the upstream point to obtain encrypted data, where the order of magnitude of the random number is a preset multiple larger than the water quality pollution concentration value of the current point;
[0028] Step S103: Send the encrypted data carried in the request to obtain a returned decrypted data string, where the decrypted data string includes multiple numerical values and a prime number, and the multiple numerical values are obtained by decrypting the encrypted data based on the RSA decryption algorithm of the upstream point and performing a modulo operation with the prime number;
[0029] Step S104: Perform a modulo operation on the random number and the prime number to obtain a modulo result numerical value;
[0030] Step S105: Select a value from the multiple values whose ranking ordinal is the same as the water quality pollution concentration value of the current point. Determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value based on whether the selected value is equal to the modulo result value, so as to determine whether the upstream point is the pollution source of the current point.
[0031] As can be seen from Figure 1 the flow shown, in the embodiment of the present invention, it is possible to determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value, so as to determine whether the upstream point is the pollution source of the current point. Without obtaining the real and actual water quality pollution concentration of the upstream point, it is possible to determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value in the case of combining the predicted water quality pollution concentration value of the upstream point and the decrypted data string obtained based on the RSA decryption algorithm of the upstream point. This not only avoids the problem of exposing the private water quality pollution data of each place, but also avoids the problems brought by manual monitoring of the real-time concentration, and can also realize accurate tracing of the water quality situation, so that it is possible to ensure data security and achieve water quality pollution tracing conveniently and accurately.
[0032] During specific implementation, if the water quality pollution concentration value of the current point exceeds the standard (i.e., is greater than the standard concentration threshold), it is assumed that the upstream point pollutes the current point, and the predicted water quality pollution concentration value of the upstream point is deduced.
[0033] For example, the standard concentration threshold of the current point a at time t is 40. When the water quality pollution concentration is greater than 40 when the water quality pollution of the upstream point b spreads to the current point a, the upstream point b pollutes the current point a.
[0034] We assume that the upstream point b pollutes the current point a, then the water quality pollution concentration of the water flowing from the upstream point b to the current point a is greater than 40, and then calculate the lowest water quality pollution concentration (i.e., the above-mentioned predicted water quality pollution concentration value) of the upstream point b polluting the current point a at time t.
[0035] During specific implementation, the predicted water quality pollution concentration value of the upstream point can be calculated according to the following formula based on the standard concentration threshold, water flow velocity, and the distance between the current point and the upstream point:
[0036]
[0037] where j is the predicted water quality pollution concentration value of the upstream point, u is the water flow velocity, k is the attenuation value, and x ab is the distance between the current point a and the upstream point b.
[0038] t ab = x ab / u
[0039] t1 = t - t ab
[0040] where t is the current time, and t ab is the time required for the water flow from the upstream point b to the current point a. t1 means that the water at the upstream point b flows to the current point a at time t.
[0041] In specific implementation, in order to obtain the decryption data string of the upstream point, the data processing device or local data management device at the current point can send a request carrying encrypted data to the data processing device or local data management device at the upstream point. Then, this embodiment proposes to generate a decryption data string in the following manner and feedback it to the data processing device or local data management device at the current point:
[0042] Perform decryption processing on the encrypted data based on the RSA decryption algorithm of the upstream point through the following formula to obtain multiple decryption values:
[0043] , n = 1, 2,... N;
[0044] where y n is the nth decryption value, E(x) is the encrypted data of the random number x, N is the total number of n, N is greater than the water quality pollution concentration value i of the current point, n is a positive integer, D is the RSA decryption algorithm, and E is the RSA encryption algorithm;
[0045] Randomly select the prime number, and perform modulo operation on each decryption value and the prime number through the following formula to obtain multiple modulo values:
[0046] z n = y n mod p
[0047] where z n is the nth modulo value, p is the prime number, and mod is the modulo function;
[0048] Generate the multiple values based on the multiple modulo values, and generate the decryption data string based on the multiple values and the prime number.
[0049] In specific implementation, generating the multiple values based on the multiple modulo values includes:
[0050] Among the multiple modulo values, for the modulo value whose ranking ordinal number is less than or equal to the water quality pollution concentration value of the current point, use this modulo value as the value corresponding to the ranking ordinal number. For the modulo value whose ranking ordinal number is greater than the water quality pollution concentration value of the current point, use the value obtained by adding 1 to this modulo value as the value corresponding to the ranking ordinal number, so as to generate the multiple values. For example, the multiple values are in sequence: z1, z2, …, z i+1 +1, z i+2 +1, …, z N +1, where i is the water quality pollution concentration value of the current point, z i+1 That is, the ranking ordinal number n is the modulo value of i + 1, and use z i+1 +1 as the value with the ranking ordinal number n being i + 1 among the multiple values.
[0051] In specific implementation, in order to further improve the accuracy of water quality pollution traceability, a method for verifying multiple modulo values is proposed. For example, generating the multiple values based on the multiple modulo values includes:
[0052] Judge whether the 1-norm of the difference between any two different modulo values among the multiple modulo values is greater than or equal to 2. If not, re-select the prime number to calculate the multiple modulo values. If so, generate the multiple values based on the multiple modulo values.
[0053] In specific implementation, the process of generating the decryption data string includes the following steps:
[0054] Assume that the actual water quality pollution concentration value of the current point a and the predicted water quality pollution concentration value deduced from the upstream point b are i and j respectively.
[0055] Select the RSA public key algorithm to encrypt the concentration data. Let E be the RSA encryption algorithm and D be the RSA decryption algorithm.
[0056] The current point a randomly selects a very large random number x, encrypts the random number x with the public key concentration of the upstream point b to obtain E(x), and then calculates E(x) - i and sends it to the relevant data processing device or local data management device of the upstream point b.
[0057] On the relevant data processing device or local data management device of the upstream point b, first, calculate N decryption values:
[0058] , n = 1, 2, …, N;
[0059] Then, randomly select a prime number p, and then calculate N modulo values:
[0060] z n = y n mod p;
[0061] Next, verify whether ||z n1 − z n2 ||≥ 2 is satisfied for all 0 ≤ n1≠ n2≤ N − 1. If not, re - select a large prime number p for re - verification. Here, n1 and n2 are any two values in n, and z n1 、z n2 are any two different (i.e., with different ranking serial numbers) modulo values among multiple modulo values.
[0062] If satisfied, send the decryption data string generated by p and N modulo values to the relevant data processing device or data management device at the current point a. The multiple values in the decryption data string are as follows:
[0063] z1, z2, …, z i+1 +1, z i+2 +1, …, z N +1.
[0064] In specific implementation, according to whether the retrieved value is equal to the modulo result value, determine whether the actual water quality pollution concentration value at the upstream point is greater than the predicted water quality pollution concentration value, so as to determine whether the upstream point is the pollution source of the current point, including:
[0065] If the retrieved value z i is equal to the modulo result value f (f = x mod p), it is determined that the actual water quality pollution concentration value at the upstream point is greater than the predicted water quality pollution concentration value j, so as to determine that the upstream point is the pollution source of the current point, that is, the upstream point b pollutes the current point a. If the retrieved value z i is not equal to the modulo result value f, it is determined that the actual water quality pollution concentration value at the upstream point is less than the predicted water quality pollution concentration value j, so as to determine that the upstream point is not the pollution source of the current point, that is, the upstream point b does not pollute the current point a.
[0066] In this embodiment, a computer device is provided. As Figure 2 shown, it includes a memory 201, a processor 202, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above - mentioned water quality pollution traceability methods based on privacy computing.
[0067] Specifically, this computer device can be a computer terminal, a server, or a similar computing device.
[0068] In this embodiment, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program for executing any of the above water pollution source tracing methods based on privacy computing.
[0069] Specifically, a computer-readable storage medium includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media do not include transitory media such as modulated data signals and carrier waves.
[0070] Based on the same inventive concept, an apparatus for tracing water pollution sources based on privacy computing is also provided in an embodiment of the present invention, as described in the following embodiments. Since the principle of the apparatus for tracing water pollution sources based on privacy computing to solve problems is similar to that of the method for tracing water pollution sources based on privacy computing, the implementation of the apparatus for tracing water pollution sources based on privacy computing can refer to the implementation of the method for tracing water pollution sources based on privacy computing, and the repeated parts will not be elaborated. As used hereinafter, the term "unit" or "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0071] Figure 3 is a structural block diagram of the apparatus for tracing water pollution sources based on privacy computing according to an embodiment of the present invention, as Figure 3 shown, including:
[0072] A calculation module 301, configured to assume that the upstream point of the current point pollutes the water quality of the current point when the water pollution concentration value at the current point is greater than the exceedance concentration threshold, and calculate the predicted water pollution concentration value of the upstream point according to the exceedance concentration threshold, the water flow velocity, and the distance between the current point and the upstream point;
[0073] An encryption module 302, configured to select a random number, encrypt the random number based on the RSA public key algorithm using the public key concentration of the upstream point to obtain encrypted data, wherein the order of magnitude of the random number is larger than the water quality pollution concentration value of the current point by a preset multiple;
[0074] A data acquisition module 303, configured to send the encrypted data carried in a request to obtain a returned decrypted data string, wherein the decrypted data string includes a plurality of numerical values and a prime number, and the plurality of numerical values are obtained by decrypting the encrypted data based on the RSA decryption algorithm of the upstream point and performing a modulo operation with the prime number;
[0075] A modulo calculation module 304, configured to perform a modulo operation on the random number and the prime number to obtain a modulo result numerical value;
[0076] A judgment module 305, configured to extract a numerical value from the plurality of numerical values whose ranking ordinal number is the same as the water quality pollution concentration value of the current point, and determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value according to whether the extracted numerical value is equal to the modulo result numerical value, so as to determine whether the upstream point is the pollution source of the current point.
[0077] In one embodiment, a calculation module 301 is configured to calculate the predicted water quality pollution concentration value of the upstream point according to the following formula based on the exceedance concentration threshold, the water flow velocity, and the distance between the current point and the upstream point:
[0078]
[0079] where j is the predicted water quality pollution concentration value of the upstream point, u is the water flow velocity, k is the attenuation value, and x ab is the distance between the current point a and the upstream point b.
[0080] In one embodiment, the above device further includes:
[0081] A decrypted data module, configured to decrypt the encrypted data based on the RSA decryption algorithm according to the following formula to obtain a plurality of decrypted numerical values:
[0082] , n = 1, 2,... N;
[0083] where y n is the nth decrypted numerical value, E(x) is the encrypted data of the random number x, N is the total number of n, N is greater than the water quality pollution concentration value i of the current point, n is a positive integer, D is the RSA decryption algorithm, and E is the RSA encryption algorithm;
[0084] Randomly select the prime number, and modulo each of the decryption values with the prime number through the following formula to obtain a plurality of modulo values:
[0085] z n =y n mod p
[0086] where z n is the nth modulo value, p is the prime number, and mod is the modulo function;
[0087] Generate the plurality of values based on the plurality of modulo values, and generate the decryption data string based on the plurality of values and the prime number.
[0088] In one embodiment, the decryption data module is configured to, among the plurality of modulo values, for the modulo value whose ranking ordinal number is less than or equal to the water quality pollution concentration value of the current point, use the modulo value as the value corresponding to the ranking ordinal number, and for the modulo value whose ranking ordinal number is greater than the water quality pollution concentration value of the current point, use the modulo value plus 1 as the value corresponding to the ranking ordinal number to generate the plurality of values.
[0089] In one embodiment, the decryption data module is configured to determine whether the 1-norm of the difference between any two different modulo values among the plurality of modulo values is greater than or equal to 2. If not, re-select the prime number to calculate the plurality of modulo values. If so, generate the plurality of values based on the plurality of modulo values.
[0090] In one embodiment, the judgment module is configured to, if the taken-out value is equal to the modulo result value, determine that the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value to determine that the upstream point is the pollution source of the current point. If the taken-out value is not equal to the modulo result value, determine that the actual water quality pollution concentration value of the upstream point is less than the predicted water quality pollution concentration value to determine that the upstream point is not the pollution source of the current point.
[0091] The embodiments of the present invention achieve the following technical effects: When combining the predicted water quality pollution concentration value of the upstream point and the obtained decryption data string of the RSA decryption algorithm based on the upstream point, it is possible to determine whether the actual water quality pollution concentration value of the upstream point is greater than the predicted water quality pollution concentration value without obtaining the real and actual water quality pollution concentration of the upstream point, which not only avoids the problem of exposing the private water quality pollution data of each place, but also avoids the problems brought by manual monitoring of the real-time concentration, and can also achieve accurate tracing of the water quality situation, so as to ensure data security and achieve water quality pollution tracing conveniently and accurately.
[0092] Obviously, those skilled in the art should understand that the various modules or steps of the above-described embodiments of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0093] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various changes and modifications can be made to the embodiments of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A water pollution source tracing method based on privacy computing, characterized in that: include: When the water pollution concentration value at the current point is greater than the excess concentration threshold, it is assumed that the upstream point of the current point pollutes the water quality of the current point, and the predicted water pollution concentration value of the upstream point is calculated according to the excess concentration threshold, the water flow velocity and the distance between the current point and the upstream point; A random number is selected, and based on the RSA public key algorithm, the public key concentration of the upstream point is used to encrypt the random number to obtain encrypted data, wherein the order of magnitude of the random number is greater than the water pollution concentration value of the current point by a preset multiple; Send the encrypted data in a request to obtain a returned decrypted data string, wherein the decrypted data string includes multiple values and a prime number, and the multiple values are obtained by decrypting the encrypted data based on the RSA decryption algorithm of the upstream point and performing modulo processing on the prime number; Performing a modulo process on the random number and the prime number to obtain a modulo result value; A value whose ranking is consistent with the water pollution concentration value of the current point is taken out from the multiple values, and whether the actual water pollution concentration value of the upstream point is greater than the predicted water pollution concentration value is judged according to whether the taken value is equal to the modulo result value, so as to determine whether the upstream point is the pollution source of the current point; Also includes: The encrypted data is decrypted based on the RSA decryption algorithm of the upstream point using the following formula to obtain multiple decrypted values: ,n=1,2,…N; Among them, y n is the nth decrypted value, E(x) is the encrypted data of the random number x, N is the total number of n, N is greater than the water pollution concentration value i at the current point, n is a positive integer, D is the RSA decryption algorithm, and E is the RSA encryption algorithm; The prime number is randomly selected, and each of the decrypted values is modulo the prime number using the following formula to obtain multiple modulo values: z n =y n mod p Among them, z n is the nth modulus value, p is the prime number, and mod is the modulus function; The multiple numerical values are generated based on the multiple modulus values, and the decrypted data string is generated based on the multiple numerical values and the prime number.
2. The water pollution source tracing method based on privacy computing as claimed in claim 1, characterized in that: Calculating the predicted water pollution concentration value of the upstream point according to the excessive concentration threshold, the water flow velocity, and the distance between the current point and the upstream point, including: Wherein, j is the predicted water pollution concentration value of the upstream point, u is the water flow velocity, k is the attenuation value, and x ab is the distance between the current point a and the upstream point b.
3. The water pollution source tracing method based on privacy computing as claimed in claim 1, characterized in that: Generating the plurality of values based on the plurality of modulo values comprises: Among the multiple modulus values, for the modulus value whose ranking number is less than or equal to the water quality pollution concentration value of the current point, the modulus value is used as the value of the corresponding ranking number; for the modulus value whose ranking number is greater than the water quality pollution concentration value of the current point, the modulus value is increased by 1 and used as the value of the corresponding ranking number to generate the multiple values.
4. The water pollution source tracing method based on privacy computing as claimed in claim 1, characterized in that: Generating the plurality of values based on the plurality of modulo values comprises: Determine whether the 1-norm of the difference between any two different modulus values among the multiple modulus values is greater than or equal to 2; if not, reselect the prime number to calculate multiple modulus values; if so, generate the multiple values based on the multiple modulus values.
5. The water pollution source tracing method based on privacy computing according to any one of claims 1 to 4, characterized in that: According to whether the extracted value is equal to the modulo result value, it is judged whether the actual water pollution concentration value of the upstream point is greater than the predicted water pollution concentration value, so as to determine whether the upstream point is the pollution source of the current point, including: If the extracted value is equal to the value of the modulo result, it is judged that the actual water pollution concentration value of the upstream point is greater than the predicted water pollution concentration value, so as to determine that the upstream point is the pollution source of the current point. If the extracted value is not equal to the value of the modulo result, it is judged that the actual water pollution concentration value of the upstream point is less than the predicted water pollution concentration value, so as to determine that the upstream point is not the pollution source of the current point.
6. A water pollution source tracing device based on privacy computing, characterized in that: include: A calculation module, for assuming that the upstream point of the current point pollutes the water quality of the current point when the water pollution concentration value of the current point is greater than the excessive concentration threshold, and calculating the predicted water pollution concentration value of the upstream point according to the excessive concentration threshold, the water flow velocity and the distance between the current point and the upstream point; An encryption module, used for selecting a random number, and encrypting the random number based on the RSA public key algorithm using the public key concentration of the upstream point to obtain encrypted data, wherein the order of magnitude of the random number is a preset multiple greater than the water pollution concentration value of the current point; A data acquisition module, used for sending the encrypted data in a request to obtain a returned decrypted data string, wherein the decrypted data string includes a plurality of numerical values and a prime number, and the plurality of numerical values are obtained by decrypting the encrypted data based on the RSA decryption algorithm of the upstream point and performing modulo processing on the prime number; A modulus calculation module, used for performing modulus processing on the random number and the prime number to obtain a modulus result value; A judgment module is used to extract a value whose ranking sequence is consistent with the water pollution concentration value of the current point from the multiple values, and judge whether the actual water pollution concentration value of the upstream point is greater than the predicted water pollution concentration value according to whether the extracted value is equal to the modulo result value, so as to determine whether the upstream point is the pollution source of the current point; The decryption data module is used to decrypt the encrypted data based on the RSA decryption algorithm using the following formula to obtain multiple decrypted values: ,n=1,2,…N; Among them, y n is the nth decrypted value, E(x) is the encrypted data of the random number x, N is the total number of n, N is greater than the water pollution concentration value i at the current point, n is a positive integer, D is the RSA decryption algorithm, and E is the RSA encryption algorithm; The prime number is randomly selected, and each of the decrypted values is modulo the prime number using the following formula to obtain multiple modulo values: z n =y n mod p Among them, z n is the nth modulus value, p is the prime number, and mod is the modulus function; The multiple numerical values are generated based on the multiple modulus values, and the decrypted data string is generated based on the multiple numerical values and the prime number.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the water pollution source tracing method based on privacy computing described in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the water pollution source tracing method based on privacy computing as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Water pollution tracing method and device and terminal equipment
CN112559657A
Water pollution tracing method, device and equipment and storage medium
CN116166669A