Disclosure of Invention
In order to solve the above problem, the present invention provides a smart campus network security protection system, including a processor and a memory, wherein the processor executes a computer program stored in the memory to implement the following steps:
acquiring an original information image; acquiring a target filtering kernel corresponding to an original information image and a kernel value corresponding to the target filtering kernel;
converting the gray value of each pixel point in the original information image into a binary sequence; obtaining bit blocks corresponding to the pixel points according to the binary sequence; the number of the sub-bit blocks in the bit block is more than 1, the bit block is composed of valued sub-bit blocks and non-valued sub-bit blocks, the non-valued sub-bit blocks correspond to the identification bits, and one pixel point corresponds to one identification bit;
obtaining a target identification code sequence corresponding to the original information image according to the bit block corresponding to each pixel point and the kernel value in the target filtering kernel; obtaining the value of a sub-bit block without value in the bit block according to the target identification code sequence; obtaining a target bit block corresponding to each pixel point according to the value of the non-value sub-bit block;
obtaining a non-value pixel block corresponding to each pixel point, and assigning values to sub-pixel blocks in the non-value pixel block according to the target bit block and the target filter core to obtain a value pixel block corresponding to each pixel point;
scrambling each sub-pixel block in the valued pixel block according to chaotic mapping and variable step length Josephson traversal to obtain a target valued pixel block corresponding to each pixel point; and storing the target valued pixel blocks corresponding to the pixel points.
Has the advantages that: the method comprises the steps of converting gray values of all pixel points in an original information image into binary sequences; constructing and obtaining a bit block corresponding to each pixel point according to the binary sequence, wherein the bit block is composed of a valued sub-bit block and an insignificant sub-bit block, the insignificant sub-bit block corresponds to an identification bit, and one pixel point only corresponds to one identification bit; then, according to the bit block corresponding to each pixel point and the kernel value in the target filtering kernel, obtaining a target identification code sequence corresponding to the original information image; obtaining the value of a sub-bit block without value in the bit block according to the target identification code sequence; obtaining a target bit block corresponding to each pixel point according to the value of the non-value sub-bit block; then, checking the assignment of each sub-pixel block in the non-valued pixel block according to the target bit block and the target filter to obtain a valued pixel block corresponding to each pixel point; scrambling each sub-pixel block in the pixel block according to Logistic mapping and variable step length Joseph traversal to obtain a target pixel block corresponding to each pixel point; and storing the target pixel blocks corresponding to the pixel points. The method and the system can guarantee the rights and interests and personal privacy of students, further ensure the safety of image data storage, maintain the safety of the intelligent campus network, and increase the identification bit when processing the original information image, further judge whether the processed image data is tampered, and further ensure the safety of the stored image data.
Preferably, the target filter kernel has a 3 × 3 structure, the bit block has a 3 × 3 structure, the target bit block has a 3 × 3 structure, the valued pixel block has a 3 × 3 structure, and the target valued pixel block has a 3 × 3 structure.
Preferably, the method for obtaining the target filtering kernel corresponding to the original information image and the kernel value corresponding to the target filtering kernel includes:
acquiring a filtering kernel set;
selecting one filtering kernel from the filtering kernel set arbitrarily, and recording the filtering kernel as a target filtering kernel corresponding to the original information image; recording the value of each element in the target filtering kernel as a kernel value; the target filtering kernel comprises 9 elements, the kernel value of the first element in the target filtering kernel is 0, the sum of the kernel values of all the elements in the target filtering kernel is 1, and the kernel values of all the elements with the kernel values not being 0 in the target filtering kernel are the same.
Preferably, converting the gray value of each pixel point in the original information image into a binary sequence; the method for obtaining the bit block corresponding to each pixel point according to the binary sequence comprises the following steps:
converting the gray value of each pixel point in the original information image into eight-bit binary number; obtaining a binary sequence corresponding to each pixel point according to the eight-bit binary number corresponding to the gray value of each pixel point;
constructing an identification bit corresponding to each pixel point, and adding the corresponding identification bit to the binary sequence corresponding to each pixel point to obtain a data sequence corresponding to each pixel point; the identification bit in the data sequence has no value;
performing reverse order processing on the data sequence to obtain a target data sequence corresponding to each pixel point;
constructing and obtaining bit blocks corresponding to the pixel points according to the target data sequences corresponding to the pixel points; the bit block is composed of 9 sub-bit blocks;
for any pixel point in the original information image: the value of the 1 st sub-bit block in the bit block corresponding to the pixel point is the value of the 1 st parameter in the target data sequence corresponding to the pixel point, and so on, and the value of the 9 th sub-bit block in the bit block corresponding to the pixel point is the value of the 9 th parameter in the target data sequence corresponding to the pixel point;
and recording sub-bit blocks corresponding to the identification bits in the bit blocks corresponding to the pixel points as non-value sub-bit blocks, and recording other sub-bit blocks except the sub-bit blocks corresponding to the identification bits in the bit blocks corresponding to the pixel points as value sub-bit blocks.
Preferably, the method for obtaining the target identification code sequence corresponding to the original information image according to the bit block corresponding to each pixel point and the kernel value in the target filtering kernel includes:
the 1 st element position in the target filtering kernel corresponds to the position of the 1 st sub-bit block in the bit block corresponding to each pixel point, the 2 nd element position in the target filtering kernel corresponds to the position of the 2 nd sub-bit block in the bit block corresponding to each pixel point, and so on, the 9 th element position in the target filtering kernel corresponds to the position of the 9 th sub-bit block in the bit block corresponding to each pixel point;
acquiring the positions of elements with the kernel values not being zero in the target filtering kernel, and recording the positions as target element positions; obtaining sub-bit blocks corresponding to the positions of the target elements one by one in the bit blocks corresponding to the pixel points, and recording the sub-bit blocks as the target sub-bit blocks corresponding to the pixel points;
acquiring pixel points of which the corresponding values of target sub-bit blocks in the bit blocks are 0 and recording the pixel points as first pixel points; and acquiring each pixel point of which the corresponding value of each target sub-bit block in each bit block is 1, and recording the pixel point as a second pixel point.
Selecting identification code sequences which are consistent with the condition that after the identification bits corresponding to the pixel points in the original information image are assigned, the identification code of the identification bit corresponding to each first pixel point is 0 and the identification code of the identification bit corresponding to each second pixel point is 1;
the rule for assigning the identification bits corresponding to the pixel points is as follows: the identification code sequence assigns identification bits corresponding to all pixel points in the original information image in sequence according to a periodic cycle rule, and one pixel point is assigned once;
selecting each identification code sequence with the shortest length from the identification code sequences; and randomly selecting one identification code sequence from the identification code sequences with the shortest length, and recording the identification code sequence as a target identification code sequence corresponding to the original information image.
Preferably, the value of the sub-bit block without value in the bit block is obtained according to the target identification code sequence; the method for obtaining the target bit block corresponding to each pixel point according to the value of the non-value sub-bit block comprises the following steps:
sequentially assigning the target identification code sequence to the identification bits corresponding to the pixel points in the original information image according to a periodic cycle rule to obtain the identification codes of the identification bits corresponding to the pixel points in the original information image;
assigning the identification code of the identification bit corresponding to each pixel point in the original information image to the non-value sub-bit block in the bit block corresponding to the corresponding pixel point to obtain the value of the non-value sub-bit block in the bit block corresponding to each pixel point; and recording bit blocks corresponding to the pixel points after the assignment of the non-value sub-bit blocks as target bit blocks corresponding to the pixel points.
Preferably, the method for obtaining the non-value pixel block corresponding to each pixel point and assigning a value to each sub-pixel block in the non-value pixel block according to the target bit block and the target filter core to obtain the value pixel block corresponding to each pixel point comprises:
recording other element positions except for each target element position in the target filtering kernel as first element positions;
constructing a non-value pixel block corresponding to each pixel point in each original information image; the non-value pixel block is of a 3 x 3 structure; the non-value pixel block is composed of 9 sub-bit blocks; the 1 st element position in the target filtering kernel corresponds to the position of the 1 st sub-pixel block in the non-value pixel block corresponding to each pixel point, the 2 nd element position in the target filtering kernel corresponds to the position of the 2 nd sub-pixel block in the non-value pixel block corresponding to each pixel point, and so on, the 9 th element position in the target filtering kernel corresponds to the position of the 9 th sub-pixel block in the non-value pixel block corresponding to each pixel point;
for any pixel point in the original information image:
obtaining a filtering value H corresponding to the pixel point;
for any first element position in the target filtering kernel, acquiring a sub-bit block corresponding to the first element position in the bit block corresponding to the pixel point, and if the value of the sub-bit block is 1, determining that the sub-bit block is in the middle of the pixel point
Any value is assigned to a sub-pixel block corresponding to the first element position in the non-value pixel block corresponding to the pixel point, if the value of the sub-bit block is 0, the sub-pixel block is positioned in the non-value pixel block corresponding to the pixel point
Any value is assigned to a sub-pixel block corresponding to the first element position in the non-value pixel block corresponding to the pixel point;
if the values of all target sub-bit blocks in the bit block corresponding to the pixel point are all 0 or all 1, assigning the filtering value H corresponding to the pixel point to all sub-pixel blocks corresponding to all target element positions in the non-value pixel block corresponding to the pixel point;
if the values of the target sub-bit blocks in the bit block corresponding to the pixel point are not all 0 or not all 1, for any target element position in the target element positions: if the value of the sub-bit block corresponding to the target element position in the bit block corresponding to the pixel point is 1, then the pixel point is processed
Any one value in the pixel point is taken as the characteristic value of the sub-pixel block corresponding to the target element position in the non-value pixel block corresponding to the pixel point, if the value of the sub-bit block corresponding to the target element position in the bit block corresponding to the pixel point is 0, the value of the sub-bit block corresponding to the target element position in the bit block corresponding to the pixel point is 0

