Subway monitoring image data encryption transmission method, system, equipment and medium

By encrypting the subway surveillance image data based on image resolution and user password, the problem of easy leakage of image data in the existing technology is solved, and higher security and privacy protection are achieved.

CN118590680AInactive Publication Date: 2024-09-03NANJING INST OF RAILWAY TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410977544.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing surveillance image transmission technology lacks encryption of image data, resulting in user privacy being easily leaked. Especially in subway surveillance applications, video data captured by cameras can easily be cracked and stolen by others.

Method used

By obtaining the image data of the external camera, the pixels are numbered based on the image resolution, combined with the numbers in the user password to form a digital password, the pixels are encrypted using different encryption methods, and the image is only decrypted after the visitor's identity verification is successful. data.

Benefits of technology

It ensures the security and uniqueness of image data, increases the difficulty of cracking, prevents illegal acquisition, and further improves the protection of user privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590680A
    Figure CN118590680A
Patent Text Reader

Abstract

The invention discloses a subway monitoring image data encryption transmission method, system and device and a medium, and relates to the technical field of monitoring image transmission, and the method comprises the following steps: obtaining image data through an external camera; confirming image information of the image data; encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; confirming the identity of the visitor and decrypting the encrypted information to obtain image information; the method and the device are used for solving the problem that the privacy of a user is easy to leak due to the lack of encryption of image data in the existing monitoring image transmission technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of monitoring image transmission, and in particular to a method, system, equipment and medium for encrypting and transmitting subway monitoring image data. Background Art

[0002] Subway monitoring can effectively monitor the entry and exit status of each subway station, and coordinate and interact with related system equipment during normal daytime operations and emergency situations, thereby ensuring the normal operation of the subway; monitoring image transmission technology refers to the technology of transmitting the image data captured by the camera to other devices or systems in some way. This technology is usually used in video surveillance, video conferencing, remote monitoring and other applications that require real-time image transmission, and it is necessary to ensure the security of image data to avoid leaking user privacy.

[0003] Existing surveillance image transmission technologies are usually based on direct transmission through wired and wireless transmission methods such as USB transmission or WIFI transmission, and do not provide certain privacy protection for the video data captured by the camera. If the video data is not protected, it may be cracked by others and the camera's shooting area may be monitored or past videos may be searched, and this behavior may further lead to the occurrence of criminal behavior, especially when used in some public places, such as when used in the subway field, the security of surveillance video transmission needs to be upgraded. Therefore, the video data captured by the camera should be encrypted to prevent others from illegally obtaining it. For example, in the Chinese patent with application publication number CN115696062A, a YUV camera data transmission method based on the Android system is disclosed. This solution lacks encryption of the image data captured by the camera, resulting in the image data being easily stolen by others, thereby endangering the privacy of others. The existing surveillance image transmission technology also lacks encryption of image data, resulting in the problem that user privacy is easily leaked. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by obtaining the image resolution of image data taken by an external camera, numbering pixels based on the image resolution, extracting numbers in the user password to form a digital password, using different encryption methods for the pixels based on the pixel numbers, encrypting the pixels based on the pixel colors of the pixels and the digital password to obtain an encrypted image, and then verifying the identity of the visitor through a camera connection program. After successful verification, the encrypted image is decrypted to obtain image data, so as to solve the problem that the existing monitoring image transmission technology still lacks encryption of image data, resulting in easy leakage of user privacy.

[0005] To achieve the above objectives, in a first aspect, the present application provides a method for encrypting and transmitting subway monitoring image data, comprising the following steps: Acquire image data through an external camera; confirming image information of the image data; Encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; Confirm the visitor's identity and decrypt the encrypted information to obtain the image information.

[0006] Furthermore, obtaining image data through an external camera includes the following sub-steps: Install an external camera; The subway monitoring area is photographed by an external camera to obtain image data.

[0007] Furthermore, confirming the image information of the image data includes obtaining the resolution of the image data, which is named as image resolution; the image resolution format is n×m, the image data contains n×m pixels, and n and m are both positive integers.

