Raw material whole-process detection method and system
By adopting the full-process raw material testing methods and systems in the construction project quality supervision system, and using biological data and dual verification mechanisms, the safety hazards existing in the supervision unit in the sample inspection and certificate management process are solved, and the safety of the inspection certificate and the transparency of the project quality are improved.
Patent Information
- Application Number
- CN202411879301.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the construction project quality supervision system, the supervision unit has safety hazards in the process of sample inspection and certificate management, which may lead to leakage or tampering of the inspection certificate, threatening the authenticity and credibility of the project quality.
A full-process detection method and system of raw materials is adopted. This method requires users to provide biological data before viewing the detection certificate, generate a verification key through a preset verification algorithm, and use the pre-stored verification ciphertext and the decrypted private key provided by the user to achieve dual verification to ensure that only users with the correct biometrics and private keys can access and verify the detection certificate.
It effectively prevents unauthorized personnel from accessing sensitive information, reduces the risk of certificate leakage, ensures the integrity and credibility of the inspection certificate, and improves the security of the system and the transparency of engineering quality.
Smart Images

Figure CN119892367A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular to a full-process detection method and system for raw materials. Background Art
[0002] In the current construction project quality supervision system, supervision units play a vital role. They are responsible for supervising the construction process of construction units to ensure that they comply with design specifications and safety standards. In order to ensure the quality of the project, supervision units often need to send the samples to be tested by the construction units, such as concrete test blocks, steel bars, welds, etc., to third-party testing agencies with relevant qualifications for detailed testing. This process aims to verify the performance of construction materials and the reliability of structures through professional technical means, thereby ensuring the long-term safety and stability of buildings.
[0003] At present, in traditional practices, the supervision unit, as the inspection party, is not only responsible for the collection and delivery of samples, but may also directly participate in or manage the receipt and storage of test certificates. Under this operation mode, if the internal management measures of the supervision unit are not strict enough, or there is human negligence, it may provide opportunities for criminals or irrelevant personnel to have access to sensitive test certificate information. Once the test certificate is viewed by unauthorized personnel, it may not only leak the internal quality control data of the project, but also lead to more serious consequences, such as the certificate content being maliciously tampered with to meet certain improper interests, which will directly threaten the authenticity and credibility of the project quality.
[0004] Therefore, there is an urgent need for a full-process detection method and system for raw materials to improve the safety of full-process detection of raw materials. Summary of the invention
[0005] The present application provides a method and system for full-process detection of raw materials, which is convenient for improving the safety of full-process detection of raw materials.
[0006] In a first aspect of the present application, a full-process inspection method for raw materials is provided, the method comprising: responding to a user's operation of viewing an inspection certificate and obtaining the user's biometric data, the inspection certificate being a certificate generated after supervision and inspection of the target raw materials; generating a verification key based on the biometric data using a preset verification algorithm; obtaining a pre-stored verification ciphertext, the verification ciphertext being encrypted verification data generated based on the inspection certificate; decrypting the verification ciphertext using a preset decryption algorithm based on the verification key to obtain a first verification text; obtaining a decryption private key input by the user, decrypting the obtained ciphertext data to obtain decrypted data; performing a hash operation on the decrypted data to obtain a second verification text; if it is confirmed that the first verification text is the same as the second verification text, determining that the decrypted data is the inspection certificate.
[0007] By adopting the above technical solution, the method effectively prevents unauthorized persons from accessing sensitive information by requiring users to provide biometric data before viewing the test certificate. Biometric data has become a powerful means of identity verification due to its uniqueness and difficulty in duplication, greatly reducing the risk of certificate leakage. The method not only relies on biometric data to generate a verification key for preliminary identity verification, but also realizes double verification through a preset verification ciphertext and a decryption private key provided by the user. This double verification mechanism ensures that only users who have both the correct biometrics and the private key can access and verify the authenticity of the test certificate, further improving the security of the system. By comparing the first verification original and the second verification original, the method can accurately determine whether the test certificate has been tampered with. Any illegal modification of the test certificate will be exposed during the verification process, thereby effectively maintaining the integrity and credibility of the certificate. Although the verification steps are added, the automation of these steps ensures that the entire process is fast and efficient. At the same time, by providing a verifiable test certificate, the transparency and credibility of the project quality are enhanced. Therefore, it is convenient to improve the security of the whole process detection of raw materials.
[0008] Optionally, the verification key is generated based on the biological data using a preset verification method, specifically including: converting the biological data into binary data; splitting the binary data into groups to obtain multiple groups of sub-data; encoding each group of the sub-data to obtain multiple encoding results; randomly inserting each of the encoding results into the corresponding sub-data to obtain multiple encoded data; according to the order of each group of the sub-data, sorting and merging the multiple encoded data to obtain an encryption key; based on the encryption key, using an asymmetric encryption algorithm to generate the verification key.
[0009] By adopting the above technical solution, first, the biological data is converted into binary data, which is the basic step of data digitization and makes subsequent processing possible. By grouping the binary data, the original data can be further dispersed, increasing the complexity and processing difficulty of the data, thereby improving the security of the data. Each group of sub-data is encoded. This process not only retains some characteristics of the original data, but also confuses it, making it difficult for unauthorized persons to restore the original biological data from the encoding result. The encoding result is randomly inserted into the corresponding sub-data, which further increases the unpredictability and complexity of the data. Even if part of the data is intercepted, it is difficult to infer the complete biological data or verification key. The encoded data is sorted and merged according to the order of the sub-data. This process ensures that the generation of the encryption key is based on the integrity and order of the original biological data. Any tampering with the original data will affect the encryption key finally generated. As an intermediate step in generating the verification key, the complexity and randomness of the encryption key are directly related to the security of the verification key. Through this process, even if the attacker obtains part of the information of the encryption key, it is difficult to directly derive the verification key. The use of asymmetric encryption algorithms to generate verification keys takes advantage of asymmetric encryption in key management and data transmission, ensuring that only users with private keys can correctly decrypt and verify the test certificate. This method not only improves the security of data transmission, but also makes the verification process more flexible and efficient. Users only need to use the private key to decrypt specific encrypted data to verify the authenticity of the test certificate without having to transmit the entire certificate or perform complex online verification operations.
[0010] Optionally, before obtaining the pre-stored verification ciphertext, the method further includes: receiving the detection certificate sent by the user device; performing a hash operation on the detection certificate to obtain a verification original text; and encrypting the verification original text using a preset encryption algorithm according to the encryption key to obtain the verification ciphertext.
[0011] By adopting the above technical solution, after receiving the test certificate sent by the user device, a hash operation is first performed on it to obtain the verification text. This step ensures that the test certificate has not been tampered with during the transmission process, because any slight modification to the certificate will cause the hash value to change. According to the encryption key previously generated by the biometric data, the verification text is encrypted using a preset encryption algorithm to obtain the verification ciphertext. The encryption process of this step ensures the security of the verification text. Even if the verification ciphertext is intercepted during storage or transmission, the attacker cannot directly obtain the original verification text or the content of the test certificate, because the decryption process requires the corresponding private key or encryption key, which is securely stored and difficult to obtain. By converting the test certificate into a verification text and then encrypting the verification text to obtain the verification ciphertext, this process provides the necessary data preparation for the subsequent verification steps. In the verification stage, the user needs to provide his own biometric data to generate a verification key, and then use the verification key to decrypt the pre-stored verification ciphertext to obtain the first verification text. At the same time, the user also needs to provide a decryption private key to decrypt another set of encrypted data to obtain the second verification text. The comparison result of the two verification texts will determine the authenticity of the test certificate. The design of this process enhances the security and credibility of the entire verification system. Through the combination of hashing and encryption technology, the integrity and confidentiality of the test certificate during storage, transmission and verification are ensured. At the same time, by introducing biometric data as a means of identity verification, the security of the system is further improved, preventing unauthorized users from accessing and tampering with the test certificate.
[0012] Optionally, before obtaining the decryption private key input by the user, the method further includes: obtaining an input timestamp and positioning data when the user inputs; converting the positioning data into a positioning code; and randomly inserting the positioning code into the input timestamp to obtain the decryption private key.
[0013] By adopting the above technical solution, by obtaining the input timestamp when the user inputs, it can be ensured that the generation of the decryption private key is closely related to time. This means that even if someone obtains the user's biometric data or other identity verification information, if this information is not entered within the correct time window, the decryption private key cannot be successfully generated. This timeliness requirement increases the difficulty for attackers to use stolen information for malicious operations. The user's location data is obtained and converted into a location code, and then the location code is randomly inserted into the input timestamp. This step introduces the geographic location factor as part of the identity verification. This means that the user must enter at a specific geographic location to successfully generate the decryption private key. This geographic location constraint further improves the security and accuracy of the identity verification. The process of randomly inserting the location code into the input timestamp not only increases the complexity of the private key, but also makes it more random and unpredictable. Even if the attacker can intercept the timestamp and location data entered by the user, it is difficult for them to accurately infer the complete form of the decryption private key because the random insertion method of the location code is unknown. Since the generation of the decryption private key depends on the timestamp and location data, both of which are dynamically changing, it is difficult for attackers to obtain the private key through brute force or replay attacks. Brute force cracking requires trying a large number of possible private key combinations, but the real-time nature of timestamps and location data makes this attempt impractical. A replay attack is when an attacker reuses previously intercepted valid identity verification information, but due to the real-time requirements of timestamps and location data, this attack is also difficult to succeed. This process not only increases the complexity of identity verification, but it also improves user experience and security. Users only need to enter relevant information at the right time and place to easily generate a decryption private key. At the same time, since timestamps and location data are introduced as part of identity verification, it is more difficult for attackers to bypass the identity verification mechanism, thereby improving the security of the entire system.
[0014] Optionally, before obtaining the decryption private key input by the user and decrypting the obtained ciphertext data to obtain the decrypted data, the method also includes: generating an encryption public key based on the decryption private key using an asymmetric encryption algorithm; and encrypting the detection certificate based on the encryption public key to obtain the ciphertext data.
[0015] By adopting the above technical solution, using an asymmetric encryption algorithm to generate an encrypted public key, and using the public key to encrypt the test certificate, the security of the test certificate during transmission and storage can be ensured. The characteristics of the asymmetric encryption algorithm enable only users with the corresponding private key to decrypt the data encrypted by the public key, which greatly enhances the confidentiality of the data. The encryption process not only protects the confidentiality of the data, but also ensures the integrity and authenticity of the data. During the encryption process, any tampering with the test certificate will cause the decrypted data to be unable to be correctly restored, so that the integrity of the data can be easily detected. At the same time, since only legitimate users can decrypt the data, this also ensures the authenticity of the data. By generating an encrypted public key by decrypting the private key, the flexible use of the key is realized. The user only needs to remember or store a private key, and can generate the corresponding public key for data encryption as needed. This design simplifies the complexity of key management and improves the availability and user-friendliness of the system. During data transmission, the use of public key encryption can effectively prevent man-in-the-middle attacks. Even if the attacker intercepts the encrypted data packet, they cannot decrypt and tamper with the data because they cannot obtain the corresponding private key. This ensures the security and integrity of the data during transmission.
[0016] Optionally, the method further includes: if it is confirmed that the first verification text and the second verification text are different, generating alarm data; sending the alarm data to an inspector who supervises the inspection of the target raw material, and the alarm data is used to remind the inspector that there is a risk of leakage of the inspection certificate.
[0017] By adopting the above technical solution, by comparing the first verification original and the second verification original, the system can promptly detect the inconsistency between the two. This inconsistency often means that the test certificate may be at risk of being leaked or tampered with to some extent, thereby triggering the alarm mechanism. This ability to promptly detect potential safety issues is crucial to ensuring the authenticity and accuracy of raw material supervision and testing. Once the alarm data is generated, the system can quickly send this information to the relevant testers. This enables the testers to immediately realize the existence of the problem and take appropriate measures to investigate and deal with it. This efficient response mechanism helps to reduce delays and losses caused by safety issues. By introducing the alarm mechanism, the system can issue warnings in a timely manner when potential safety issues are detected, thereby enhancing the reliability and credibility of the system, which helps to improve users' trust in the system.
[0018] Optionally, the method further includes: obtaining a current storage node storing the detection certificate; sending the detection certificate to a target storage node for backup storage, the storage node including the current storage node, and the target storage node being any one of the multiple storage nodes.
[0019] By adopting the above technical solution, the system achieves data redundancy by backing up and storing the test certificate in any one of multiple storage nodes. This means that even if the current storage node fails or data is lost, the test certificate can still be restored from the target storage node, thereby enhancing the system's fault tolerance and data recovery capabilities. Data redundancy not only enhances fault tolerance, but also improves data availability and reliability. Backing up and storing the test certificate in multiple storage nodes ensures that the data can be accessed from at least one node at any time, thereby ensuring the continuity and accuracy of the supervision and inspection work. Backing up and storing in multiple nodes can also achieve load balancing. When the access volume or data volume on a storage node is too large, the system can assign new backup tasks to other nodes to avoid single point overload and optimize overall performance. By restoring data from the backup node, the system can quickly resume normal operation and reduce losses caused by data loss.
[0020] The present application also provides a full-process detection system for raw materials, which includes an acquisition module and a processing module, wherein the acquisition module is used to respond to the user's operation of viewing the detection certificate and obtain the user's biometric data, and the detection certificate is a certificate generated after the target raw materials are supervised and tested; the processing module is used to generate a verification key based on the biological data using a preset verification algorithm; the acquisition module is also used to obtain a pre-stored verification ciphertext, and the verification ciphertext is encrypted verification data generated based on the detection certificate; the processing module is also used to decrypt the verification ciphertext using a preset decryption algorithm based on the verification key to obtain a first verification text; the acquisition module is also used to obtain the decryption private key input by the user, decrypt the obtained ciphertext data, and obtain decrypted data; the processing module is also used to perform a hash operation on the decrypted data to obtain a second verification text; the processing module is also used to determine that the decrypted data is the detection certificate if it is confirmed that the first verification text is the same as the second verification text.
[0021] In the third aspect of the present application, an electronic device is provided, which includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device performs the method described above.
[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, the method described above is executed.
[0023] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages: By requiring users to provide biometric data before viewing the test certificate, the method effectively prevents unauthorized personnel from accessing sensitive information. Biometric data, due to its uniqueness and difficulty in duplication, has become a powerful means of identity verification, greatly reducing the risk of certificate leakage. The method not only relies on biometric data to generate a verification key for preliminary identity verification, but also implements double verification through a preset verification ciphertext and a decryption private key provided by the user. This double verification mechanism ensures that only users who have both the correct biometrics and the private key can access and verify the authenticity of the test certificate, further improving the security of the system. By comparing the first verification original and the second verification original, the method can accurately determine whether the test certificate has been tampered with. Any illegal modification of the test certificate will be exposed during the verification process, thereby effectively maintaining the integrity and credibility of the certificate. Although the verification steps are added, the automation of these steps ensures that the entire process is fast and efficient. At the same time, by providing a verifiable test certificate, the transparency and credibility of the project quality are enhanced. Therefore, it is convenient to improve the security of the whole process of raw material testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic flow chart of a full-process detection method for raw materials provided in an embodiment of the present application.
[0025] Figure 2 Another schematic diagram of the process of a full-process detection method for raw materials provided in an embodiment of the present application.
[0026] Figure 3 A module schematic diagram of a full-process detection system for raw materials provided in an embodiment of the present application.
[0027] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0028] Explanation of the reference numerals: 31, acquisition module; 32, processing module; 41, processor; 42, communication bus; 43, user interface; 44, network interface; 45, memory. DETAILED DESCRIPTION
[0029] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0030] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0031] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0032] In the quality control system of construction projects, the supervision unit occupies a pivotal position. Its responsibility is to closely monitor the operation process of the construction unit and ensure that it strictly follows the design blueprint and safety regulations. In order to maintain the high standard of project quality, the supervision unit needs to transfer the samples to be inspected provided by the construction unit, such as concrete test blocks, steel bar materials and weld samples, to a third-party testing agency with corresponding professional qualifications for in-depth and detailed testing. The core of this process is to use high-precision and cutting-edge technical means to verify the mechanical properties and structural stability of building materials, thereby laying a solid foundation for the long-term safety and stability of the building.
[0033] However, in the traditional operation mode, the supervision unit, as the subject of inspection, not only undertakes the task of collecting and transporting samples, but may also directly intervene in the receipt and storage of test reports. Under this operating mechanism, if the internal control mechanism of the supervision unit is not rigorous enough, or there are human errors, it may create opportunities for lawbreakers or unrelated personnel to access sensitive test report information. Once the test report falls into unauthorized hands, it may not only lead to the leakage of internal quality control data of the project, but also induce more serious consequences, such as the malicious tampering of the report content to cater to illegal interests, which will seriously damage the authenticity of the project quality and the public's trust.
[0034] In order to improve the safety of the whole process detection of raw materials, this application provides a whole process detection method of raw materials, referring to Figure 1 , Figure 1A schematic diagram of a whole-process detection method for raw materials provided in an embodiment of the present application. The whole-process detection method for raw materials is applied to a server, including steps S110 to S170, which are as follows: S110, in response to the user's operation of viewing the inspection certificate, and obtaining the user's biometric data, the inspection certificate is a certificate generated after the supervision inspection of the target raw material.
[0035] Specifically, the user requests to view the test certificate of a target raw material in some way, such as accessing it through the testing software. After receiving this request, the server will process it accordingly. While processing the user's request to view the test certificate, the server will also obtain the user's biometric data. Biometric data includes fingerprints, facial recognition information, iris scans, etc., which are used for identity verification or security purposes. The test certificate is generated after supervision and testing of a specific target raw material, such as construction materials. Supervision and testing involves many aspects, such as quality, safety, compliance, etc., with the aim of ensuring that the raw materials meet relevant standards or regulations. The generated test certificate will record the results and conclusions of the test in detail, and is an important document to prove the quality and safety of the raw materials.
[0036] S120: Generate a verification key based on the biometric data using a preset verification algorithm.
[0037] Specifically, the server receives the user's biometric data, which may include fingerprints, facial features, iris scans, etc. Biometric data is unique and difficult to copy, so it is used as a reliable means of identity verification. The server uses a pre-set verification algorithm to process the biometric data. This algorithm can be based on a hash function or other mathematical transformation, and its purpose is to convert the biometric data into a string of fixed length, namely the verification key. The application of the preset verification algorithm ensures the security, accuracy and efficiency of the conversion process. By running the preset verification algorithm, the server converts the biometric data into a verification key. This verification key is a unique string that represents the user's biometric characteristics and can be used for subsequent identity verification, data encryption or other security-related operations.
[0038] In a possible implementation, a verification key is generated based on biological data using a preset verification method, specifically including: converting the biological data into binary data; splitting the binary data into groups to obtain multiple groups of sub-data; encoding each group of sub-data to obtain multiple encoding results; randomly inserting each encoding result into the corresponding sub-data to obtain multiple encoded data; sorting and merging the multiple encoded data according to the order of each group of sub-data to obtain an encryption key; and generating a verification key based on the encryption key using an asymmetric encryption algorithm.
[0039] Specifically, the server converts the user's biometric data, such as fingerprints and facial features, into a binary form that can be processed by a computer, that is, the biometric image or signal is digitized to obtain a binary data stream consisting of 0s and 1s. Next, the server will split this binary data stream into multiple smaller data blocks or sub-data. The purpose of this is to make it easier to manage and operate this data during subsequent processing. The server will perform some form of encoding on each set of sub-data, such as using a hash function, encryption algorithm, or other mathematical transformation. This encoding process is to increase the complexity and security of the data, making it more difficult to directly restore or crack the original data. Among them, the server will insert the encoding result of each sub-data back into the corresponding sub-data in a random manner. The purpose of this is to further confuse the data and increase the difficulty of cracking.
[0040] Next, the server will reorder and merge these encoded and randomly inserted sub-data into a whole according to the order of the original sub-data. This merged data is the encryption key, which contains all the information of the original biometric data, but in a more complex and difficult to crack form. The last step is to use asymmetric encryption algorithms such as RSA, ECC, etc. to generate a verification key. In this process, the encryption key will be used as input and processed by an asymmetric encryption algorithm to generate a unique verification key. This verification key can be used for subsequent identity verification, data encryption or other security-related operations.
[0041] S130, obtaining a pre-stored verification ciphertext, where the verification ciphertext is encrypted verification data generated based on the detection certificate.
[0042] Specifically, a piece of encrypted data has been pre-stored on the server, which is the verification ciphertext. The verification ciphertext is used in the subsequent security verification process to ensure that only users who hold the correct key or meet specific conditions can pass the verification. Among them, the verification ciphertext is not generated arbitrarily, but is generated based on the detection certificate. By using the encryption algorithm and the detection certificate, a unique, encrypted verification ciphertext can be generated. Even if the verification ciphertext is intercepted during transmission, the attacker cannot easily parse the original detection certificate information because the verification ciphertext is encrypted. The verification ciphertext contains some form of verification or signature, which can ensure that the data has not been tampered with during transmission. If the verification ciphertext is found to be inconsistent with the pre-stored version after reaching the server, the server can refuse to accept the data, thereby preventing potential malicious behavior. The server only needs to store and verify the encrypted verification ciphertext, and does not need to store and process the original detection certificate. This can greatly simplify the server's storage and verification process and improve the efficiency and response speed of the system. Since the verification ciphertext is generated based on the detection certificate and does not directly contain the user's sensitive information, even if the verification ciphertext is leaked, it will not directly expose the user's personal privacy. In some cases, the server may not be able to access the detection certificate in real time. By pre-storing the verification ciphertext, the server can perform verification in an offline state to ensure the availability and reliability of the system.
[0043] S140. Decrypt the verification ciphertext using a preset decryption algorithm according to the verification key to obtain a first verification original text.
[0044] Specifically, the decryption algorithm is a mathematical process corresponding to the encryption algorithm, which is used to restore the encrypted data to the original text data. The preset decryption algorithm means that this algorithm is pre-defined and the server knows how to use it for decryption operations. The correctness of the decryption algorithm depends on whether it matches the algorithm used for encryption and whether the key is correct. The verification ciphertext is the encrypted data previously encrypted by the encryption algorithm and key. The server uses the verification key and the preset decryption algorithm to decrypt the verification ciphertext in order to restore the original text data before encryption. After the decryption operation is successful, the server will obtain a decrypted text data. The first verification text contains information about the original data before encryption, which can be used for subsequent verification or processing.
[0045] S150: Obtain a decryption private key input by a user, decrypt the obtained ciphertext data, and obtain decrypted data.
[0046] Specifically, the user has a decryption private key, which is the key information used to decrypt specific encrypted data. The user may provide his decryption private key to the server through some security mechanism, such as login verification, key management service, etc. The server needs to ensure that its confidentiality and integrity are maintained during the process of receiving and decrypting the private key. The server uses the decryption private key provided by the user and the corresponding decryption algorithm to decrypt the ciphertext data, which corresponds to the algorithm used for encryption. The correctness of the decryption algorithm depends on whether it matches the algorithm used for encryption and whether the decryption private key is correct. After the decryption operation is successful, the server will obtain a decrypted text data, that is, the decrypted data. The decrypted data contains the information of the original data before encryption, which can be used for subsequent processing or displayed to the user.
[0047] S160, performing a hash operation on the decrypted data to obtain a second verification text.
[0048] Specifically, the server uses a hash function, such as SHA-256, MD5, etc., to perform a hash operation on the decrypted data. The hash function is designed so that even if the input data has only a slight change, the output hash value will be very different. The result of the hash operation is a hash value of a fixed length, namely the second verification text, which is used to verify the integrity of the data or as a unique identifier of the data. Due to the one-way and collision resistance of the hash function, that is, it is difficult to find two different inputs that produce the same hash value, the second verification text can be used to detect whether the data has been tampered with during transmission or storage.
[0049] S170: If it is confirmed that the first verification text is the same as the second verification text, the decrypted data is determined to be a detection certificate.
[0050] Specifically, the server verifies whether the decrypted data is consistent with the original data by comparing the two verification texts. If the server confirms that the first verification text is the same as the second verification text, then it can be considered that the decrypted data is valid and matches the original test certificate. In this case, the server will determine that the decrypted data is the expected test certificate and may use it for subsequent processing, verification or storage operations. For example, after a batch of raw materials is tested, a corresponding test certificate will be generated. When the first verification text provided by the user is the same as the second verification text stored in the server, the user is allowed to view the test certificate.
[0051] In a possible implementation, before obtaining the pre-stored verification ciphertext, a test certificate sent by a user device is received; a hash operation is performed on the test certificate to obtain a verification original text; and the verification original text is encrypted using a preset encryption algorithm based on an encryption key to obtain a verification ciphertext.
[0052] Specifically, the server receives the test certificate from the user device, such as a mobile phone, computer, etc. After receiving the test certificate, the server uses a hash function to perform a hash operation on it to obtain the verification text. The verification text serves as the unique identifier or summary of the test certificate for subsequent data verification and integrity check. After obtaining the verification text, the server uses a preset encryption algorithm, such as AES, RSA, etc., and an encryption key to encrypt the verification text. The encryption key is a secret key used to encrypt and decrypt data. It can be a symmetric key, such as an AES key, or a private key in an asymmetric key pair, such as an RSA private key. The encrypted data is called the verification ciphertext. The verification ciphertext is an encrypted version of the verification text, which is used for verification or comparison in subsequent steps.
[0053] For example, suppose there is an online testing system, and the user needs to upload the test certificate to the system for verification. The system requires the user to upload a verification ciphertext generated by the user at the same time as uploading the test certificate, so that the system can verify it. The user first uses a hash function to hash the test certificate to obtain the verification text. Then, the user selects an encryption key and encrypts the verification text using a preset encryption algorithm to obtain the verification ciphertext. Next, the user uploads the test certificate and the verification ciphertext to the system together. After the system receives the test certificate and the verification ciphertext, it first uses the same hash function to hash the test certificate to obtain a new verification text. Then, the system uses the encryption key provided by the user and the preset encryption algorithm to decrypt the verification ciphertext to obtain the decrypted verification text. Finally, the system compares whether the two verification texts are the same. If they are the same, it means that the test certificate uploaded by the user is authentic and valid; if they are not the same, it may mean that the test certificate has been tampered with or the user has provided an incorrect verification ciphertext. In practical applications, in order to ensure security, the selection of encryption keys and hash functions should follow security best practices, and the encryption and decryption processes should be performed in a secure environment to prevent data leakage or tampering. At the same time, users should properly keep encryption keys to avoid disclosure to unauthorized persons.
[0054] In a possible implementation, before obtaining the decryption private key input by the user, the input timestamp and positioning data of the user are obtained; the positioning data is converted into a positioning code; the positioning code is randomly inserted into the input timestamp to obtain the decryption private key.
[0055] Specifically, before the user attempts to enter the decryption private key, the server will first record the specific time when the user performs this operation, which is called the input timestamp. The timestamp is a number accurate to seconds or milliseconds, which is used to indicate the time point when the event occurs. At the same time, the server will also obtain the user's location data, which can be achieved through the built-in GPS module of the user's device, such as a smartphone, tablet, etc., or a network positioning service. The positioning data includes the user's geographical location information such as longitude and latitude. After obtaining the positioning data, the server needs to convert it into a more concise, easy to process and store format, namely the positioning code. This can be achieved by hashing, encoding or compressing the positioning data. The positioning code is a fixed-length string or number that uniquely represents the user's location information. After obtaining the input timestamp and positioning code, the server will randomly insert the positioning code into a certain position of the timestamp. The "random insertion" here means that the specific position where the positioning code is inserted into the timestamp is randomly selected to increase the complexity and unpredictability of the decryption private key. After this step of processing, the original simple input timestamp becomes a complex string containing positioning information, which is used as the decryption private key. Since the location code is inserted randomly, even if two users enter it at the same time, their decryption private keys will be different due to the different location information.
[0056] For example, suppose there is an online raw material detection system, and the user needs to enter the decryption private key to decrypt the received encrypted message. In order to increase the security of the system, the server will require the user to perform some additional operations to generate the private key before the user enters the decryption private key. The user is first asked to confirm the current time and record the timestamp. For example, the current time is 12:34:56 on April 1, 2023, then the timestamp is "20230401123456". At the same time, the server will obtain the user's location data. For example, the user's longitude is 116.404 and the latitude is 39.915.
[0057] The server converts the positioning data into a positioning code. For example, the longitude and latitude can be hashed to obtain a short hash value as the positioning code. Assume that the positioning code obtained after the hashing operation is "abc123". The server randomly inserts the positioning code into the timestamp. For example, the positioning code "abc123" can be randomly inserted into a certain position of the timestamp to obtain a new string as the decryption private key. Assume that the private key after insertion is "202304011a2b3c456". In this way, the user needs to enter this complex string containing the positioning information as the decryption private key to decrypt the received encrypted message. Since the positioning code is randomly inserted, even if two users enter it at the same time, their decryption private keys will be different due to different positioning information, thereby increasing the security of the system.
[0058] In one possible implementation, after obtaining the decryption private key input by the user and decrypting the obtained ciphertext data, before obtaining the decrypted data, an encryption public key is generated based on the decryption private key using an asymmetric encryption algorithm; the detection certificate is encrypted based on the encryption public key to obtain the ciphertext data.
[0059] Specifically, asymmetric encryption algorithms are characterized by a pair of keys: a public key and a private key. The public key is used to encrypt data, while the private key is used to decrypt data. The two keys are mathematically related, but it is computationally infeasible to derive one from the other. Therefore, in this step, the decryption private key, which is actually part of the private key or information associated with it, depending on the algorithm and key management method used, and the corresponding asymmetric encryption algorithm are used to generate the corresponding encryption public key. Once the encryption public key is available, it can be used to encrypt the test certificate. The encryption process involves converting the raw data of the test certificate into a format that can only be decrypted by someone who holds the corresponding private key. This is achieved through a public key encryption algorithm, which uses the public key as the encryption key to encrypt the data. The encrypted data can be safely transmitted or stored because only someone with the corresponding private key can decrypt and read the original test certificate content.
[0060] In one possible implementation, refer to Figure 2 , Figure 2 Another flow chart of a full-process detection method for raw materials provided in an embodiment of the present application. Specifically including S210 to S220, the above steps are as follows: S210, if it is confirmed that the first verification original text and the second verification original text are different, then generate alarm data; S220, send alarm data to the inspection personnel who supervise the inspection of the target raw materials, and the alarm data is used to remind the inspection personnel that the inspection certificate is at risk of leakage.
[0061] Specifically, in this step, the server compares two verification texts. The two verification texts come from different sources or are generated at different points in time. If the two verification texts are not the same, this may mean that some kind of change or tampering has occurred during the transmission, storage or processing of the data, or it may indicate a risk of data leakage. Once it is confirmed that the two verification texts are not the same, the server generates alarm data. Alarm data is a specific information or signal used to notify relevant personnel or servers that an abnormal situation has occurred. The alarm data may contain detailed information about the difference between the two verification texts, as well as possible consequences or recommended countermeasures. The server sends the generated alarm data to the inspectors who conduct supervisory inspections on the target raw materials. These inspectors are high-authority professionals responsible for ensuring the quality, compliance and safety of the raw materials. The purpose of sending alarm data is to promptly notify the inspectors about the possible leakage risk of the test certificate so that they can take appropriate actions to deal with the situation. The main purpose of the alarm data is to remind the inspectors to pay attention to the security of the test certificate. If the test certificate is leaked or tampered with, this may have a significant impact on the quality, compliance and safety of the raw materials. By receiving the alarm data, the inspectors can quickly identify potential risks and take necessary measures to prevent further damage or adverse consequences.
[0062] For example, suppose there is a building materials company that uses specific raw materials to produce building materials. In order to ensure the quality and safety of the raw materials, the company commissioned an independent testing agency to supervise and test the raw materials. During the testing process, the testing agency will generate a test certificate, which contains the test results and conclusions of the raw materials. In order to ensure the authenticity and integrity of the test certificate, the testing agency will use an encryption algorithm to encrypt the test certificate and generate a verification original. At the same time, the company may also save an encrypted copy of the test certificate in the internal system, that is, another verification original, for subsequent comparison and verification.
[0063] Further, at a certain point in time, the company decides to verify the verification text provided by the testing agency to ensure its authenticity and integrity. The company compares the verification text provided by the testing agency with the verification text stored in the internal system. If the two verification texts are found to be different, this may mean that the test certificate has been tampered with or leaked during transmission or storage. Once it is confirmed that the two verification texts are different, the company's system will automatically generate an alarm data. This alarm data contains detailed information about the difference between the two verification texts and possible consequences, such as the test certificate may have been leaked or tampered with. The system will send this alarm data to the tester responsible for supervising the test so that they can take appropriate actions to deal with this situation. After the tester receives the alarm data, the tester will immediately investigate the security of the test certificate. They may contact the testing agency to request a new authentic and valid test certificate. At the same time, they may also take measures to strengthen the quality control and safety management of raw materials to prevent further damage or adverse consequences.
[0064] In a possible implementation, a current storage node storing the detection certificate is obtained; the detection certificate is sent to a target storage node for backup storage, the storage node includes the current storage node, and the target storage node is any one of the multiple storage nodes.
[0065] Specifically, the server first needs to know which node the detection certificate is currently stored on. Storage nodes refer to devices or systems used to store data, which can be physical servers, virtual machines, cloud storage services, etc. The server may obtain this information by querying a database, a configuration file, or communicating with other systems. Once the current storage node is determined, the server can know where to obtain the detection certificate for subsequent operations. After determining the current storage node, the server needs to select one or more target storage nodes to store the backup of the detection certificate. These target storage nodes can be the same device or system as the current storage node, or different devices or systems. The purpose of backup storage is to ensure that the original version of the detection certificate can be restored in the event that the original data is lost, damaged, or tampered with. By storing backups on different storage nodes, the redundancy and reliability of the data can be increased. In this step, the server will copy the detection certificate from the current storage node to the target storage node. This can be achieved through a file transfer protocol, a database replication mechanism, or an API provided by a cloud storage service.
[0066] This application also provides a raw material full-process detection system, referring to Figure 3 , Figure 3A module schematic diagram of a raw material full-process detection system provided for an embodiment of the present application. The system is a server, and the server includes an acquisition module 31 and a processing module 32, wherein the acquisition module 31 responds to the user's operation of viewing the detection certificate and acquires the user's biological data, and the detection certificate is a certificate generated after the target raw material is supervised and tested; the processing module 32 generates a verification key based on the biological data using a preset verification algorithm; the acquisition module 31 acquires a pre-stored verification ciphertext, and the verification ciphertext is an encrypted verification data generated based on the detection certificate; the processing module 32 decrypts the verification ciphertext using a preset decryption algorithm based on the verification key to obtain a first verification original text; the acquisition module 31 acquires the decryption private key input by the user, decrypts the acquired ciphertext data, and obtains decrypted data; the processing module 32 performs a hash operation on the decrypted data to obtain a second verification original text; if the processing module 32 confirms that the first verification original text is the same as the second verification original text, it determines that the decrypted data is a detection certificate.
[0067] In a possible implementation, the processing module 32 generates a verification key based on the biological data using a preset verification method, specifically including: the processing module 32 converts the biological data into binary data; the processing module 32 groups the binary data to obtain multiple groups of sub-data; the processing module 32 encodes each group of sub-data to obtain multiple encoding results; the processing module 32 randomly inserts each encoding result into the corresponding sub-data to obtain multiple encoded data; the processing module 32 sorts and merges the multiple encoded data according to the order of each group of sub-data to obtain an encryption key; the processing module 32 generates a verification key based on the encryption key using an asymmetric encryption algorithm.
[0068] In a possible implementation, before the processing module 32 obtains the pre-stored verification ciphertext, the acquisition module 31 receives the detection certificate sent by the user device; the processing module 32 performs a hash operation on the detection certificate to obtain the verification original text; the processing module 32 encrypts the verification original text according to the encryption key using a preset encryption algorithm to obtain the verification ciphertext.
[0069] In a possible implementation, before obtaining the decryption private key input by the user, the acquisition module 31 obtains the input timestamp and positioning data of the user input; the processing module 32 converts the positioning data into a positioning code; the processing module 32 randomly inserts the positioning code into the input timestamp to obtain the decryption private key.
[0070] In a possible implementation, the acquisition module 31 obtains the decryption private key input by the user and decrypts the obtained ciphertext data. Before obtaining the decrypted data, the processing module 32 generates an encryption public key based on the decryption private key using an asymmetric encryption algorithm; the processing module 32 encrypts the detection certificate based on the encryption public key to obtain the ciphertext data.
[0071] In a possible implementation, if the processing module 32 confirms that the first verification text and the second verification text are different, it generates alarm data; the processing module 32 sends the alarm data to the inspection personnel who supervise the inspection of the target raw materials, and the alarm data is used to remind the inspection personnel that there is a risk of leakage of the inspection certificate.
[0072] In a possible implementation, the acquisition module 31 acquires the current storage node where the detection certificate is stored; the processing module 32 sends the detection certificate to the target storage node for backup storage, the storage node includes the current storage node, and the target storage node is any one of the multiple storage nodes.
[0073] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0074] The present application also provides an electronic device, referring to Figure 4 , Figure 4 The electronic device may include: at least one processor 41 , at least one network interface 44 , a user interface 43 , a memory 45 , and at least one communication bus 42 .
[0075] The communication bus 42 is used to realize the connection and communication between these components.
[0076] The user interface 43 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 43 may also include a standard wired interface and a wireless interface.
[0077] The network interface 44 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0078] Among them, the processor 41 may include one or more processing cores. The processor 41 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 45, and calling data stored in the memory 45. Optionally, the processor 41 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 41 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 41, and it can be implemented separately through a chip.
[0079] Among them, the memory 45 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 45 includes a non-transitory computer-readable storage medium. The memory 45 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 45 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 45 may also be optionally at least one storage device located away from the aforementioned processor 41. As Figure 4 As shown, the memory 45 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for a full-process detection method for raw materials.
[0080] exist Figure 4In the electronic device shown, the user interface 43 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 41 can be used to call an application program stored in the memory 45 for a full-process detection method for raw materials. When executed by one or more processors, the electronic device executes one or more methods in the above-mentioned embodiments.
[0081] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0082] The present application also provides a computer-readable storage medium, which stores instructions. When executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0087] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0088] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, it will be easy for those skilled in the art to think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A full-process detection method for raw materials, characterized in that: The method comprises: In response to a user's operation of viewing a test certificate, obtaining biometric data of the user, wherein the test certificate is a certificate generated after a supervisory test on the target raw material; Generating a verification key using a preset verification algorithm according to the biometric data; Obtaining a pre-stored verification ciphertext, wherein the verification ciphertext is encrypted verification data generated based on the detection certificate; Decrypting the verification ciphertext using a preset decryption algorithm according to the verification key to obtain a first verification original text; Obtaining the decryption private key input by the user, decrypting the obtained ciphertext data, and obtaining decrypted data; Performing a hash operation on the decrypted data to obtain a second verification original text; If it is confirmed that the first verification original text is the same as the second verification original text, the decrypted data is determined to be the detection certificate.
2. The whole-process detection method of raw materials according to claim 1 is characterized in that: The step of generating a verification key according to the biological data using a preset verification method specifically includes: converting the biological data into binary data; Performing group splitting on the binary data to obtain multiple groups of sub-data; Encoding each group of sub-data to obtain multiple encoding results; Randomly inserting each of the encoding results into the corresponding sub-data to obtain a plurality of encoded data; Sort and merge the plurality of coded data according to the order of each group of sub-data to obtain an encryption key; The verification key is generated according to the encryption key using an asymmetric encryption algorithm.
3. The whole-process detection method of raw materials according to claim 2 is characterized in that: Before obtaining the pre-stored verification ciphertext, the method further includes: Receiving the detection certificate sent by the user equipment; Performing a hash operation on the test certificate to obtain a verification original text; According to the encryption key, the verification original text is encrypted using a preset encryption algorithm to obtain the verification ciphertext.
4. The whole-process detection method of raw materials according to claim 1 is characterized in that: Before obtaining the decryption private key input by the user, the method further includes: Obtaining the input timestamp and positioning data of the user input; Converting the positioning data into a positioning code; The positioning code is randomly inserted into the input timestamp to obtain the decryption private key.
5. The whole-process detection method of raw materials according to claim 1 is characterized in that: Before obtaining the decryption private key input by the user and decrypting the obtained ciphertext data to obtain the decrypted data, the method further includes: Generate an encryption public key using an asymmetric encryption algorithm based on the decryption private key; The detection certificate is encrypted according to the encryption public key to obtain the ciphertext data.
6. The whole-process detection method of raw materials according to claim 1 is characterized in that: The method further comprises: If it is confirmed that the first verification original text and the second verification original text are not the same, generating alarm data; The alarm data is sent to the inspector who conducts the supervisory inspection on the target raw material, and the alarm data is used to remind the inspector that there is a risk of leakage of the inspection certificate.
7. The whole-process detection method of raw materials according to claim 6 is characterized in that: The method further comprises: Obtain the current storage node where the detection certificate is stored; The detection certificate is sent to a target storage node for backup storage, the storage node includes the current storage node, and the target storage node is any one of the multiple storage nodes.
8. A full-process raw material detection system, characterized in that: The detection system comprises an acquisition module (31) and a processing module (32), wherein: The acquisition module (31) is used to respond to the user's operation of viewing the test certificate and acquire the user's biometric data, wherein the test certificate is a certificate generated after the supervision test of the target raw material; The processing module (32) is used to generate a verification key based on the biological data using a preset verification algorithm; The acquisition module (31) is further used to acquire pre-stored verification ciphertext, wherein the verification ciphertext is encrypted verification data generated based on the detection certificate; The processing module (32) is further used to decrypt the verification ciphertext using a preset decryption algorithm according to the verification key to obtain a first verification original text; The acquisition module (31) is further used to acquire the decryption private key input by the user, decrypt the acquired ciphertext data, and obtain decrypted data; The processing module (32) is further used to perform a hash operation on the decrypted data to obtain a second verification original text; The processing module (32) is further configured to determine that the decrypted data is the detection certificate if it is confirmed that the first verification text is the same as the second verification text.
9. An electronic device, characterized in that: The electronic device comprises a processor (41), a memory (45), a user interface (43) and a network interface (44), wherein the memory (45) is used to store instructions, the user interface (43) and the network interface (44) are both used to communicate with other devices, and the processor (41) is used to execute the instructions stored in the memory (45) so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.
Citation Information
Patent Citations
Internet of Things supervision system based on industrial field data
CN117150404A
Company certificate management method and device based on block chain, and electronic equipment
CN117424694A
Mobile office data security access system based on encrypted mirror image transmission
CN118433704A
Confidential raw material management device, confidential raw material management method and confidential raw material management program
JP2020158273A
Authentication system and method for digital televisions
US20140032898A1