Any one value in the pixel block is taken as a characteristic value of a sub-pixel block corresponding to the target element position in a non-value pixel block corresponding to the pixel point; assigning the sum of the characteristic value and the filter value H of the sub-pixel block corresponding to the target element position in the non-value pixel block corresponding to the pixel point to the sub-pixel block corresponding to the target element position in the non-value pixel block corresponding to the pixel point; the above-mentioned
The number of sub-bit blocks with the median value of 1 in the bit block corresponding to the pixel point, wherein
The number of sub bit blocks with the median value of 0 in the bit block corresponding to the pixel point;
recording the pixel blocks after assigning values to each sub-pixel block in the non-value pixel blocks as the value pixel blocks corresponding to each pixel point; and recording the value of each sub-pixel block in the valued pixel block as the pixel value of each sub-pixel block in the valued pixel block.
Preferably, the method for scrambling each sub-pixel block in the valued pixel block according to chaotic mapping and variable step length josephson traversal to obtain a target valued pixel block corresponding to each pixel point comprises:
obtaining a chaotic sequence with the length of 8 by using Logistic mapping; taking the chaotic sequence as a step length sequence for carrying out variable step length Josephson traversal;
scrambling each sub-pixel block in the valued pixel block according to the step sequence traversed by the variable-step Josephson to obtain the valued pixel block corresponding to each pixel point.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by those skilled in the art based on the embodiments of the present invention belong to the protection scope of the embodiments of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The embodiment provides a security protection system for a smart campus network, which comprises a processor and a memory, wherein the processor executes a computer program stored in the memory to realize a security protection method for the smart campus network. As shown in fig. 1, the method for securing a smart campus network includes the following steps:
step S001, acquiring an original information image; and acquiring a target filtering kernel corresponding to the original information image and a kernel value corresponding to the target filtering kernel.
The embodiment mainly comprises the steps of firstly processing an image, namely converting each pixel in an original information image into a binary number of a fixed bit number, and adding a bit identification bit to obtain a bit block corresponding to each pixel; then, obtaining a valued pixel block corresponding to each pixel point according to a filtering kernel corresponding to the original information image and a bit block corresponding to each pixel point, scrambling the valued pixel block, and then storing the scrambled valued pixel block. Because the processed image is completely different from the original image, even if the processed image is attacked by a network, the processed image data is leaked, and the rights and interests and the personal privacy of students cannot be infringed, so that the safety of image data storage is ensured, and the safety of the intelligent campus network is further maintained; and when the original information image is processed, the identification bit is added, so that whether the processed image data is tampered or not can be judged, and the safety of the stored image data is further ensured.
In this embodiment, image data of various information of students collected by a school is acquired, and is subjected to graying processing, and an image subjected to graying processing is recorded as an original information image. Because a filtering kernel is used in the subsequent data processing, before an original information image is processed, a filtering kernel needs to be arbitrarily selected from a filtering kernel set, one original information image corresponds to one filtering kernel, and in the embodiment, the size of each filtering kernel in the filtering kernel set is set to be 3 x 3, the value of each element in the filtering kernel is recorded as a kernel value, one filtering kernel has 9 elements, the kernel value in one filtering kernel has only two types, and a kernel value sequence corresponding to each filtering kernel is obtained according to the kernel value of each element in each filtering kernel; and setting the kernel value of the first element in each filtering kernel to be 0, setting the sum of the kernel values of all elements in each filtering kernel to be 1, and setting the kernel values of the elements with the kernel values not being 0 in the filtering kernels to be the same. In the following process of this embodiment, only one original information image is analyzed, so the filter kernel corresponding to the original information image is regarded as the target filterKernel, the sequence of kernel values of the target filter kernel being