[0008] Furthermore, encrypting the image data based on the image information and encrypting the image data for transmission includes the following sub-steps: The pixels are numbered and named as pixel numbers, which are represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row; Get the user password set by the user, extract the numbers in the user password one by one, and name it as a digital password; The digital password is numbered and named as the password number, which is represented by the symbol Fi, where i is a positive integer; For S(n,m), calculate (n+m)%2, where % is the modulus operator. The calculation result is named the judgment remainder. If the judgment remainder is 0, the positive encryption signal is output; if the judgment remainder is 1, the negative encryption signal is output; Get the pixel color of the S(n,m) pixel point, where the pixel color is (R, G, B); If a positive encryption signal is output, the pixel points are encrypted using a positive encryption method; if a negative encryption signal is output, the pixel points are encrypted using a negative encryption method.

[0009] Further, if a positive encryption signal is output, the pixel point is encrypted by a positive encryption method; if a reverse encryption signal is output, the pixel point is encrypted by a reverse encryption method, including the following sub-steps: When outputting a positive encrypted signal, obtain R, and add R-G+B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; When outputting a positive encrypted signal, obtain G, add G+B to get g; check whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; When outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi; When outputting the decrypted signal, obtain R, add R to GB to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, obtain G, and obtain g from GB; detect whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi; Calculate the value of B+F1+…+Fi in sequence, mark the calculation result as b, and check whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a normal color value signal; Fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m); After all pixels of the image data are encrypted, an encrypted image is obtained, and the encrypted image is transmitted to the camera connection program.

[0010] Furthermore, confirming the identity of the visitor and decrypting the encrypted information to obtain the image information includes the following sub-steps: The identity of the visitor is confirmed by the camera connection program; After confirmation, the image resolution of the encrypted image is obtained to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution; Calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output the positive decryption signal; if the decryption remainder is 1, output the negative decryption signal; Get the pixel color (R, G, B) of K(x, y); If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method.

[0011] Further, if a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method, including the following sub-steps: When outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as the positive and negative values; if the positive and negative values ​​are 0, output the subtraction signal; if the positive and negative values ​​are 1, output the addition signal; When outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values ​​are 0, output the addition signal; if the positive and negative values ​​are 1, output the subtraction signal; If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; Calculate the value of e+F1+…+Fi in sequence, mark the calculation result as e, and check whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal; When outputting the positive decryption signal, get w, and subtract we to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; When outputting the positive decryption signal, get q, add q+we to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, get w, add w+e to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, get q, and add q-w+e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; Fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y); After all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user.

[0012] In a second aspect, the present application provides an external camera image data transmission system, including an external camera, an image information acquisition module, an image data encryption module, and an encrypted image decryption module; the external camera, the image information acquisition module, and the encrypted image decryption module are respectively data-connected to the image data encryption module; The external camera is used to obtain image data through the external camera; The image information acquisition module is used to confirm the image information of the image data; The image data encryption module is used to encrypt the image data based on the image information and transmit the image data to obtain encrypted information; The encrypted image decryption module is used to confirm the identity of the visitor and decrypt the encrypted information to obtain image information.

[0013] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the above method are executed.

[0014] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are executed.

