A cemetery information management method, system and electronic device based on QR code
By generating and encrypting the grave QR code, the problems of low query efficiency and insufficient security in cemetery information management are solved, and efficient and secure information storage and query are achieved.
Patent Information
- Application Number
- CN202510086527.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-01-20
AI Technical Summary
The existing cemetery information management has problems such as low query efficiency, inconvenient storage and low security.
A QR code-based cemetery information management method is adopted. By generating a unique key for the grave, the grave information is encrypted, a QR code for the grave is generated, and it is associated with the unique key and stored in the database. Authorized users can scan the QR code and decrypt it to obtain the information.
It improves the convenience of information storage and query efficiency, ensures the security of information storage and transmission, and is suitable for large-scale applications.
Smart Images

Figure CN120046131B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information management, and in particular relates to a cemetery information management method, system and electronic equipment based on QR codes. Background Art
[0002] At present, the existing management of cemetery information mostly adopts traditional management methods and technical means, that is, traditional cemetery management mostly relies on paper records, among which paper records have the following shortcomings: (1) Low query efficiency: Since information is mainly stored in the form of paper documents, a large number of documents need to be manually flipped through when querying, resulting in low efficiency; (2) Inconvenient storage: The storage of paper records requires a large amount of physical space, and is not convenient for long-term storage and management, and is prone to damage or loss; (3) Low security. Paper records of cemetery information may be at risk of information leakage or loss during storage and retrieval, posing a major security risk. Therefore, based on the above-mentioned shortcomings, how to provide a cemetery information management method based on QR codes that is convenient to store, highly secure, and highly efficient has become an urgent problem to be solved. Summary of the Invention
[0003] The purpose of the present invention is to provide a cemetery information management method, system and electronic equipment based on QR code to solve the problems of low query efficiency, inconvenient storage and low security that exist in the existing technology.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] In a first aspect, a cemetery information management method based on a QR code is provided, comprising:
[0006] Get the grave information of each grave in the cemetery;
[0007] Generate a unique key for each grave location based on the grave location information of each grave location;
[0008] Based on the unique key of each grave, each grave information is symmetrically encrypted to obtain each encrypted grave information;
[0009] Using each encrypted grave location information, generating a grave location QR code corresponding to each grave location, and associating the grave location QR code of each grave location with a unique key of each grave location, so as to store the associated unique keys and grave location QR codes in a database;
[0010] Obtaining user information of a user corresponding to the user terminal, wherein the user information is read when the user terminal scans a QR code of a designated grave site;
[0011] Determining whether the user is an authorized user based on the user information;
[0012] If so, the unique key associated with the QR code of the designated grave is retrieved from the database and used as the decryption key;
[0013] The decryption key is sent to the user terminal, so that the user terminal uses the decryption key to decrypt the encrypted grave information of the specified grave to obtain the grave information of the specified grave, wherein the encrypted grave information of the specified grave is obtained when the user terminal scans the grave QR code of the specified grave.
[0014] Based on the above-disclosed content, the present invention first obtains the grave information of each grave, and then generates a unique key for each grave according to the information of each grave; then, based on the unique key of each grave, symmetrical encryption is performed on the information of each grave to obtain the encrypted grave information corresponding to each grave, and then, each encrypted grave information is used to generate a grave QR code corresponding to each grave, and each grave QR code is associated with the corresponding unique key. Finally, the associated unique key and grave QR code are stored in the database to complete the information storage; in this way, the use of QR codes to store grave information can be preserved for a long time compared to traditional paper records, and does not require a large amount of physical space, thereby improving the convenience of storage.
[0015] After completing the recording of the grave information, the user terminal can obtain the grave information by scanning the grave QR code; specifically, the present invention will obtain the corresponding user information when the user terminal scans the grave QR code, and then, based on this, determine whether the user is an authorized user; wherein, when it is determined that the user is an authorized user, the unique key associated with the grave QR code scanned by the user can be found from the database, and the key can be sent to the user terminal as a decryption key, and the user terminal can use the decryption key to decrypt the encrypted grave information obtained by the scan, thereby obtaining the plaintext grave information; in this way, the use of QR codes to store grave information improves the user's query efficiency, and encryption is performed during storage, so when an illegal user scans the QR code, the encrypted grave information is also obtained, thereby ensuring the storage security and transmission security of the information.
[0016] Through the above design, the present invention encrypts the grave information of each grave, and then uses each encrypted grave information to generate a grave QR code corresponding to each grave, and thereby completes the recording of the grave information; finally, when in use, the authorized user only needs to scan the grave QR code to obtain the corresponding plaintext grave information; based on this, compared with traditional paper records, the present invention uses QR codes to store grave information, which not only does not require a large amount of physical space and can be preserved for a long time, but also improves the user's query efficiency. At the same time, encryption is performed during storage, so when an illegal user scans the QR code, the encrypted grave information is obtained, thus ensuring the storage and transmission security of the information; thus, the present invention provides a new way for cemetery information management, which is very suitable for large-scale application and promotion.
[0017] In a possible design, a unique key for each grave is generated based on the grave information of each grave, including:
[0018] Constructing a first key model and a second key model;
[0019] For any grave location, generating a first key initial value and a second key initial value based on the grave location information of the any grave location;
[0020] generating a first key sequence based on the first key initial value and the first key model, and generating a second key sequence based on the second key initial value and the second key model;
[0021] A unique key for any of the tombs is generated using the first key sequence and the second key sequence.
[0022] In one possible design, generating a first key initial value and a second key initial value based on the tomb location information of any tomb location includes:
[0023] Performing a hash operation on the grave location information of any grave location to obtain hash data corresponding to the any grave location;
[0024] Dividing the hash data into first hash segment data and second hash segment data of the same length;
[0025] The first key initial value is generated using the first hash segment data, and the second key initial value is generated using the second hash segment data.
[0026] In one possible design, generating the first key initial value using the first hash segment data includes:
[0027] Using the first hash segment data and the following formula (1), generate the first key initial value;
[0028]
[0029] In the above formula (1), x0 represents the initial value of the first key, h1 represents the first hash segment data, and mod() is a remainder operation.
[0030] In one possible design, constructing the first key model and the second key model includes:
[0031] The first key model and the second key model are constructed by sequentially using the following formulas (2) and (3);
[0032]
[0033]
[0034] The above formula (2) represents the first key model, where x n+1 Indicates the first key value output by the first key model at the n+1th iteration, x n Indicates the first key value output by the first key model at the nth iteration. When n is 0, x n is the initial value of the first key, δ represents the first control parameter, and δ∈(3.05699,4);
[0035] The above formula (3) represents the second key model, where y n+1 Indicates the second key value output by the second key model at the n+1th iteration, y n Indicates the second key value output by the second key model at the nth iteration. When n is 0, y n is the initial value of the second key, and τ represents the second control parameter.
[0036] In one possible design, generating a first key sequence based on the first key initial value and the first key model, and generating a second key sequence based on the second key initial value and the second key model includes:
[0037] Obtain the block length of the grave information corresponding to each grave, wherein the block length of each grave information is the same;
[0038] Determine the number of iterations based on the length of any tomb information and the length of the block;
[0039] performing an iterative operation on the first key model based on the number of iterations and the first key initial value to obtain a first initial key sequence, and performing an iterative operation on the second key model based on the number of iterations and the second key initial value to obtain a second initial key sequence;
[0040] Filtering a last first initial key from the first initial key sequence to serve as a third initial key value of the first key model, and filtering a last second initial key from the second initial key sequence to serve as a fourth initial key value of the second key model;
[0041] performing a second iterative operation on the first key model based on the third key initial value, and performing a second iterative operation on the second key model based on the fourth key initial value, so as to obtain the first key sequence and the second key sequence respectively after the second iterative operation, wherein the number of iterations of the second iterative operation is the block length;
[0042] Accordingly, using the first key sequence and the second key sequence to generate a unique key for any of the graves includes:
[0043] Perform an XOR operation on the first key sequence and the second key sequence to obtain a unique key for any of the tombs after the XOR operation.
[0044] In a possible design, the encrypted grave information is used to generate a QR code corresponding to each grave, including:
[0045] For the encrypted grave location information of any grave location, encoding the encrypted grave location information of any grave location, so as to obtain an initial grave location QR code corresponding to the any grave location after encoding;
[0046] Converting the initial grave QR code into an RGB image to obtain a color initial grave QR code;
[0047] Performing color decomposition processing on the color initial grave location QR code to obtain a red component image, a green component image, and a blue component image of the color initial grave location QR code;
[0048] Performing watermark embedding processing on the red component image to obtain a watermarked red component image;
[0049] The watermark red component image is fused with the green component image and the blue component image to obtain a grave QR code corresponding to any grave after the fusion process.
[0050] In one possible design, performing watermark embedding processing on the red component image to obtain a watermarked red component image includes:
[0051] Dividing the red component image into a plurality of image blocks of the same size;
[0052] Selecting a plurality of image blocks for embedding watermark information from a plurality of image blocks as target image blocks;
[0053] Performing discrete wavelet transform processing on each target image block to obtain an LL band signal of each target image block;
[0054] Performing singular value decomposition on the LL band signal of each target image block to obtain multiple singular values of each target image block, and using the multiple singular values corresponding to each target image block to form a singular value sequence corresponding to each target image block;
[0055] For any target image block, randomly select two singular values from the singular value sequence corresponding to the any target image block as a first designated element and a second designated element;
[0056] determining a watermark bit of any target image block according to the first designated element and the second designated element;
[0057] Generate a new first designated element and a new second designated element using the first designated element, the second designated element, and the watermark bit, and replace the first designated element in the singular value sequence corresponding to any target image block with the new first designated element, and replace the second designated element in the singular value sequence corresponding to any target image block with the new second designated element, so as to obtain a new singular value sequence after the replacement is completed;
[0058] Performing inverse singular value decomposition based on the new singular value sequence to obtain an updated LL band signal corresponding to any target image block;
[0059] The updated LL band signal is subjected to inverse discrete wavelet transform processing to obtain any target image block embedded with the watermark, and after all target image blocks are polled, the watermark red component image is obtained.
[0060] In the second aspect, a cemetery information management system based on a QR code is provided, comprising:
[0061] An acquisition unit, used for acquiring grave information of each grave in the cemetery;
[0062] A key generation unit, configured to generate a unique key for each grave location according to the grave location information of each grave location;
[0063] An encryption unit is used to perform symmetrical encryption processing on each grave location information based on a unique key of each grave location to obtain each encrypted grave location information;
[0064] The QR code unit is used to generate a QR code corresponding to each grave location using each encrypted grave location information, and associate the QR code of each grave location with a unique key of each grave location, so as to store the associated unique keys and grave location QR codes in a database;
[0065] The acquiring unit is further configured to acquire user information of a user corresponding to the user terminal, wherein the user information is read when the user terminal scans a QR code of a designated grave site;
[0066] an information sending unit, configured to determine whether the user is an authorized user based on the user information;
[0067] The information sending unit is configured to, when determining that the user is an authorized user, retrieve a unique key associated with the QR code of the designated grave from a database to serve as a decryption key;
[0068] The information sending unit is also used to send the decryption key to the user terminal, so that the user terminal uses the decryption key to decrypt the encrypted tomb information of the specified tomb to obtain the tomb information of the specified tomb, wherein the encrypted tomb information of the specified tomb is obtained when the user terminal scans the tomb QR code of the specified tomb.
[0069] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the QR code-based cemetery information management method as described in the first aspect or any possible design of the first aspect.
[0070] In a fourth aspect, a storage medium is provided, on which instructions are stored. When the instructions are run on a computer, the QR code-based cemetery information management method as described in the first aspect or any possible design of the first aspect is executed.
[0071] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, causes the computer to execute the QR code-based cemetery information management method as described in the first aspect or any possible design of the first aspect.
[0072] Beneficial effects:
[0073] (1) The present invention encrypts the grave information of each grave, and then uses each encrypted grave information to generate a grave QR code corresponding to each grave, and thereby completes the recording of the grave information; finally, when in use, the authorized user only needs to scan the grave QR code to obtain the corresponding plaintext grave information; based on this, compared with traditional paper records, the present invention uses QR codes to store grave information, which not only does not require a large amount of physical space and can be stored for a long time, but also improves the user's query efficiency. At the same time, encryption is performed during storage, so when an illegal user scans the QR code, the encrypted grave information is obtained, thus ensuring the storage and transmission security of the information; thus, the present invention provides a new way for cemetery information management, which is very suitable for large-scale application and promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 A schematic diagram of the steps of a QR code-based cemetery information management method provided by an embodiment of the present invention;
[0075] Figure 2 A schematic diagram of the structure of a cemetery information management system based on a QR code according to an embodiment of the present invention;
[0076] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0077] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly introduced below in conjunction with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0078] It should be understood that although the terms "first," "second," etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element without departing from the scope of the exemplary embodiments of the present invention.
[0079] It should be understood that the term "and / or" that may appear in this document is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may indicate three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this document describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B may indicate two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0080] Example:
[0081] See also Figure 1 As shown, the QR code-based cemetery information management method provided in this embodiment encrypts the information of each grave site, and then uses the encrypted grave site information to generate a grave site QR code for each grave site, and based on this, records and stores information; in this way, using the QR code method to store information, compared with traditional technologies, not only does it not require a large amount of physical space and can be stored for a long time, but the authorized user only needs to scan the QR code to obtain the corresponding grave site information, based on this, the convenience of storage and the user's query efficiency are improved. At the same time, encryption is performed during storage, so that the storage and transmission security of information can be guaranteed; thus, this method provides a new way for cemetery information management, which is very suitable for large-scale application and promotion; among them, for example, this method can be but not limited to running on the information management platform or server side. It can be understood that the aforementioned execution subject does not constitute a limitation on the embodiments of the present application. Accordingly, the operation steps of this method can be but not limited to the following steps S1 to S8.
[0082] S1. Obtaining the grave information of each grave in the cemetery; in a specific implementation, for example, the grave information of any grave may include, but is not limited to: the name of the grave owner, epitaph, birth and death dates, grave location, maintenance records, etc., and may also include basic information of the grave owner's family, etc.; at the same time, the grave information of each grave may be obtained, but is not limited to, in response to human-computer interaction operations; and after obtaining the grave information of each grave, the grave information may be stored.
[0083] In specific applications, this embodiment first generates a unique key for each grave, and then uses the unique key of each grave to encrypt the corresponding grave information of each grave; finally, the encrypted grave information is used to generate a unique grave QR code for each grave; in this way, information storage in the form of a QR code can be completed; wherein the aforementioned storage process can be but is not limited to the following steps S2 to S3.
[0084] S2. Generate a unique key for each grave based on the grave information of each grave; in specific applications, for example, but not limited to, the following steps S21 to S24 may be used to generate a unique key for each grave.
[0085] S21. Construct a first key model and a second key model. In this embodiment, for example, but not limited to, the following formulas (2) and (3) may be used in sequence to construct the first key model and the second key model.
[0086]
[0087]
[0088] The above formula (2) represents the first key model, where x n+1 Indicates the first key value output by the first key model at the n+1th iteration, x n Indicates the first key value output by the first key model at the nth iteration. When n is 0, x n is the first key initial value, δ represents the first control parameter, and δ∈(3.05699,4).
[0089] The above formula (3) represents the second key model, where y n+1 Indicates the second key value output by the second key model at the n+1th iteration, y n Indicates the second key value output by the second key model at the nth iteration. When n is 0, y n is the initial value of the second key, and τ represents the second control parameter; in this embodiment, the second control parameter is taken as 2.
[0090] Thus, from the above formulas (2) and (3), it can be seen that as long as the initial values of the two key models are given, the iteration of the two key models can be realized, thereby obtaining the key sequence output by the model.
[0091] Among them, since the generation principle of the initial values of the two key models of each tomb is the same, the following takes any tomb as an example to illustrate one of the determination processes of the initial values of the two key models, and the process is shown in the following step S22.
[0092] S22. For any grave site, based on the grave site information of any grave site, generate a first key initial value and a second key initial value; in specific implementation, for example, but not limited to, first performing a hash operation on the grave site information of any grave site to obtain hash data corresponding to any grave site; then, dividing the hash data into first hash segment data and second hash segment data of the same length; finally, the first hash segment data can be used to generate the first key initial value, and the second hash segment data can be used to generate the second key initial value.
[0093] In this embodiment, for example, but not limited to, the SHA256 algorithm can be used to obtain the hash data of the tomb information corresponding to any tomb, and then the hash data is divided into two hash segment data (that is, the length of each hash segment data is 128). Finally, the two hash segment data can be used to generate the first key initial value and the second key initial value respectively.
[0094] Optionally, for example, but not limited to, the first hash segment data may be used and the following formula (1) may be used to generate the first key initial value.
[0095]
[0096] In the above formula (1), x0 represents the initial value of the first key, h1 represents the first hash segment data, and mod() is the remainder operation; of course, the calculation process of the second hash segment data is the same as the calculation process of the aforementioned first hash segment data, only the first hash segment data in formula (1) is replaced by the second hash segment data, and the principle is not repeated here.
[0097] In this way, after determining the initial values of the two key models through the aforementioned formula (1), the two can be substituted into the corresponding key models to perform key iteration to generate the corresponding key sequence; wherein, the key sequence generation process can be but is not limited to the following step S23.
[0098] S23. Generate a first key sequence based on the first key initial value and the first key model, and generate a second key sequence based on the second key initial value and the second key model; in specific applications, this embodiment first calculates the number of iterations, and then performs one iteration of the two key models to obtain two initial key sequences; then, determine the second number of iterations and the model initial value at the second iteration, and based on this, perform a second iteration on the two key models; finally, after the iteration is completed, the aforementioned first and second key sequences can be obtained; wherein, the generation process of the two key sequences can be, but is not limited to, as shown in the following steps S23a to S23e.
[0099] S23a. Obtain the block length of the tomb information corresponding to each tomb, wherein the block length of each tomb information is the same; in specific implementation, during encryption, the plaintext data (i.e., the tomb information) is usually encrypted in blocks; therefore, it is necessary to first determine the block length of the tomb information corresponding to each tomb; of course, the specific block length can be specifically set according to actual use and is not specifically limited here.
[0100] After obtaining the block length of each grave information, the number of iterations of one iteration can be determined according to the length of each grave information and the block length. Here, any grave information is taken as an example for explanation, and the process can be, but is not limited to, as shown in the following step S23b.
[0101] S23b. Determine the number of iterations based on the length of any grave information and the block length. In specific implementation, for example, but not limited to, the length of any grave information can be divided by the block length to obtain the remainder of the block, that is, to determine whether any of the grave information can be divided into whole pieces when the block length is used for the block. This is equivalent to calculating the remainder between any grave information and the block length. Then, the minimum number of iterations (such as 1500) is added to the remainder to obtain the number of iterations of the two-key model in one iteration. After determining the number of iterations, one iteration of the two-key model can be performed, and the process can be, but not limited to, as shown in the following step S23c.
[0102] S23c. Based on the number of iterations and the initial value of the first key, perform an iterative operation on the first key model to obtain a first initial key sequence, and based on the number of iterations and the initial value of the second key, perform an iterative operation on the second key model to obtain a second initial key sequence; in this embodiment, assuming that the number of iterations is 1505, then the initial value of the model is substituted into the aforementioned formula (2) and formula (3) to obtain the corresponding first initial key sequence and second initial key sequence respectively.
[0103] Therefore, through the aforementioned steps S23a to S23c, the first and second initial key sequences output by the two key models can be determined; then, based on the first and second initial key sequences, the initial values of the two key models at the second iteration can be determined, and the process can be but is not limited to the following step S23d.
[0104] S23d. Filter out the last first initial key from the first initial key sequence to serve as the third key initial value of the first key model, and filter out the last second initial key from the second initial key sequence to serve as the fourth key initial value of the second key model; in this embodiment, it is equivalent to using the last key value in the first initial key sequence and the second initial key sequence as the initial values of the two key models, and finally, based on this, perform a second iteration, and the process can be but is not limited to the following step S23e.
[0105] S23e. Based on the third key initial value, perform a second iterative operation on the first key model, and based on the fourth key initial value, perform a second iterative operation on the second key model, so as to obtain the first key sequence and the second key sequence respectively after the second iterative operation, wherein the number of iterations of the second iterative operation is the block length.
[0106] In this embodiment, the output value of the model after the first iteration is used as the initial value of the second iteration, and then multiple iterations are performed (the number of iterations is the value corresponding to the block length); finally, after the iteration is completed, the first key sequence and the second key sequence can be obtained; in this way, it can be guaranteed that the obtained key sequence is the same as the block length corresponding to any of the tomb information; for example, assuming that the block length is 128, then the number of iterations of the second iteration operation is 128 times, and the length of the generated key sequence is also 128, based on this, it can be convenient for subsequent encryption processing.
[0107] Thus, through the aforementioned steps S23a to S23e, two key sequences can be generated based on the two-key model, and then the two key sequences can be used to generate a unique key for any of the aforementioned graves, as shown in the following step S24.
[0108] S24. Generate a unique key for any of the tombs using the first key sequence and the second key sequence. In a specific application, for example, but not limited to, performing an XOR operation on the first key sequence and the second key sequence, thereby obtaining a unique key for any of the tombs after the XOR operation.
[0109] Based on the aforementioned steps S21 to S24, a unique key for each grave location can be generated based on the grave location information of each grave location and combined with the aforementioned two-key model; then, based on this, the grave location information can be encrypted, and the process can be but is not limited to the following step S3.
[0110] S3. Based on the unique key of each grave, the information of each grave is symmetrically encrypted to obtain the encrypted information of each grave; in the specific implementation, for example, but not limited to, the AES algorithm can be used to encrypt the information of each grave, thereby obtaining the encrypted information of each grave corresponding to the grave; of course, AES is a commonly used encryption technology, and its principle will not be repeated.
[0111] After obtaining the encrypted grave information, a grave QR code corresponding to each grave can be generated based on the encrypted grave information, thereby completing the storage of each grave information based on the grave QR code; wherein, the generation process of the grave QR code can be but is not limited to the following step S4.
[0112] S4. Use the encrypted grave information to generate a grave QR code corresponding to each grave, and associate the grave QR code of each grave with the unique key of each grave, so as to store the associated unique keys and grave QR codes in the database; in the specific implementation, since the generation principle of the grave QR code of each encrypted grave information is the same, the encrypted grave information of any grave is taken as an example for explanation, and the generation process of the corresponding grave QR code can be but is not limited to the following steps S41 to S45.
[0113] S41. For the encrypted grave location information of any grave location, the encrypted grave location information of any grave location is encoded to obtain an initial grave location QR code corresponding to the any grave location after the encoding process; in a specific implementation, for example, but not limited to, QR encoding can be used to encode the encrypted grave location information of any grave location, so as to obtain the initial grave location QR code corresponding to the any grave location; wherein, QR encoding is a commonly used method for generating QR codes, and its principle will not be repeated here.
[0114] After obtaining the initial grave QR code, it can be converted into an RGB image so that a watermark can be embedded based on the color image. After the watermark embedding is completed, the grave QR code of any grave is obtained. The image color space conversion process is shown in the following step S42.
[0115] S42. Convert the initial grave QR code into an RGB image to obtain a colored initial grave QR code; in this embodiment, after completing the color space conversion of the image, watermark information can be inserted into the red component image to ensure the anti-counterfeiting property of the generated grave QR code; wherein, the watermark information embedding process can be, but is not limited to, as shown in the following steps S43 and S44.
[0116] S43. Perform color decomposition processing on the color initial grave position QR code to obtain a red component image, a green component image, and a blue component image of the color initial grave position QR code; in this embodiment, a watermark is added to the red component image; of course, the watermark can also be embedded in the green or blue component image, which is not limited to this.
[0117] After the separation of the RGB three primary color channels is completed, watermark embedding can be performed, and the process is shown in the following step S44.
[0118] S44. Perform watermark embedding processing on the red component image to obtain a watermarked red component image; in specific applications, this embodiment first selects an important part of the red component image, and then embeds a watermark in the selected important part; among them, the above-mentioned process can be, but is not limited to, as shown in the following steps S44a to S44i.
[0119] S44a. Divide the red component image into a number of image blocks of the same size. In a specific implementation, for example, but not limited to, the size of each image block can be set to 8×8, thereby dividing the image blocks based on the image size. After obtaining the number of image blocks of the same size, important image blocks can be screened out from the number of image blocks to embed watermark information. The image block selection process can be, but is not limited to, as shown in the following step S44b.
[0120] S44b. Filter out a plurality of image blocks for embedding watermark information from a plurality of image blocks to serve as target image blocks. In specific implementation, this embodiment selects image blocks based on the information entropy of each image block. The specific selection process may be, but is not limited to: (1) calculating the information entropy of each image block; (2) calculating the edge information of each image block based on the information entropy of each image block; (3) summing the information entropy and the edge information of each image block to obtain the information characteristic value of each image block; (4) sorting the image blocks in ascending order of the information characteristic value to obtain a sorted image sequence; (5) selecting the first several image blocks in the sorted image sequence as the target image blocks.
[0121] Optionally, the information entropy of any image block is calculated as follows:
[0122]
[0123] In the above formula (4), p(x k) is the probability of the k-th pixel value appearing in any image block (that is, assuming the i-th pixel value is 23, then the number of pixels with a pixel value of 23 is counted, and then divided by the total number of pixels in any image block), K represents the total number of pixel values in any image block (that is, how many different pixel values there are), and H(x) represents the information entropy.
[0124] Similarly, the edge information amount of any image block can be calculated by, for example but not limited to, using the following formula (5).
[0125]
[0126] In the above formula (5), B(x) represents the edge information amount of any image block.
[0127] Thus, after calculating the information characteristic value of each image block based on the aforementioned formula (4) and formula (5), multiple image blocks for embedding watermark information can be selected based on this; then, the watermark information can be embedded in the selected image blocks, and the process can be, but is not limited to, as shown in the following steps S44c to S44i.
[0128] S44c. Perform discrete wavelet transform on each target image block to obtain the LL band signal of each target image block; in this embodiment, the LL band is the low-frequency part of the target image block, which usually contains the main energy and contour information of the signal; of course, discrete wavelet transform is a commonly used technology for image processing, and its principle will not be repeated here.
[0129] After obtaining the LL band signal of each target image block, singular value decomposition can be performed on each LL band signal so as to embed watermark information based on the singular eigenvalue of each target image block. The process is shown in the following steps S44d to S44i.
[0130] S44d. Perform singular value decomposition on the LL band signal of each target image block to obtain multiple singular values of each target image block, and use the multiple singular values corresponding to each target image block to form a singular value sequence corresponding to each target image block; in this embodiment, it is equivalent to performing matrix decomposition on each target image block to obtain two unit orthogonal matrices and a diagonal matrix, and the non-negative numbers on the diagonal of the diagonal matrix are used as singular values; then, all singular values are extracted from the diagonal of the diagonal matrix, so as to use the extracted singular values to form a singular value sequence; of course, the extraction method is random extraction, and it is ensured that the singular value sequence is not arranged in descending or ascending order.
[0131] After obtaining the singular value sequence, watermark information can be embedded by changing the singular values in the singular value sequence; wherein, the singular value updating process can be but is not limited to the following steps S44e to S44g.
[0132] S44e. For any target image block, randomly select two singular values from the singular value sequence corresponding to the target image block as the first designated element and the second designated element. In this embodiment, after the two singular values are randomly selected from the singular value sequence of the target image block, the watermark bit of the target image block can be determined based on the two singular values, so that the two designated elements can be subsequently updated based on the watermark bit. The process of determining the watermark bit is shown in the following step S44f.
[0133] S44f. Determine the watermark bit of any target image block based on the first designated element and the second designated element; in specific applications, it can be, but is not limited to, first determining whether the first designated element is greater than the second designated element; then, determine the watermark bit of any target image block based on the judgment result; wherein, if the first designated element is greater than the second designated element, then determine the watermark bit of any target image block to be 1, otherwise, determine the watermark bit of any target image block to be 0; in this way, based on the aforementioned method, after the watermark bit of any target image block is obtained, the selected singular value can be updated, and the process can be, but is not limited to, as shown in the following step S44g.
[0134] S44g. Generate a new first designated element and a new second designated element using the first designated element, the second designated element, and the watermark bit, and use the new first designated element to replace the first designated element in the singular value sequence corresponding to any target image block, and use the new second designated element to replace the second designated element in the singular value sequence corresponding to any target image block, so as to obtain a new singular value sequence after the replacement is completed.
[0135] In this embodiment, one of the element updating methods is disclosed below, as shown in the following steps.
[0136] Step 1: Calculate the mean of the first specified element and the second specified element to obtain the element mean.
[0137] Step 2: If the watermark bit is 1, the following formula (6) is used to calculate the new first designated element and the new second designated element.
[0138]
[0139] In the above formula (6), Q1′, Q2′ represent the new first designated element and the new second designated element respectively, Q represents the element mean, and Q0 represents the watermark threshold.
[0140] If the watermark bit is 1, the following formula (7) is used to calculate the new first designated element and the new second designated element;
[0141]
[0142] In this way, after completing the updating of the first designated element and the second designated element through the aforementioned steps, the image block can be restored, and the process is shown in the following step S44h.
[0143] S44h. Based on the new singular value sequence, inverse singular value decomposition is performed to obtain an updated LL band signal corresponding to the arbitrary target image block; in this embodiment, it is equivalent to using the modified singular value sequence (i.e., the aforementioned diagonal matrix) to reconstruct the LL band signal of the arbitrary target image block, and then, the reconstructed LL band signal can be used to reconstruct the arbitrary target image block, thereby obtaining any target image block embedded with watermark information; wherein, the reconstruction process of the arbitrary target image block can be, but is not limited to, as shown in the following step S44i.
[0144] S44i. Perform inverse discrete wavelet transform processing on the updated LL band signal to obtain any target image block embedded with the watermark, and after polling all target image blocks, obtain the watermark red component image; in this embodiment, the inverse discrete wavelet transform processing is a restoration operation of the discrete wavelet transform, which is a commonly used method for image reconstruction, and its principle will not be repeated here.
[0145] Therefore, through the aforementioned steps S44a to S44i, the watermark embedding of each target image block can be completed, thereby obtaining the watermark red component image; finally, it is fused with the green and blue component images of the original image to obtain the tomb QR code corresponding to any tomb, wherein the aforementioned process is shown in the following step S45.
[0146] S45. Fusing the watermark red component image with the green component image and the blue component image to obtain a grave QR code corresponding to any grave after the fusion process.
[0147] Of course, in this embodiment, the watermark information can also be embedded in the green component image. It is only necessary to replace the red component image in the above step with the green component image. The principle is the same and will not be described in detail here.
[0148] In this way, through the aforementioned steps S41 to S45, the encrypted tomb information corresponding to each tomb can be used to obtain the tomb QR code of each tomb; at the same time, when generating the QR code, watermark information is added to the image, based on this, the uniqueness of the tomb QR code is guaranteed, thereby improving the security of information storage.
[0149] After obtaining the QR code corresponding to each grave, it can be displayed visually (such as on a display screen in the park), or when a code acquisition request is received from a user terminal, it can be sent to the user terminal, so that the user can use the user terminal to scan the code to obtain the corresponding grave information; wherein, the process of the user obtaining the grave information is shown in the following steps S5 to S8.
[0150] S5. Obtain user information of the user corresponding to the user terminal, wherein the user information is read when the user terminal scans the grave QR code of the designated grave; in this embodiment, for example, the user terminal can use an app or WeChat applet to scan the grave QR code of the designated grave; wherein, during the scanning, information authorization will be performed, so that the server can capture the user information of the user corresponding to the user terminal; at the same time, for example, the user information can include but is not limited to: user name, account information, etc.; in this way, the server can determine whether the user is an authorized user based on the user account, so that different processes can be executed subsequently according to the judgment result; wherein, the user identification process is shown in the following step S6.
[0151] S6. Determine whether the user is an authorized user based on the user information. In this embodiment, an authorized user table is stored in the server, and the table is associated with the account information of each authorized user. Therefore, after obtaining the user information corresponding to the user terminal, a matching query can be performed in the authorized user table to determine whether the user is an authorized user.
[0152] Among them, when the user is an authorized user, a decryption key needs to be issued so that the user terminal can decrypt the encrypted grave information based on the decryption key, thereby completing the information acquisition; otherwise, there is no need to send the decryption key; optionally, the aforementioned key issuance process can be but is not limited to as shown in the following step S7.
[0153] S7. If so, the unique key associated with the grave QR code of the specified grave is retrieved from the database as the decryption key; in this embodiment, as mentioned above, the grave information adopts symmetric encryption, and therefore, the keys used for encryption and decryption are the same, and at the same time, the grave QR code is associated with the corresponding unique key; therefore, based on this association relationship, the unique key associated with the grave QR code of the specified grave can be determined.
[0154] After the decryption key is obtained based on step S6, the key can be distributed, and the process is shown in the following step S8.
[0155] S8. Send the decryption key to the user terminal so that the user terminal uses the decryption key to decrypt the encrypted tomb information of the designated tomb to obtain the tomb information of the designated tomb, wherein the encrypted tomb information of the designated tomb is obtained when the user terminal scans the tomb QR code of the designated tomb; in this embodiment, since the user terminal obtains the tomb information of the designated tomb when scanning the tomb QR code of the designated tomb, after receiving the decryption key, the encrypted tomb information can be decrypted using the decryption key to obtain the plaintext tomb information of the designated tomb; in this way, the acquisition of the tomb information can be completed; at the same time, if the user is not an authorized user, he cannot obtain the decryption key. At this time, the tomb information obtained by the scan is encrypted information, so he cannot obtain valid information. Based on this, the acquisition and storage security of the information can be guaranteed.
[0156] Furthermore, staff can also manage and maintain the grave by scanning the grave QR code. That is, by scanning the grave QR code, they can upload the grave maintenance record, inspection status and other information to update and maintain the grave information.
[0157] Furthermore, since the grave QR code contains the grave location, navigation services in the park can also be provided to help users quickly locate the grave location.
[0158] At the same time, this embodiment also provides online service functions. For example, after the user scans the QR code of the tomb, he will jump to the corresponding online platform and can perform various online services, such as online appointment for tomb sweeping, service purchase, virtual commemoration and other functions; in this way, the user experience can be further improved; in addition, when the user generates behavioral data, the server can also recommend services based on the historical behavior of each user, based on this, the user experience can be further improved.
[0159] Therefore, according to the cemetery information management method based on QR codes described in detail in the aforementioned steps S1 to S6, the present invention encrypts the information of each grave site, and then uses the encrypted grave site information to generate a grave site QR code for each grave site, and based on this, records and stores information; in this way, using the QR code method to store information, compared with traditional technologies, not only does it not need to occupy a large amount of physical space and can be preserved for a long time, but the authorized user only needs to scan the QR code to obtain the corresponding grave site information, based on this, the convenience of storage and the user's query efficiency are improved. At the same time, encryption is performed during storage, so that the storage and transmission security of information can be guaranteed; thus, the present invention provides a new way for cemetery information management, which is very suitable for large-scale application and promotion.
[0160] like Figure 2 As shown, the second aspect of this embodiment provides a hardware system for implementing the QR code-based cemetery information management method described in the first aspect of the embodiment, including:
[0161] The acquisition unit is used to acquire the grave information of each grave in the cemetery.
[0162] The key generation unit is used to generate a unique key for each grave location according to the grave location information of each grave location.
[0163] The encryption unit is used to perform symmetrical encryption processing on each grave location information based on the unique key of each grave location to obtain each encrypted grave location information.
[0164] The QR code unit is used to generate a QR code corresponding to each grave location using the encrypted grave location information, and associate the QR code of each grave location with the unique key of each grave location, so as to store the associated unique keys and grave location QR codes in a database.
[0165] The acquisition unit is further used to obtain user information of the user corresponding to the user terminal, wherein the user information is read when the user terminal scans the grave QR code of the designated grave.
[0166] The information sending unit is used to determine whether the user is an authorized user based on the user information.
[0167] The information sending unit is used to find out the unique key associated with the grave QR code of the designated grave from the database when it is determined that the user is an authorized user, so as to serve as a decryption key.
[0168] The information sending unit is also used to send the decryption key to the user terminal, so that the user terminal uses the decryption key to decrypt the encrypted tomb information of the specified tomb to obtain the tomb information of the specified tomb, wherein the encrypted tomb information of the specified tomb is obtained when the user terminal scans the tomb QR code of the specified tomb.
[0169] The working process, working details and technical effects of the device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0170] like Figure 3 As shown, the third aspect of this embodiment provides an electronic device, comprising: a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the QR code-based cemetery information management method as described in the first aspect of the embodiment.
[0171] For example, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out memory (FIFO), and / or first-in-last-out memory (FILO). Specifically, the processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor may be implemented in at least one hardware form selected from the group consisting of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). Furthermore, the processor may include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); and the coprocessor is a low-power processor for processing data in a standby state.
[0172] In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit, image processor), which is responsible for rendering and drawing the content required to be displayed on the display screen. For example, the processor may be limited to a microprocessor of the STM32F105 series, a reduced instruction set computer (RISC) microprocessor, an X86 architecture processor, or an integrated embedded neural network processor (NPU); the transceiver may be, but is not limited to, a wireless fidelity (WIFI) wireless transceiver, a Bluetooth wireless transceiver, a general packet radio service technology (GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE 802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver. In addition, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0173] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0174] The fourth aspect of this embodiment provides a storage medium that stores instructions for the QR code-based cemetery information management method described in the first aspect of the embodiment, that is, the storage medium stores instructions, and when the instructions are run on a computer, the QR code-based cemetery information management method described in the first aspect of the embodiment is executed.
[0175] The storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive and / or a memory stick, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0176] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0177] A fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the QR code-based cemetery information management method as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0178] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A cemetery information management method based on QR code, characterized in that: include: Get the grave information of each grave in the cemetery; Generate a unique key for each grave location based on the grave location information of each grave location; Based on the unique key of each grave, each grave information is symmetrically encrypted to obtain each encrypted grave information; Using each encrypted grave location information, generating a grave location QR code corresponding to each grave location, and associating the grave location QR code of each grave location with a unique key of each grave location, so as to store the associated unique keys and grave location QR codes in a database; Obtaining user information of a user corresponding to the user terminal, wherein the user information is read when the user terminal scans a QR code of a designated grave site; Determining whether the user is an authorized user based on the user information; If so, the unique key associated with the QR code of the designated grave is retrieved from the database and used as the decryption key; Sending the decryption key to the user terminal so that the user terminal uses the decryption key to decrypt the encrypted grave location information of the designated grave location to obtain the grave location information of the designated grave location, wherein the encrypted grave location information of the designated grave location is obtained when the user terminal scans the grave location QR code of the designated grave location; Using the encrypted grave information, generate the grave QR code corresponding to each grave, including: For the encrypted grave location information of any grave location, encoding the encrypted grave location information of any grave location, so as to obtain an initial grave location QR code corresponding to the any grave location after encoding; Converting the initial grave QR code into an RGB image to obtain a color initial grave QR code; Performing color decomposition processing on the color initial grave location QR code to obtain a red component image, a green component image, and a blue component image of the color initial grave location QR code; Performing watermark embedding processing on the red component image to obtain a watermarked red component image; The watermark red component image is fused with the green component image and the blue component image to obtain a grave QR code corresponding to any grave after the fusion process; Performing watermark embedding processing on the red component image to obtain a watermarked red component image, including: Dividing the red component image into a plurality of image blocks of the same size; Selecting a plurality of image blocks for embedding watermark information from a plurality of image blocks as target image blocks; Performing discrete wavelet transform processing on each target image block to obtain an LL band signal of each target image block; Performing singular value decomposition on the LL band signal of each target image block to obtain multiple singular values of each target image block, and using the multiple singular values corresponding to each target image block to form a singular value sequence corresponding to each target image block; For any target image block, randomly select two singular values from the singular value sequence corresponding to the any target image block as a first designated element and a second designated element; determining a watermark bit of any target image block according to the first designated element and the second designated element; Generate a new first designated element and a new second designated element using the first designated element, the second designated element, and the watermark bit, and replace the first designated element in the singular value sequence corresponding to any target image block with the new first designated element, and replace the second designated element in the singular value sequence corresponding to any target image block with the new second designated element, so as to obtain a new singular value sequence after the replacement is completed; Performing inverse singular value decomposition based on the new singular value sequence to obtain an updated LL band signal corresponding to any target image block; The updated LL band signal is subjected to inverse discrete wavelet transform processing to obtain any target image block embedded with the watermark, and after all target image blocks are polled, the watermark red component image is obtained.
2. The method according to claim 1, characterized in that include: Generate a unique key for each grave based on its location information, including: Constructing a first key model and a second key model; For any grave location, generating a first key initial value and a second key initial value based on the grave location information of the any grave location; generating a first key sequence based on the first key initial value and the first key model, and generating a second key sequence based on the second key initial value and the second key model; A unique key for any of the tombs is generated using the first key sequence and the second key sequence.
3. The method according to claim 2, characterized in that Generating a first key initial value and a second key initial value based on the tomb location information of any one of the tomb locations includes: Performing a hash operation on the grave location information of any grave location to obtain hash data corresponding to the any grave location; Dividing the hash data into first hash segment data and second hash segment data of the same length; The first key initial value is generated using the first hash segment data, and the second key initial value is generated using the second hash segment data.
4. The method according to claim 3, characterized in that Generating the first key initial value using the first hash segment data includes: Using the first hash segment data and the following formula (1), generate the first key initial value; (1) In the above formula (1), represents the initial value of the first key, represents the first hash segment data, It is the remainder operation.
5. The method according to claim 2, characterized in that Constructing a first key model and a second key model includes: The first key model and the second key model are constructed by using the following formula (2) and formula (3) in sequence; (2) (3) The above formula (2) represents the first key model, where Indicates the first key value output by the first key model at the n+1th iteration, Indicates the first key value output by the first key model at the nth iteration. When n is 0, is the initial value of the first key, represents the first control parameter, and ; The above formula (3) represents the second key model, where Indicates the second key value output by the second key model at the n+1th iteration, Indicates the second key value output by the second key model at the nth iteration. When n is 0, is the initial value of the second key, and represents the second control parameter.
6. The method according to claim 2, characterized in that Generating a first key sequence based on the first key initial value and the first key model, and generating a second key sequence based on the second key initial value and the second key model, including: Obtain the block length of the grave information corresponding to each grave, wherein the block length of each grave information is the same; Determine the number of iterations based on the length of any tomb information and the length of the block; performing an iterative operation on the first key model based on the number of iterations and the first key initial value to obtain a first initial key sequence, and performing an iterative operation on the second key model based on the number of iterations and the second key initial value to obtain a second initial key sequence; Filtering a last first initial key from the first initial key sequence to serve as a third initial key value of the first key model, and filtering a last second initial key from the second initial key sequence to serve as a fourth initial key value of the second key model; performing a second iterative operation on the first key model based on the third key initial value, and performing a second iterative operation on the second key model based on the fourth key initial value, so as to obtain the first key sequence and the second key sequence respectively after the second iterative operation, wherein the number of iterations of the second iterative operation is the block length; Accordingly, using the first key sequence and the second key sequence to generate a unique key for any of the graves includes: Perform an XOR operation on the first key sequence and the second key sequence to obtain a unique key for any of the tombs after the XOR operation.
7. A cemetery information management system based on a QR code, applied to the cemetery information management method based on a QR code according to any one of claims 1 to 6, characterized in that: include: An acquisition unit, used for acquiring grave information of each grave in the cemetery; A key generation unit, configured to generate a unique key for each grave location according to the grave location information of each grave location; An encryption unit is used to perform symmetrical encryption processing on each grave location information based on a unique key of each grave location to obtain each encrypted grave location information; The QR code unit generates a QR code corresponding to each grave location using each encrypted grave location information, and associates the QR code of each grave location with a unique key of each grave location, so as to store the associated unique keys and grave location QR codes in a database; The acquiring unit is further configured to acquire user information of a user corresponding to the user terminal, wherein the user information is read when the user terminal scans a QR code of a designated grave site; an information sending unit, configured to determine whether the user is an authorized user based on the user information; The information sending unit is configured to, when determining that the user is an authorized user, retrieve a unique key associated with the QR code of the designated grave from a database to serve as a decryption key; The information sending unit is also used to send the decryption key to the user terminal, so that the user terminal uses the decryption key to decrypt the encrypted tomb information of the specified tomb to obtain the tomb information of the specified tomb, wherein the encrypted tomb information of the specified tomb is obtained when the user terminal scans the tomb QR code of the specified tomb.
8. An electronic device, characterized in that: include: A memory, a processor and a transceiver that are sequentially connected in communication, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the QR code-based cemetery information management method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Double color image blind watermarking method based on singular value decomposition
CN103810668A
Sacrifice method and system based on two-dimensional code
CN113076494A
Digital watermarking method and related device
CN115689852A