Wherein, in the step (A),
for the kernel value of the 1 st element in the target filter kernel,
for the kernel value of the 2 nd element in the target filter kernel,
the kernel value of the 9 th element in the kernel is filtered for the target.
The process of obtaining the filtering kernel set comprises the following steps: there are eight classes, the kernel value types in the first class of filtering kernel are 0 and 1/8, respectively, and when the kernel value of the first element in the filtering kernel is 0, the arrangement mode types of the kernel values corresponding to the remaining eight elements are 0
A method for preparing
Is a combination formula, so the number of the filter kernels is
I.e. corresponding to a sequence of kernel values of
(ii) a The kernel value types in the second major filtering kernel are respectively 0 and 1/7, and when the kernel value of the first element in the filtering kernel is 0, the arrangement mode types of the kernel values corresponding to the remaining eight elements are
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of two elements in each filter kernel in the class is 0, e.g. the sequence of kernel values of any two filter kernels in the class is
And
(ii) a The kernel value types in the third class of filter kernel are respectively 0 and 1/6, and when the kernel value of the first element in the filter kernel is 0, the arrangement mode types of the kernel values corresponding to the remaining eight elements are
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of three elements in each filter kernel in the class is 0, e.g., the sequence of kernel values of any two filter kernels in the class is
And
(ii) a The kernel value types in the fourth major filtering kernel are 0 and 1/5, respectively, and when the kernel value of the first element in the filtering kernel is 0, the arrangement mode types of the kernel values corresponding to the remaining eight elements are
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of four elements in each filter kernel in the class is 0, for example, the sequence of the kernel values of any two filter kernels in the class is
And
(ii) a The kernel value types in the fifth main class of filter kernel are 0 and 1/4, respectively, and when the kernel value of the first element in the filter kernel is 0, the kernel values corresponding to the remaining eight elements are arranged in the mode of type
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of five elements in each filter kernel in the class is 0, e.g., the sequence of kernel values of any two filter kernels in the class is
And
(ii) a The kernel value types in the sixth filtering kernel are 0 and 1/3, respectively, and when the kernel value of the first element in the filtering kernel is 0, the kernel values corresponding to the remaining eight elements are arranged in the mode of 0
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of six elements in each filter kernel in the class is 0, for example, the kernel value sequence of any two filter kernels in the class is
And
(ii) a The kernel value types in the seventh major filtering kernel are 0 and 1/2, respectively, and when the kernel value of the first element in the filtering kernel is 0, the kernel values corresponding to the remaining eight elements are arranged in the mode of 0
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of each filtering kernel in the class has seven elements of 0, for example, the kernel value sequence of any two filtering kernels in the class is
And
(ii) a The kernel value types in the eighth class of filter kernel are respectively 0 and 1, and when the kernel value of the first element in the filter kernel is 0, the arrangement mode types of the kernel values corresponding to the remaining eight elements are
A method for preparing
Is a combination formula, so the number of the filter kernels is
And the kernel value of eight elements in each filter kernel in the class is 0, e.g., the sequence of kernel values of any two filter kernels in the class is
And
。
step S002, converting the gray value of each pixel point in the original information image into a binary sequence; obtaining bit blocks corresponding to the pixel points according to the binary sequence; the number of the sub-bit blocks in the bit block is greater than 1, the bit block is composed of valued sub-bit blocks and non-valued sub-bit blocks, the non-valued sub-bit blocks correspond to the identification bits, and one pixel point corresponds to one identification bit.
Since the gray value has a value range of
Therefore, the embodiment can express each gray value by selecting an eight-bit binary system; therefore, the gray value of each pixel point in the original information image is converted into eight-bit binary number; obtaining a binary sequence corresponding to each pixel point according to the eight-bit binary number corresponding to the gray value of each pixel point
Said
Is binary number; for example, if the gray value of any pixel point is 8, the binary sequence corresponding to the pixel point is
. Then, constructing the identification bit corresponding to each pixel point, and mapping each imageAdding corresponding identification bits to the eight-bit binary sequence corresponding to the pixel points to obtain the data sequence corresponding to each pixel point
The identification bit is added to the back of the last parameter in the corresponding binary sequence; and performing reverse order processing on the data sequence to obtain a target data sequence corresponding to each pixel point
The length of the target data sequence is 9, the
The identification bit is an identification bit, and the identification bit is not assigned at the moment, namely the identification bit has no value; constructing and obtaining bit blocks corresponding to the pixel points according to the data sequences corresponding to the pixel points; as shown in fig. 2, the numbers 1 to 9 in fig. 2 respectively indicate the 1 st sub-bit block to the 9 th sub-bit block in the bit block, that is, the bit block is composed of 9 sub-bit blocks, the structure of the bit block is 3 × 3, each column of each row of the bit block has 3 sub-bit blocks, and the value of the 1 st sub-bit block in the bit block is the value of the 1 st parameter in the corresponding target data sequence, and so on, the value of the 9 th sub-bit block in the bit block is the value of the 9 th parameter in the corresponding target data sequence.
Therefore, the bit blocks corresponding to the pixels are obtained through the above process, and the bit blocks corresponding to the identification bits all have sub-bit blocks corresponding to the identification bits, and since the identification bits have no value at this time, the sub-bit blocks corresponding to the identification bits in the bit blocks corresponding to the pixels are recorded as non-value sub-bit blocks, and the other sub-bit blocks except the sub-bit blocks corresponding to the identification bits in the bit blocks corresponding to the pixels are recorded as valued sub-bit blocks.
Step S003, according to the bit block corresponding to each pixel point and the kernel value in the object filtering kernel, obtain the correspondent object identification code sequence of the original information image; obtaining the value of a sub-bit block without value in the bit block according to the target identification code sequence; and obtaining a target bit block corresponding to each pixel point according to the value of the non-value sub-bit block.
Next, according to the bit block and the target filtering kernel, a target identification code sequence corresponding to the original information image is obtained; and then determining the identification code of the identification bit corresponding to each pixel point based on the target identification code sequence so as to obtain a target bit block, wherein the target bit block is a basis for obtaining a pixel block with a value corresponding to each pixel point through subsequent construction. The specific process is as follows:
since the target filter kernel has a 3 × 3 structure, the 1 st element position in the target filter kernel corresponds to the position of the 1 st sub-bit block in the bit block corresponding to each pixel point, the 2 nd element position in the target filter kernel corresponds to the position of the 2 nd sub-bit block in the bit block corresponding to each pixel point, and so on, the 9 th element position in the target filter kernel corresponds to the position of the 9 th sub-bit block in the bit block corresponding to each pixel point. Therefore, the positions of the elements with the kernel value not 0 in the target filter kernel are obtained first, that is, the kernel value in the target filter kernel is