[0015] Beneficial effects of the present invention: The present invention obtains the user password and extracts the numbers therein to form a digital password. The advantage is that each user has his own unique user password, and the digital password formed by the numbers in the user password and then encrypting the image data can ensure the uniqueness of the digital password and improve the security of the image data. The present invention obtains pixel numbers by numbering the pixel points based on the image resolution, and then encrypts the pixel points using different encryption methods based on the pixel numbers. The advantage is that encrypting different pixel points using different encryption methods can avoid the encrypted images of the same image data encrypted by the same encryption method having certain regularities, and at the same time increases the difficulty of cracking, thereby improving the security of the image data and the effectiveness of the image data encryption. The present invention obtains the pixel color of the pixel point and encrypts the pixel point in combination with a digital password and an encryption method to obtain an encrypted image. The advantage is that there is no regularity between the pixels in the encrypted image. Encrypting the image data itself can also prevent others from cracking the camera and obtaining the image data. The original image data can only be obtained after identity authentication, which further improves the security and privacy of the image data. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a functional block diagram of the system of the present invention; Figure 2 The image data of the present invention; Figure 3 The figure is a flow chart of the steps of the method of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] Example 1, please refer to Figure 1 As shown, in the first aspect, the present application provides an external camera image data transmission system, including an external camera, an image information acquisition module, an image data encryption module and an encrypted image decryption module; the external camera, the image information acquisition module and the encrypted image decryption module are respectively connected to the image data encryption module; See also Figure 2 As shown, the external camera is used to obtain image data through the external camera; the external camera is installed; the subway monitoring area is photographed through the external camera to obtain image data; In the specific implementation, the external camera uses an existing high-definition camera. The image data obtained by shooting with an external camera involves user privacy. Therefore, the image data in this embodiment only shows part of the natural area, and when the image resolution is too large, it is not conducive to the specific explanation of the principle of image encryption in this embodiment. Therefore, only part of the image in the original image is captured to obtain Figure 2 ,Will Figure 2 The image data is set and subsequently processed. This embodiment aims to explain the specific analysis process and principle of the image data. The video data obtains the image data of each frame for encryption.

[0019] The image information acquisition module is used to confirm the image information of the image data; obtain the resolution of the image data, which is named image resolution; the image resolution format is n×m, and the image data contains n×m pixels, where n and m are both positive integers; In a specific implementation, the obtained image resolution is 16×16, 1≤n≤16, 1≤m≤≤16.

