International Core Journal of Engineering 2020-26 | Page 144

F ( x i , w j ) Y a fit 1  Y b fit 2 detection operator is converted into a two-dimensional matrix of 0,1, in which white Representing a binary one, black represents a binary zero, and finally converts the binary image into a one-dimensional watermark sequence. Since the white pixel contains the main information of the copyright image, the white pixel is used to control the embedding of the watermark. There Y a 0.4 , Y b 0.6 , avg a : average value of data blocks before watermark embedding; avg b :average value of data block after watermark embedding; V a 2 : variance of data block before watermark embedding; V b 2 :variance of data block after watermark embedding; | after ( i , j )  before ( i , j ) | : Indicates the amount of data change after embedding the watermark, the abscissa i is the id value, and the ordinate j represents the attribute column. The database performs block preprocessing, connects to the database, counts the attribute names of the database, randomly selects a list of attributes, and counts the number of the columns, and compares the number of the numbers with the set threshold. When the number of the numbers is greater than the threshold Count all the ids of the tuple in which the mode is located as a block into the table, and set an index for each block to facilitate traversal. The initial population is sorted by embedding the initial population into the database, and the individuals with better fitness are obtained with smaller sequence values. Then, the sorted individuals are given a serial number R i by using the following formula: R i N  i ; i 1, 2,..., N ; Next, the selection probability p i of each individual is calculated by the serial number and the population number: R p i ; i 1, 2,..., N ; N B. Watermark embedding algorithm Definition 1. In the m * n relational database, the relationship is represented by R ( p , A 1 , A 2 ,..., A n ) , where P is the primary key, and A i (1 d i d n ) 0 is the attribute in the relational database R, then r j (1 d j d m ) is a tuple of the database, and ( r j , A i ) represents the value of the i-th attribute of the j-th row tuple. (3) From the population X i 0 Each data block is assigned a random 8-bit binary watermark sequence, and the one-dimensional array generated by the image is traversed. When the pixel is 0, no operation is performed. When the pixel is 1, the following operations are performed: ^ ` U i g  1 ^ u i 1 g  1 ` , u i 2 g  1 , u i 3 g  1 ,..., u iD g  1 ; i 1, 2,3,..., N (5) According to the selection formula, variation of individuals to generate new population after crossover operation u i g  1 compared with x i g , if the candidate ` 1 m m ¦¦ | after ( i , j )  before ( i , j ) | 2 m * n i 1 j 1 ` (4) The parent x j g and the v i g  1 generated after mutation were partially crossed according to the crossover formula to obtain the experimental vector : (2) The fitness function is calculated for the population by the following formula, and the fitness function is set to two parts: fit 2 , x i 2 0 , x i 3 0 ,..., x iD 0 is an evolutionary algebra. (1) The scaling factor F and the crossover probability CR are initialized, and F 0.5 , CR 0.3 . N individuals are generated from the database partition by means of a uniformly distributed random function. x i 0 represents the i- th individual of the 0th generation, and each individual is composed of the values of D coordinate points, that is, D- x i 1 0 , x i 2 0 , x i 3 0 ,..., x iD 0 ; i 1, 2,3,..., N . dimensional: X i 0 (| avg a  avg b |  | V a 2  V b 2 |) * N D 0 i 1 generated, and then a random number a is generated from 0~1, and individuals x r 2 and x r 3 are randomly selected. If the probability values of the selected individuals are greater than a and mutual If it is not the same, the selection is successful, otherwise it is re-selected, and it is mutated by the above variation formula to generate the intermediate individual V i g  1 v i 1 g  1 , v i 2 g  1 , v i 3 g  1 ,..., v iD g  1 ; i 1, 2,3,..., N ; where g Specific steps: fit 1 ^ x randomly selected An individual x r 1 different from x i is Definition 2. The least significant bit LSB (Least Significant Byte), which represents the smallest unit in a binary number, also refers to the smallest weighted byte in a multi-byte sequence. For the low redundancy of the numerical database, the watermark is embedded by changing the least significant bit. ^ (10) individuals u i g  1 , the fitness function is better than x i g chose u i g  1 as a child, otherwise choose x i g as a child, generate the final population: X i g  1 x i 1 g  1 , x i 2 g  1 ,..., x iD g  1 ; i 1, 2,3,..., N The final ^ (8) ` population is the optimal watermark embedding position. (6) Iterate through the random watermark sequence allocated for the data block. When the watermark parameter is 0, the position to be embedded is traversed, and the least significant bit of the position data is subtracted. When the watermark parameter is 1, the least significant bit of the position data is added. (9) Add weights to two formulas: (7) Determine whether all the data blocks are traversed, if not, return (1). 122