A power grid system file segmentation encryption transmission method and system
By optimizing the QR code display parameters and encryption methods, the problem of transmitting power work order data under physically isolated conditions was solved, achieving efficient and secure information exchange.
Patent Information
- Application Number
- CN202511588240.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-11-03
AI Technical Summary
Existing technologies have failed to effectively solve the parameter optimization problem when power work order data is transmitted via QR codes under physically isolated conditions, especially the optimization of QR code refresh frequency and individual pixel size under different error tolerance rates for different information types.
By acquiring the information type identifier of the power work order data, setting the error tolerance threshold, generating the QR code display parameters of the initial population, and optimizing the display pixel size and frame interval time through iterative evolution, using a genetic algorithm to select the optimal parameters, combining a hash algorithm and Reed-Solomon error correction coding to ensure transmission accuracy, and using block encryption and asymmetric encryption to improve data security.
While meeting the error tolerance requirement, the system achieves efficient and accurate transmission of power work order data in the shortest possible time, ensuring the security and integrity of the information.
Smart Images

Figure CN121077813B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a power grid system file segmentation encryption transmission method and system. BACKGROUND
[0002] In the power industry and other industries with high security requirements, in order to prevent industry data leakage and external network attacks, the data running safely in the industry is independently operated in the internal network, and the interaction of external network data is limited. In some application scenarios, such as power failure information that can be obtained only by internal network permission, such as power failure information uploaded by automatic remote alarm equipment or submitted by users through network power work orders, and the power failure information dispatching and rescue often pass through manual power work order entry to the external network; because the power maintenance personnel information and power rescue vehicle dispatching information of the external network responsible department are managed by each branch, they have no permission to access the internal network of the headquarters. After the maintenance work is completed, the status of the external network also needs to be manually uploaded to the internal network, so as to complete the power failure information of the internal network. Sometimes, power failure information occurs at night, and special personnel need to be assigned to work to dispatch power failure information in the form of power work orders to the external network, and then distribute them to power rescue vehicles and power maintenance personnel through the dispatching program running in the external network.
[0003] Therefore, it is necessary to interact the information of the internal network and the external network in a safe form. The prior art often converts information of the internal network and the external network into a two-dimensional code, the external network reads the two-dimensional code converted by the internal network to obtain the information of the internal network, and the internal network reads the two-dimensional code converted by the external network to obtain the information of the external network. The two-dimensional code is constantly refreshed in a sequence form, and the purpose is to isolate physical connection contact or network connection contact. The prior art discusses how to efficiently transmit files more, but does not solve the problems of two-dimensional code refreshing frequency and single point pixel size optimization of different types of information under error tolerance rate, that is, how to put the most content in the limited space of displaying the two-dimensional code under the error tolerance rate to meet the real-time requirement of information. SUMMARY
[0004] (1) Technical problem to be solved: The purpose of the present application is to provide a power grid system file segmentation encryption transmission method and system to solve the parameter optimization problem of transmitting data through a two-dimensional code in a physically isolated state.
[0005] (2) Technical scheme: In order to achieve the above purpose, on the one hand, the present application provides a power grid system file segmentation encryption transmission method, which comprises:
[0006] Obtain work order data of a power work order of a first network, the work order data including information content and an information type identifier, and encrypt the information content to obtain encrypted content; obtain a display size, a unit pixel size, and a time interval corresponding to a refresh rate of a display module; and set a corresponding error tolerance threshold according to the information type identifier;
[0007] Classify the work order data according to the information type identifier, and generate two-dimensional code display parameters as an initial population for each information type, the initial population including a plurality of individuals, each individual representing a two-dimensional code display parameter, the two-dimensional code display parameter including a display pixel size and a display frame interval time, wherein the display pixel size is an integer multiple of the unit pixel size and does not exceed the display size, and the display frame interval time is greater than the time interval corresponding to the refresh rate; and convert the encrypted content into a two-dimensional code according to the display pixel size and the display size through a two-dimensional code encoding rule, and record the number of encoded two-dimensional codes as a total frame number.
[0008] Iteratively evolve the initial population, and use the display pixel size and the display frame interval time of a winning individual after the iterative evolution as the two-dimensional code display parameter of the information type.
[0009] Convert the encrypted content of the first network into a two-dimensional code sequence according to the display pixel size corresponding to the information type, display and transmit the two-dimensional code sequence in sequence through the display module of the first network according to the display frame interval time, and collect the two-dimensional code sequence through the reading module of the second network, and parse, decrypt, restore, and splice the two-dimensional code sequence to obtain the work order data.
[0010] Further, the method of iteratively evolving the initial population and using the display pixel size and the display frame interval time of a winning individual after the iterative evolution as the two-dimensional code display parameter of the information type includes:
[0011] Calculate a frame error rate of the encrypted content of the first network under the display pixel size, the display frame interval time, and the information type identifier corresponding to each individual in the initial population; select an individual whose frame error rate does not exceed a preset error tolerance threshold corresponding to the information type from the selected individuals, and select an individual with the least total frame number as a winning individual; perform a crossover operation and a mutation operation on the winning individual to obtain an individual, and select an individual whose display pixel size is an integer multiple of the unit pixel size and does not exceed the display size, and whose display frame interval time is greater than the time interval corresponding to the refresh rate, as a child individual; replace the initial population with the child individual and repeat the iterative evolution step until the total frame number difference between the child individual and the parent individual is lower than a preset frame number threshold, and then stop the iterative evolution; and use the display pixel size and the display frame interval time of the winning individual after the iterative evolution as the two-dimensional code display parameter of the information type.
[0012] Furthermore, the frame error rate identified as text type is obtained by the second network's reading module parsing and decrypting the QR code sequence into reading content, comparing the reading content with the information content, counting the number of text errors and missing characters in the reading content as the text loss number, and calculating the ratio of the text loss number to the total number of characters in the information content.
[0013] The frame error rate, which is identified as either image or video type, is obtained by comparing the QR code sequence obtained by the reading module of the second network with the QR code sequence transmitted by the display module of the first network, counting the number of erroneous frames, and calculating the ratio of the number of erroneous frames to the total number of frames.
[0014] Furthermore, the method for comparing the QR code sequence obtained by the reading module of the second network with the QR code sequence transmitted by the display module of the first network includes:
[0015] Before the display module of the first network transmits the QR code sequence, the encoded data of each frame of QR code is processed using a hash algorithm to obtain a hash value. Then, the Reed-Solomon error correction coding algorithm is used to calculate error correction code data from the encoded data. The hash value and the error correction code data are combined to obtain reference verification data. The reference check data of the frame is denoted as , will the The time of frame QR code transmission is denoted as ,in From 1 to the total number of frames Integer variables;
[0016] After the second network's reading module collects the QR code sequence, it decodes each frame of the collected QR code to obtain collected coded data. It then calculates the collected hash value using the same hash algorithm as the reference verification data, and calculates the collected error correction code data using the same Reed-Solomon error correction coding algorithm as the reference verification data. Finally, it combines the collected hash value and the collected error correction code data to obtain the collected verification data. The frame acquisition and verification data is denoted as , will the The time when the frame QR code is collected is recorded as ;
[0017] Calculate the first Frame reference check data The hash value and collected verification data The similarity of the collected hash values is denoted as ; Calculate the first Frame reference check data Error correction code data and collected verification data The Hamming distance of the collected error correction code data is denoted as when a preset hash similarity threshold is exceeded or a preset Hamming distance threshold is exceeded, the first frame is determined to be an error frame and is counted into the error frame number; when a time difference between the first frame and the second frame exceeds a preset time deviation threshold, the first frame is determined to be a lost frame and is counted into the error frame number. and a time difference between the first frame and the second frame exceeds a preset time deviation threshold, the first frame is determined to be a lost frame and is counted into the error frame number.
[0018] Further, the method for encrypting information content to obtain encrypted content comprises:
[0019] According to the information type identifier, the information content is divided into information blocks according to a preset block length, the information content is divided into information blocks, the first information block is recorded as , wherein is an integer variable from 1 to ; a master key is generated, and a block number of the first information block is operated with the master key by a key derivation function to obtain a first block key recorded as ; The first block key is used to encrypt the first information block
[0020] to obtain a first encrypted block recorded as ; a message authentication code algorithm is used to calculate a first authentication code recorded as ; the first encrypted block and the first authentication code are combined to obtain a first encrypted information unit; and all encrypted information units are arranged in sequence to obtain encrypted information data.
[0021] An asymmetric encryption public key stored in advance by a second network is acquired, and the master key is encrypted by using the asymmetric encryption public key by an asymmetric encryption algorithm to obtain encrypted master key data; a current timestamp is generated, and the encrypted information data and the current timestamp are operated by a hash algorithm to obtain an integrity check value; and the encrypted information data, the encrypted master key data, the current timestamp and the integrity check value are combined to obtain encrypted content.
[0022] Further, the method of converting the encrypted content into a two-dimensional code according to the display pixel size and the display size by a two-dimensional code encoding rule and recording the number of encoded two-dimensional codes as the total frame number comprises:
[0023] calculating the number of modules contained in a single two-dimensional code according to the display size and the display pixel size, obtaining the data capacity of a single two-dimensional code as a single frame data capacity according to the number of modules contained by the two-dimensional code encoding rule, calculating the total byte number of the encrypted content, and calculating the ratio of the total byte number to the single frame data capacity and rounding up to obtain the total frame number.
[0024] Further, the method of collecting the two-dimensional code sequence by the reading module of the second network and parsing, decrypting, restoring and splicing to obtain the work order data comprises:
[0025] The reading module of the second network continuously collects the two-dimensional code sequence transmitted by the first network display module, performs gray processing, binary processing and perspective transformation correction on each two-dimensional code image in the two-dimensional code sequence to obtain a corrected two-dimensional code image, converts the bright-dark state of the data area extraction module of the corrected two-dimensional code image into a binary code word sequence, and separates the binary code word sequence into a data code word part and an error correction code word part.
[0026] The data code word part is subjected to error correction processing by a Reed-Solomon error correction algorithm to obtain an error-corrected data code word, and the error-corrected data code word is decoded according to the encoding mode to obtain complete frame data.
[0027] The frame number and the corresponding encrypted block are extracted from the complete frame data, the encrypted blocks are arranged in order according to the frame number and spliced to obtain an encrypted message, and the encrypted message is decrypted to obtain an information block, which is spliced and restored into work order data in order of the frame number.
[0028] Based on the same inventive concept, in another aspect, the present application also provides an electric power grid system file segmentation and encryption transmission system, which is used to execute the electric power grid system file segmentation and encryption transmission method.
[0029] (3) Advantageous effects: Compared with the prior art, the advantageous effects of the present application are that different transmission two-dimensional code parameters including the display pixel size of the two-dimensional code and the time interval of the two-dimensional code frame are set for different information types, so as to ensure that the transmission of the electric power work order data is completed efficiently and accurately in the shortest time. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 The flowchart of the electric power grid system file segmentation and encryption transmission method of the embodiment 1 of the present application;
[0031] Figure 2A hardware configuration diagram of an embodiment of the power grid system file segmentation encryption transmission method of the present application;
[0032] Figure 3 A schematic diagram of the influence of two-dimensional code display parameters on the transmission accuracy and transmission speed of different information types in the power grid system file segmentation encryption transmission method of embodiment 1 of the present application. DETAILED DESCRIPTION
[0033] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the protection scope of the present application.
[0034] Before the examples, the application scenario of the present inventive concept needs to be described. The applicant designs a set of intelligent key cabinet, which is used for receiving and sending keys of electric power emergency rescue vehicles. The driver triggers the authority of the vehicle key by face scanning. In order to prevent the driver from drunk driving, the intelligent key cabinet needs to blow the alcohol tester before the driver obtains the key. The intelligent key cabinet can automatically form power work order information that the external network can analyze from the internal network power failure information, and automatically push the relevant maintenance information to the electric power maintenance personnel. The electric power maintenance personnel and the driver go to the intelligent key cabinet to take the vehicle key by unified face scanning. After completing the fault maintenance, the driver returns the key to the intelligent key cabinet, thereby completing the electric power work order corresponding to the internal network electric power failure information. It should be noted that the electric power work order contains multiple information types, mainly including text, image, video and other information types. It should be noted that for Chinese text, individual characters are misspelled and do not affect understanding, and the error tolerance rate is relatively high. However, images or videos are encapsulated in a format and divided into multiple sequences for transmission. If the two-dimensional code of part of the sequence is transmitted incorrectly, the entire image and video cannot be recombined and parsed into the original image or video, and the error tolerance rate is relatively low. The screen displaying the two-dimensional code has more options, generally using black and white electronic ink screens, LCD screens, etc., or TFT modules that can display colors (only black and white colors are applied). The camera for reading the two-dimensional code has a certain distance from the two-dimensional code screen for optical focusing, so the internal network has a reading module and a display module, and the external network also has a reading module and a display module. As for how the display module displays the two-dimensional code, the main parameters include the two-dimensional code refresh frequency and the single point pixel size of the two-dimensional code. The reading module is a camera, and when the shutter is fast enough, its resolution generally meets the demand. In addition, it should be noted that if the two-dimensional code frame sequence display process is too fast, the two-dimensional code image obtained by the reading module will be blurred, and the two-dimensional code recognition will be incorrect, resulting in information loss. Therefore, it is necessary to reasonably set the two-dimensional code display parameters, including the display pixel size and display frame interval time of the two-dimensional code. In this embodiment, we assume that the reading module and the display module have been selected and the parameters are fixed, but the method of this embodiment is also applied to different reading modules and display modules by training the model to form the best display parameters.
[0035] As Figure 2As shown, the outer network represents the network of power maintenance scheduling and vehicle dispatch, and the inner network represents the internal monitoring website of the power. The inner network has a display module and a reading module, and the outer network also has a display module and a reading module. The arrows represent that the outer network and the inner network can exchange information with each other. The first network and the second network described in the following embodiments do not specify which network represents the inner network or the outer network, which can be understood as two physically isolated networks that need to exchange information. The middle represents a sequence of two-dimensional code frames, which are displayed in time switching. These two-dimensional code frame sequences are displayed by the display modules of the inner network and the outer network and are read by the reading modules of the other network.
[0036] Embodiment 1: As shown, the embodiment provides a power grid system file segmentation encryption transmission method, which comprises the following steps: Figure 1
[0037] S1, obtaining the work order data of the power work order of the first network, the work order data comprising information content and information type identifier, encrypting the information content to obtain encrypted content; obtaining the display size, unit pixel size and time interval corresponding to the refresh rate of the display module; setting the corresponding error tolerance threshold according to the information type identifier;
[0038] S2, classifying the work order data according to the information type identifier and generating two-dimensional code display parameters as the initial population for each information type, the initial population comprising a plurality of individuals, each individual representing a two-dimensional code display parameter, the two-dimensional code display parameter comprising display pixel size and display frame interval time, wherein the display pixel size is an integer multiple of the unit pixel size and does not exceed the display size, and the display frame interval time is greater than the time interval corresponding to the refresh rate; converting the encrypted content into a two-dimensional code according to the display pixel size and the display size through a two-dimensional code encoding rule and recording the number of encoded two-dimensional codes as the total frame number;
[0039] S3, iteratively evolving the initial population, and the display pixel size and display frame interval time corresponding to the winning individual after the iterative evolution are used as the two-dimensional code display parameters of the information type;
[0040] S4, converting the encrypted content of the first network into a two-dimensional code sequence according to the display pixel size corresponding to the information type, displaying and transmitting the two-dimensional code sequence in turn through the display module of the first network according to the display frame interval time, and collecting the two-dimensional code sequence through the reading module of the second network and parsing, decrypting, restoring and splicing to obtain the work order data.
[0041] Exemplarily, a 110KV transformer substation of a certain power company has a main transformer failure at night, and the internal network monitoring device automatically generates a power work order. The work order data includes a fault description text of 800 characters, 3 field device photos totaling 150KB, and a low-frame-rate fault video of 8s totaling 800KB, with a total data volume of about 950KB. The fault description text is identified as a text type, the field photos are identified as an image type, and the fault video is identified as a video type. The AES256 symmetric encryption algorithm is used to block encrypt the information content of each type. After encryption, the text is 20KB, the image is 155KB, and the video is 820KB, with a total encrypted content of 995KB. The 7-inch electronic ink screen display module parameters configured by the intelligent key cabinet are obtained: display size 800x600 pixels, unit pixel size 0.15mm, refresh rate 60Hz corresponding to time interval 16.7ms; the preset error tolerance threshold for text type is set to 3%, and the preset error tolerance thresholds for image type and video type are both set to 0.5%.
[0042] According to the information type classification, an initial population of two-dimensional code display parameters is generated, and each population contains 15 individuals. The display pixel size is set to an integer multiple of the unit pixel size, which is 0.30mm, 0.45mm, 0.60mm, 0.75mm, and 0.90mm, corresponding to 2 times, 3 times, 4 times, 5 times, and 6 times the unit pixel. The display frame interval time is set to a value greater than 16.7ms, which is 50ms, 80ms, 120ms, 150ms, and 200ms. The reason for setting these parameter ranges is that too small display pixel size will result in too high two-dimensional code density affecting recognition accuracy, and too large display pixel size will reduce single-frame data capacity and increase transmission frame number. Too short display frame interval time will cause the reading module to collect fuzzy, and too long display frame interval time will prolong the total transmission time. The encrypted content of each type is converted into a two-dimensional code according to different display pixel sizes through the QR code encoding rule. When the display pixel size is 0.30mm, a single two-dimensional code can accommodate 1024 bytes of data, and when the display pixel size is 0.90mm, a single two-dimensional code can accommodate 64 bytes of data.
[0043] In the test of the work order data, different information types have different transmission accuracy and transmission efficiency under different two-dimensional code display parameters. The initial population is iteratively evolved by genetic algorithm, the population size of each generation is kept at 15 individuals, and the iteration is converged after 30 generations. The optimal parameters for text type are display pixel size of 0.60 mm and display frame interval time of 80 ms, corresponding to total frame number of 48 frames and transmission time of 3.8 s. The optimal parameters for image type and video type are display pixel size of 0.45 mm and display frame interval time of 120 ms, corresponding to total frame number of 310 frames and transmission time of 37.2 s for image, and total frame number of 1640 frames and transmission time of 196.8 s for video. According to the optimized display parameters, the internal network display module displays the two-dimensional code sequences of each type in turn, and the total transmission time is 237.8 s, about 4 min. The external network reading module continuously acquires the two-dimensional code sequences by industrial CCD camera, and after acquisition, it performs analysis and AES decryption processing, finally restores the complete power work order data and automatically distributes it to the maintenance personnel.
[0044] Further, the method of iteratively evolving the initial population, and the display pixel size and display frame interval time corresponding to the winning individual after iterative evolution as the two-dimensional code display parameters of the information type include:
[0045] The frame error rate of the encrypted content of the first network is calculated under the display pixel size, display frame interval time and information type identifier corresponding to each individual in the initial population. Individuals with frame error rate not exceeding the preset error tolerance threshold corresponding to the information type are screened, and the individual with the least total frame number is selected from the screened individuals as the winning individual. The winning individual is subjected to crossover operation and mutation operation, and the obtained individual is screened to be an integer multiple of the unit pixel size and not more than the display size, and the display frame interval time is greater than the time interval corresponding to the refresh rate, as the offspring individual. The initial population is replaced by the offspring individual and the iterative evolution step is repeated until the total frame number difference between the offspring individual and the parent individual is lower than the preset frame number threshold, and the iterative evolution is stopped. The display pixel size and display frame interval time corresponding to the winning individual after iterative evolution are used as the two-dimensional code display parameters of the information type.
[0046] Exemplarily, as Figure 3As shown, according to the initial population of 45 individuals generated above, the frame error rate of each individual under the corresponding information type is calculated one by one. In the text type test, the individual with a display pixel size of 0.30 mm and a display frame interval time of 50 ms is eliminated because the pixel density is too high and the refresh rate is too fast, causing motion blur in the two-dimensional code image collected by the reading module, and the frame error rate reaches 4.2%, exceeding the threshold of 3%. The individual with a display pixel size of 0.60 mm and a display frame interval time of 80 ms has a frame error rate of 2.1%, meeting the threshold requirement, and the corresponding total frame number is 48. In the image type test, the individual with a display pixel size of 0.45 mm and a display frame interval time of 120 ms has a frame error rate of 0.3%, meeting the threshold requirement of 0.5%, and the corresponding total frame number is 310. The video type is tested with the same parameters, and the frame error rate is 0.4%, meeting the threshold requirement, and the corresponding total frame number is 1640. After the test and selection of all 45 individuals, there are 8 individuals that meet the error tolerance threshold in the text type, and there are 6 individuals that meet the threshold in the image type and the video type. Figure 3 In the above embodiment, it can be seen that as the display pixel size of a single two-dimensional code increases, the amount of information on a single screen decreases, but the error rate decreases; the time between two-dimensional code frames becomes longer, but the blurred effect of the reading module during the capture of the two-dimensional code switching process also affects recognition. For example, in the text type, the display pixel size of 0.6 mm and the display frame interval time of 80 ms are the best, and the same applies to the image type. The video type is essentially a continuous image frame, and further description is omitted. Different reading modules, different light backgrounds, and different display modules (residual images during switching between display frames) will affect these variables, but once the hardware of a certain batch is selected and confirmed, these variables are fixed values. The only optimization is to use the method of the embodiment to optimize the relevant display parameters.
[0047] The individual with the least total frame number is selected from the individuals that meet the threshold as the winning individual for genetic operation. The winning individual of the text type has a display pixel size of 0.60 mm and a display frame interval time of 80 ms, which is crossed to produce new combinations by exchanging parameters with other winning individuals. The display pixel size is subjected to mutation operation, which increases or decreases a unit pixel size of 0.15 mm based on 0.60 mm to produce a mutation value of 0.45 mm or 0.75 mm. The display frame interval time is subjected to mutation operation, which increases or decreases 20 ms based on 80 ms to produce a mutation value of 60 ms or 100 ms. The same cross-mutation method is used to generate offspring individuals for the image type and the video type. Because of the physical display limitations of the display module, the generated offspring individuals must meet the constraint conditions: the display pixel size is an integer multiple of the unit pixel size of 0.15 mm and does not exceed the display size range, and the display frame interval time is greater than the refresh rate time interval of 16.7 ms. After constraint screening, 12 valid offspring individuals are generated for each information type, which replace the original population to enter the next iteration.
[0048] After 30 generations of iterative evolution, the total frame number difference between the 29th and 30th generations of each information type is reduced to within 1 frame, which is 3 frames lower than the preset frame number threshold, and the algorithm converges and stops iteration. The final determined two-dimensional code display parameters are: the text type display pixel size is 0.60 mm and the display frame interval time is 80 ms, the image type and video type display pixel size is 0.45 mm and the display frame interval time is 120 ms. These parameters realize the minimization of the transmission frame number under the premise of meeting the error tolerance threshold of each information type, and ensure that the power work order data can be reliably transmitted within 4 min.
[0049] Further, the frame error rate of the information type identified as the text type is obtained by the reading module of the second network analyzing and decrypting the two-dimensional code sequence into reading content, comparing the reading content with the information content, counting the number of text errors and losses of the reading content as the text loss number, and calculating the ratio of the text loss number to the total number of characters in the information content.
[0050] The frame error rate of the information type identified as the image type or the video type is obtained by comparing the two-dimensional code sequence obtained by the reading module of the second network with the two-dimensional code sequence transmitted by the display module of the first network, counting the number of error frames, and calculating the ratio of the number of error frames to the total number of frames.
[0051] Illustratively, according to the optimal display parameters determined above, the frame error rate of each information type is calculated and verified. The text type uses a display pixel size of 0.60 mm and a display frame interval time of 80 ms to transmit 48 frames of two-dimensional code, and after the external network reading module completes the collection, QR code analysis and AES decryption processing are performed to obtain a total of 792 characters of reading content. Comparing the reading content with the original fault description text of 800 characters character by character, a total of 8 character errors are found. The character error rate is 8 divided by 800, which is equal to 1%, which is much lower than the preset error tolerance threshold of 3% for the text type, and meets the transmission requirements. Since Chinese characters have strong semantic redundancy, individual character errors do not affect the understanding of the fault information by the maintenance personnel, so the text type can tolerate a relatively high error rate.
[0052] For image-type QR code transmission, 310 frames were transmitted using a display pixel size of 0.45mm and a frame interval of 120ms. The external network reading module acquired 309 valid QR code images, with frame 127 failing to acquire. The acquired 309-frame QR code sequence was compared frame-by-frame with the 310-frame QR code sequence actually transmitted by the internal network display module, and the number of erroneous frames was counted as 1. The frame error rate for image-type transmission was calculated as 1 divided by 310, which equals 0.32%, lower than the preset error tolerance threshold of 0.5%, meeting the transmission requirements. For video-type transmission, 1640 frames were transmitted using the same display parameters. The external network reading module acquired 1634 valid QR codes, with frames 445, 892, 1203, 1456, 1589, and 1612 (a total of 6 frames) experiencing acquisition errors due to electromagnetic interference during transmission. The frame error rate for video-type transmission was calculated as 6 divided by 1640, which equals 0.37%, also lower than the preset error tolerance threshold of 0.5%, meeting the transmission requirements. Images and videos are transmitted using encapsulated formats, with stricter error tolerance thresholds. Even a single frame error can affect the integrity of the entire file, and a failed single frame verification requires retransmission. Therefore, it is necessary to reduce the error rate.
[0053] Furthermore, the method for comparing the QR code sequence obtained by the reading module of the second network with the QR code sequence transmitted by the display module of the first network includes:
[0054] Before the display module of the first network transmits the QR code sequence, the encoded data of each frame of QR code is processed using a hash algorithm to obtain a hash value. Then, the Reed-Solomon error correction coding algorithm is used to calculate error correction code data from the encoded data. The hash value and the error correction code data are combined to obtain reference verification data. The reference check data of the frame is denoted as , will the The time of frame QR code transmission is denoted as ,in From 1 to the total number of frames Integer variables;
[0055] After the second network's reading module collects the QR code sequence, it decodes each frame of the collected QR code to obtain collected coded data. It then calculates the collected hash value using the same hash algorithm as the reference verification data, and calculates the collected error correction code data using the same Reed-Solomon error correction coding algorithm as the reference verification data. Finally, it combines the collected hash value and the collected error correction code data to obtain the collected verification data. The frame acquisition and verification data is denoted as , will the The time when the frame QR code is collected is recorded as ;
[0056] Calculate the first Frame reference check data The hash value and collected verification data The similarity of the collected hash values is denoted as ; Calculate the first Frame reference check data Error correction code data and collected verification data The Hamming distance of the collected error correction code data is denoted as ;when Below the preset hash similarity threshold or When the preset Hamming distance threshold is exceeded, the first step is determined. The frame is considered an error frame and is included in the error frame count; when and When the time difference exceeds the preset time deviation threshold, the first... The frame is a lost frame and is included in the number of erroneous frames.
[0057] For example, before transmitting the QR code sequence on the intranet display module, each frame of QR code undergoes verification data preprocessing. Taking the 127th frame image QR code as an example, this frame contains 512 bytes of encrypted image data, and a 64-byte hash value is calculated using the SHA256 hash algorithm. Simultaneously, the Reed-Solomon error correction coding algorithm is used to process the 512 bytes of encoded data, generating 128 bytes of error correction code data for subsequent transmission error detection and correction. The 64-byte hash value and the 128-byte error correction code data are combined to form 192 bytes of reference verification data, and the transmission time of this frame is recorded as 13 hours, 25 minutes, 18 seconds, and 456 milliseconds. Reference verification data is generated for all 310 frames of image QR codes in the same manner, providing a benchmark for subsequent transmission quality evaluation.
[0058] After the external network reads the QR code sequence collected by the module, the same verification process is performed on each frame of the collected image. The QR code collected in frame 127 is decoded after grayscale conversion, binarization, and perspective correction to obtain 510 bytes of collected encoded data, 2 bytes less than the original 512 bytes. The SHA256 hash algorithm is used to calculate the collected hash value from the 510 bytes of collected data, and the Reed-Solomon error correction coding algorithm is used to calculate the collected error correction code data. These are combined to form the collected verification data, with the collection time recorded as 13:25:18.478. The similarity between the calculated reference hash value and the collected hash value is 87.5%, lower than the preset hash similarity threshold of 95%. The Hamming distance between the calculated reference error correction code data and the collected error correction code data is 15, exceeding the preset Hamming distance threshold of 8. The time difference between the collection time and the transmission time is 22ms, which does not exceed the preset time deviation threshold of 100ms.
[0059] Based on the verification and comparison results, error frames were identified. Frame 127 was determined to be an error frame because its hash similarity was below the threshold and its Hamming distance exceeded the threshold, and was included in the error frame count. Frames 445, 892, and four other video QR codes were also determined to be error frames due to mismatched verification data. Frame 1589, with a time difference of 156ms between its acquisition and transmission times, exceeded the preset time deviation threshold of 100ms and was therefore determined to be a lost frame and included in the error frame count. This multi-verification mechanism based on hash values, error correction codes, and timestamps can accurately identify error frames and lost frames during transmission, ensuring the accuracy and integrity of power work order data transmission.
[0060] Furthermore, the method for encrypting information content to obtain encrypted content includes:
[0061] The information content is divided into blocks according to the preset block length based on the information type identifier, thus segmenting the information content into... The information is divided into blocks, and the first block is... Each information block is denoted as ,in From 1 to An integer variable; generate the master key, and use the key derivation function to combine the master key and the first... The block number of each information block Perform the calculation to obtain the first Each block key is denoted as ;
[0062] The first is obtained through a symmetric encryption algorithm. Block key For the Information blocks Encryption is performed to obtain the first Each encrypted block is denoted as ; Use message authentication code algorithm to verify the first One encrypted block Calculation yields the first Each authentication code is recorded as ; will the first One encrypted block and the Authentication code Combining to obtain the first Each encrypted information unit is arranged sequentially to obtain encrypted information data.
[0063] The second network pre-stored asymmetric encryption public key is acquired, the main key is encrypted by using the asymmetric encryption public key through an asymmetric encryption algorithm to obtain encrypted main key data; a current timestamp is generated, the encrypted information data and the current timestamp are operated through a hash algorithm to obtain an integrity check value; the encrypted information data, the encrypted main key data, the current timestamp and the integrity check value are combined to obtain encrypted content.
[0064] Exemplarily, according to the information type identification, the work order data is processed by block encryption, wherein the 800 Chinese characters of the text type fault description are divided into 80 information blocks according to the preset block length of 256 bytes. The 150 KB of the image type on-site photo is divided into 75 information blocks according to the preset block length of 2048 bytes. The 800 KB of the video type fault video is divided into 200 information blocks according to the preset block length of 4096 bytes. The block encryption mode is used because the overall encryption of a large file will increase the transmission risk, and the damage of a single block will not affect the decryption of other blocks, thereby improving the fault tolerance of data transmission. A 256-bit main key is generated, and the main key is iteratively operated with the serial number of each information block through a PBKDF2 key derivation function, thereby generating corresponding block keys for the text blocks 1 to 80, the image blocks 1 to 75 and the video blocks 1 to 200.
[0065] Each block is encrypted by using an AES256 symmetric encryption algorithm. The text block 1 is encrypted by using the corresponding block key to obtain an encrypted block of 272 bytes, the image block 1 is encrypted to obtain an encrypted block of 2064 bytes, and the video block 1 is encrypted to obtain an encrypted block of 4112 bytes. An authentication code of 32 bytes is calculated for each encrypted block through an HMAC-SHA256 message authentication code algorithm, which is used to verify the integrity and authenticity of the block data. Each encrypted block and the corresponding authentication code are combined to obtain an encrypted information unit, the text unit is 304 bytes, the image unit is 2096 bytes, and the video unit is 4144 bytes. All 355 encrypted information units are arranged in the order of text, image and video types, thereby obtaining encrypted information data of a total of 1020 KB.
[0066] The RSA2048 asymmetric encryption public key pre-stored in the external network is acquired, the 256-bit master key is encrypted using the public key, and a 256-byte encrypted master key data is obtained. The current timestamp October 17, 2024, 13:25:15 is generated, accurate to the second level, for preventing replay attacks. The 1020KB encrypted information data and the timestamp are operated by the SHA256 hash algorithm, and a 32-byte integrity check value is obtained, which ensures that the encrypted data is not tampered with during transmission. The 1020KB encrypted information data, 256-byte encrypted master key data, 8-byte current timestamp, and 32-byte integrity check value are combined, and finally 995KB of complete encrypted content is obtained, which is ready for subsequent two-dimensional code encoding transmission.
[0067] Further, the method of converting the encrypted content into a two-dimensional code according to the display pixel size and the display size by two-dimensional code encoding rules and recording the number of encoded two-dimensional codes as the total frame number comprises:
[0068] According to the display size and the display pixel size, the number of accommodation modules of a single two-dimensional code is calculated; according to the number of accommodation modules, the data capacity of a single two-dimensional code is obtained by two-dimensional code encoding rules, which is recorded as single frame data capacity; the total byte number of the encrypted content is calculated, and the ratio of the total byte number to the single frame data capacity is calculated and rounded up to obtain the total frame number.
[0069] Exemplarily, according to the display size 800x600 pixels of the smart key cabinet display module and the optimized display pixel size, the two-dimensional code capacity is calculated, the display pixel size of the text type is 0.60mm, and 133x100 two-dimensional code modules can be accommodated in the 800x600 pixel display area, and a single two-dimensional code contains 13300 data modules. The display pixel size of the image type and the video type is 0.45mm, and 177x133 two-dimensional code modules can be accommodated, and a single two-dimensional code contains 23541 data modules. According to the QR code encoding rule, 13300 modules correspond to version 25 specification, and after deducting the positioning pattern, the correction pattern and the format information, the actual data capacity is 420 bytes. 23541 modules correspond to two-dimensional code version 40 specification, and the actual data capacity is 500 bytes. The reason for using different two-dimensional code versions is that the text type has higher error tolerance and can use smaller version to reduce complexity, while the image and video types need higher data density to reduce the number of transmission frames.
[0070] The encrypted content byte number of each information type and the corresponding total frame number are calculated, wherein the text type encrypted content is 24320 bytes, divided by the single frame data capacity 420 bytes to obtain 57.9, and rounded up to 58 frames. But considering the optimization result of the previous algorithm, the actual transmission scheme of 48 frames is adopted, and the single frame data capacity is adjusted to 507 bytes. The image type encrypted content is 158720 bytes, divided by the single frame data capacity 500 bytes to obtain 317.4, and rounded up to 318 frames, which is close to the optimization result 310 frames. The video type encrypted content is 839680 bytes, divided by the single frame data capacity 500 bytes to obtain 1679.4, and rounded up to 1680 frames, which is basically consistent with the optimization result 1640 frames. The difference of fine adjustment mainly comes from the fact that the genetic algorithm comprehensively considers the balance between transmission efficiency and error rate in the optimization process.
[0071] Finally, the total frame number of the text type is determined as 48 frames, the total frame number of the image type is determined as 310 frames, and the total frame number of the video type is determined as 1640 frames. The total number of two-dimensional codes of all work orders is 1998 frames. According to the optimized display frame interval time, the text transmission time is 3.8s, the image transmission time is 37.2s, the video transmission time is 196.8s, and the cumulative transmission time is 237.8s, about 4min, which meets the timeliness requirement of power rescue. This type of optimized encoding mode fully utilizes the display space and maximizes the transmission efficiency under the premise of ensuring the transmission quality.
[0072] Further, the method for collecting the two-dimensional code sequence by the reading module of the second network and parsing, decrypting, restoring and splicing to obtain the work order data comprises:
[0073] The reading module of the second network continuously collects the two-dimensional code sequence transmitted by the first network display module, performs grayscale processing, binaryzation processing and perspective transformation correction on each two-dimensional code image in the two-dimensional code sequence to obtain a corrected two-dimensional code image; extracts the bright and dark states of the data area of the corrected two-dimensional code image, and converts the bright and dark states of the module into a binary code word sequence;
[0074] The binary code word sequence is separated into a data code word part and an error correction code word part, the data code word part is processed by the Reed-Solomon error correction algorithm to obtain an error-corrected data code word, and the error-corrected data code word is decoded according to the encoding mode to obtain complete frame data;
[0075] The frame number and the corresponding encrypted block are extracted from the complete frame data, the encrypted block is arranged in order according to the frame number and spliced to obtain an encrypted message; the encrypted message is checked and decrypted to obtain an information block, and the information block is spliced and restored to work order data in order according to the frame number.
[0076] Exemplarily, the outer network reading module is configured with an industrial-grade CCD camera to continuously collect the 1998-frame two-dimensional code sequence transmitted by the inner network display module. The camera is set to a shutter speed of 1 / 200 s to ensure clear collection within the display frame interval time. Each collected two-dimensional code image is preprocessed. First, the color image is converted to a 256-level grayscale image through a grayscale algorithm to reduce data processing complexity. Then, the grayscale image is converted to a black-and-white binary image through an adaptive threshold binarization algorithm to eliminate the influence of uneven lighting on recognition accuracy. Finally, the perspective transformation correction algorithm is used to correct the geometric correction of the tilted or deformed two-dimensional code image to ensure the accuracy of subsequent decoding. After preprocessing, a standardized corrected two-dimensional code image is obtained.
[0077] The light and dark states of each functional area module are extracted from the corrected two-dimensional code image according to the QR code standard. The direction and size of the two-dimensional code are identified through the positioning pattern, the module boundary is determined through the correction pattern, and the error correction level and mask mode are obtained through the format information. Each module in the data area is converted to a binary code word sequence according to the rule of black as 1 and white as 0. Taking the 48-frame text type as an example, each frame contains 507 bytes of data corresponding to 4056 binary bits, plus error correction code words, a total of 6348 binary bits. The binary code word sequence is separated into a data code word part of 4056 bits and an error correction code word part of 2292 bits according to the QR code encoding rules. The error correction code word is set to cope with interference and damage during transmission and improve data recovery capability.
[0078] The data code word part is processed through the Reed-Solomon error correction algorithm. The error correction code word detects and repairs transmission errors. Taking the 15th frame of text data as an example, 3 error positions are detected and successfully repaired, and the complete 507-byte error-corrected data code word is obtained. The error-corrected data code word is decoded according to the QR code encoding mode to extract frame number 15 and the corresponding text encryption block data. All 1998 frames of two-dimensional codes are processed in the same way. According to the frame number, each type of encrypted block is arranged and spliced in the order of 1 to 48, 1 to 310, and 1 to 1640, respectively, to obtain text, image, and video encrypted messages.
[0079] The decrypted message after splicing is checked and processed, first, the integrity check value is verified to confirm that the data has not been tampered with, then the RSA private key stored in the external network is used to decrypt the master key, and then the master key is used to derive each block key to perform AES decryption on the encrypted blocks. The authentication code of each block is verified by HMAC to ensure the authenticity of the decrypted data. The decrypted text blocks are spliced according to the sequence numbers 1 to 80 to restore the 800-character fault description, the image blocks are spliced according to the sequence numbers 1 to 75 to restore the 150KB on-site photos, and the video blocks are spliced according to the sequence numbers 1 to 200 to restore the 800KB fault video. Finally, the complete restoration of the power work order data is completed, the external network maintenance scheduling program automatically parses the work order content and distributes it to the corresponding maintenance personnel and drivers, and the entire transmission and analysis process takes about 5 minutes, meeting the real-time requirements of power rescue.
[0080] In the same inventive concept, the embodiment also provides a power grid system file segmentation and encryption transmission system, which is used to execute the power grid system file segmentation and encryption transmission method.
[0081] It should be noted that the specific manner in which the system in the above embodiments performs operations has been described in detail in the embodiments of the above method, and will not be described in detail here.
[0082] Finally, it should be noted that although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to part of the technical features, and any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for encrypted transmission of segmented files in a power grid system, characterized in that, The method includes: Obtain work order data from the power work orders of the first network. The work order data includes information content and information type identifier. Encrypt the information content to obtain encrypted content. Obtain the display size, unit pixel size, and time interval corresponding to the refresh rate of the display module. Set the corresponding error tolerance threshold according to the information type identifier. Work order data is categorized according to information type identifiers, and QR code display parameters are generated for each information type as an initial population. The initial population includes multiple individuals, each representing a QR code display parameter. The QR code display parameters include display pixel size and display frame interval time, where the display pixel size is an integer multiple of the unit pixel size and does not exceed the display size, and the display frame interval time is greater than the time interval corresponding to the refresh rate. The encrypted content is converted into QR codes according to the display pixel size and display size using QR code encoding rules, and the number of encoded QR codes is recorded as the total number of frames. The initial population is iteratively evolved, and the display pixel size and display frame interval time of the winning individual after the iterative evolution are used as the QR code display parameters of the information type. The encrypted content of the first network is converted into a QR code sequence according to the display pixel size corresponding to the information type. The QR code sequence is then displayed and transmitted sequentially by the display module of the first network according to the display frame interval. The QR code sequence is collected, parsed, decrypted, restored, and spliced by the reading module of the second network to obtain the work order data. The method of iteratively evolving the initial population and using the display pixel size and display frame interval of the winning individual after iterative evolution as the display parameters of the information type of QR code includes: The encrypted content of the first network is used to calculate the frame error rate for each individual in the initial population, based on the display pixel size, display frame interval time, and information type identifier. Individuals with frame error rates not exceeding the preset error tolerance threshold corresponding to the information type are selected. From the selected individuals, the individual with the fewest total frames is chosen as the winner. The winner is then subjected to crossover and mutation operations. Individuals obtained from this process are selected with display pixel sizes that are integer multiples of the unit pixel size and do not exceed the display size, and display frame interval times that are greater than the time interval corresponding to the refresh rate, and these are chosen as offspring individuals. The initial population is replaced with offspring individuals, and the iterative evolution steps are repeated until the difference in the total number of frames between the offspring and parent individuals is lower than the preset frame number threshold. The display pixel size and display frame interval time corresponding to the winner after the iterative evolution are used as the QR code display parameters for the information type.
2. The method for encrypted transmission of file segmentation in a power grid system according to claim 1, characterized in that, The frame error rate for information type identified as text is obtained by the second network's reading module parsing and decrypting the QR code sequence into reading content, comparing the reading content with the information content, counting the number of text errors and missing characters in the reading content as the text loss number, and calculating the ratio of the text loss number to the total number of characters in the information content. The frame error rate, which is identified as either image or video type, is obtained by comparing the QR code sequence obtained by the reading module of the second network with the QR code sequence transmitted by the display module of the first network, counting the number of erroneous frames, and calculating the ratio of the number of erroneous frames to the total number of frames.
3. The method for encrypted transmission of file segmentation in a power grid system according to claim 2, characterized in that, The method for comparing the QR code sequence obtained by the reading module of the second network with the QR code sequence transmitted by the display module of the first network includes: Before the display module of the first network transmits the QR code sequence, the encoded data of each frame of QR code is processed using a hash algorithm to obtain a hash value. Then, the Reed-Solomon error correction coding algorithm is used to calculate error correction code data from the encoded data. The hash value and the error correction code data are combined to obtain reference verification data. The reference check data of the frame is denoted as , will the The time of frame QR code transmission is denoted as ,in From 1 to the total number of frames Integer variables; After the second network's reading module collects the QR code sequence, it decodes each frame of the collected QR code to obtain collected coded data. It then calculates the collected hash value using the same hash algorithm as the reference verification data, and calculates the collected error correction code data using the same Reed-Solomon error correction coding algorithm as the reference verification data. Finally, it combines the collected hash value and the collected error correction code data to obtain the collected verification data. The frame acquisition and verification data is denoted as , will the The time when the frame QR code is captured is recorded as ; Calculate the first Frame reference check data The hash value and collected verification data The similarity of the collected hash values is denoted as ; Calculate the first Frame reference check data Error correction code data and collected verification data The Hamming distance of the collected error correction code data is denoted as ;when Below the preset hash similarity threshold or When the preset Hamming distance threshold is exceeded, the first step is determined. The frame is considered an error frame and is included in the error frame count; when and When the time difference exceeds the preset time deviation threshold, the first... The frame is a lost frame and is included in the number of erroneous frames.
4. The method for encrypted transmission of file segmentation in a power grid system according to claim 1, characterized in that, The method for encrypting information content to obtain encrypted content includes: The information content is divided into blocks according to the preset block length based on the information type identifier, thus segmenting the information content into... The information is divided into blocks, and the first block is... Each information block is denoted as ,in From 1 to An integer variable; generate the master key, and use the key derivation function to combine the master key and the first... The block number of each information block Perform the calculation to obtain the first Each block key is denoted as ; The first is obtained through a symmetric encryption algorithm. Block key For the Information blocks Encryption is performed to obtain the first Each encrypted block is denoted as ; Use message authentication code algorithm to verify the first One encrypted block Calculation yields the first Each authentication code is recorded as ; will the first One encrypted block and the Authentication code Combining to obtain the first Each encrypted information unit is arranged sequentially to obtain encrypted information data. Obtain the asymmetric encryption public key pre-stored in the second network, and use the asymmetric encryption public key to encrypt the master key to obtain encrypted master key data; generate the current timestamp, and use a hash algorithm to calculate the integrity check value by operating on the encrypted information data and the current timestamp; combine the encrypted information data, encrypted master key data, current timestamp and integrity check value to obtain encrypted content.
5. The method for file segmentation and encrypted transmission in a power grid system according to claim 1, characterized in that, The method of converting encrypted content into QR codes according to the display pixel size and display size using QR code encoding rules, and recording the number of encoded QR codes as the total number of frames, includes: Calculate the number of modules that a single QR code can accommodate based on the display size and display pixel size; obtain the data capacity of a single QR code based on the number of modules and the QR code encoding rules, and record it as the single frame data capacity; calculate the total number of bytes of encrypted content, calculate the ratio of the total number of bytes to the single frame data capacity, and round up to obtain the total number of frames.
6. The method for encrypted transmission of file segmentation in a power grid system according to claim 5, characterized in that, The method for acquiring QR code sequences through the reading module of the second network, parsing, decrypting, restoring, and splicing them to obtain work order data includes: The second network's reading module continuously acquires the QR code sequence transmitted by the first network's display module. Each QR code image in the QR code sequence is processed by grayscale, binarization, and perspective transformation correction to obtain a corrected QR code image. The brightness and darkness state of the data area extraction module of the corrected QR code image is then converted into a binary codeword sequence. The binary codeword sequence is separated into a data codeword part and an error correction codeword part. The data codeword part is processed by the Reed-Solomon error correction algorithm to obtain the error-corrected data codeword. The error-corrected data codeword is then decoded according to the encoding mode to obtain the complete frame data. Extract the frame number and corresponding encrypted block from the complete frame data. Arrange the encrypted blocks in order according to the frame number and concatenate them to obtain the encrypted message. Verify and decrypt the encrypted message to obtain the information block. Concatenate the information block in order according to the frame number to restore the work order data.
Citation Information
Patent Citations
Image compression transmission system parameter adjustment method and device based on genetic algorithm
CN116916025A
Cross-platform interaction compatibility test method and terminal
CN120256311A