[0020] The image data encryption module is used to encrypt the image data based on the image information and transmit the image data to obtain the encrypted information; the image data encryption module includes an encryption decision unit and an image encryption unit; The encryption decision unit is configured with an encryption decision strategy, which includes: The pixels are numbered and named as pixel numbers, which are represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row; Get the user password set by the user, extract the numbers in the user password one by one, and name it as a digital password; The digital password is numbered and named as the password number, which is represented by the symbol Fi, where i is a positive integer; In a specific implementation, the pixel points are numbered to obtain pixel numbers S(1,1) to S(16,16); the user password is obtained as TEST134test556, and the numbers 1, 3, 4, 5, 5 and 6 are extracted in sequence, that is, the digital password is 134556, and the digital password is numbered to obtain password numbers F1 to F6, 1≤i≤6; For S(n,m), calculate (n+m)%2, where % is the modulus operator. The calculation result is named the judgment remainder. If the judgment remainder is 0, the positive encryption signal is output; if the judgment remainder is 1, the negative encryption signal is output; Get the pixel color of pixel S(n,m), the pixel color is (R, G, B); If a positive encryption signal is output, the pixel is encrypted by a positive encryption method; if a negative encryption signal is output, the pixel is encrypted by a negative encryption method; In the specific implementation, this embodiment takes S(1,1) and S(1,2) as examples, and the analysis process of the remaining pixels is the same as that of S(1,1) and S(1,2); for S(1,1), n=1, m=1, the calculated judgment remainder is 0, and the positive encryption signal is output, and the pixel point S(1,1) is encrypted by the positive encryption method; for S(1,2), n=1, m=2, the calculated judgment remainder is 1, and the reverse encryption signal is output, and the pixel point S(1,2) is encrypted by the reverse encryption method; the pixel color of S(1,1) is obtained to be (76, 76, 76), and the pixel color of S(1,2) is obtained to be (206, 206, 206); The image encryption unit is configured with an image encryption strategy, which includes: When outputting a positive encrypted signal, obtain R, and add R-G+B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; When outputting a positive encrypted signal, obtain G, and add G to B to obtain g; detect whether g is less than 0 or greater than 255, if g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; in practical applications, the image data is a color image, and usually R, G, and B are not equal. In this embodiment, the image data is a grayscale image, so R, G, and B are equal, resulting in a weakened encryption effect, but it does not affect actual use. This embodiment is only used to explain the encryption process; In the specific implementation, the pixel point S(1,1) outputs a positive encrypted signal. The pixel color of S(1,1) is (76, 76, 76). R is 76, G is 76, and B is 76. R-G+B gets r=76. By comparison, it is found that r is greater than 0 and less than 255, and the color value is normal. G+B gets g=152. By comparison, it is found that g is greater than 0 and less than 255, and the color value is normal. When outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi; In the specific implementation, the pixel point S(1,1) outputs a positive encrypted signal, and F1 to F6 are obtained as 1, 3, 4, 5, 5 and 6 respectively. For F1, i=1, the calculated addition and subtraction value is 1, then the subtraction signal is output, and F1 is changed to a negative number, that is, -1; similarly, F2 is 3, F3 is -4, F4 is 5, F5 is -5, and F6 is 6; When outputting the decrypted signal, obtain R, add R to GB to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, obtain G, and obtain g from GB; detect whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; In the specific implementation, the pixel point S(1,2) outputs the anti-encryption signal. The pixel color of S(1,2) is (206, 206, 206). R is 206, G is 206, and B is 206. R+GB is r=206. By comparison, it is found that r is greater than 0 and less than 255, and the color value is output as a normal signal; GB is obtained to obtain g=0. By comparison, it is found that g is equal to 0, and the color value is output as a normal signal; When outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi; In the specific implementation, the pixel point S(1,2) outputs a positive encrypted signal, and F1 to F6 are obtained as 1, 3, 4, 5, 5 and 6 respectively. For F2, i=2, the calculated addition and subtraction value is 0, then the subtraction signal is output, and F2 is changed to a negative number, that is, -3; similarly, F1 is 1, F3 is 4, F4 is -5, F5 is 5, and F6 is -6; Calculate the value of B+F1+…+Fi in sequence, mark the calculation result as b, and check whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a normal color value signal; In the specific implementation, for S(1,1), B is 76, F1 is -1, F2 is 3, F3 is -4, F4 is 5, F5 is -5, F6 is 6, and b=80 is calculated. By comparison, it is found that b is greater than 0 and less than 255, and the output color value is a normal signal; For S(1,2), B is 206, F1 is 1, F2 is -3, F3 is 4, F4 is -5, F5 is 5, and F6 is -6. The calculated value is b=202. By comparison, it is found that b is greater than 0 and less than 255, and the output color value is normal. Fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m); After encrypting all pixels of the image data, an encrypted image is obtained, and the encrypted image is transmitted to the camera connection program; In a specific implementation, for S(1,1), r=76, g=152, b=80 are calculated, and (76, 152, 80) is used as the pixel color of the pixel point S(1,1) and filled to S(1,1); for S(1,2), r=206, g=0, b=202 are calculated, and (206, 0, 202) is used as the pixel color of the pixel point S(1,2) and filled to S(1,2); after all pixels are encrypted, an encrypted image is obtained. Since the encrypted pixel color is in color, the encrypted image is not displayed in this embodiment. The pixel colors of some pixels in the encrypted image are shown in Table 1 below: Table 1 Pixel colors of some pixels in the encrypted image Due to the excessive amount of data, only part of the data is shown in this embodiment.