The n element positions of (a) are marked as target element positions; obtaining sub-bit blocks corresponding to the positions of the target elements one by one in the bit blocks corresponding to the pixel points, and recording the sub-bit blocks as the target sub-bit blocks corresponding to the pixel points; the kernel value of the first element in the target filtering kernel is 0, and the first sub-bit block in the bit block is a non-value sub-bit block, so that the target sub-bit blocks are all valued sub-bit blocks; in order to subsequently operate an image, it is required to ensure that the identification code of the identification bit corresponding to the pixel point where the value corresponding to each target sub-bit block corresponding to each pixel point is 0 and the identification code of the identification bit corresponding to the pixel point where the value corresponding to each target sub-bit block corresponding to each pixel point is 1 is 0; for example, for any pixel: if the value of each target sub-bit block corresponding to the pixel point is 0, the identification code of the identification bit corresponding to the pixel point needs to be ensured to be 0, namely the value of the non-value bit block corresponding to the pixel point is 0; if the values of the target sub-bit blocks corresponding to the pixel point are all1, it needs to ensure that the identification code of the identification bit corresponding to the pixel point is 1, that is, the value of the non-value bit block corresponding to the pixel point is 1. In this embodiment, the identification code sequence assigns the identification bits corresponding to the pixels in the original information image in sequence according to a periodic cycle rule, that is, the identification codes are periodically used in a cycle, so that while it is ensured that the value of the identification bit corresponding to the pixel whose value is 0 in each target sub-bit block corresponding to each bit block is 0 and the value of the identification bit corresponding to the pixel whose value is 1 in each target sub-bit block in each bit block is 1, it is also required to ensure that the identification bit corresponding to each pixel corresponds to only one type of identification code, that is, the identification code of the identification bit corresponding to each pixel cannot be 0 or 1, and the identification code of the identification bit set in this embodiment is only 0 or 1. Therefore, the specific process of acquiring the identification code sequence corresponding to the original information image in this embodiment is as follows:
acquiring pixel points of which the corresponding values of target sub-bit blocks in the bit blocks are 0 and recording the pixel points as first pixel points; and acquiring each pixel point of which the corresponding value of each target sub-bit block in each bit block is 1, and recording the pixel point as a second pixel point.
Then selecting identification code sequences which accord with the condition that if the identification bits corresponding to the pixel points in the original information image are assigned, the identification code of the identification bit corresponding to each first pixel point is 0 and the identification code of the identification bit corresponding to each second pixel point is 1; the lengths of the identification code sequences may be the same or different, and two identification code sequences with the similarity of 1 do not exist in each identification code sequence; when assigning, the identification code sequence assigns identification bits to all pixel points in the original information image according to a periodic cycle rule, namely, one pixel point is assigned once; for example, the identification code sequence is

