A unique identifier generation method and system based on blockchain
Through a blockchain-based method, evaluating the trustworthiness of data sources of IoT devices and generating unique identifiers, the problem of unsafe and unreliable identifiers in traditional methods is solved, and the unique identifiers of high credibility and security is achieved Character generation.
Patent Information
- Application Number
- CN202410684716.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-05-30
AI Technical Summary
Traditional IoT device unique identifier generation methods have problems with security, uniqueness and immutability, especially centralized management methods are vulnerable to attacks and have a single point of failure risk, resulting in inaccurate or unsafe identifiers.
Using a blockchain-based method, collect relevant metadata of IoT devices for credibility assessment, filter the authenticated data source, perform hash calculation to generate a unique identifier, and store it in the blockchain to ensure the identification High credibility and security of the symbol.
Through the immutability and transparency of blockchain, reliable management and traceability of IoT device identifiers is realized, the security and credibility of unique identifiers are improved, and the immutability and transparency of identifiers are ensured. Prevent forgery and duplicate generation.
Smart Images

Figure CN118646764B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic data digital processing, and specifically to a unique identifier generation method and system based on blockchain. Background Art
[0002] In the ecosystem of Internet of Things (IoT) devices, generating and managing unique identifiers for devices is a critical task to ensure that each device can be correctly identified and tracked. However, traditional methods of generating identifiers face many challenges, including security, uniqueness, and immutability. Traditional centralized identifier management methods rely on a single trusted entity, which has the risk of single point failure and is vulnerable to tampering and attacks. If the centralized management system is compromised or fails, the security and reliability of the entire system will be seriously affected.
[0003] Prior art, such as the invention patent with announcement number: CN106687984B, is a device and method for data matching and anonymization, including receiving multiple data sets. Each data set includes a customer identifier field, and the customer identifier field specifies a unique customer identifier associated with each entry in each data set. The multiple data sets include a first set of data sets and a second set of data sets. The method also includes saving the multiple data sets and generating a key mapping table including a customer identifier field and an anonymous identifier field, the customer identifier field of the key mapping table includes a unique customer identifier of the first set of data sets in the multiple data sets, and the anonymous identifier field includes a unique anonymous identifier. Each anonymous identifier corresponds to a customer identifier of the key mapping table. It also includes replacing each unique customer identifier in the second set of data sets with a corresponding anonymous identifier.
[0004] The prior art, such as announcement number: CN116089921B, is a method for generating an identifiable identifier for a distributed digital identity, including: using an identity management platform to verify the real-name information of users sent from different business systems, generating different legal identity identifiers corresponding to the users in different business systems, and binding them one-to-one with the public keys sent by different business systems, and then returning the corresponding legal identity identifier to the corresponding business system; when the current business system performs real-name verification on the user, the legal identity identifier and public key of the user are sent to the identity management platform. After the identity management platform verifies the binding relationship between the legal identity identifier and the public key of the user in the current business system, it generates a unique business identity identifier for the user in the current business system and returns it to the current business system.
[0005] In combination with the above scheme, it is found that currently in the generation of unique identifiers, it is not possible to ensure that only relevant information from data collection data sources is accepted from trusted data sources, resulting in the data source being unreliable or vulnerable, and the identifier may be generated repeatedly, resulting in the generated unique identifier being inaccurate or unsafe. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides a unique identifier generation method and system based on blockchain, which can effectively solve the problems involved in the above-mentioned background technology.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a unique identifier generation method based on blockchain, including collecting relevant metadata of each IoT device, performing credibility assessment and analysis on each data source of each IoT device, obtaining a confidence characterization value of each data source of each IoT device, and screening to obtain each authenticated data source of each IoT device.
[0008] Obtain multi-type data from each data source of each IoT device, and perform hash calculation to obtain a preset hash value of each data source of each IoT device.
[0009] Obtain each data source verification request of each IoT device, and determine the verification request result of each data source of each IoT device.
[0010] A unique identifier is generated based on the verification request results of each data source of each IoT device, and the unique identifier of each authenticated data source of each IoT device and the corresponding related metadata are counted and stored in the blockchain.
[0011] Furthermore, the credibility evaluation and analysis is performed on each data source of each IoT device to obtain the confidence characterization value of each data source of each IoT device. The specific process is: setting a monitoring period, monitoring and counting the average request response time of each data source of each IoT device during the monitoring period, and extracting the number of successful identity authentications and the total number of authentication attempts of each data source of each IoT device, and obtaining the first confidence factor of each data source of each IoT device after processing.
[0012] During the monitoring period, the total amount of data and the total amount of missing data from each data source of each IoT device are monitored and extracted, the missing data ratio of each data source of each IoT device is obtained through processing, and the total number of erroneous data items of each data source of each IoT device is counted, and the second confidence factor of each data source of each IoT device is obtained through processing.
[0013] According to the first confidence factor of each data source of each Internet of Things device and the second confidence factor of each data source of each Internet of Things device, a confidence representation value of each data source of each Internet of Things device is obtained through processing.
[0014] Furthermore, the confidence characterization value of each data source of each IoT device is a numerical quantification result obtained by performing a credibility assessment analysis on each data source of each IoT device, and is used to quantify the credibility and reliability of the data source of each IoT device.
[0015] Furthermore, the screening obtains the authentication data sources of each IoT device, and the specific process is: according to the confidence characterization value of each data source of each IoT device, and compared with the set confidence characterization threshold of the IoT device data source, if the confidence characterization value of a data source of a certain IoT device is higher than or equal to the confidence characterization threshold of the IoT device data source, then the data source of the IoT device is extracted and recorded as a trusted data source, thereby traversing to obtain the authentication data sources of each IoT device.
[0016] Furthermore, the method of obtaining multi-type data of each data source of each IoT device and performing hash calculation to obtain preset hash values of each data source of each IoT device specifically comprises the following steps: extracting multi-type data of each data source of each IoT device, including an initial identifier, a public key, geographic location data, and environmental parameters, and fitting the multi-type data of each data source of each IoT device to obtain fitting strings of each data source of each IoT device, and importing the fitting strings into a hash algorithm for calculation to obtain preset hash values of each data source of each IoT device.
[0017] Furthermore, the specific judgment process of determining the verification request results of each data source of each IoT device is as follows: packaging the preset hash value of each data source of each IoT device and the corresponding related metadata, and creating a blockchain transaction to send to the network node.
[0018] Extract the hash value of each IoT device in the blockchain transaction information of the network node and record it as the current hash value of each IoT device.
[0019] The preset hash value of each data source of each IoT device is extracted, and compared with the current hash value of each IoT device to obtain the verification request result of each data source of each IoT device. The verification request result of each data source of each IoT device is a valid verification result or an invalid verification result. If a trusted data source of a certain IoT device is consistent with the current hash value of the IoT device, the verification request result of the trusted data source of the IoT device is defined as a valid verification request. If a certain IoT device in a trusted data source is inconsistent with the current hash value of the IoT device, the verification request result of the IoT device in the trusted data source is defined as an invalid verification request.
[0020] Furthermore, the unique identifier of each authentication data source of each IoT device and the corresponding related metadata are stored in the blockchain. The specific process is: the unique identifier of each authentication data source of each IoT device whose verification request result is a valid verification request is packaged into a block and stored in the blockchain.
[0021] Furthermore, the confidence characterization value of each data source of each IoT device is specifically analyzed under the following conditions:
[0022]
[0023] Where Zi→j represents the confidence representation value of the jth data source of the i-th IoT device, Wi→j represents the first confidence factor of the jth data source of the i-th IoT device, Yi→j represents the second confidence factor of the jth data source of the i-th IoT device, Indicates the weight factor corresponding to the first confidence factor set, It represents the weight factor corresponding to the set second confidence factor, i represents the number of each IoT device, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
[0024] Furthermore, the first confidence factor of each data source of each IoT device is specifically analyzed under the following conditions:
[0025]
[0026] Wherein, Wi→j represents the first confidence factor of the jth data source of the ith IoT device, Ti→j represents the average request response time of the jth data source of the ith IoT device, ci→j represents the number of successful authentications of the jth data source of the ith IoT device, Ki→j represents the total number of authentication attempts of the jth data source of the ith IoT device, ΔT represents the set reference request response time, ΔP represents the set reference authentication success rate, δ1 represents the correction factor corresponding to the set request response time, δ2 represents the correction factor corresponding to the set authentication success rate, i represents the number of each IoT device, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
[0027] The second aspect of the present invention also provides a unique identifier generation system based on blockchain, characterized in that it includes: a data source credibility assessment and analysis module, which is used to collect relevant metadata of each Internet of Things device, perform credibility assessment and analysis on each data source of each Internet of Things device, obtain the confidence characterization value of each data source of each Internet of Things device, and screen out each authenticated data source of each Internet of Things device.
[0028] The hash value calculation module is used to obtain multi-type data from each data source of each IoT device, and perform hash calculation to obtain the preset hash value of each data source of each IoT device.
[0029] The data source credibility evaluation and analysis module is used to obtain the data source verification request of each IoT device and determine the result of the data source verification request of each IoT device.
[0030] The data storage module is used to generate a unique identifier based on the verification request results of each data source of each IoT device, and to count the unique identifiers of each authentication data source of each IoT device and the corresponding related metadata and store them in the blockchain.
[0031] The present invention has the following beneficial effects:
[0032] (1) The present invention collects relevant metadata of each IoT device, performs credibility assessment and analysis on each data source of each IoT device, screens out each authenticated data source of each IoT device, then obtains multiple types of data from these trusted data sources, performs hash calculations to obtain preset hash values, and stores these preset hash values and relevant metadata in the blockchain according to the verification request results. This helps to generate a unique identifier with high credibility and security, and at the same time, utilizes the immutability and transparency of the blockchain to achieve reliable management and traceability of IoT device identifiers.
[0033] (2) The present invention collects relevant metadata of each IoT device and finally obtains the confidence characterization value of each data source, thereby comprehensively and specifically analyzing the reliability and accuracy of each data source of each IoT device. Furthermore, by storing the highly reliable data source information on the blockchain, the security and credibility of the unique identifier generation method are improved, thereby effectively ensuring the immutability and transparency of the identifier.
[0034] (3) The present invention packages the preset hash value of the IoT device in each authentication data source and the corresponding related metadata, creates a blockchain transaction and sends it to the network node, then extracts the device hash value in the blockchain transaction information as the current hash value, and compares it with the preset hash value to determine the validity or invalidity of the verification request result, which helps to ensure the integrity and accuracy of the data. Through the distributed verification mechanism of the blockchain, the transparency and non-tamperability of the unique identifier generation process of the IoT device are ensured.
[0035] (4) The present invention extracts the initial identification, public key, geographic location data and environmental parameters of the IoT device from each authentication data source, fits these multiple types of data to generate a string, and then uses the hash algorithm to calculate the preset hash value. These steps ensure that the generated unique identifier contains a variety of key information. Through the encryption of the hash algorithm and the immutability of the blockchain, a safe, unique and reliable device identifier is provided, which improves the security and credibility of IoT device management.
[0036] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the method flow of the present invention.
[0038] Figure 2 A schematic diagram of the relationship between the second confidence factor provided by the present invention and the total number of erroneous data items.
[0039] Figure 3 It is a schematic diagram of system module connection of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] In the description of the present invention, it should be understood that the terms "opening", "upper", "lower", "thickness", "top", "middle", "length", "inside", "all around" and the like indicating orientation or positional relationship are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the components or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0042] See also Figure 1 As shown, an embodiment of the present invention provides a technical solution for a unique identifier generation method based on blockchain: a unique identifier generation method based on blockchain, comprising collecting relevant metadata of each Internet of Things device, performing credibility assessment and analysis on each data source of each Internet of Things device, obtaining a confidence representation value of each data source of each Internet of Things device, and screening to obtain each authenticated data source of each Internet of Things device.
[0043] It should be noted that the data sources of each IoT device refer to the data collected by the IoT device through different sources or channels, and can also refer to the data collection obtained by the device from different sources. These data sources can be various sensors, device interfaces, external systems or other IoT devices, which are used to provide different types of data, such as environmental parameters, sensor readings, user behavior, etc. IoT devices usually obtain data from multiple data sources and use this data for various purposes, such as real-time monitoring, analysis, control, etc.
[0044] Obtain multi-type data from each data source of each IoT device, and perform hash calculation to obtain a preset hash value of each data source of each IoT device.
[0045] Obtain each data source verification request of each IoT device, and determine the verification request result of each data source of each IoT device.
[0046] A unique identifier is generated based on the verification request results of each data source of each IoT device, and the unique identifier of each authenticated data source of each IoT device and the corresponding related metadata are counted and stored in the blockchain.
[0047] The relevant metadata includes the MAC address and serial number of the device, as well as the data transmission method, communication protocol, and network type of the device.
[0048] Specifically, a credibility assessment and analysis is performed on each data source of each IoT device to obtain a confidence characterization value of each data source of each IoT device. The specific process is: a monitoring period is set, during which the average request response time of each data source of each IoT device is monitored and counted, and the number of successful identity authentications and the total number of authentication attempts of each data source of each IoT device are extracted, and the first confidence factor of each data source of each IoT device is obtained after processing.
[0049] During the monitoring period, the total amount of data from each data source of each IoT device is monitored and extracted, the total amount of missing data from each data source of each IoT device during the monitoring period is counted, the missing data ratio of each data source of each IoT device is obtained, and the total number of erroneous data items of each data source of each IoT device is counted, and the second confidence factor of each data source of each IoT device is obtained after processing.
[0050] It should be noted that the second confidence factor of each data source of each IoT device is obtained by performing data analysis on the total amount of data of each data source of each IoT device and the total amount of missing data of each data source of each IoT device. The second confidence factor of each data source of each IoT device can also be obtained by collecting historical performance data of each data source, including data transmission delay, packet loss rate, error rate, etc. Then, an anomaly detection algorithm such as the isolation forest algorithm is used to identify and process abnormal data. Next, the historical performance data of each data source is extracted and the model is trained using the random forest algorithm to evaluate the reliability of the data source. Finally, the confidence factor of the data source is further optimized and predicted by the support vector machine, so as to obtain the second confidence factor of each data source of each IoT device. In this embodiment, it is obtained by the following calculation method, and the specific calculation method is as follows:
[0051]
[0052] Wherein, Yi→j represents the second confidence factor of the jth data source of the ith IoT device, Qi→j represents the total number of missing data of the jth data source of the ith IoT device, Gi→j represents the total number of erroneous data items of the jth data source of the ith IoT device, Bi→j represents the total number of data of the jth data source of the ith IoT device, δ3 represents the correction factor corresponding to the set missing data, δ4 represents the correction factor corresponding to the set erroneous data item, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
[0053] As shown in Table 1, Table 1 is example data of the second confidence factor of each data source of each IoT device, which lists the total amount of erroneous data and the value of the second confidence factor of each data source of each IoT device.
[0054] Table 1 Example data of the second confidence factor of each data source of each IoT device
[0055]
[0056] It should be noted that if the total number of erroneous data items of a data source of a certain IoT device is large (for example, 92 erroneous data items), the second confidence factor of the data source of the IoT device will also be relatively high (0.259), indicating that the reliability of the data source is low. Conversely, if the total number of erroneous data items of a data source of a certain IoT device is small (for example, 15 erroneous data items), the second confidence factor of the data source of the IoT device is low (0.105), indicating that the reliability of the data source is high. This can help operation and maintenance personnel identify and improve low-quality data sources, thereby improving the stability and reliability of the overall unique identifier generation.
[0057] It should be noted that by calculating the second confidence factor, the reliability of each data source can be quantitatively evaluated, which is crucial in the process of data integration and use to ensure the credibility and accuracy of the data source.
[0058] It should be noted that the total number of data from each data source of each IoT device represents the total number of data items received from a data source during the monitoring period, which is obtained by recording the number of data packets or data items received from the data source during the monitoring period, such as recording each data item received in a log file, and when the monitoring period ends, the total number of data is obtained by counting the number of entries in the log file. The total number of missing data from each data source of each IoT device represents the number of data items actually missing from the data items expected to be received from a data source during the monitoring period, which is obtained by comparing the number of data items expected to be received with the number of data items actually received, and calculating the missing data items. For example, at the end of the monitoring period, the total number of missing data is obtained by subtracting the total number of data items actually received from the total number of expected data.
[0059] It should be noted that if Figure 2 As shown in FIG. 1 , it is a schematic diagram of the relationship between the second confidence factor and the total number of erroneous data items, where the x-axis represents the total number of erroneous data items (in units), and the y-axis represents the second confidence factor. Three different sets of example parameters are defined in the figure, corresponding to different situations of the three curves, respectively represented by solid lines, dashed lines and dot-dash lines, and the corresponding curve labels are a, b, and c. When the total number of missing data is 100, the schematic diagram of the relationship between the second confidence factor and the total number of erroneous data items is shown in curve a, when the total number of missing data is 300, the schematic diagram of the relationship between the second confidence factor and the total number of erroneous data items is shown in curve b, and when the total number of missing data is 500, the schematic diagram of the relationship between the second confidence factor and the total number of erroneous data items is shown in curve c. And as the total number of erroneous data items increases, the second confidence factor also increases. Different total numbers of missing data will affect the trend of the curve. In general, as the total number of missing data increases, the position of the curve will shift. Therefore, as the total number of missing data increases, the overall position of the overall trend curve may move to the left, which means that with the same total number of erroneous data items, the value of the second confidence factor will increase, indicating that the integrity of the data is affected, resulting in a decrease in trust in the data source.
[0060] It should be noted that the total number of error data items of each data source of each IoT device represents the number of data items received within a monitoring cycle but containing errors (such as format errors, abnormal values, etc.). It is obtained by verifying whether the received data items conform to the expected format and range, and counting the number of data items containing errors. For example, when receiving each piece of data, the data is checked by the data verification module. If the data does not conform to the expected format or value range, it is marked as error data and recorded. Exemplarily, it is assumed that a data source of a certain IoT device is expected to receive 1000 pieces of data within the monitoring cycle, but 950 pieces of data are actually received within the monitoring cycle, so the total number of data of the data source of the IoT device is 950 pieces of data. Then the total number of missing data of the data source of the IoT device is 1000-950=50. And among the 950 pieces of data actually received, it is found that 20 pieces of data have errors (for example, the value exceeds the reasonable range or the format is wrong), then the total number of error data items of the data source of the IoT device is 20.
[0061] It should be noted that data analysis of the total amount of data from each data source of each IoT device and the total amount of missing data from each data source of each IoT device can better evaluate the reliability and data quality of the data source of each IoT device, and provide reliable data support for the subsequent generation of unique identifiers. And it can effectively screen out high-quality and high-reliability data sources. High-quality data sources can ensure the accuracy and reliability of the generated unique identifiers, enhance the overall security and credibility of the blockchain system, and thus better manage and verify the identity of IoT devices.
[0062] It should be noted that the correction factor corresponding to missing data is usually determined based on the degree of impact of missing data on the overall data credibility of the data source of each IoT device. The correction factor corresponding to missing data is usually set between 0.1 and 0.9, and the formula is made more adaptable by adjusting the value of the correction factor. For example, in an application scenario of a certain IoT device, data integrity is crucial to the stability and reliability of the system, and missing data will seriously affect the normal operation of the system. In this case, a higher correction factor will be given to missing data to emphasize the importance of data integrity, so the correction factor corresponding to missing data can be set to 0.8. In addition, if the impact of missing data on the overall data credibility of the data source of each IoT device is not so serious, or there are other data processing mechanisms that can partially compensate for the impact of missing data, then the correction factor can be relatively low. For example, the correction factor corresponding to missing data is set to 0.6.
[0063] It should be noted that the correction factor corresponding to the erroneous data item is usually determined based on the degree of influence of the erroneous data on the overall data credibility of the data source of each IoT device. The value range of the correction factor corresponding to the erroneous data item is between 0.1 and 0.9. By adjusting the value of the correction factor, the formula is more adaptable. For example, suppose that in an application scenario of a certain IoT device, the accuracy of the data is crucial to the reliability and performance of the system, and the erroneous data item will cause the system to make misjudgments or wrong decisions, thereby seriously affecting the normal operation of the system. In this case, a higher correction factor will be given to the erroneous data item to emphasize the importance of data accuracy. Therefore, the correction factor corresponding to the erroneous data item can be set to 0.6. In addition, if the degree of influence of the erroneous data on the overall data credibility of the data source of each IoT device is not so serious, or there are other data processing mechanisms that can partially correct the impact of the erroneous data item, then the correction factor can be relatively low, so the correction factor corresponding to the erroneous data item can be set to 0.4.
[0064] According to the first confidence factor of each data source of each Internet of Things device and the second confidence factor of each data source of the Internet of Things device, a confidence representation value of each data source of each Internet of Things device is obtained through processing.
[0065] It should be noted that in the Internet of Things, the data sources of each device refer to the various devices and nodes used to collect and transmit data. These data sources can be physical devices, sensors, gateways, servers, etc.
[0066] It should be noted that in a blockchain environment, each IoT device has a unique identifier (UID). By calculating the confidence of the device, this information can be associated with the UID to enhance the credibility of the identifier. The higher the confidence, the more reliable the data source of the device, and the more credible the identifier. High-confidence device identifiers can prevent forgery. On the blockchain, all transactions and records are transparent and cannot be tampered with. By combining confidence assessment, it is possible to better detect and prevent the addition of untrusted devices or data sources, and ensure the security and reliability of IoT devices.
[0067] Specifically, the confidence representation value of each data source of each IoT device is a numerical quantification result obtained by performing a credibility assessment analysis on each data source of each IoT device, and is used to quantify the credibility and reliability of the data source of each IoT device.
[0068] It should be noted that the data credibility is evaluated and combined with data fusion, resource optimization and security management. By scientifically and reasonably setting and calculating the confidence characterization value, the overall performance and security of the Internet of Things system can be greatly improved.
[0069] Specifically, each authentication data source of each IoT device is screened, and the specific process is: according to the confidence characterization value of each data source of each IoT device, and compared with the set confidence characterization threshold of the IoT device data source, if the confidence characterization value of a data source of a certain IoT device is higher than or equal to the confidence characterization threshold of the IoT device data source, then the data source of the IoT device is extracted and recorded as a trusted data source, thereby traversing to obtain each authentication data source of each IoT device.
[0070] It should be noted that the confidence characterization threshold of the IoT device data source analyzes historical data, including analysis of indicators such as data quality, data integrity, authentication success rate, and response time, determines the performance of different data sources, and identifies which data sources have performed well in the past. The confidence characterization values of all data sources in the past period of time are obtained, and the statistical distribution of these values (such as mean, standard deviation, quantile, etc.) is calculated. Then, the threshold is set based on these statistical results. For example, the collected historical confidence characterization values are: [85, 90, 78, 92, 88, 80, 95, 87, 89, 91], and the average value of the historical confidence characterization values is calculated = (85+90+78+92+88+80+95+87+89+91) / 10 = 87.5 and Finally, the confidence threshold of the IoT device data source is set to mean value - standard deviation = 87.5 - 5.28 ≈ 82.22. Alternatively, the quantile method is used. The 90th percentile value may be around 91, so the confidence threshold is set to 91.
[0071] Specifically, multi-type data of each data source of each IoT device is obtained, and hash calculation is performed to obtain preset hash values of each data source of each IoT device. The specific process is: extract multi-type data of each data source of each IoT device, including initial identification, public key, geographic location data and environmental parameters, and fit the multi-type data of each data source of each IoT device to obtain the fitting string of each data source of each IoT device, which is imported into the hash algorithm for calculation to obtain the preset hash value of each data source of each IoT device.
[0072] It should be noted that the initial identifier of the device in this embodiment is the device serial number or MAC address. Geographic location data includes latitude, longitude, altitude, etc. Environmental parameters include temperature, humidity, light intensity, air pressure, etc.
[0073] It should be noted that the multi-type data from each data source of each IoT device is fitted and spliced to form a string. This step is to merge the two parts of information into a unified input for subsequent hash calculation.
[0074] It should be noted that the specific process of fitting the multi-type data of each data source of each IoT device is as follows: First, collect the multi-type data of each data source, such as the initial identification, public key, geographic location data and environmental parameters. Then, standardize these data to ensure that they have the same data format and unit. Then, concatenate the standardized data in a certain order to form a complete data string. This order can be determined according to the importance of the data or other requirements. Finally, the standardized, concatenated and converted data strings are spliced together to form a fitting string. For example, suppose there is an IoT device whose multi-type data includes an initial identification of "device123", a public key of "abc123", a geographic location of longitude 120.1234 and latitude 30.5678, and an environmental parameter of temperature 25°C. Then, the fitting string may be: "device123_abc123_120.1234_30.5678_25". This string can be used as the input of the hash algorithm to generate a preset hash value.
[0075] It should be noted that the preset hash value is recorded in the blockchain or central server when the device is first registered as the unique identifier of the device. In the subsequent data transmission process of the device, the preset hash value of the device is used for data integrity verification and device authentication. The uniqueness and anti-counterfeiting of the device identity are ensured by the hash value. It can ensure that the identifier of each IoT device is unique and secure, providing a reliable authentication basis for the IoT system.
[0076] It should be noted that each IoT device has a unique initial identifier (Initial Identifier) when it leaves the factory, which is usually the serial number (Serial Number) or MAC address of the device, such as "device-12345ABC".
[0077] It should be noted that each IoT device generates a pair of public and private keys when it is used for the first time. The public key can be made public, while the private key must be kept secret. The IoT device generates a pair of keys by using the elliptic curve encryption algorithm, and then stores the public key on the device and the trusted blockchain.
[0078] It should be noted that the hash algorithm converts an input of any length into an output of a fixed length through a hash algorithm. Common hash algorithms include SHA-256, SHA-3, etc. The hash value is a unique digital fingerprint used to verify the integrity of the data. The hash algorithm usually maps the input data to a hash value of a fixed length. For example, the SHA-256 algorithm is a commonly used hash algorithm, which converts the input data into a 256-bit hash value. For example, there is a string "Hello, Worl d!", and we use the SHA-256 algorithm to hash it, and the resulting hash value may be 861844d6704e8573fec34d967e20bcfef3d424cf8fdef3a31e1457a2e92bab98. The hash value is a fixed-length hexadecimal string. No matter how long the input data is, the length of the hash value remains unchanged. This feature makes the hash algorithm very suitable for generating unique identifiers for data, because even if the input data changes slightly, the generated hash value will be very different, thus ensuring uniqueness.
[0079] It should be noted that geographic location data is obtained through technologies such as the GPS module on the device, Wi-Fi positioning, and cellular network triangulation. For example, the device's GPS module detects the current location and records its longitude and latitude, such as "latitude: 37.7749°N, longitude: 122.4194°W".
[0080] It should be noted that environmental data is obtained through various sensors on the device, such as temperature, humidity, light, air pressure, air quality, etc.
[0081] It should be noted that when a device is first registered, the generated preset hash value (device hash) is sent to the blockchain or central server for recording. This preset hash value will serve as the unique identifier of the device.
[0082] It should be noted that by acquiring and integrating these multi-type data, a unique and reliable identifier can be generated for each IoT device, and the authenticity and integrity of the data can be ensured. The data is calculated through a hash algorithm to obtain the preset hash value of the device and stored in the blockchain, further enhancing the security and immutability of the data.
[0083] Specifically, the verification request results of each data source of each IoT device are judged, and the specific judgment process is: the preset hash value of each data source of each IoT device and the corresponding related metadata are packaged, and a blockchain transaction is created and sent to the network node.
[0084] It should be noted that creating a blockchain transaction refers to creating a new transaction in the blockchain network. This transaction can be a contract call, data storage and other operations. When creating a blockchain transaction, you need to specify the sender, receiver, validity period and other information of the transaction. The created blockchain transaction will be broadcast to the entire blockchain network, waiting to be packaged into the block and confirmed. By creating a blockchain transaction, various types of data exchange and smart contract execution can be realized on the blockchain.
[0085] Extract the hash value of each IoT device in the blockchain transaction information of the network node and record it as the current hash value of each IoT device.
[0086] It should be noted that the hash value of each IoT device in the blockchain transaction information of the network node is usually extracted through the data structure of the blockchain. On the blockchain, each block contains a series of transaction information, and each transaction has a unique hash value for identification. Therefore, to extract the hash value of a specific IoT device, it is necessary to traverse the entire blockchain, find the block containing the transaction related to the device, and extract the corresponding hash value from it. For example, the blockchain transaction information can be obtained through the blockchain browser or the API interface of the blockchain node, and then the transactions containing the relevant information of the target IoT device can be filtered out. For each transaction, the hash value can be extracted as the hash value of the IoT device.
[0087] The preset hash value of each data source of each IoT device is extracted, and compared with the current hash value of each IoT device to obtain the verification request result of each data source of each IoT device. The verification request result of each data source of each IoT device is a valid verification result or an invalid verification result. If a trusted data source of a certain IoT device is consistent with the current hash value of the IoT device, the verification request result of the trusted data source of the IoT device is defined as a valid verification request. If a certain IoT device in a trusted data source is inconsistent with the current hash value of the IoT device, the verification request result of the IoT device in the trusted data source is defined as an invalid verification request.
[0088] It should be noted that once the transaction is verified, it will be recorded on the blockchain and become public, unalterable device registration information. The device's U ID becomes a record item on the blockchain.
[0089] It should be noted that after receiving the transaction, the nodes in the network will verify it, including checking the integrity of the data and the validity of the signature.
[0090] It should be noted that the verified transactions will be packaged into a new block. This block contains multiple transactions, forming a blockchain data structure. The newly created block is added to the end of the blockchain, and all nodes will update the blockchain synchronously to ensure data consistency across the entire network. Once the data is stored in the blockchain, it becomes an immutable record. The system and users can query the blockchain to access the stored preset hash value and its metadata for verification and auditing.
[0091] Specifically, the unique identifier of each authentication data source of each IoT device and the corresponding related metadata are counted and stored in the blockchain. The specific process is: the unique identifier of each authentication data source of each IoT device whose verification request result is a valid verification request and the corresponding related metadata are packaged into a block and stored in the blockchain.
[0092] Specifically, the confidence characterization value of each data source of each IoT device, the specific analysis conditions are:
[0093]
[0094] Where Zi→j represents the confidence representation value of the jth data source of the i-th IoT device, Wi→j represents the first confidence factor of the jth data source of the i-th IoT device, Yi→j represents the second confidence factor of the jth data source of the i-th IoT device, Indicates the weight factor corresponding to the first confidence factor set, It represents the weight factor corresponding to the set second confidence factor, i represents the number of each IoT device, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
[0095] It should be noted that the determination of weight factors usually needs to be adjusted and set according to specific application scenarios and requirements. It can be set based on experience or professional knowledge, or determined by data analysis or machine learning algorithms. The weight factor is a value between 0 and 1. For example, assuming that in a certain IoT device scenario, the request response time of the data source is critical to system performance, so we believe that the request response time in the first confidence factor should have a greater weight. At the same time, the number of successful authentications and the total number of authentication attempts are also important indicators, but the weights can be slightly lower than the request response time. In this case, the weight factor corresponding to the first confidence factor can be set to 0.6, and the weight factor corresponding to the second confidence factor can be set to 0.4. By flexibly adjusting the weight factors according to actual needs and preferences, the importance and confidence of the data source can be better reflected.
[0096] Specifically, the first confidence factor of each data source of each IoT device is analyzed under the following specific conditions:
[0097]
[0098] Wherein, Wi→j represents the first confidence factor of the jth data source of the ith IoT device, Ti→j represents the average request response time of the jth data source of the ith IoT device, ci→j represents the number of successful authentications of the jth data source of the ith IoT device, Ki→j represents the total number of authentication attempts of the jth data source of the ith IoT device, ΔT represents the set reference request response time, ΔP represents the set reference authentication success rate, δ1 represents the correction factor corresponding to the set request response time, δ2 represents the correction factor corresponding to the set authentication success rate, i represents the number of each IoT device, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
[0099] It should be noted that the ratio of the number of successful authentications to the total number of authentication attempts is the authentication success rate, which reflects the success rate of the data source in identity authentication. A high authentication success rate indicates that the data source rarely fails to authenticate when connected to the Internet of Things, which means that the data source itself is more credible and reliable.
[0100] It should be noted that the reference request response time refers to a benchmark or standard response time, which is used to compare with the actual request response time. By checking the distribution of past request response times, the system's response time requirements are determined. For example, historical request response time data over a period of time is collected, and the average or median of the historical request response time data is calculated as a reference. In this embodiment, the average value in the historical request response time data is used as the reference request response time. For example, if the average request response time in the past month is 5.5 seconds, the reference request response time can be set to 5.5 seconds.
[0101] It should be noted that the correction factor corresponding to the request response time is used to adjust the confidence representation value to reflect the impact of the deviation of the request response time on the reliability of the data source. Assume that the reference request response time has been determined to be 5.5 seconds. In addition, the actual request response time of a data source is 7 seconds. Therefore, the correction factor can be set to the ratio of the reference request response time to the actual request response time, which is 5.5 / 7=0.78.
[0102] It should be noted that the reference authentication success rate refers to a pre-set benchmark authentication success rate, which is used to evaluate and compare the actual authentication success rates of various data sources to help determine their reliability and credibility. This benchmark is usually set by statistically analyzing the authentication success rates of various historical data sources and calculating the average authentication success rates of each data source. For example, assuming that data source A: 80 / 100, data source B: 85 / 100, data source C: 90 / 100, data source D: 95 / 100, the average authentication success rate of these data sources is calculated as the reference authentication success rate, and the average authentication success rate is finally calculated to be 87.5%, then the reference authentication success rate can be set to 87.5%.
[0103] It should be noted that the correction factor corresponding to the authentication success rate is used to reflect the impact of the authentication success rate on the credibility of the data source in the overall credibility assessment, and is used to adjust and standardize the value of the authentication success rate, and to correct the confidence characterization value of the data source to reflect its reliability. By analyzing historical data, we can understand the actual impact of the authentication success rate on the credibility of the data source. For example, suppose that the credibility assessment of the data source is required to be as strict as possible. Then after analysis and evaluation, it is determined that the authentication success rate has a greater impact on the credibility of the data source, so a higher correction factor needs to be set. For example, the correction factor can be set to 1.2, indicating that the impact of the authentication success rate on the credibility of the data source is increased by 20%. In this way, data sources with higher authentication success rates will receive higher credibility assessment values, and thus have a more important position in the system, while data sources with lower authentication success rates will be subject to stricter evaluation and monitoring.
[0104] The second aspect of the present invention also provides a unique identifier generation system based on blockchain, characterized in that it includes: a data source credibility assessment and analysis module, which is used to collect relevant metadata of each Internet of Things device, perform credibility assessment and analysis on each data source of each Internet of Things device, obtain the confidence characterization value of each data source of each Internet of Things device, and screen out each authenticated data source of each Internet of Things device.
[0105] The hash value calculation module is used to obtain multi-type data from each data source of each IoT device, and perform hash calculation to obtain the preset hash value of each data source of each IoT device.
[0106] The data source credibility evaluation and analysis module is used to obtain the data source verification request of each IoT device and determine the result of the data source verification request of each IoT device.
[0107] The data storage module is used to generate a unique identifier based on the verification request results of each data source of each IoT device, and to count the unique identifiers of each authentication data source of each IoT device and the corresponding related metadata and store them in the blockchain.
[0108] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0109] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for generating a unique identifier based on blockchain, characterized in that: include: Collect relevant metadata of each IoT device, conduct credibility assessment and analysis on each data source of each IoT device, obtain the confidence representation value of each data source of each IoT device, and screen to obtain each authenticated data source of each IoT device; Obtain multi-type data of each data source of each IoT device, and perform hash calculation to obtain a preset hash value of each data source of each IoT device; Obtain verification requests for each data source of each IoT device, and determine verification results for each data source of each IoT device; Generate a unique identifier based on the verification request results of each data source of each IoT device, and count the unique identifiers of each authentication data source of each IoT device and the corresponding related metadata and store them in the blockchain; The credibility evaluation and analysis of each data source of each IoT device is performed to obtain the confidence representation value of each data source of each IoT device. The specific process is as follows: A monitoring period is set, during which an average request response time of each data source of each IoT device is monitored and counted, and the number of successful identity authentications and the total number of attempted authentications of each data source of each IoT device are extracted, and a first confidence factor of each data source of each IoT device is obtained after processing; During the monitoring period, the total amount of data and the total amount of missing data from each data source of each IoT device are monitored and extracted, and the missing data ratio of each data source of each IoT device is obtained through processing, and the total number of erroneous data items of each data source of each IoT device is counted, and the second confidence factor of each data source of each IoT device is obtained through processing; According to the first confidence factor of each data source of each IoT device and the second confidence factor of each data source of each IoT device, a confidence representation value of each data source of each IoT device is obtained through processing; The specific judgment process of judging the result of each data source verification request of each IoT device is as follows: Pack the preset hash values and corresponding metadata of each data source of each IoT device, and create a blockchain transaction to send to the network node; Extract the hash value of each IoT device in the blockchain transaction information of the network node and record it as the current hash value of each IoT device; Extract the preset hash value of each data source of each IoT device, and compare it with the current hash value of each IoT device to obtain the verification request result of each data source of each IoT device. The verification request result of each data source of each IoT device is a valid verification result or an invalid verification result. If a trusted data source of a certain IoT device is consistent with the current hash value of the IoT device, the verification request result of the trusted data source of the IoT device is defined as a valid verification request. If a certain IoT device in a trusted data source is inconsistent with the current hash value of the IoT device, the verification request result of the IoT device in the trusted data source is defined as an invalid verification request. The unique identifier of each authentication data source of each IoT device and the corresponding related metadata are counted and stored in the blockchain. The specific process is: Counting the verification request results of each data source of each IoT device, the unique identifier of each authentication data source of each IoT device with valid verification request and the corresponding related metadata are packaged into a block and stored in the blockchain; The confidence characterization value of each data source of each IoT device, the specific analysis conditions are: ; In the formula, represents the confidence representation value of the jth data source of the i-th IoT device, represents the first confidence factor of the jth data source of the i-th IoT device, represents the second confidence factor of the jth data source of the i-th IoT device, Indicates the weight factor corresponding to the first confidence factor set, It represents the weight factor corresponding to the set second confidence factor, i represents the number of each IoT device, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
2. A method for generating a unique identifier based on blockchain according to claim 1, characterized in that: The confidence characterization value of each data source of each IoT device is a numerical quantification result obtained by performing a credibility evaluation and analysis on each data source of each IoT device, and is used to quantify the credibility and reliability of the data source of each IoT device.
3. A method for generating a unique identifier based on blockchain according to claim 1, characterized in that: The screening process obtains the authentication data sources of each IoT device, and the specific process is as follows: According to the confidence characterization value of each data source of each IoT device, it is compared with the set confidence characterization threshold of the IoT device data source. If the confidence characterization value of a data source of a certain IoT device is higher than or equal to the confidence characterization threshold of the IoT device data source, the data source of the IoT device is extracted and recorded as a trusted data source. In this way, the authenticated data sources of each IoT device are traversed to obtain.
4. The method for generating a unique identifier based on blockchain according to claim 1, characterized in that: The process of obtaining multi-type data from each data source of each IoT device and performing hash calculation to obtain a preset hash value of each data source of each IoT device is as follows: Extract multi-type data from each data source of each IoT device, including initial identification, public key, geographic location data and environmental parameters, and fit the multi-type data from each data source of each IoT device to obtain a fitting string of each data source of each IoT device, import it into a hash algorithm for calculation, and obtain a preset hash value of each data source of each IoT device.
5. The method for generating a unique identifier based on blockchain according to claim 1, characterized in that: The first confidence factor of each data source of each IoT device is specifically analyzed under the following conditions: ; In the formula, represents the first confidence factor of the jth data source of the i-th IoT device, represents the average request response time of the jth data source of the i-th IoT device, represents the number of successful authentications of the jth data source of the i-th IoT device, represents the total number of authentication attempts of the jth data source of the i-th IoT device, Indicates the set reference request response time. Indicates the set reference authentication success rate, Indicates the correction factor corresponding to the set request response time. It represents the correction factor corresponding to the set authentication success rate, i represents the number of each IoT device, i=1,2,3....n, n represents the total number of IoT devices, j represents the number of each data source, j=1,2,3....m, m represents the total number of data sources.
6. A unique identifier generation system based on blockchain, used to execute a unique identifier generation method based on blockchain according to any one of claims 1 to 5, characterized in that: include: The data source credibility evaluation and analysis module is used to collect relevant metadata of each IoT device, conduct credibility evaluation and analysis on each data source of each IoT device, obtain the confidence representation value of each data source of each IoT device, and screen and obtain each authenticated data source of each IoT device; A hash value calculation module is used to obtain multi-type data of each data source of each IoT device, and perform hash calculation to obtain a preset hash value of each data source of each IoT device; The data source credibility evaluation and analysis module is used to obtain the data source verification request of each IoT device and determine the result of the data source verification request of each IoT device; The data storage module is used to generate a unique identifier based on the verification request results of each data source of each IoT device, and to count the unique identifiers of each authentication data source of each IoT device and the corresponding related metadata and store them in the blockchain.