[0021] The encrypted image decryption module is used to confirm the identity of the visitor and decrypt the encrypted information to obtain the image information; the encrypted image decryption module includes a decryption decision unit and an image decryption unit; The decryption decision unit is configured with a decryption decision strategy, which includes: The identity of the visitor is confirmed by the camera connection program; After confirmation, the image resolution of the encrypted image is obtained to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution; In a specific implementation, the camera connection program is an access program that is equipped by an existing high-definition camera, and can confirm the identity of the visitor through an account password or a verification code. After the confirmation is completed, the image resolution of the encrypted image is 16×16, and the pixels K(1,1) to K(16,16) are obtained. In this embodiment, K(1,1) and K(1,2) are analyzed, corresponding to S(1,1) and S(1,2), in order to explain the specific decryption process of the pixels. The decryption process of the remaining pixels is the same as that of K(1,1) and K(1,2). Calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output the positive decryption signal; if the decryption remainder is 1, output the negative decryption signal; Get the pixel color (R, G, B) of K(x, y); If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method; In the specific implementation, for K(1,1), x=1, y=1, the decryption remainder obtained by calculation is 0, and the positive decryption signal is output, and the pixel point is decrypted by the positive decryption method; for K(1,2), x=1, y=2, the decryption remainder obtained by calculation is 1, and the reverse decryption signal is output, and the pixel point is decrypted by the reverse decryption method; the pixel color of K(1,1) is obtained to be (76, 152, 80), and the pixel color of K(1,2) is obtained to be (206, 0, 202); The image decryption unit is configured with an image decryption strategy, which includes: When outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as the positive and negative values; if the positive and negative values ​​are 0, output the subtraction signal; if the positive and negative values ​​are 1, output the addition signal; When outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values ​​are 0, output the addition signal; if the positive and negative values ​​are 1, output the subtraction signal; If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; In the specific implementation, K(1,1) outputs a positive decryption signal, and the obtained Fi are 1, 3, 4, 5, 5 and 6 respectively. For F2, i=2, the calculated positive and negative values ​​are 0, and the subtraction signal is output to change F2 to a negative number. F2 is 3, that is, F2 is changed to -3. Similarly, F1 is 1, F3 is 4, F4 is -5, F5 is 5, and F6 is -6. K(1,2) outputs the inverse decryption signal. Fi is 1, 3, 4, 5, 5 and 6. For F1, i=1, the calculated positive and negative values ​​are 1, and the subtraction signal is output. F1 is changed to a negative number. F2 is 1, that is, F1 is changed to -1. Similarly, F2 is 3, F3 is -4, F4 is 5, F5 is -5, and F6 is 6. Calculate the value of e+F1+…+Fi in sequence, mark the calculation result as e, and check whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal; In the specific implementation, for K(1,1), e is 80, and the calculation results are e+F1+F2+F3+F4+F5+F6=80+1-3+4-5+5-6=e=76. By comparison, it is found that e is greater than 0 and less than 255, and the output color value is a normal signal; For K(1,2), e is 202, and we get e+F1+F2+F3+F4+F5+F6=202-1+3-4+5-5+6=e=206. By comparison, we get that e is greater than 0 and less than 255, and the output color value is a normal signal. When outputting the positive decryption signal, get w, and subtract we to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; When outputting the positive decryption signal, get q, add q+we to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; In the specific implementation, K(1,1) outputs a positive decryption signal, obtains w as 152, calculates e as 76, then calculates we to obtain w as 76, and by comparison, w is greater than 0 and less than 255, and outputs a normal color value signal; obtains q as 76, calculates w as 76, and e is 76, then calculates q+we to obtain q as 76, and by comparison, q is greater than 0 and less than 255, and outputs a normal color value signal; When outputting the decrypted signal, get w, add w+e to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, get q, and add q-w+e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; In the specific implementation, K(1,2) outputs the decrypted signal, obtains w as 0, calculates e as 206, then calculates w+e to obtain w as 206, and by comparison, it is found that w is greater than 0 and less than 255, and the color value is output as a normal signal; obtains q as 206, calculates w as 206, and e is 206, then calculates q-w+e to obtain q as 206, and by comparison, it is found that q is greater than 0 and less than 255, and the color value is output as a normal signal; Fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y); After all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user; In the specific implementation, for K(1,1), q is calculated to be 76, w is 76, and e is 76, then (76, 76, 76) is used as the pixel color of the pixel point K(1,1) and filled to K(1,1); for K(1,2), q is calculated to be 206, w is 206, and e is 206, then (206, 206, 206) is used as the pixel color of the pixel point K(1,2) and filled to K(1,2); all pixels are decrypted to obtain image data and displayed to the user through the camera connection program.