If the identification code of the identification bit corresponding to the 1 st pixel point on the original information image is 0, the identification code of the identification bit corresponding to the 2 nd pixel point on the original information image is 0, the identification code of the identification bit corresponding to the 3 rd pixel point on the original information image is 1, and the original information image is displayed in a screen-like mannerThe identification code of the identification bit corresponding to 4 pixel points on the information image is 0, and the identification code of the identification bit corresponding to 5 pixel points on the original information image is 0. Then, each identification code sequence with the shortest length is selected from the identification code sequences, any identification code sequence is selected from the identification code sequences with the shortest length and is marked as a target identification code sequence corresponding to the original information image, and the length of the target identification code sequence is marked as a target length.
Then the target identification code sequence assigns the identification bits of all the pixel points in the original information image according to the periodic cycle rule to obtain the identification codes of the identification bits corresponding to all the pixel points in the original information image; assigning the value of the identification code of the identification bit corresponding to each pixel point in the original information image to the value-free sub-bit block in the bit block corresponding to the corresponding pixel point to obtain the value of the value-free sub-bit block in the bit block corresponding to each pixel point; and recording bit blocks corresponding to the pixel points after the assignment of the non-value sub-bit blocks as target bit blocks corresponding to the pixel points.
Step S004, obtaining a non-valued pixel block corresponding to each pixel point, assigning values to each sub-pixel block in the non-valued pixel block according to the target bit block and the target filter core, and obtaining a valued pixel block corresponding to each pixel point.
Then, according to the target bit block and the target filtering kernel, a valued pixel block corresponding to each pixel point is obtained in the embodiment; the specific process is as follows:
firstly, constructing a non-value pixel block corresponding to each pixel point in each original information image; the non-value pixel block is of a 3 x 3 structure; the non-value pixel block is composed of 9 sub-bit blocks; the 1 st element position in the target filtering kernel corresponds to the position of the 1 st sub-pixel block in the non-value pixel block corresponding to each pixel point, the 2 nd element position in the target filtering kernel corresponds to the position of the 2 nd sub-pixel block in the non-value pixel block corresponding to each pixel point, and so on, the 9 th element position in the target filtering kernel corresponds to the position of the 9 th sub-pixel block in the non-value pixel block corresponding to each pixel point; similarly, the 1 st sub-bit block position in the bit block corresponds to the corresponding pixel point pairThe position of the 1 st sub-pixel block in the corresponding non-value pixel block corresponds to the position of the 2 nd sub-pixel block in the bit block corresponds to the position of the 2 nd sub-pixel block in the non-value pixel block corresponding to the corresponding pixel point, and so on, the position of the 9 th sub-bit block in the bit block corresponds to the position of the 9 th sub-pixel block in the non-value pixel block corresponding to each pixel point; one sub-pixel block represents one pixel point; then randomly from

