Data output method and system based on NFC and blockchain technology of Internet of Things
By detecting the signal status of NFC tags and establishing an integrated database, using comparison algorithms and traceability judgment strategies, the data reading failure caused by NFC tag corruption or signal abnormality is solved, and the effect of automatically finding backup information and improving information credibility is achieved.
Patent Information
- Application Number
- CN202411525112.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Existing NFC tags cannot work properly when damaged or signal is disturbed, resulting in data reading failure, affecting consumer trust, and high repair or replacement costs.
By detecting the NFC tag signal status, if abnormal, an NFC integrated database is established and an error recovery mechanism is equipped. The tag comparison algorithm is used to call the comparison information tag to obtain the product backup interaction information, and determine the information credibility through the traceability judgment strategy to provide the final product interaction information.
It realizes that when NFC tags are damaged or signal abnormal, automatically search for backup information, reduce information loss, improve information integrity and accuracy, and enhance consumer trust.
Smart Images

Figure CN119047498B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data output method and system based on NFC and blockchain technology. Background Art
[0002] Near Field Communication (NFC) is an important communication technology in the Internet of Things. With its short-range, high-frequency wireless communication capabilities, it makes it possible for fast and secure data transmission between devices. NFC technology is widely used in mobile payment, electronic ticketing, access control, mobile identity recognition and other fields, greatly improving the efficiency and security of data transmission. Blockchain, as a decentralized and tamper-proof distributed ledger technology, achieves data traceability and security through cryptographic algorithms and consensus mechanisms. Combined with the Internet of Things technology, especially NFC (Near Field Communication) technology, a more efficient, secure and reliable anti-counterfeiting traceability service system can be built.
[0003] For example, an existing Chinese patent with publication number CN114595795A discloses a method for processing traceability data of an NFC tag, the method comprising: generating a first traceability character string when issuing traceability data for an NFC tag; performing character encoding conversion to generate a first traceability character encoding sequence; and writing the first traceability character encoding sequence into a plurality of data storage areas specified on the NFC tag; generating a second traceability character encoding sequence when reading traceability data from the NFC tag; and performing string conversion on the second traceability character encoding sequence to generate a second traceability character string; performing data format verification; if the verification is successful, extracting a second traceability domain name string, a second traceability interface string, a second product identification string, and a second timestamp string; performing time legitimacy verification; if the verification is successful, generating a first traceability URL address; obtaining and displaying a first traceability data page according to the first traceability URL address; through this invention, the traceability data of the product can be continuously updated.
[0004] However, the above design does not consider the response method when the NFC chip is damaged. If the NFC tag is physically damaged, such as bending, scratching or breaking, the tag may not work properly, causing the reading device to be unable to read the data therein, and NFC communication is easily interfered by the surrounding environment, such as other electronic devices, metal objects or electromagnetic fields, which may cause the signal quality to degrade, resulting in the loss of product interaction information and affecting consumer trust. Replacing damaged NFC tags or reading devices will incur additional costs, and repairing damaged equipment will also incur costs, especially outside the warranty period, the repair cost is higher. To this end, the present invention provides a data output method and system based on the Internet of Things NFC and blockchain technology. Summary of the invention
[0005] The purpose of the present invention is to provide a data output method and system based on NFC and blockchain technology to solve the existing problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solution: a data output method based on NFC and blockchain technology, comprising the following steps:
[0007] S1. Detect the NFC tag signal status. When the NFC tag signal status is normal transmission, directly retrieve the product interaction information corresponding to the NFC chip and provide it to the user. When the NFC tag signal status is abnormal transmission, execute S2.
[0008] S2. Establish an NFC integrated database and equip it with an error recovery mechanism. Use the tag comparison algorithm to call the comparison information tag to obtain the product backup interaction information.
[0009] Setting a traceability judgment strategy to judge the information credibility of the product standby interaction information, and obtaining the final product interaction information by setting an information credibility threshold to provide to the user;
[0010] A further improvement of the present invention is that the NFC integrated database includes tag data storing NFC tags, the tag data includes product interaction information and redundant information, and the redundant information includes comparison storage sub-information;
[0011] The specific steps of the error recovery mechanism include:
[0012] Step 1: Extract the NFC tag scanned by the user as the main NFC tag, and its corresponding comparison storage sub-information as the main comparison tag;
[0013] Step 2: extract the parent chain information in the main comparison tag, and call the comparison sub-database associated with the parent chain information, and use the corresponding comparison storage sub-information as the tag to be compared;
[0014] Step 3: Setting a tag comparison algorithm to calculate the information similarity between the tags to be compared and the main comparison tags of all NFC tags in the comparison sub-database;
[0015] Step 4: Sort all NFC tags in the comparison sub-database according to the rule of information similarity from large to small to generate a sequence of NFC tags to be selected;
[0016] Step 5: extracting the first NFC tag in the NFC tag candidate sequence as the first candidate replacement NFC tag, and extracting the product interaction information corresponding to the first candidate replacement NFC tag as the product standby interaction information of the main NFC tag;
[0017] Step 6: Calculate the information credibility of the extracted interaction information, and determine the interaction information used to replace the main NFC tag based on the information credibility;
[0018] The present invention is further improved in that the tag comparison algorithm includes extracting feature data from the tags to be compared and the main comparison tag of all NFC tags in the comparison sub-database, and calculating the similarity of the feature data in the two data tags, and the calculation formula is:
[0019]
[0020] Among them: Las represents the similarity of the feature data in the two data labels, N represents the number of features in the main comparison label, represents the i-th feature data vector in the main comparison label, represents the i-th feature data vector in any tag to be compared in the comparison sub-database, X represents the feature set in the main comparison tag, and Y represents the feature set in the tag to be compared of any NFC tag in the comparison sub-database.
[0021] The present invention is further improved in that the label comparison algorithm further includes setting a label similarity threshold. For any label to be compared in the sub-database, feature data whose feature data similarity is greater than the label similarity threshold is taken as a positive example, and the label pair corresponding to the positive example is marked as 1. Feature data whose feature data similarity is less than or equal to the label similarity threshold is taken as a negative example, and the label pair corresponding to the negative example is marked as 0. The training data set composed of positive examples and negative examples is input into the SVM learning model, and the SVM model is used to perform a binary classification task. Then, the SVM similarity is expressed as:
[0022]
[0023] Among them: the function sign represents the activation function, represents the weight vector, represents the transpose of the weight vector, b is the bias term, represents the mapping function, The i-th tag pair representing the main comparison tag and the tag to be compared is calculated, the SVM similarity mean of all feature data in any tag to be compared in the sub-database is calculated, and the SVM similarity mean is listed in the SVM similarity sequence in descending order, and the NFC tags corresponding to the SVM similarity sequence are extracted and listed in the NFC tag candidate sequence.
[0024] A further improvement of the present invention is that extracting the product interaction information corresponding to the first candidate replacement NFC tag as the product standby interaction information of the main NFC tag and replacing the interaction information of the main NFC tag with the extracted interaction information specifically includes:
[0025] Calculating the information credibility of the interaction information, and determining whether to use the extracted interaction information to replace the interaction information of the primary NFC tag based on the information credibility;
[0026] The redundant information also includes product comparison sub-information. The product comparison sub-information corresponding to the first candidate replacement NFC tag and the product comparison sub-information of the main NFC tag are extracted. The product comparison sub-information includes the production date, batch number, manufacturer name and place of origin of the product. The difference between the production dates of the first candidate replacement NFC tag and the main NFC tag is calculated and recorded as the production difference value after standardization. The character string s1 of the batch number of the main NFC tag and the character string s2 of the batch number of the first candidate replacement NFC tag are extracted. The minimum number of single-character edits for converting s1 to s2 is calculated. The calculation formula is:
[0027]
[0028] in, Indicates the number of inserted characters when s1 is converted to s2. Indicates the number of characters deleted when converting s1 to s2. Indicates the number of replacement characters when s1 is converted to s2;
[0029] Get the batch number authenticity:
[0030]
[0031] Among them, the function len() represents the length of the string. For the manufacturer name and place of origin, when the results are consistent, it is recorded as 1 point, and when the results are inconsistent, it is recorded as 0 point. The production difference value, batch number authenticity, and the scores of the manufacturer name and place of origin are weighted and summed to obtain the information credibility score of the first alternative replacement NFC tag result.
[0032] A further improvement of the present invention is that the source tracing judgment strategy specifically includes:
[0033] An information credibility threshold is set. When the information credibility score of the first candidate replacement NFC tag result is greater than or equal to the information credibility threshold, the product interaction information corresponding to the first candidate replacement NFC tag is extracted as the final product interaction information of the main NFC tag; when the information credibility score of the first candidate replacement NFC tag result is less than the information credibility threshold, the NFC tag selection sequence is traversed in sequence until the NFC tag in the sequence is traversed and the information credibility score of the main NFC tag result is greater than or equal to the information credibility threshold, then the product interaction information corresponding to the NFC tag is extracted as the final product interaction information of the main NFC tag.
[0034] A further improvement of the present invention is that the NFC tag signal status is detected by the NFC TagInfo tool. When the user's mobile terminal is close to the product NFC chip, the receiving end verifies the CRC check bit. If the CRC check fails, the error is recorded, and the maximum number of retries and the retry time interval are set. If the CRC check still fails after the maximum number of retries and the retry time interval, the NFC tag signal status is judged to be abnormal transmission. If the check succeeds, the NFC tag signal status is judged to be normal transmission.
[0035] On the other hand, the present invention provides a data output system based on NFC and blockchain technology, including:
[0036] The NFC tag abnormality detection module is used to detect the NFC tag signal status. When the NFC tag signal status is normal transmission, the product interaction information corresponding to the NFC chip is directly retrieved and provided to the user. When the NFC tag signal status is abnormal transmission, the database matching module is run;
[0037] The database matching module is used to establish an NFC integrated database and is equipped with an error recovery mechanism. It calls the comparison information tag through the tag comparison algorithm to obtain the product backup interaction information;
[0038] The product traceability inspection module is used to set the traceability judgment strategy, judge the information credibility of the product backup interaction information, and obtain the final product interaction information by setting the information credibility threshold to provide it to the user.
[0039] A further improvement of the present invention is that the NFC integrated database is used to store information tags of NFC chips, each entry contains a unique identifier of the NFC chip and corresponding tag data, and the NFC tags are classified and summarized according to the suppliers in the compared stored information to generate K NFC sub-databases, and each NFC sub-database uses the corresponding supplier information as a unique sub-database identifier.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] 1. The present invention first detects the NFC tag signal status through the NFC tag abnormality detection module. When the NFC tag is abnormal, the system can automatically search for backup information, thereby reducing the problem of information loss caused by tag damage;
[0042] 2. Secondly, by equipping each NFC tag with redundant information, including product comparison sub-information, the integrity and accuracy of the information are improved;
[0043] 3. Set up a traceability judgment strategy to ensure that the product information provided is authentic and reliable, thereby enhancing consumer trust. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of a data output method based on NFC and blockchain technology of the Internet of Things in the present invention;
[0045] Figure 2 This is a flow chart of an error recovery mechanism of a data output method based on NFC and blockchain technology of the Internet of Things in the present invention;
[0046] Figure 3 This is a flow chart of a label comparison algorithm for a data output method based on NFC and blockchain technology of the present invention;
[0047] Figure 4 This is a schematic diagram of a data output method traceability judgment strategy based on NFC and blockchain technology of the Internet of Things in the present invention;
[0048] Figure 5 This is a framework diagram of a data output system based on NFC and blockchain technology of the Internet of Things in the present invention. DETAILED DESCRIPTION
[0049] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.
[0050] The term "and / or" is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " generally indicates that the related objects are in an "or" relationship.
[0051] Example 1
[0052] Figure 1 The present invention shows a flow chart of a data output method based on NFC and blockchain technology of the Internet of Things, including:
[0053] S1. Detect the NFC tag signal status. When the NFC tag signal status is normal transmission, directly retrieve the product interaction information corresponding to the NFC chip and provide it to the user. When the NFC tag signal status is abnormal transmission, run S2; the product interaction information may include the promotional display information about the product that the merchant or enterprise wants to provide to the user. The NFC tag signal status is detected by the NFC TagInfo tool. When the user's mobile terminal is close to the product NFC chip, the receiving end verifies the CRC check bit. If the CRC check fails, the error is recorded, and the maximum number of retries and the retry time interval are set. If the CRC check still fails after the maximum number of retries and the retry time interval, the NFC tag signal status is judged to be abnormal transmission. If the check succeeds, the NFC tag signal status is judged to be normal transmission.
[0054] S2. Establish an NFC integrated database and equip it with an error recovery mechanism. Use the tag comparison algorithm to call the comparison information tag to obtain the product backup interaction information.
[0055] The NFC integrated database is used to store information tags of NFC chips, each entry contains a unique identifier of the NFC chip and corresponding tag data, and the interactive information is used to record product content so that an interactive promotional effect of the product content can be achieved through NFC. Therefore, NFC tags are classified and summarized according to the suppliers in the storage information to generate K NFC sub-databases, and each NFC sub-database uses the corresponding supplier information as a unique sub-database identifier.
[0056] In order to achieve this, each NFC chip is equipped with an information tag as redundant storage. Even if the NFC is damaged, the information tag can be obtained through the redundant storage information in the NFC. When the chip detects that it is damaged, the chip will obtain the information tag from the redundant storage and is equipped with an error recovery mechanism. Figure 2 The present invention shows a flow chart of an error recovery mechanism of a data output method based on NFC and blockchain technology of the Internet of Things, and the specific steps include:
[0057] Step 1: Extract the NFC tag scanned by the user as the main NFC tag, and its corresponding comparison storage sub-information as the main comparison tag;
[0058] Step 2: extract the parent chain information in the main comparison tag, and call the comparison sub-database associated with the parent chain information, and use the corresponding comparison storage sub-information as the tag to be compared;
[0059] Step 3: Setting a tag comparison algorithm to calculate the information similarity between the tags to be compared and the main comparison tags of all NFC tags in the comparison sub-database;
[0060] Figure 3The present invention shows a data output method based on NFC and blockchain technology, and the tag comparison algorithm includes extracting feature data from the tags to be compared and the main comparison storage tags of all NFC tags in the comparison sub-database, including the storage data type, storage capacity and usage frequency of the tags; calculating the similarity of the feature data in the two data tags, and the calculation formula is: , where: Las represents the similarity of the feature data in the two data labels, N represents the number of features in the main comparison label, represents the i-th feature data vector in the main comparison label, represents the i-th feature data vector in any tag to be compared in the comparison sub-database, X represents the feature set in the main comparison tag, and Y represents the feature set in the tag to be compared of any NFC tag in the comparison sub-database.
[0061] Set the label similarity threshold. For any label to be compared in the sub-database, the feature data whose feature data similarity is greater than the label similarity threshold is taken as a positive example, and the label pair corresponding to the positive example is marked as 1. The feature data whose feature data similarity is less than or equal to the label similarity threshold is taken as a negative example, and the label pair corresponding to the negative example is marked as 0. SVM will try to find an optimal decision boundary (hyperplane) to separate the positive and negative examples as much as possible and maximize the interval between them. Input the training data set consisting of positive and negative examples into the SVM learning model, use the SVM model for binary classification tasks, normalize or standardize the feature vectors, establish the SVM model through the Gaussian kernel function, select a reasonable range to search for the values of C and gamma, for example, for C and gamma, you can consider using values on the logarithmic scale, such as [0.001, 0.01, 0.1, 1, 10, 100, 1000], use k-fold cross validation, assuming k = 5, then the data will be divided into 5 parts, for each pair of C and gamma combination, each time retain one data as the validation set, the rest of the data as the training set, train the SVM model on the training set. Use the F1 score on the validation set to evaluate the model performance, record the results of each validation, and calculate the average performance after all folds are completed. According to the average performance of cross validation, select the best performing combination of C and gamma to train the SVM model.
[0062] Then the SVM similarity is expressed as: , where: the function sign represents the activation function, represents the weight vector, represents the transpose of the weight vector, b is the bias term, represents the mapping function, Representing the i-th tag pair of the main comparison tag and the tag to be compared, the SVM similarity mean of all feature data in any tag to be compared in the sub-database is calculated, and the SVM similarity mean is listed in the SVM similarity sequence in descending order, and the NFC tags corresponding to the SVM similarity sequence are extracted and listed in the NFC tag candidate sequence.
[0063] Step 4: Sort all NFC tags in the comparison sub-database according to the rule of information similarity from large to small to generate a sequence of NFC tags to be selected;
[0064] Step 5: Extract the first NFC tag in the NFC tag candidate sequence as the first candidate replacement NFC tag, and extract the product interaction information corresponding to the first candidate replacement NFC tag as the product standby interaction information of the main NFC tag. Since the selection logic of the first NFC tag in the sequence is single, the expression of the interaction information is inaccurate, so it is necessary to verify the information credibility of the interaction information.
[0065] Step 6: Calculate the information credibility of the extracted interaction information, and determine the interaction information used to replace the main NFC tag based on the information credibility.
[0066] A traceability judgment strategy is set to judge the information credibility of the product backup interaction information, and by setting an information credibility threshold, the final product interaction information is obtained and provided to the user.
[0067] Figure 4 The present invention shows a traceability judgment strategy schematic diagram of a data output method based on the Internet of Things NFC and blockchain technology, including extracting the product comparison sub-information corresponding to the first candidate replacement NFC tag and the product comparison sub-information of the main NFC tag, wherein the product comparison sub-information includes the production date, batch number, manufacturer name and place of origin of the product, calculating the difference between the production date of the first candidate replacement NFC tag and the main NFC tag, and recording it as the production difference value after standardization, extracting the string s1 of the batch number of the main NFC tag and the string s2 of the batch number of the first candidate replacement NFC tag, and calculating the minimum number of single-character edits for converting s1 to s2, and the calculation formula is: ,in, Indicates the number of inserted characters when s1 is converted to s2. Indicates the number of characters deleted when converting s1 to s2. Indicates the number of replacement characters when s1 is converted to s2; obtains the authenticity of the batch number , where the function len() represents the string length. For the manufacturer name and origin, when the results are consistent, it is recorded as 1 point, and when the results are inconsistent, it is recorded as 0 point. The production difference value, batch number authenticity, and the scores of the manufacturer name and origin are weighted and summed to obtain the information credibility score of the first alternative replacement NFC tag result.
[0068] An information credibility threshold is set. When the information credibility score of the first candidate replacement NFC tag result is greater than or equal to the information credibility threshold, the product interaction information corresponding to the first candidate replacement NFC tag is extracted as the final product interaction information of the main NFC tag; when the information credibility score of the first candidate replacement NFC tag result is less than the information credibility threshold, the NFC tag selection sequence is traversed in sequence until the NFC tag in the sequence is traversed and the information credibility score of the main NFC tag result is greater than or equal to the information credibility threshold, then the product interaction information corresponding to the NFC tag is extracted as the final product interaction information of the main NFC tag.
[0069] The threshold and weight settings can be set by the operator.
[0070] Example 2
[0071] Figure 5 The data output system framework diagram based on NFC and blockchain technology of the present invention is shown. Based on the same inventive concept as Example 1, the present invention provides a data output system based on NFC and blockchain technology of the Internet of Things, including:
[0072] The NFC tag abnormality detection module is used to detect the NFC tag signal status. When the NFC tag signal status is normal transmission, the product interaction information corresponding to the NFC chip is directly retrieved and provided to the user. When the NFC tag signal status is abnormal transmission, the database matching module is run;
[0073] The database matching module is used to establish an NFC integrated database and is equipped with an error recovery mechanism. It uses the tag matching algorithm to call the matching information tag to obtain the product backup interaction information;
[0074] The product traceability inspection module is used to set the traceability judgment strategy, judge the information credibility of the product backup interaction information, and obtain the final product interaction information by setting the information credibility threshold to provide it to the user.
[0075] The database matching module includes equipping each NFC tag with tag data, including product interaction information and redundant information, wherein the redundant information includes product comparison sub-information and comparison storage sub-information.
[0076] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0080] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A data output method based on NFC and blockchain technology, characterized in that: The following steps are involved: S1. Detect the NFC tag signal status. When the NFC tag signal status is normal transmission, directly retrieve the product interaction information corresponding to the NFC chip and provide it to the user. When the NFC tag signal status is abnormal transmission, execute S2. S2. Establish an NFC integrated database and equip it with an error recovery mechanism. Use the tag comparison algorithm to call the comparison information tag to obtain the product backup interaction information. Setting a traceability judgment strategy to judge the information credibility of the product standby interaction information, and obtaining the final product interaction information by setting an information credibility threshold to provide to the user; The NFC integrated database includes tag data storing NFC tags, the tag data includes product interaction information and redundant information, and the redundant information includes comparison storage sub-information; The specific steps of the error recovery mechanism include: Step 1: Extract the NFC tag scanned by the user as the main NFC tag, and its corresponding comparison storage sub-information as the main comparison tag; Step 2: extract the parent chain information in the main comparison tag, and call the comparison sub-database associated with the parent chain information, and use the corresponding comparison storage sub-information as the tag to be compared; Step 3: Setting a tag comparison algorithm to calculate the information similarity between the tags to be compared and the main comparison tags of all NFC tags in the comparison sub-database; Step 4: Sort all NFC tags in the comparison sub-database according to the rule of information similarity from large to small to generate a sequence of NFC tags to be selected; Step 5: extracting the first NFC tag in the NFC tag candidate sequence as the first candidate replacement NFC tag, and extracting the product interaction information corresponding to the first candidate replacement NFC tag as the product standby interaction information of the main NFC tag; Step 6: Calculate the information credibility of the extracted interaction information, and determine the interaction information used to replace the main NFC tag based on the information credibility; The tag comparison algorithm includes extracting feature data from the tags to be compared and the main comparison tag of all NFC tags in the comparison sub-database, and calculating the similarity of the feature data in the two data tags. The calculation formula is: ; Among them: Las represents the similarity of the feature data in the two data labels, N represents the number of features in the main comparison label, represents the i-th feature data vector in the main comparison label, represents the i-th feature data vector in any tag to be compared in the comparison sub-database, X represents the feature set in the main comparison tag, and Y represents the feature set in the tag to be compared of any NFC tag in the comparison sub-database.
2. The data output method based on NFC and blockchain technology of the Internet of Things according to claim 1 is characterized in that: The label comparison algorithm further includes setting a label similarity threshold. For any label to be compared in the sub-database, feature data whose feature data similarity is greater than the label similarity threshold is taken as a positive example, and the label pair corresponding to the positive example is marked as 1. Feature data whose feature data similarity is less than or equal to the label similarity threshold is taken as a negative example, and the label pair corresponding to the negative example is marked as 0. The training data set composed of positive examples and negative examples is input into the SVM learning model, and the SVM model is used to perform a binary classification task. Then, the SVM similarity is expressed as: ; Among them: the function sign represents the activation function, represents the weight vector, represents the transpose of the weight vector, b is the bias term, represents the mapping function, The i-th tag pair representing the main comparison tag and the tag to be compared is calculated, the SVM similarity mean of all feature data in any tag to be compared in the sub-database is calculated, and the SVM similarity mean is listed in the SVM similarity sequence in descending order, and the NFC tags corresponding to the SVM similarity sequence are extracted and listed in the NFC tag candidate sequence.
3. The data output method based on NFC and blockchain technology of the Internet of Things according to claim 2 is characterized in that: The extracting the product interaction information corresponding to the first candidate replacement NFC tag as the product standby interaction information of the main NFC tag and replacing the interaction information of the main NFC tag with the extracted interaction information specifically includes: Calculating the information credibility of the interaction information, and determining whether to use the extracted interaction information to replace the interaction information of the primary NFC tag based on the information credibility; The redundant information also includes product comparison sub-information. The product comparison sub-information corresponding to the first candidate replacement NFC tag and the product comparison sub-information of the main NFC tag are extracted. The product comparison sub-information includes the production date, batch number, manufacturer name and place of origin of the product. The difference between the production dates of the first candidate replacement NFC tag and the main NFC tag is calculated and recorded as the production difference value after standardization. The character string s1 of the batch number of the main NFC tag and the character string s2 of the batch number of the first candidate replacement NFC tag are extracted. The minimum number of single-character edits for converting s1 to s2 is calculated. The calculation formula is: ; in, Indicates the number of inserted characters when s1 is converted to s2. Indicates the number of characters deleted when converting s1 to s2. Indicates the number of replacement characters when s1 is converted to s2; Get the batch number authenticity: ; Among them, the function len() represents the length of the string. For the manufacturer name and place of origin, when the results are consistent, it is recorded as 1 point, and when the results are inconsistent, it is recorded as 0 point. The production difference value, batch number authenticity, and the scores of the manufacturer name and place of origin are weighted and summed to obtain the information credibility score of the first alternative replacement NFC tag result.
4. The data output method based on NFC and blockchain technology of the Internet of Things according to claim 3 is characterized in that: The traceability judgment strategy specifically includes: An information credibility threshold is set. When the information credibility score of the first candidate replacement NFC tag result is greater than or equal to the information credibility threshold, the product interaction information corresponding to the first candidate replacement NFC tag is extracted as the final product interaction information of the main NFC tag; when the information credibility score of the first candidate replacement NFC tag result is less than the information credibility threshold, the NFC tag selection sequence is traversed in sequence until the NFC tag in the sequence is traversed and the information credibility score of the main NFC tag result is greater than or equal to the information credibility threshold, then the product interaction information corresponding to the NFC tag is extracted as the final product interaction information of the main NFC tag.
5. The data output method based on NFC and blockchain technology of the Internet of Things according to claim 4 is characterized in that: The NFC tag signal status is detected by the NFC TagInfo tool. When the user's mobile terminal is close to the product NFC chip, the receiving end verifies the CRC check bit. If the CRC check fails, the error is recorded, and the maximum number of retries and the retry time interval are set. If the CRC check still fails after the maximum number of retries and the retry time interval, the NFC tag signal status is judged to be abnormal transmission. If the check succeeds, the NFC tag signal status is judged to be normal transmission.
6. A data output system based on NFC and blockchain technology, used to execute the data output method based on NFC and blockchain technology as claimed in any one of claims 1 to 5, characterized in that: include: The NFC tag abnormality detection module is used to detect the NFC tag signal status. When the NFC tag signal status is normal transmission, the product interaction information corresponding to the NFC chip is directly retrieved and provided to the user. When the NFC tag signal status is abnormal transmission, the database matching module is run; The database matching module is used to establish an NFC integrated database and is equipped with an error recovery mechanism. It uses the tag matching algorithm to call the matching information tag to obtain the product backup interaction information; The product traceability inspection module is used to set the traceability judgment strategy, judge the information credibility of the product backup interaction information, and obtain the final product interaction information by setting the information credibility threshold to provide it to the user.
7. The data output system based on NFC and blockchain technology of the Internet of Things according to claim 6 is characterized in that: The NFC integrated database is used to store information tags of NFC chips, each entry contains a unique identifier of the NFC chip and corresponding tag data, and NFC tags are classified and summarized according to the suppliers in the compared stored information to generate K NFC sub-databases, each NFC sub-database uses the corresponding supplier information as a unique sub-database identifier.
Citation Information
Patent Citations
NFC label traceability data processing method
CN114595795A
Quantum encryption anti-counterfeiting traceability method and terminal based on block chain and NFC
CN116091087A
Intelligent agent rapid switching method based on NFC technology
CN118860326A