[0022] Example 2, please refer to Figure 3 As shown, in the second aspect, the present application provides a method for encrypting and transmitting subway monitoring image data, comprising the following steps: Step S1, acquiring image data through an external camera; Step S1 includes the following sub-steps: Step S101, installing an external camera; Step S102, photographing the subway monitoring area through an external camera to obtain image data; Step S2, confirming the image information of the image data; confirming the image information of the image data includes obtaining the resolution of the image data, which is named as the image resolution; the image resolution format is n×m, the image data contains n×m pixels, and n and m are both positive integers; Step S3, encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; Step S3 includes the following sub-steps: Step S301, numbering the pixels, named as pixel numbers, represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row; Step S302, obtaining a user password set by the user, extracting numbers from the user password in sequence, and naming them as digital passwords; Step S303, numbering the digital password, naming it as the password number, represented by the symbol Fi, where i is a positive integer; Step S304, for S(n,m), calculate (n+m)%2, where % is a modulo operator, and name the calculation result as the judgment remainder. If the judgment remainder is 0, output the positive encryption signal; if the judgment remainder is 1, output the reverse encryption signal; Step S305, obtaining the pixel color of the S(n,m) pixel point, the pixel color is (R, G, B); Step S306: if a positive encryption signal is output, the pixel is encrypted by a positive encryption method; if a negative encryption signal is output, the pixel is encrypted by a negative encryption method; Step S306 includes the following sub-steps: Step S30601, when outputting a positive encrypted signal, obtain R, and obtain r by adding R-G+B; detect whether r is less than 0 or greater than 255, if r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; Step S30602, when outputting a positive encrypted signal, obtain G, add G to B to get g; detect whether g is less than 0 or greater than 255, if g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; Step S30603, when outputting a positive encrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; if the addition and subtraction value is 1, output the subtraction signal; if the subtraction signal is output, change the number corresponding to Fi to a negative number, that is, -Fi; Step S30604, when outputting the decrypted signal, obtain R, add R to GB to get r; detect whether r is less than 0 or greater than 255, if r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; Step S30605, when outputting the decrypted signal, obtain G, and obtain g by subtracting GB; detect whether g is less than 0 or greater than 255, if g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; Step S30606, when outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the subtraction signal; if the addition and subtraction value is 1, output the addition signal; if the subtraction signal is output, the number corresponding to Fi is changed to a negative number, that is, -Fi; Step S30607, calculate the value of B+F1+...+Fi in sequence, mark the calculation result as b, and detect whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a signal with normal color value; Step S30608, fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m); Step S30609, encrypt all pixels of the image data to obtain an encrypted image, and transmit the encrypted image to the camera connection program.

[0023] Step S4, confirming the identity of the visitor and decrypting the encrypted information to obtain image information; Step S4 includes the following sub-steps: Step S401, the camera connection program confirms the visitor's identity; Step S402, after confirmation, obtain the image resolution of the encrypted image to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution; Step S403, calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output a positive decryption signal; if the decryption remainder is 1, output a negative decryption signal; Step S404, obtaining the pixel color (R, G, B) of K(x, y); Step S405: if a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if a negative decryption signal is output, the pixel is decrypted by a negative decryption method. Step S405 includes the following sub-steps: Step S40501, when outputting the positive and negative decryption signals, obtain e and Fi, calculate the value of i%2, and name the calculation result as positive and negative values; if the positive and negative values ​​are 0, output the subtraction signal; if the positive and negative values ​​are 1, output the addition signal; Step S40502, when outputting the inverse decryption signal, obtain e and Fi, and calculate the positive and negative values; if the positive and negative values ​​are 0, output the addition signal; if the positive and negative values ​​are 1, output the subtraction signal; Step S40503, if a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; Step S40504, calculate the value of e+F1+...+Fi in sequence, mark the calculation result as e, and detect whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal; Step S40505, when outputting the positive decryption signal, obtain w, and obtain w by subtracting we; detect whether w is less than 0 or greater than 255, if w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; Step S40506, when outputting the positive decryption signal, obtain q, add q+we to get q; detect whether q is less than 0 or greater than 255, if q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; Step S40507, when outputting the decrypted signal, obtain w, add w+e to get w; detect whether w is less than 0 or greater than 255, if w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; Step S40508, when outputting the decrypted signal, obtain q, and obtain q by adding q-w+e; detect whether q is less than 0 or greater than 255, if q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; Step S40509, fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y); Step S40510, after all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user.