Selecting a number as a filtering value corresponding to each pixel point, wherein the filtering values corresponding to each pixel point can be the same or different, and the filtering value is used for subsequently assigning each sub-pixel block, namely after the assignment of the sub-pixel blocks in each non-value pixel block is completed subsequently, the sum of the value of each sub-pixel block in each non-value pixel block multiplied by the kernel value of the corresponding element position is the filtering value of the pixel point corresponding to the non-value pixel block; for example, for any pixel point, the filtering value corresponding to the pixel point is
Wherein, in the process,
the value corresponding to the 1 st sub-pixel block in the pixel block corresponding to the pixel point,
the value corresponding to the 9 th sub-pixel block in the pixel block corresponding to the pixel point,
for the kernel value corresponding to the 1 st element in the target filter kernel,
and the kernel value corresponding to the 9 th element in the target filtering kernel. In this embodiment, the element positions except for the target element positions in the target filter kernel are referred to as first element positions, and the kernel of each first element positionThe value is 0. Therefore, the present embodiment assigns values to sub-pixel blocks in the non-value pixel block by the following process:
for any first element position and any pixel point in the target filtering kernel: recording the filtering value corresponding to the pixel point as H;
(1) obtaining a sub-bit block corresponding to the first element position in the bit block corresponding to the pixel point, if the value of the sub-bit block is 1, the pixel value of a sub-pixel block corresponding to the first element position in the pixel block corresponding to the pixel point belongs to
I.e. in
Any value is assigned to a sub-pixel block corresponding to the first element position in a non-value pixel block corresponding to the pixel point, if the value of the sub-bit block is 0, the pixel value of the sub-pixel block corresponding to the first element position in the pixel block corresponding to the pixel point belongs to
I.e. in
Any value in the pixel block is assigned to a sub-pixel block corresponding to the first element position in the non-value pixel block corresponding to the pixel point.
(2) And if the values of all target sub-bit blocks in the bit block corresponding to the pixel point are all 0 or all 1, assigning the filtering value H corresponding to the pixel point to all sub-pixel blocks corresponding to all target element positions in the non-value pixel block corresponding to the pixel point.
(3) If the values of the target sub-bit blocks in the bit block corresponding to the pixel point are not all 0 or not all 1, for any target element position in the target element positions: if the value of the sub-bit block corresponding to the target element position in the bit block corresponding to the pixel point is 1, then the pixel point is processed
Any one value in the pixel point is taken as the characteristic value of the sub-pixel block corresponding to the target element position in the non-value pixel block corresponding to the pixel point, if the value of the sub-bit block corresponding to the target element position in the bit block corresponding to the pixel point is 0, the value of the sub-bit block corresponding to the target element position in the bit block corresponding to the pixel point is 0

