Original data organization encryption, decryption and acquisition method
By compressing and encrypting the detection data of the building's civil structure and checking it during the decryption process, the problem that the detection data is easily tampered with during the collection, transmission and storage is solved, and the authenticity and security of the data are improved.
Patent Information
- Application Number
- CN202510265175.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-24
AI Technical Summary
In the prior art, in the performance parameter detection of buildings' civil structures, the original detection data is easily tampered with or illegally obtained during the collection, transmission and storage process, resulting in the authenticity and security of the data being threatened.
By obtaining the data file group of detection points, applying compression algorithms and encryption algorithms to process the data, generating encrypted data packets, and verifying them using the verification code and geographical location information in the configuration description file during the decryption process to ensure the integrity and authenticity of the data.
It improves the authenticity and security of the detection data, prevents illegal tampering and acquisition of data, and ensures the integrity and reliability of the detection data.
Smart Images

Figure CN120197191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data acquisition, and particularly to a method for encrypting, decrypting, and collecting original data organization. Background Art
[0002] Detecting the performance parameters of the core components and key positions of civil structures of buildings is an effective means to reliably analyze the health status of the inspected buildings. How to ensure the authenticity of the original detection data, prevent the original data from being illegally tampered with, and prevent the accidental loss of intangible assets of the detection data is one of the issues that need attention. In the prior art, detection equipment is mostly used to collect data at detection points to generate original data, and then the data is read and saved through a USB flash drive or a serial port. Because the data adds intermediate links such as export and transfer, there are risks such as the data being tampered with, replaced, and illegally obtained by humans. Summary of the Invention
[0003] The purpose of the present invention is to provide a method for encrypting, decrypting, and collecting original data organization, which can improve the authenticity of the original data.
[0004] To achieve the above purpose, the present invention provides the following solutions:
[0005] An original data organization encryption method, the encryption method includes:
[0006] Obtain a data file group of a detection point; the data file group includes a detection data file and a configuration description data file; the detection data file is the detection data of the detection point; the configuration description data file includes the number of times the detection data has been cumulatively collected, the geographical location data corresponding to the detection point, the time information for collecting the detection data, and a check code;
[0007] Apply a compression algorithm to compress the data file group to obtain an original data packet;
[0008] Apply an encryption algorithm to encrypt the original data packet to obtain an encrypted data packet.
[0009] Optionally, apply the LZMA compression algorithm to compress the data file group.
[0010] Optionally, apply the SM1 encryption algorithm to encrypt the original data packet.
[0011] Optionally, the check code is an MD5 check code.
[0012] Optionally, apply a positioning module to obtain the geographical location data corresponding to the detection point.
[0013] An original data decryption method, applying the above original data organization encryption method, the decryption method includes:
[0014] Obtain the geographical coordinate position of the building to be detected;
[0015] Decrypt the encrypted data packet according to the encryption key to obtain the decrypted data packet;
[0016] Calculate the check code of the decrypted data packet to obtain the decrypted check code;
[0017] Compare the decrypted check code with the check code of the configuration description data file to obtain the first comparison result;
[0018] When the first comparison result meets the first preset condition, extract the geographical location data in the configuration description data file;
[0019] Compare the geographical location data with the geographical coordinate position to obtain the second comparison result;
[0020] When the second comparison result meets the second preset condition, extract the number of times and time information of the detected data collected cumulatively in the configuration description data file;
[0021] When the number of times and time information of the detected data collected cumulatively in the configuration description data file meet the third preset condition, obtain the detected data of the detection point.
[0022] Optionally, the obtaining of the geographical coordinate position of the building to be detected specifically includes:
[0023] Determine the detection point of the building to be detected;
[0024] Locate the geographical location information of the detection point to obtain the geographical coordinate position of the detection point, and use the geographical coordinate position of the detection point as the geographical coordinate position of the building to be detected.
[0025] A raw data acquisition method, which applies the above-mentioned raw data organization encryption method and the above-mentioned raw data decryption method. The acquisition method includes:
[0026] Use a detection device to obtain a data file group of a detection point, process the data file group to obtain an encrypted data packet, and transmit the encrypted data packet to a data processing center;
[0027] The data processing center obtains the geographical coordinate position of the building to be detected, and obtains the detected data of the detection point according to the geographical coordinate position of the building to be detected and the encrypted data packet.
[0028] Optionally, the ways for the detection device to transmit the encrypted data packet to the data processing center include USB flash drive transfer, serial port transmission, and network transmission.
[0029] According to the specific embodiments provided by the present invention, the following technical effects are disclosed by the present invention:
[0030] The present invention obtains a data file group including a detection data file and a configuration description data file at a detection point; applies a compression algorithm to compress the data file group to obtain an original data packet, and applies an encryption algorithm to encrypt the original data packet to obtain an encrypted data packet. By decrypting the encrypted data packet, the detection data is appended with "configuration data file" information, improving the self-description ability of the detection data, and the data processing center can identify unexpected data through this information, improving the authenticity of the original data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0032] Figure 1 It is a practical application flowchart of the original data organization encryption method of the present invention;
[0033] Figure 2 It is a flowchart of the original data organization encryption method of the present invention;
[0034] Figure 3 It is a flowchart of the original data decryption method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0036] The object of the present invention is to provide a method for encrypting, decrypting, and collecting original data, which can improve the authenticity of the original data.
[0037] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the drawings and specific embodiments.
[0038] Embodiment 1
[0039] As Figure 2 shown, the present invention provides an original data organization encryption method, and the encryption method includes:
[0040] Step S101: Obtain a data file group of a detection point; the data file group includes a detection data file and a configuration description data file; the detection data file is the detection data of the detection point; the configuration description data file includes the number of times of the accumulated collected detection data, the geographical location data corresponding to the detection point, the time information of collecting the detection data, and a check code.
[0041] Specifically, the check code is an MD5 check code.
[0042] Further, a positioning module is applied to obtain the geographical location data corresponding to the detection point.
[0043] Step S102: Apply a compression algorithm to compress the data file group to obtain an original data packet.
[0044] Specifically, the LZMA compression algorithm is applied to compress the data file group.
[0045] Step S103: Apply an encryption algorithm to encrypt the original data packet to obtain an encrypted data packet.
[0046] Specifically, the SM1 encryption algorithm is applied to encrypt the original data packet.
[0047] In practical applications, the present invention adds a configuration description file (adding geographical location information, adding time stamp information, adding check code information, adding cumulative count value information). During the data decryption process, the configuration description file is applied to check the MD5 check code to ensure the integrity of the detection data, and check and verify the geographical location information, time stamp information, and cumulative count information to ensure that the detection data is the data detected at the specified location and specified time and that the data that needs to be detected multiple times is not repeated.
[0048] Such as Figure 1 As shown, the steps of the original data organization and encryption method provided by the present invention in the actual application process are as follows:
[0049] The first step: The detection device collects the original test data of a specified detection point of the building to be measured and generates an original detection data file (assuming the data file name is ABC.dat), and enters the second step.
[0050] In the present invention, the original detection data file is the detection data file.
[0051] Step 2: The detection device obtains the geographical location coordinate information and time stamp information of the detection point through the built-in Beidou / GPS function module, creates a configuration description file with the same name (with a different extension, file name: ABC.cfg), and generates a detection data file group (the file group contains two files, namely ABC.dat and ABC.cfg; among them, ABC.dat is the detection data file; ABC.cfg is the configuration description file. Proceed to Step 3.
[0052] Among them, the specific content description of the configuration description file is as follows:
[0053] DevID = YT-DJKT-2311001; The device number is used to identify test device-related information such as the ownership, function, model, and inventory number of the test device.
[0054] ChkNm = 10201; The cumulative count value generated by the test increments by 1 for each test. Pos_X = +113.17; The longitude of the test geographical location.
[0055] Pos_Y = +23.03; The latitude of the test geographical location.
[0056] DDate = 2023-11-10; The test date, Beijing time.
[0057] DTime = 16:27; The test time, Beijing time.
[0058] FTMD5 = d7c0a9e5f081ef310d0ef51be6869fcdfbd917db; The MD5 checksum of the detection data file is used to verify the integrity of the file.
[0059] In the present invention, the configuration description file is also referred to as the configuration description data file. The detection data file group is also referred to as the data file group.
[0060] Step 3: The detection device compresses the detection data file group using the LZMA compression algorithm to generate the original data packet (ABC.pkg), and proceeds to Step 4. Among them, the original data packet (ABC.pkg) is the detection data file packet in Step 4.
[0061] Step 4: The detection device encrypts the detection data file packet using the national secret SM1 encryption algorithm to generate the encrypted data packet (ABC.spk).
[0062] Among them, the SM1 algorithm is a commercial cipher block standard symmetric algorithm. This algorithm, the SM1 block cipher algorithm, has a block length and a key length of 128 bits. The security and secrecy strength of the algorithm and the performance of related software and hardware implementations are comparable to AES. This algorithm is not publicly available and only exists in the form of an IP core in the chip.
[0063] Example 2
[0064] Based on Example 1, the present invention provides a method for decrypting original data, as Figure 3 shown, the decryption method includes:
[0065] Step S201: Obtain the geographical coordinate position of the building to be detected.
[0066] Specifically, S201 includes:
[0067] Step S2011: Determine the detection points of the building to be detected.
[0068] Step S2012: Perform GPS geographical location information positioning on the detection points, obtain the geographical coordinate positions of the detection points, and use the geographical coordinate positions of the detection points as the geographical coordinate positions of the building to be detected.
[0069] Step S202: Decrypt the encrypted data packet according to the encryption key to obtain a decrypted data packet.
[0070] Step S203: Calculate the check code of the decrypted data packet to obtain a decrypted check code.
[0071] Step S204: Compare the decrypted check code with the check code of the configuration description data file to obtain a first comparison result.
[0072] Step S205: When the first comparison result meets the first preset condition, extract the geographical location data in the configuration description data file.
[0073] Specifically, the first preset condition is that the decrypted check code is consistent with the check code of the encrypted data packet.
[0074] Step S206: Compare the geographical location data with the geographical coordinate position to obtain a second comparison result.
[0075] Step S207: When the second comparison result meets the second preset condition, extract the number of times and time information of the detected data collected cumulatively in the configuration description data file.
[0076] Specifically, the second preset condition is that the geographical location data is consistent with the geographical coordinate position.
[0077] Step S208: When the number of times and time information of the detected data collected cumulatively in the configuration description data file meet the third preset condition, obtain the detected data of the detection points.
[0078] Specifically, the third preset condition is that the number of times of the detection data accumulated in the configuration description data file is inconsistent with the number of times of the detection data accumulated at the corresponding existing detection point, and the time information is consistent with the date arranged in the work log of the detector at this detection point.
[0079] The execution steps of the original data decryption method provided by the present invention in practical applications are as follows:
[0080] The first step: Submit the data to the data center by corresponding means, such as USB flash drive transfer, serial port, network transmission, etc., and enter the second step.
[0081] The second step: The data center receives the encrypted data packet and decrypts the data packet according to the encryption key. If the decryption is successful, enter the third step, otherwise enter the sixth step.
[0082] The third step: Calculate the MD5 checksum of the detection data file and compare it with the MD5 checksum stored in the configuration description file to confirm the integrity of the data file. If they are the same, enter the fourth step, otherwise enter the sixth step.
[0083] Among them, MD5 (Message-Digest Algorithm 5), that is, the fifth version of the message digest algorithm. MD5 treats the entire file as a large text message and generates a unique MD5 message digest through an irreversible string transformation algorithm. It is used for the receiving party to recalculate the MD5 result after receiving the file to compare and know whether the file is downloaded completely or whether it has been tampered with during the transmission process.
[0084] The fourth step: Extract the geographic coordinate information in the configuration description file and compare it with the geographic coordinate position of the building to be detected. If it is correct, enter the fifth step, otherwise enter the sixth step.
[0085] Before preparing to collect detection data for the building to be tested, it is first necessary to determine the detection points of the building to be tested. After determining the detection points, perform GPS geographic location information positioning on the detection positions, and then the longitude and latitude information of the corresponding detection points can be obtained. This longitude and latitude information is used as the attached information for establishing a file for the detection project. After receiving the encrypted detection data packet, decrypting and decompressing it to restore it to a detection data file group, extract the geographic coordinate information from the configuration description file, and compare it with the attached longitude and latitude information of the project, then it can be known whether the detection data is the effective detection data collected at the specified longitude and latitude position.
[0086] The fifth step: Extract the test cumulative value in the configuration description file, which should have no duplication with the test cumulative value of the existing test data. At the same time, extract the date and time stamp information in the configuration description file and compare it with the date and time stamp arranged in the work log. If it is correct, complete this round of testing, otherwise enter the sixth step.
[0087] In order to prevent testers from repeatedly submitting an existing test data as new test data, or submitting a single test data as multiple test data, the date attached to the configuration file is used to avoid repeated submission of old data, and the test cumulative number is used to prevent one data from being used to impersonate multiple test data. The test cumulative value is automatically maintained by the test equipment. Each time the equipment is started for a test, the cumulative value is automatically increased by 1.
[0088] After each test data submission, the attached configuration description file information is also saved to the server together with the test data for permanent storage. When new test data is submitted, the server searches the database to determine that there should be no duplicate test cumulative values.
[0089] Step 6: If the test data is unqualified, please conduct a second test.
[0090] Embodiment 3
[0091] Based on the second embodiment, the present invention provides a method for collecting raw data, the method comprising:
[0092] Step S301: using a detection device to obtain a data file group of a detection point, and processing the data file group to obtain an encrypted data packet, and transmitting the encrypted data packet to a data processing center.
[0093] Step S302: The data processing center obtains the geographic coordinate position of the detected building, and obtains the detection data of the detection point according to the geographic coordinate position of the detected building and the encrypted data packet.
[0094] As a specific implementation method, the detection device transmits the encrypted data packet to the data processing center in the following ways: USB disk transfer, serial port transmission and network transmission.
[0095] In addition, the collection of raw data is fully closed-loop managed and automatically uploaded to the data center via the network after collection, reducing the number of human intermediate links. However, the requirements for hardware resources and working environment are relatively high.
[0096] Compared with the prior art, the present invention has the following advantages:
[0097] First: ensure that the data is authentic and valid original data.
[0098] Second: ensure that the data is the original data collected at the specified time and location.
[0099] Third: Keep the data confidential and prevent unauthorized personnel from using it, thus ensuring the value of the data.
[0100] Fourth: By encrypting the original monitoring data, it is possible to prevent artificial data tampering and ensure the authenticity of the original sampling data;
[0101] Fifth: By attaching geographical coordinate information and data collection time stamps to the original detection data, it is ensured that the data is collected at a specified location and at a specified time.
[0102] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.
[0103] In this article, specific examples are used to elaborate on the principles and implementation methods of the present invention. The descriptions of the above embodiments are only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for encrypting raw data, characterized in that: The encryption method comprises: Acquire a data file group of a detection point; the data file group includes a detection data file and a configuration description data file; the detection data file is the detection data of the detection point; the configuration description data file includes the cumulative number of times the detection data is collected, the geographical location data corresponding to the detection point, the time information of collecting the detection data, and a check code; Applying a compression algorithm to compress the data file group to obtain an original data packet; The original data packet is encrypted using an encryption algorithm to obtain an encrypted data packet.
2. The original data organization encryption method according to claim 1, characterized in that: The data file group is compressed using the LZMA compression algorithm.
3. The original data organization encryption method according to claim 1, characterized in that: The original data packet is encrypted using the SM1 encryption algorithm.
4. The original data organization encryption method according to claim 1, characterized in that: The verification code is an MD5 verification code.
5. The original data organization encryption method according to claim 1, characterized in that: The positioning module is applied to obtain the geographical location data corresponding to the detection point.
6. A method for decrypting original data, using the original data organization encryption method according to any one of claims 1 to 5, characterized in that: The decryption method comprises: Get the geographic coordinates of the detected building; Decrypt the encrypted data packet according to the encryption key to obtain a decrypted data packet; Calculating the check code of the decrypted data packet to obtain a decryption check code; Compare the decryption verification code with the verification code of the configuration description data file to obtain a first verification result; When the first checking result satisfies a first preset condition, extracting geographic location data from the configuration description data file; Compare the geographical location data with the geographical coordinate position to obtain a second comparison result; When the second verification result meets the second preset condition, extracting the number of times and time information of the cumulatively collected detection data in the configuration description data file; When the number of times and time information of the cumulatively collected detection data in the configuration description data file meet the third preset condition, the detection data of the detection point is obtained.
7. The original data decryption method according to claim 6, characterized in that: The obtaining of the geographical coordinate position of the detected building specifically includes: Determining the inspection point of the inspected building; The detection point is positioned according to its geographical location information to obtain the geographical coordinate position of the detection point, and the geographical coordinate position of the detection point is used as the geographical coordinate position of the detected building.
8. A method for collecting raw data, using the method for organizing and encrypting raw data described in claims 1-5 and the method for decrypting raw data described in claims 6-7, characterized in that: The collection method comprises: Using the detection device to obtain the data file group of the detection point, and processing the data file group to obtain an encrypted data packet, and transmitting the encrypted data packet to the data processing center; The data processing center obtains the geographical coordinate position of the detected building, and obtains the detection data of the detection point according to the geographical coordinate position of the detected building and the encrypted data packet.
9. The method for collecting raw data according to claim 8, characterized in that: The detection device transmits the encrypted data packet to the data processing center in the following ways: U disk transfer, serial port transmission and network transmission.