[0024] Embodiment 3, in the third aspect, the present application provides an electronic device, including a processor and a memory, the memory storing computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the above method are executed. Through the above technical solution, the processor and the memory are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanisms, and the memory stores a computer program executable by the processor. When the electronic device is running, the processor executes the computer program to execute the method in any optional implementation of the above embodiment to achieve the following functions: acquiring image data through an external camera; confirming the image information of the image data; encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; confirming the identity of the visitor and decrypting the encrypted information to obtain image information.

[0025] Embodiment 4, in a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are executed. Through the above technical solution, when the computer program is executed by the processor, the method in any optional implementation of the above embodiment is executed to achieve the following functions: acquiring image data through an external camera; confirming the image information of the image data; encrypting the image data based on the image information and transmitting the image data to obtain the encrypted information; confirming the identity of the visitor and decrypting the encrypted information to obtain the image information.

[0026] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0027] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0028] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

Claims

1. A method for encrypting and transmitting subway monitoring image data, characterized in that: The steps include: Acquire image data through an external camera; confirming image information of the image data; Encrypting the image data based on the image information and transmitting the image data to obtain encrypted information; Confirm the visitor's identity and decrypt the encrypted information to obtain the image information.

2. The method for encrypting and transmitting subway monitoring image data according to claim 1, characterized in that: Acquiring image data through an external camera includes the following sub-steps: Install an external camera; The subway monitoring area is photographed by an external camera to obtain image data.

3. The method for encrypting and transmitting subway monitoring image data according to claim 2, characterized in that: Confirming the image information of the image data includes obtaining the resolution of the image data, which is named as the image resolution; the image resolution format is n×m, the image data contains n×m pixels, and n and m are both positive integers.

4. The method for encrypting and transmitting subway monitoring image data according to claim 3, characterized in that: Encrypting image data based on image information and encrypting image data for transmission includes the following sub-steps: The pixels are numbered and named as pixel numbers, which are represented by the symbol S(n,m), where S(n,m) specifically represents the pixel in the nth column and the mth row; Get the user password set by the user, extract the numbers in the user password one by one, and name it as a digital password; The digital password is numbered and named as the password number, which is represented by the symbol Fi, where i is a positive integer; For S(n,m), calculate (n+m)%2, where % is the modulus operator. The calculation result is named the judgment remainder. If the judgment remainder is 0, the positive encryption signal is output; if the judgment remainder is 1, the negative encryption signal is output; Get the pixel color of the S(n,m) pixel point, where the pixel color is (R, G, B); If a positive encryption signal is output, the pixel points are encrypted using a positive encryption method; if a negative encryption signal is output, the pixel points are encrypted using a negative encryption method.

5. The method for encrypting and transmitting subway monitoring image data according to claim 4, characterized in that: If a positive encryption signal is output, the pixel point is encrypted by a positive encryption method; if a negative encryption signal is output, the pixel point is encrypted by a negative encryption method, including the following sub-steps: When outputting a positive encrypted signal, obtain R, and add R-G+B to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; When outputting a positive encrypted signal, obtain G, add G+B to get g; check whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; When outputting the positive encryption signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; if the addition and subtraction value is 0, output the addition signal; If the addition and subtraction value is 1, the subtraction signal is output; If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; When outputting the decrypted signal, obtain R, add R to GB to get r; check whether r is less than 0 or greater than 255. If r is less than 0, increase r by 255; if r is greater than 255, decrease r by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, obtain G, and obtain g from GB; detect whether g is less than 0 or greater than 255. If g is less than 0, increase g by 255; if g is greater than 255, decrease g by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, obtain B and Fi, calculate the value of i%2, and name the calculation result as the addition and subtraction value; If the addition and subtraction value is 0, the subtraction signal is output; If the addition and subtraction value is 1, the addition signal is output; If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; Calculate the value of B+F1+…+Fi in sequence, mark the calculation result as b, and check whether b is less than 0 or greater than 255. If b is less than 0, increase b by 255; if b is greater than 255, decrease b by 255; otherwise, output a normal color value signal; Fill r, g and b into the pixel color to obtain (r, g, b), and use (r, g, b) as the pixel color of the pixel point S(n, m); After all pixels of the image data are encrypted, an encrypted image is obtained, and the encrypted image is transmitted to the camera connection program.