Any one value in the pixel block is taken as a characteristic value of a sub-pixel block corresponding to the target element position in a non-value pixel block corresponding to the pixel point; assigning the sum of the characteristic value and the filter value H of the sub-pixel block corresponding to the target element position in the non-value pixel block corresponding to the pixel point to the sub-pixel block corresponding to the target element position in the non-value pixel block corresponding to the pixel point; the above-mentioned
The number of sub-bit blocks with the median value of 1 in the bit block corresponding to the pixel point is set as
The number of sub-bit blocks with the median value of 0 in the bit block corresponding to the pixel point. Therefore, the pixel values of the sub-pixel blocks corresponding to the target element positions in the non-value pixel block corresponding to the pixel point can be obtained through the above process, and the sum of the characteristic values of the sub-pixel blocks corresponding to the target element positions is required to be 0.
Therefore, the value of each sub-pixel block in the non-value pixel block corresponding to each pixel point in the original information image can be obtained through the process; recording the pixel block after assigning each sub-pixel block in the non-value pixel block as a value pixel block corresponding to each pixel point; and recording the value of each sub-pixel block in the valued pixel block as the pixel value of each sub-pixel block in the valued pixel block. In addition, in this embodiment, the pixel value of each sub-pixel block in the valued pixel block corresponding to each pixel point is compared with the corresponding filter value, so as to obtain a local binary pattern of the valued pixel block corresponding to each pixel point, where the local binary pattern is the same as the value of each sub-bit block in the target bit block corresponding to each pixel point. For example, for any pixel: marking the pixel value which is larger than the corresponding filtering value of the pixel point in the valued pixel block corresponding to the pixel point as 1, marking the pixel value which is smaller than the corresponding filtering value of the pixel point in the pixel block corresponding to the pixel point as 0, marking the pixel value which is equal to the corresponding filtering value of the pixel point in the pixel block corresponding to the pixel point as the same value as the identification code corresponding to the pixel point, thereby obtaining the marking value of each sub-pixel block in the pixel block corresponding to the pixel point, and the marking value of each sub-pixel block in the pixel block corresponding to the pixel point is the same as the value of the sub-bit block at the corresponding position in the bit block corresponding to the pixel point.
S005, scrambling each sub-pixel block in the valued pixel block according to chaotic mapping and variable step length Joseph traversal to obtain a target valued pixel block corresponding to each pixel point; and storing the target valued pixel blocks corresponding to the pixel points.
In the embodiment, the scrambling is mainly performed on each sub-pixel block of the pixel block corresponding to each pixel point by utilizing variable-step Joseph traversal, and the scrambling aims are mainly to scramble pixel values corresponding to each sub-pixel block in the pixel block corresponding to each pixel point, so that the safety of the campus network can be further improved; the method specifically comprises the following steps:
firstly, obtaining a chaotic sequence with the length of 8 by using Logistic mapping; taking the chaotic sequence as a step length sequence for carrying out variable step length Josephson traversal; the Logistic mapping is a typical chaotic mapping, and the model is
When coefficient of performance
When the system enters a chaotic state, the chaotic state can be generated
In the form of a chaotic sequence in between,
is composed of
Is randomly selected from the above-mentioned two groups,
is composed of
A value randomly selected from the above values; then the parameters are measured
Iterating the corresponding Logistic chaotic mapping model for 8 times, and multiplying each number by
And rounding to obtain a set of lengths
Of the chaotic sequence
,
To
Is the step length; the Logistic mapping is prior art and therefore will not be described in detail.
The specific steps of the variable step length Joseph traversal are as follows:
for any pixel point corresponding pixel block: sequentially placing 9 sub-pixel blocks in the valued pixel block in a circle in the clockwise direction and the order of the sub-pixel blocks, as shown in fig. 3, where 1 to 9 in fig. 3 are sub-pixel blocks; if the chaotic sequence is

