[0039] Embodiment two:
[0040] figure 2 The flow of the method for synchronizing the inspection report of the medical LIS system provided by the embodiment of the present invention is shown. For the convenience of description, only the parts related to the embodiment of the present invention are shown.
[0041] The method for synchronizing the inspection report of the medical LIS system provided in this embodiment includes the following steps:
[0042] Step S201: Refresh the view every certain time interval. When it is found that there is new data in the LIS system, read the newly added patient number, test number, and storage path of the test report image.
[0043] Step S202: Read the inspection report image according to the storage path of the inspection report image, and store it in a folder.
[0044] The above steps S201 and S202 are the same as the steps S101 and S102 in the first embodiment, and will not be repeated here.
[0045] Step S203: Perform image splitting and combination processing on the stored inspection report image, and generate a key.
[0046] As a specific treatment, such as image 3 As shown, the step S203 specifically includes:
[0047] S301: Sort the inspection report images in a sequence.
[0048] There are usually multiple inspection reports, such as Figure 4 As shown, suppose there are m images.
[0049] S302. For each image, w-1 points are randomly generated in the width direction, h-1 points are randomly generated in the height direction, and each image is split into w×h grid pixel blocks.
[0050] In each image, the divided grid pixel blocks have random sizes and are not related to each other. Each image has w×h pixel blocks.
[0051] S303. Randomly take out a pixel block from each image in order for the first round of selection, and then randomly take out a pixel block from the remaining pixel blocks of each image for the second round of selection, so that all pixels are selected after w×h rounds of selection. After the pixel block is selected, a memory block matrix B = T 1 X 11 T 2 X 12 ... T m X 1 m T 1 T twenty one T 2 X twenty two ... T m X 2 m ... ... T z X i j ... T 1 X w h 1 T 2 X w h 2 ... T m X w h m , Where m is the number of images, T z X ij When selecting for the i-th round, the X-th randomly selected from the z-th image ij Pixel blocks, here X ij ∈[1,w×h].
[0052] Reference Figure 5 , From the first image to the mth image, randomly select a pixel block in turn, and then continue to select randomly from the remaining pixel blocks in each image until the pixel blocks of all images are selected. Here mark m images as T 1 , T 2 ,..., T m , In the first round of selection, the image T 1 X of 11 Pixel blocks are selected, image T 2 X of 12 Pixel blocks are selected, image T m X of 1m Pixel blocks are selected, and the selected pixel blocks are marked as T 1 X 11 , T 2 X 12 ,, T m X 1m. By analogy, then, in the i-th round of selection, the Xth image randomly selected from the zth ij Pixel blocks, which can be marked as T z X ij. After all the pixel blocks of the image are selected, a memory block matrix B = T 1 X 11 T 2 X 12 ... T m X 1 m T 1 T twenty one T 2 X twenty two ... T m X 2 m ... ... T z X i j ... T 1 X w h 1 T 2 X w h 2 ... T m X w h m . This matrix is the data obtained by recombining the image after splitting.
[0053] S304: Multiply each pixel block in the storage block matrix by a brightness factor to obtain a deformation matrix C = α 11 T 1 X 11 α 12 T 2 X 12 ... α 1 m T m X 1 m α twenty one T 1 X twenty one α twenty two T 2 X twenty two ... α 2 m T m X 2 m ... ... α i j T z X i j ... α w h 1 T 1 X w h 1 α w h 2 T 2 X w h 2 ... α w h m T m X w h m , among them α i j = X k = 1 m X i k - X i j w X h + T i ( j + 1 ) X i ( j + 1 ) ‾ + T i ( j - 1 ) X i ( j - 1 ) ‾ 2 D , Where the function Represents the average brightness value of the pixel block F, D is the reference brightness value, and the processed incremental file is the deformed matrix C. When j=m, T i ( j + 1 ) X i ( j + 1 ) ‾ = T i 1 X i 1 ‾ , When j=1, T i ( j - 1 ) X i ( j - 1 ) ‾ = T i m X i m .
[0054] In order to further encrypt the data in the pixel block, in this step, each pixel block is multiplied by a brightness factor, and the pixel block T z X ij The brightness factor is α ij , For the i-th round selection, the image T z X randomly selected in ij The brightness factor of each pixel block is related to the pixel block selected in the current round of all other images, and is also related to the average brightness selected by the two images before and after. In the expression, D is the reference brightness value, which is the default known value.
[0055] S305. Generate a key corresponding to the current inspection report image, where the key includes w and h, and also includes a key matrix E = X 11 X 12 ... X 1 m X twenty one X twenty two ... X 2 m ... ... X i j ... X w h 1 X w h 2 ... X w h m .
[0056] After the image is split and combined, it needs a key to be decrypted and restored on the front-end server. Here the key includes the w and h selected during the split in the figure, and of course the key matrix E = X 11 X 12 ... X 1 m X twenty one X twenty two ... X 2 m ... ... X i j ... X w h 1 X w h 2 ... X w h m , Here the key matrix is the number X of the pixel block specifically selected for each image in each round of selection ij. Of course, in order to facilitate fast calculation, the key also includes the brightness factor matrix α 11 α 12 ... α 1 m α twenty one α twenty two ... α 2 m ... ... α i j ... α w h 1 α w h 2 ... α w h m .
[0057] In the above-mentioned key matrix E, the key matrix can be further deformed to make the key matrix more secure. Here, the key matrix is divided into 2×2 regions from the upper left corner, each region has 4 elements, and the elements in each region rotate one position in a clockwise direction. If the number of columns in the key matrix is If the number is odd, the last column of elements will not be processed. If the number of rows in the key matrix is odd, the last row of elements will not be processed.
[0058] Step S204: Scan whether there is a new inspection report image, that is, an incremental file, every preset time.
[0059] Step S205: If there is an incremental file, the processed incremental file and key, as well as the corresponding patient number and examination number are synchronized to the cloud server by using the port completed by the socket combination.
[0060] The difference between this embodiment and the first embodiment is that in this embodiment, after the front-end server saves the inspection report image, it needs to split and combine the inspection report image, that is, encrypt it, and obtain the key. Then scan every preset time to see if a new inspection report image, that is, an incremental file, is the image data of the incremental file that has not been processed. If there is an incremental file, use the socket port to synchronize the incremental file and the corresponding patient number and test number to the cloud server. In this way, after the inspection report image is processed, it is impossible to restore the patient's inspection report image without obtaining the key, which guarantees the patient's privacy. Especially for some important customers, the encryption of the inspection report image is particularly important.
[0061] In addition, during specific implementation, the above step S205 specifically includes:
[0062] First, send a handshake signal to the cloud server;
[0063] Then, after receiving the feedback signal, send the patient number and test number to the cloud server, and receive the storage address returned by the cloud server;
[0064] Finally, get the last byte of the patient number. When it is an odd number, synchronize the odd-numbered row of pixel blocks in the deformation matrix C to the cloud server, then synchronize the even-numbered row of pixel blocks to the cloud server, and finally synchronize the key to the cloud server ; When it is an even number, synchronize the pixel blocks of the even rows in the deformation matrix C to the cloud server, then synchronize the pixel blocks of the odd rows to the cloud server, and finally synchronize the key to the cloud server.