6. A subway monitoring image data encryption transmission method according to claim 5, characterized in that: Confirming the identity of the visitor and decrypting the encrypted information to obtain the image information includes the following sub-steps: The identity of the visitor is confirmed by the camera connection program; After confirmation, the image resolution of the encrypted image is obtained to obtain the pixel point K(x,y), where x and y are both positive integers, x is n in the image resolution, and y is m in the image resolution; Calculate (x+y)%2, and name the calculation result as the decryption remainder. If the decryption remainder is 0, output the positive decryption signal; if the decryption remainder is 1, output the negative decryption signal; Get the pixel color (R, G, B) of K(x, y); If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method.

7. A subway monitoring image data encryption transmission method according to claim 6, characterized in that: If a positive decryption signal is output, the pixel is decrypted by a positive decryption method; if an inverse decryption signal is output, the pixel is decrypted by an inverse decryption method, including the following sub-steps: When outputting the positive decryption signal, obtain e and Fi, calculate the value of i%2, and name the calculation result as the positive and negative value; if the positive and negative values ​​are 0, output the subtraction signal; If the positive and negative values ​​are 1, the addition signal is output; When outputting the decrypted signal, obtain e and Fi, and calculate the positive and negative values; If the positive and negative values ​​are 0, the addition signal is output; If the positive and negative values ​​are 1, the subtraction signal is output; If a subtraction signal is output, the number corresponding to Fi is changed to a negative number, i.e. -Fi; Calculate the value of e+F1+…+Fi in sequence, mark the calculation result as e, and check whether e is less than 0 or greater than 255. If e is less than 0, increase e by 255; if e is greater than 255, decrease e by 255; otherwise, output a normal color value signal; When outputting the positive decryption signal, get w, and subtract we to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; When outputting the positive decryption signal, get q, add q+we to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, get w, add w+e to get w; check whether w is less than 0 or greater than 255. If w is less than 0, increase w by 255; if w is greater than 255, decrease w by 255; otherwise, output a signal with normal color value; When outputting the decrypted signal, get q, and add q-w+e to get q; check whether q is less than 0 or greater than 255. If q is less than 0, increase q by 255; if q is greater than 255, decrease q by 255; otherwise, output a signal with normal color value; Fill q, w and e into the pixel color to obtain (q, w, e), and use (q, w, e) as the pixel color of the pixel point K(x, y); After all pixels in the encrypted image are decrypted, the image data is obtained and decrypted in real time through the camera connection program and displayed to the user.

8. A system applicable to the method for encrypting and transmitting subway monitoring image data according to any one of claims 1 to 7, characterized in that: It includes an external camera, an image information acquisition module, an image data encryption module and an encrypted image decryption module; the external camera, the image information acquisition module and the encrypted image decryption module are respectively connected to the image data encryption module; The external camera is used to obtain image data through the external camera; The image information acquisition module is used to confirm the image information of the image data; The image data encryption module is used to encrypt the image data based on the image information and transmit the image data to obtain encrypted information; The encrypted image decryption module is used to confirm the identity of the visitor and decrypt the encrypted information to obtain image information.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 7 are executed.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are executed.

Citation Information

Cited By

  • Security encryption method and system for digital collections

    CN119885243A