Then 2 pairs in FIG. 3 are extracted for the first timeThe corresponding sub-pixel blocks are extracted for the second time to be the sub-pixel block corresponding to 1 in fig. 3, the sub-pixel block corresponding to 4 in fig. 3 is extracted for the third time, the sub-pixel block corresponding to 6 in fig. 3 is extracted for the fourth time, the sub-pixel block corresponding to 8 in fig. 3 is extracted for the fifth time, the sub-pixel block corresponding to 7 in fig. 3 is extracted for the sixth time, the sub-pixel block corresponding to 3 in fig. 3 is extracted for the seventh time, the sub-pixel block corresponding to 9 in fig. 3 is extracted for the eighth time, and the sub-pixel block corresponding to 5 in fig. 3 is extracted for the last time. And then constructing a target pixel block corresponding to the pixel point: the target pixel block is also in a 3-by-3 structure, then the sub-pixel blocks are sequentially placed in the target valued pixel block corresponding to the pixel block according to the extraction sequence, namely the sub-pixel block extracted for the first time is placed at the position of the 1 st sub-pixel block in the target valued pixel block, the sub-pixel block extracted for the second time is placed at the position of the 2 nd sub-pixel block in the target valued pixel block, and so on, the sub-pixel block extracted for the last time is placed at the position of the 9 th sub-pixel block in the target valued pixel block; thus, the aim of scrambling the valued pixel blocks is achieved.
In the embodiment, the target valued pixel blocks corresponding to the pixel points are stored in the form of target valued pixel blocks, so that even if the system attacks the original information image, an attacker does not know which filter kernel is used for processing the original information image and how the chaotic mapping parameters are scrambled, so that the original image cannot be obtained, and the rights and privacy of students cannot be infringed. And the subsequent staff only need to restore the original information image according to the chaotic mapping parameter and the filtering core; meanwhile, whether the image is tampered or not can be identified through the identification code extracted from the restored image, and the safety of the system is further guaranteed.
Has the advantages that: in the embodiment, the gray value of each pixel point in the original information image is converted into a binary sequence; according to the binary sequence, constructing and obtaining bit blocks corresponding to all pixel points, wherein each bit block is composed of a valued sub-bit block and an unqualified sub-bit block, each unqualified sub-bit block corresponds to an identification bit, and one pixel point only corresponds to one identification bit; then, according to the bit block corresponding to each pixel point and the kernel value in the target filtering kernel, obtaining a target identification code sequence corresponding to the original information image; obtaining the value of a non-value sub-bit block in the bit block according to the target identification code sequence; obtaining a target bit block corresponding to each pixel point according to the value of the non-value sub-bit block;
then, checking the assignment of each sub-pixel block in the non-valued pixel block according to the target bit block and the target filter to obtain a valued pixel block corresponding to each pixel point; scrambling each sub-pixel block in the pixel block according to Logistic mapping and variable step length Joseph traversal to obtain a target pixel block corresponding to each pixel point; and storing the target pixel blocks corresponding to the pixel points. The embodiment can guarantee the rights and interests and the individual privacy of students, further guarantees the safety of image data storage, maintains the safety of the intelligent campus network, increases the identification bit when processing the original information image, further can judge whether the processed image data is tampered, and further guarantees the safety of the stored image data.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.