Data management method and system based on block chain and meta universe
By adopting smart device data collection, preprocessing and encryption processing in smart cities, and using blockchain and metacosmic technology for data management, the problems of data security and data sharing in smart cities are solved, and efficient and intelligent Data management and personalized recommendation services.
Patent Information
- Application Number
- CN202411506796.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There are challenges in data security and privacy protection in smart cities. It is difficult for existing technologies to effectively integrate and share data from different sources. Traditional data prediction methods are not accurate and cannot meet the precise decision-making needs of smart cities.
Use intelligent devices to collect initial data and preprocess it, encrypt data based on hash algorithm and store it on the blockchain, use virtual reality technology and three-dimensional modeling technology to build a meta-universe virtual digital space, through GAN adversarial network, LSTM network and improvement The Duckling Optimization Algorithm builds a GAN-LSTM intelligent prediction model to achieve safe, efficient and intelligent data management.
Ensure data security and privacy through encryption and blockchain storage, promote data sharing and collaboration, improve the accuracy and stability of data prediction, realize personalized recommendation services, and improve user experience and data management level in smart cities.
Smart Images

Figure CN119477195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data management method and system based on blockchain and metaverse. Background Art
[0002] Metaverse and blockchain technology play an important role in data management, data sharing interaction and data security. With the acceleration of urbanization and the development of information technology, the construction of smart cities has become an important development trend in today's society. At present, the security and privacy protection of smart city data have become urgent issues to be solved. In terms of data sharing and collaboration, due to the lack of effective platforms and technical means, data from different sources are difficult to integrate and share, which limits the coordinated development of smart cities. At the same time, traditional data prediction methods are usually not accurate enough to meet the precise decision-making needs of large amounts of data in smart cities. In terms of providing services to users, the existing smart city service model is relatively single and cannot meet the personalized needs of users. Although there are some smart city data management solutions in the existing technology, most of them focus on a single field or specific scenarios, and lack a comprehensive solution that combines smart cities with the metaverse. Therefore, how to combine the characteristics of blockchain and metaverse and manage smart city data safely, efficiently and intelligently is a technical problem that needs to be solved at this stage. Summary of the invention
[0003] The purpose of the present invention is to solve the above problems and to design a data management method and system based on blockchain and metaverse.
[0004] A first aspect of the present invention provides a data management method based on blockchain and metaverse, and the data management method based on blockchain and metaverse comprises the following steps:
[0005] Using smart devices to collect initial data in the smart city, preprocessing the initial data to complete the preprocessing operation through data cleaning processing, standardization processing, data labeling processing and data clustering processing to obtain first data;
[0006] Encrypting the first data based on a hash algorithm to obtain encrypted data, generating corresponding blocks from the encrypted data, verifying the blocks, determining the correspondence between off-chain data and on-chain block records, and completing the chain after verification to store the encrypted data on the blockchain to obtain second data;
[0007] Accessing the second data in the blockchain, and constructing a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology;
[0008] A GAN-LSTM intelligent prediction model is constructed by using a GAN adversarial network, an LSTM network, and an improved dung beetle optimization algorithm, and the GAN-LSTM intelligent prediction model is used to perform data prediction on the second data in a virtual digital space of the metaverse to obtain a prediction result;
[0009] In the virtual digital space of the Metaverse, users access smart city data through virtual reality devices or mobile terminals according to their needs, and the smart city makes personalized recommendations.
[0010] Optionally, in a first implementation of the first aspect of the present invention, the initial data in the smart city is collected by using a smart device, and the initial data is preprocessed to complete the preprocessing operation through data cleaning processing, standardization processing, data labeling processing and data clustering processing to obtain the first data, including:
[0011] Using smart devices to collect initial data in the smart city, performing data cleaning on the initial data to remove noise and outliers in the initial data, and using interpolation to fill missing values, wherein the smart devices at least include sensors and cameras, and the initial data at least include traffic data, environmental data, energy data, and public safety data;
[0012] The cleaned initial data is subjected to standardization and data annotation processing to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes data collection time, data collection location and collection equipment;
[0013] Different data points are randomly selected from the data to be classified as the initial clustering centers, and the minimum distance rule is used for the remaining data points in the data to be classified to obtain S j clusters;
[0014] S j =min{‖x i -z j ‖}
[0015] In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category;
[0016] Perform iterative clustering for each classified class, and modify each cluster center in each iteration:
[0017]
[0018] Where N j represents the number of data points in the jth category;
[0019] Reclassification is performed based on the obtained new cluster center. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering result, and the first data is obtained based on the clustering result of the data to be classified, so as to classify the initial data according to the nature and purpose of the data (for example, traffic data is divided into vehicle flow data, vehicle speed data, road congestion data, etc.; environmental data is divided into air quality data, noise data, water quality data, etc.).
[0020] Optionally, in a second implementation of the first aspect of the present invention, encrypting the first data based on a hash algorithm to obtain encrypted data includes:
[0021] The first data is divided into blocks of fixed length, each block is quantized and converted into characters, and the converted character code is used as the initial value of the chaotic hash algorithm mapping to perform chaotic mapping. The dual mapping equation can be expressed as:
[0022]
[0023] Where x and y represent the input values of the dual mapping, μ1 and μ2 represent the corresponding control parameters under the dual mapping conditions, xn and yn represent the x value and y value at the nth iteration, respectively, and xn+1 and yn+1 represent the x value and y value at the n+1th iteration, respectively;
[0024] Iteration is performed according to the number of iterations and precision, an array is generated and chaotic sequences X and Y are produced, and the final sequence Z = [XY] is obtained, where the relationship between the number of iterations and precision is expressed as:
[0025] Ln+1=2*Ln+Kλ
[0026] In the formula, Ln represents the current iteration parameter, and Lλ represents the current accuracy;
[0027] The decimal values of the final sequence are stored in a one-dimensional array, and grouped and seeded according to the number of digits of the hash summary, the size between the array sequence and the number of digits is determined, and encryption is performed to obtain the hash summary;
[0028] The array sequence generated by the previous iteration is used as a new initial parameter, and an iterative process is performed to generate another hash summary. The final hash summary sequence is obtained by iterating in sequence to complete the encryption process of the first data and obtain the encrypted data.
[0029] Optionally, in a third implementation of the first aspect of the present invention, storing the decimal values of the final sequence in a one-dimensional array, grouping and seeding according to the number of digits of the hash summary, determining the size between the array sequence and the number of digits, and performing encryption processing to obtain the hash summary includes:
[0030] Select two unequal values and perform extraction function processing on the two unequal values:
[0031]
[0032] In the formula, f represents the extraction function, X represents the data to be transmitted, represents iterative behavior, c and b represent two unequal values, G′ represents the new function obtained by extracting function from f, which is the subkey for data encryption transmission, and mod(f) represents the remainder operation on f;
[0033] The data length is aggregated using a hexadecimal mechanism so that the common factor of two unequal values minus 1 reaches the minimum value, and the encryption parameters of the RSA algorithm are obtained;
[0034] According to the size of the array sequence and the number of bits, the subkey is updated to generate a pair of public and private keys for encryption and decryption to obtain the hash summary:
[0035]
[0036] In the formula, S represents the encrypted data, h represents the public key matrix, l represents the key length, hl represents the random number, and Pl represents the data to be encrypted.
[0037] Optionally, in a fourth implementation of the first aspect of the present invention, accessing the second data in the blockchain, and constructing a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology, includes:
[0038] The system that constructs the virtual digital space of the Metaverse sends an access request to the blockchain, and generates a corresponding one-time authentication token based on the access request. Before each new one-time authentication token is generated, the previous authentication token is deleted, and the access rights of the deleted token are deleted at the same time:
[0039] C→η,η={τ}
[0040] In the formula, C represents the system for constructing the virtual digital space of the metaverse, η represents a one-time authentication token, and τ represents a large prime number;
[0041] After the token is verified, the conditional attributes of the system that builds the virtual digital space of the Metaverse are verified. After verification, the identity security of the system access that builds the virtual digital space of the Metaverse is determined, and the access token is obtained: (some characteristics of the client, such as IP address, browser version, etc.)
[0042]
[0043] Where g represents the authentication function; W, U, Denotes the known authentication key, one-time token, and conditional attributes, W′, U′, Represents the authentication key, one-time token and conditional attributes corresponding to the system that constructs the virtual digital space of the Metaverse;
[0044] Access the second data in the blockchain based on the access token, and establish a tamper-proof signed transaction to create a transaction record on the blockchain:
[0045] Data=h(t)‖C‖h block
[0046] In the formula, Data represents the content of the required signature, h(t) represents the hash value of the timestamp, C represents the content of the smart contract, and h block represents the hash value of the block in the current blockchain, and ‖·‖ represents the linking operation, which connects the transaction data and signature together.
[0047] Optionally, in a fifth implementation of the first aspect of the present invention, the GAN-LSTM intelligent prediction model is constructed by using the GAN adversarial network, the LSTM network and the improved dung beetle optimization algorithm, and the GAN-LSTM intelligent prediction model is used to perform data prediction on the second data in the metaverse virtual digital space to obtain a prediction result, including:
[0048] The data samples of the smart city are input into the GAN adversarial network. In the generation of the GAN adversarial network, Gaussian random noise is added to the generator. The spatial mapping principle of the generator is used to map the Gaussian noise space to a high-dimensional saturation space field, and data is generated in the generator.
[0049] Input smart city data samples into the discriminator network and train them using the GAN adversarial network trainer. Use the trained discriminator to reversely adjust the data generated by the generator. Use the alternating training of the discriminator and the generator to obtain the equilibrium point of the GAN adversarial network.
[0050] The GAN adversarial network generator is connected to the output layer of the LSTM network, and the improved dung beetle optimization algorithm is used to optimize the parameters to obtain the GAN-LSTM intelligent prediction model;
[0051] The second data is input into the GAN-LSTM intelligent prediction model and the GAN adversarial network generator is used to map the time series spatial feature extraction results to the saturation field of the next time series. The operation is repeated until the final prediction result is obtained, wherein the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
[0052] Optionally, in a sixth implementation of the first aspect of the present invention, the GAN adversarial network generator is connected to the output layer of the LSTM network, and an improved dung beetle optimization algorithm is used to perform parameter optimization to obtain a GAN-LSTM intelligent prediction model, including:
[0053] Set the population size and the maximum number of iterations. During the initialization of the position update process, use the Piecewise chaotic mapping to initialize the position of the dung beetle.
[0054] Calculate the fitness value of each dung beetle and determine whether the fitness is less than 0.9. If so, update the position of the rolling dung beetle using the following formula:
[0055]
[0056] In the formula, represents the position of the i-th dung beetle in the j-th dimension in the first stage, H i,j Indicates the starting position of the rolling dung beetle, SF i,j represents the scale factor used to control the moving speed of the rolling dung beetle, r i,j Represents a random number from 0 to 1, I i,j Indicates that the inertia weight is 0 or 1;
[0057] Otherwise, update the position of the rolling dung beetle using the following formula:
[0058] X i (t+1)=X i (t)+|X i (t)-X i (t-1)|tanθ
[0059] Where, X i (t+1) represents the position of the i-th ball beetle at the t+1th iteration, X i (t) represents the position of the t-th rolling dung beetle at the t-th iteration, X i (t-1) represents the position of the i-th ball-rolling dung beetle at the t-1th iteration, and tanθ represents the jumping angle of the ball-rolling dung beetle;
[0060] Update the positions of breeding dung beetles (a female dung beetle will lay a brood ball in the egg-laying area in one iteration), young dung beetles (newly grown dung beetles will crawl out of the nest to look for food), and stealing dung beetles (in the dung beetle population, some dung beetles will steal the dung balls of other dung beetles), make boundary judgments for each dung beetle, calculate the fitness value of each dung beetle, and find the optimal solution, where the ratio of rolling dung beetles, breeding dung beetles, young dung beetles, and stealing dung beetles is 6:6:7:11;
[0061] An adaptive T-distribution perturbation strategy is used to perturb the current optimal solution to generate a new solution. If it is better than the optimal value, it is updated to the optimal value. It is judged whether the current number of iterations is less than the maximum number of iterations. If so, the iteration continues. Otherwise, the optimal position and fitness value are output, and the GAN adversarial network and LSTM network are assigned to obtain the GAN-LSTM intelligent prediction model.
[0062] The second aspect of the present invention provides a data management system based on blockchain and metaverse, wherein the data management system based on blockchain and metaverse includes a data preprocessing module, a data encryption module, a construction module, a data prediction module and an access module, wherein:
[0063] A data preprocessing module, used to collect initial data in the smart city using smart devices, and preprocess the initial data to complete the preprocessing operation through data cleaning processing, standardization processing, data labeling processing and data clustering processing to obtain first data;
[0064] A data encryption module is used to encrypt the first data based on a hash algorithm to obtain encrypted data, generate corresponding blocks from the encrypted data, verify the blocks, determine the corresponding relationship between the off-chain data and the on-chain block records, complete the chain after verification, so as to store the encrypted data on the blockchain to obtain second data;
[0065] A construction module, used to access the second data in the blockchain, and construct a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology;
[0066] A data prediction module, used to construct a GAN-LSTM intelligent prediction model through a GAN adversarial network, an LSTM network and an improved dung beetle optimization algorithm, and to perform data prediction on the second data using the GAN-LSTM intelligent prediction model in a virtual digital space of the metaverse to obtain a prediction result;
[0067] The access module is used to enable users to access the data of the smart city through virtual reality devices or mobile terminals in the virtual digital space of the metaverse according to their needs, and the smart city will make personalized recommendations.
[0068] Optionally, in a first implementation of the second aspect of the present invention, the data preprocessing module includes a data cleaning processing submodule, a data labeling processing submodule, a selection submodule, an iterative clustering submodule and a classification submodule, wherein:
[0069] The data cleaning processing submodule is used to collect initial data in the smart city using smart devices, perform data cleaning on the initial data to remove noise and outliers in the initial data, and fill in missing values using interpolation;
[0070] The data annotation processing submodule is used to perform standardization and data annotation processing on the cleaned initial data to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes the data collection time, data collection location and collection equipment;
[0071] The selection submodule is used to randomly select different data points from the data to be classified as the initial clustering center, and use the minimum distance rule for the remaining data points in the data to be classified to obtain S j clusters;
[0072] S j =min{‖x i -z j ‖}
[0073] In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category;
[0074] The iterative clustering submodule is used to perform iterative clustering for each classified class, and to modify each cluster center in each iteration:
[0075]
[0076] Where N j represents the number of data points in the jth category;
[0077] The classification submodule is used to reclassify according to the obtained new cluster center. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering result, and the first data is obtained based on the clustering result of the data to be classified, so as to classify the initial data according to the nature and purpose of the data.
[0078] Optionally, in a second implementation of the second aspect of the present invention, the data prediction module includes a mapping submodule, a training submodule, a parameter optimization submodule and a feature extraction submodule, wherein:
[0079] A mapping submodule is used to input the data samples of the smart city into the GAN adversarial network. In the generation of the GAN adversarial network, Gaussian random noise is added to the generator, and the spatial mapping principle of the generator is used to map the Gaussian noise space to a high-dimensional saturation space field, and generate data in the generator;
[0080] The training submodule is used to input the data samples of the smart city into the discriminator network and train it using the trainer in the GAN adversarial network. The trained discriminator is used to reversely adjust the data generated by the generator, and the balance point of the GAN adversarial network is obtained by alternating the training of the discriminator and the generator.
[0081] The parameter optimization submodule is used to connect the GAN adversarial network generator with the output layer of the LSTM network, and use the improved dung beetle optimization algorithm to perform parameter optimization to obtain the GAN-LSTM intelligent prediction model;
[0082] The feature extraction submodule is used to input the second data into the GAN-LSTM intelligent prediction model and use the GAN adversarial network generator to map the time series spatial feature extraction results to the saturation field of the next time series, and repeat the operation until the final prediction result is obtained, wherein the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
[0083] In the technical solution provided by the present invention, 1. By using intelligent devices to collect initial data in the smart city, the initial data is preprocessed to complete the preprocessing operation through data cleaning, standardization, data annotation and data clustering, which can improve the data quality and effectively improve the quality and availability of the data. 2. The first data is encrypted based on the hash algorithm, and the encrypted data is used to generate corresponding blocks, and the blocks are verified to determine the corresponding relationship between the off-chain data and the on-chain block records. After verification, the encrypted data is stored on the blockchain, which can ensure data security and privacy. The data is encrypted and processed by the hash algorithm to ensure data security; at the same time, the integrity and non-tamperability of the data are further enhanced to protect the privacy of users. 3. Based on the second data in the blockchain, the virtual digital space of the metaverse of the smart city is constructed using virtual reality technology and three-dimensional modeling technology, which can promote data sharing and collaboration. The virtual digital space of the smart city constructed in the metaverse environment enables data from different sources to be accessed and used on a unified platform, which promotes data sharing and cross-domain collaboration. 4. Improve data prediction accuracy: Construct a GAN-LSTM intelligent prediction model through the GAN adversarial network, LSTM network and improved dung beetle optimization algorithm, and use the GAN-LSTM intelligent prediction model to predict the second data in the virtual digital space of the metaverse, which significantly improves the accuracy and stability of data prediction. 5. Realize personalized recommendation services. Users can directly access the data of smart cities through virtual reality devices or mobile terminals, and obtain personalized recommendation services according to their own needs, which improves user experience and service efficiency. 6. Promote the sustainable development of smart cities. The present invention not only helps to improve the data management level of smart cities, but also constructs an intuitive metaverse virtual digital space through virtual reality technology and three-dimensional modeling technology, which provides strong support for urban planning and resource allocation, and is conducive to promoting the development of smart cities in the direction of intelligence. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0085] Figure 1 A schematic diagram of a first embodiment of a data management method based on blockchain and metaverse provided by an embodiment of the present invention;
[0086] Figure 2 A schematic diagram of data preprocessing of a data management method based on blockchain and metaverse provided in an embodiment of the present invention;
[0087] Figure 3A schematic diagram of model data prediction of a data management method based on blockchain and metaverse provided in an embodiment of the present invention;
[0088] Figure 4 A structural diagram of a data management system based on blockchain and metaverse provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0089] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to the process, method, product or device.
[0090] Example 1
[0091] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 A first embodiment schematic diagram of a data management method based on blockchain and metaverse provided by an embodiment of the present invention, the method specifically comprises the following steps:
[0092] Step 101: using smart devices to collect initial data in the smart city, preprocessing the initial data to complete the preprocessing operation through data cleaning processing, standardization processing, data labeling processing and data clustering processing to obtain first data;
[0093] Specifically, in this embodiment, smart devices are used to collect initial data in the smart city, and data cleaning is performed on the initial data to remove noise and outliers in the initial data, and interpolation is used to fill missing values, wherein the smart devices include at least sensors and cameras, and the initial data include at least traffic data, environmental data, energy data, and public safety data;
[0094] The cleaned initial data is standardized and annotated to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes data collection time, data collection location and collection equipment;
[0095] Randomly select different data points from the data to be classified as the initial clustering center, and use the minimum distance rule for the remaining data points in the data to be classified to obtain Sj clusters;
[0096] S j =min{‖x i -z j ‖}
[0097] In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category;
[0098] Perform iterative clustering for each classified class, and modify each cluster center in each iteration:
[0099]
[0100] Where N j represents the number of data points in the jth category;
[0101] Reclassification is performed based on the new cluster centers obtained. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering results. Based on the clustering results of the data to be classified, the first data is obtained to classify the initial data according to the nature and purpose of the data (for example, traffic data is divided into vehicle flow data, vehicle speed data, road congestion data, etc.; environmental data is divided into air quality data, noise data, water quality data, etc.).
[0102] Step 102: Encrypt the first data based on a hash algorithm to obtain encrypted data, generate corresponding blocks from the encrypted data, verify the blocks, determine the corresponding relationship between the off-chain data and the on-chain block records, complete the chain after verification, and store the encrypted data on the blockchain to obtain second data;
[0103] Specifically, in this embodiment, the first data is encrypted based on the hash algorithm, and the encrypted data obtained includes:
[0104] The first data is divided into blocks of fixed length, each block is quantized and converted into characters, and the converted character code is used as the initial value of the chaotic hash algorithm mapping to perform chaotic mapping. The dual mapping equation can be expressed as:
[0105]
[0106] Where x and y represent the input values of the dual mapping, μ1 and μ2 represent the corresponding control parameters under the dual mapping conditions, xn and yn represent the x value and y value at the nth iteration, respectively, and xn+1 and yn+1 represent the x value and y value at the n+1th iteration, respectively;
[0107] Iteration is performed according to the number of iterations and precision, an array is generated and chaotic sequences X and Y are produced, and the final sequence Z = [XY] is obtained, where the relationship between the number of iterations and precision is expressed as:
[0108] Ln+1=2*Ln+Lλ
[0109] In the formula, Ln represents the current iteration parameter, and Lλ represents the current accuracy;
[0110] The decimal values of the final sequence are stored in a one-dimensional array, and grouped and seeded according to the number of digits of the hash summary, the size between the array sequence and the number of digits is determined, and encryption is performed to obtain the hash summary;
[0111] The array sequence generated by the previous iteration is used as a new initial parameter, and an iterative process is performed to generate another hash summary. The final hash summary sequence is iterated in sequence to complete the encryption process of the first data and obtain the encrypted data.
[0112] Specifically, in this embodiment, the decimal values of the final sequence are stored in a one-dimensional array, and grouping and seeding are performed according to the number of digits of the hash summary, the size between the array sequence and the number of digits is determined, and encryption processing is performed to obtain the hash summary, including:
[0113] Select two unequal values and perform extraction function processing on the two unequal values:
[0114]
[0115] In the formula, f represents the extraction function, X represents the data to be transmitted, represents iterative behavior, c and b represent two unequal values, G′ represents the new function obtained by extracting function from f, which is the subkey for data encryption transmission, and mod(f) represents the remainder operation on f;
[0116] The data length is aggregated using a hexadecimal mechanism so that the common factor of two unequal values minus 1 reaches the minimum value, and the encryption parameters of the RSA algorithm are obtained;
[0117] According to the size of the array sequence and the number of bits, the subkey is updated to generate a pair of public and private keys for encryption and decryption to obtain the hash summary:
[0118]
[0119] In the formula, S represents the encrypted data, h represents the public key matrix, l represents the key length, hl represents the random number, and Pl represents the data to be encrypted.
[0120] Step 103: access the second data in the blockchain, and construct a metaverse virtual digital space of the smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology;
[0121] Specifically, in this embodiment
[0122] The system that builds the virtual digital space of the Metaverse sends an access request to the blockchain, and generates a corresponding one-time authentication token based on the access request. Before each new authentication token is generated, the previous authentication token is deleted, and the access rights of the deleted token are deleted at the same time:
[0123] C→η,η={τ}
[0124] In the formula, C represents the system for constructing the virtual digital space of the metaverse, η represents a one-time authentication token, and τ represents a large prime number;
[0125] After the token is verified, the conditional attributes of the system that builds the virtual digital space of the Metaverse are verified. After verification, the identity security of the system access that builds the virtual digital space of the Metaverse is determined, and the access token is obtained: (some characteristics of the client, such as IP address, browser version, etc.)
[0126]
[0127] Where g represents the authentication function; W, U, Denotes the known authentication key, one-time token, and conditional attributes, W′, U′, Represents the authentication key, one-time token and conditional attributes corresponding to the system that constructs the virtual digital space of the Metaverse;
[0128] Access the second data in the blockchain based on the access token and establish a tamper-proof signed transaction to create a transaction record on the blockchain:
[0129] Data=h(t)‖C‖h block
[0130] In the formula, Data represents the content of the required signature, h(t) represents the hash value of the timestamp, C represents the content of the smart contract, and h block represents the hash value of the block in the current blockchain, and ‖·‖ represents the linking operation, which connects the transaction data and signature together.
[0131] Specifically, in this embodiment, the server obtains the data points of the smart city by scanning through virtual reality technology, and generates an intermediate digital twin model in a preset three-dimensional model format corresponding to the smart city based on the data points using three-dimensional modeling technology. The server determines the model of the smart city based on the smart city through the digital twin model operation module, imports the intermediate digital twin model into the model of the smart city for simulation operation, and uses the digital twin model adjustment module to adjust the intermediate digital twin model based on the simulation operation results to obtain the target digital twin model. The server constructs a metaverse virtual digital space that is compatible with the target digital twin model through the virtual scene construction module.
[0132] Step 104: construct a GAN-LSTM intelligent prediction model through a GAN adversarial network, an LSTM network, and an improved dung beetle optimization algorithm, and use the GAN-LSTM intelligent prediction model to perform data prediction on the second data in the virtual digital space of the metaverse to obtain a prediction result;
[0133] Specifically, in this embodiment, the data samples of the smart city are input into the GAN adversarial network. In the generation of the GAN adversarial network, Gaussian random noise is added to the generator, and the spatial mapping principle of the generator is used to map the Gaussian noise space to a high-dimensional saturation space field, and generate data in the generator;
[0134] Input smart city data samples into the discriminator network and train them using the GAN adversarial network trainer. Use the trained discriminator to reversely adjust the data generated by the generator. Use the alternating training of the discriminator and the generator to obtain the equilibrium point of the GAN adversarial network.
[0135] The GAN adversarial network generator is connected to the output layer of the LSTM network, and the improved dung beetle optimization algorithm is used to optimize the parameters to obtain the GAN-LSTM intelligent prediction model;
[0136] The second data is input into the GAN-LSTM intelligent prediction model and the GAN adversarial network generator is used to map the time series spatial feature extraction results to the saturation field of the next time series. The operation is repeated until the final prediction result is obtained, where the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
[0137] Specifically, in this embodiment, the GAN adversarial network generator is connected to the output layer of the LSTM network, and the improved dung beetle optimization algorithm is used to perform parameter optimization to obtain a GAN-LSTM intelligent prediction model, including:
[0138] Set the population size and the maximum number of iterations. During the initialization of the position update process, use the Piecewise chaotic mapping to initialize the position of the dung beetle.
[0139] Calculate the fitness value of each dung beetle and determine whether the fitness is less than 0.9. If so, update the position of the rolling dung beetle using the following formula:
[0140]
[0141] In the formula, represents the position of the i-th dung beetle in the j-th dimension in the first stage, X i,j Indicates the starting position of the rolling dung beetle, SF i,j represents the scale factor used to control the moving speed of the rolling dung beetle, r i,j Represents a random number from 0 to 1, I i,j Indicates that the inertia weight is 0 or 1;
[0142] Otherwise, update the position of the rolling dung beetle using the following formula:
[0143] Xi ( t+1)=X i (t)+|X i (t)-X i (t-1)|tanθ
[0144] Where, X i (t+1) represents the position of the i-th ball beetle at the t+1th iteration, X i (t) represents the position of the i-th ball beetle at the t-th iteration, X i (t-1) represents the position of the i-th ball-rolling dung beetle at the t-1th iteration, and tanθ represents the jumping angle of the ball-rolling dung beetle;
[0145] Update the positions of breeding dung beetles (a female dung beetle will lay a brood ball in the egg-laying area in one iteration), young dung beetles (newly grown dung beetles will crawl out of the nest to look for food), and stealing dung beetles (in the dung beetle population, some dung beetles will steal the dung balls of other dung beetles), make boundary judgments for each dung beetle, calculate the fitness value of each dung beetle, and find the optimal solution, where the ratio of rolling dung beetles, breeding dung beetles, young dung beetles, and stealing dung beetles is 6:6:7:11;
[0146] An adaptive T-distribution perturbation strategy is used to perturb the current optimal solution to generate a new solution. If it is better than the optimal value, it is updated to the optimal value. It is judged whether the current number of iterations is less than the maximum number of iterations. If so, the iteration continues. Otherwise, the optimal position and fitness value are output, and the GAN adversarial network and LSTM network are assigned to obtain the GAN-LSTM intelligent prediction model.
[0147] Step 105: In the virtual digital space of the Metaverse, users access the data of the smart city through virtual reality devices or mobile terminals according to their needs, and the smart city makes personalized recommendations.
[0148] Specifically, in this embodiment, the user wears a VR helmet or glasses and is transported to the virtual world of the smart city. The virtual world of the smart city not only reproduces the geographical layout and architectural style of the real city, but also incorporates elements of future technology, such as air traffic and holographic projection advertising. Using interactive technologies such as gesture recognition and eye tracking, users can freely walk and explore in the virtual space, and even directly "touch" and operate virtual objects, such as querying public facility information, environmental information, traffic information, urban energy information, urban safety information, urban planning schemes, etc. Smart city applications intelligently adjust the interface layout and recommended content based on user preferences and historical behaviors. For example, for users who commute frequently, the application may give priority to displaying real-time traffic conditions, optimal route planning and other information.
[0149] The metaverse virtual digital space of smart cities uses big data analysis and artificial intelligence technology to deeply mine users' behavior data, location information, interest preferences, etc. to build user portraits. The portrait not only reflects the current needs of users, but also predicts their potential needs. Based on user portraits, smart cities can push personalized services and information to users. For example, based on the user's shopping habits, recommend nearby discounted merchants; based on the user's health data, provide personalized exercise advice or medical service appointments; predict traffic congestion based on traffic conditions and send it to the user's interactive device; based on the city's environmental information, the city's current air quality, temperature, weather conditions, etc., and conduct environmental monitoring and early warning for abnormal weather conditions, such as typhoon weather, high temperature weather, etc., and send early warning information to the user's interactive device; based on the city's energy information, obtain the city's electricity and heat energy information, manage and predict the user's housing energy based on the electricity and heat energy information, obtain the latest urban public safety hazards, such as fires and floods, through urban safety information, and manage and predict the user's personal and property safety based on fires or floods.
[0150] The metaverse virtual digital space of the smart city also has the ability to self-learn and optimize. It can continuously adjust recommendation algorithms and strategies based on user feedback and real-time data to ensure the accuracy and timeliness of recommended content, further improving user experience.
[0151] The beneficial effect is that the initial data in the smart city is collected by using smart devices, and the initial data is preprocessed to complete the preprocessing operation through data cleaning, standardization, data labeling and data clustering to obtain the first data; the first data is encrypted based on the hash algorithm to obtain the encrypted data, and the encrypted data generates a corresponding block, the block is verified to determine the correspondence between the off-chain data and the on-chain block record, and the chain is completed after verification to store the encrypted data on the blockchain to obtain the second data; the second data in the blockchain is accessed, and the metaverse virtual digital space of the smart city is constructed based on the second data in the blockchain by using virtual reality technology and three-dimensional modeling technology; the GAN-LSTM intelligent prediction model is constructed by using the GAN adversarial network, LSTM network and improved dung beetle optimization algorithm, and the GAN-LSTM intelligent prediction model is used to predict the second data in the metaverse virtual digital space to obtain the prediction result; in the metaverse virtual digital space, users access the data of the smart city through virtual reality devices or mobile terminals according to their own needs, and the smart city makes personalized recommendations. It can enhance data security and privacy protection, promote data sharing and value circulation, and improve data transparency and credibility; it can improve the data management level of smart cities, provide strong support for urban planning and resource allocation, and help promote the development of smart cities in a more intelligent direction.
[0152] Example 2
[0153] See also Figure 2 , a schematic diagram of data preprocessing of a data management method based on blockchain and metaverse provided by an embodiment of the present invention, the method comprising:
[0154] Step 1011: Use smart devices to collect initial data in the smart city, perform data cleaning on the initial data to remove noise and outliers in the initial data, and use interpolation to fill missing values;
[0155] Step 1012: standardize and annotate the cleaned initial data to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes data collection time, data collection location and collection equipment;
[0156] Step 1013: randomly select different data points from the data to be classified as the initial clustering centers, and use the minimum distance rule for the remaining data points in the data to be classified to obtain S j clusters;
[0157] S j =min{‖x i -z j ‖}
[0158] In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category;
[0159] Perform iterative clustering for each classified class, and modify each cluster center in each iteration:
[0160]
[0161] Where N j represents the number of data points in the jth category;
[0162] Step 1014: reclassify according to the obtained new cluster center. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering result. Based on the clustering result of the data to be classified, the first data is obtained to classify the initial data according to the nature and purpose of the data (for example, traffic data is divided into vehicle flow data, vehicle speed data, road congestion data, etc.; environmental data is divided into air quality data, noise data, water quality data, etc.).
[0163] The beneficial effect is that the scheme completes the preprocessing operation through data cleaning, standardization, data labeling and data clustering, which can improve the data quality and effectively improve the quality and availability of the data.
[0164] Example 3
[0165] See also Figure 3 , a schematic diagram of model data prediction of a data management method based on blockchain and metaverse provided by an embodiment of the present invention, the method comprising:
[0166] Step 1041: input the data sample of the smart city into the GAN adversarial network. In the generation of the GAN adversarial network, add Gaussian random noise to the generator, use the spatial mapping principle of the generator to map the Gaussian noise space to a high-dimensional saturation space field, and generate data in the generator;
[0167] Step 1042: Input the data samples of the smart city into the discriminator network and train it using the GAN adversarial network trainer. Use the trained discriminator to reversely adjust the data generated by the generator. Use the alternating training of the discriminator and the generator to obtain the equilibrium point of the GAN adversarial network.
[0168] Step 1043: connect the GAN adversarial network generator to the output layer of the LSTM network, and use the improved dung beetle optimization algorithm to perform parameter optimization to obtain a GAN-LSTM intelligent prediction model;
[0169] Step 1044: Input the second data into the GAN-LSTM intelligent prediction model and use the GAN adversarial network generator to map the time series spatial feature extraction results to the saturation field of the next time series, and repeat the operation until the final prediction result is obtained, wherein the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
[0170] The beneficial effect is that the GAN-LSTM intelligent prediction model constructed in this scheme by combining GAN (generative adversarial network), LSTM (long short-term memory network) and improved dung beetle optimization algorithm significantly improves the accuracy and stability of data prediction.
[0171] Example 4
[0172] See also Figure 4 , a structural diagram of a data management system based on blockchain and metaverse provided by an embodiment of the present invention, the system includes a data preprocessing module, a data encryption module, a construction module, a data prediction module and an access module, wherein,
[0173] 401. A data preprocessing module, configured to collect initial data in a smart city using smart devices, and preprocess the initial data to complete the preprocessing operation through data cleaning, standardization, data labeling, and data clustering to obtain first data;
[0174] Specifically, this embodiment includes:
[0175] The data cleaning processing submodule is used to collect the initial data in the smart city using smart devices, perform data cleaning on the initial data to remove noise and outliers in the initial data, and use interpolation to fill in missing values;
[0176] The data annotation processing submodule is used to perform standardization and data annotation processing on the cleaned initial data to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes the data collection time, data collection location and collection equipment;
[0177] The selection submodule is used to randomly select different data points from the data to be classified as the initial clustering center, and use the minimum distance rule for the remaining data points in the data to be classified to obtain S j clusters;
[0178] S j =min{‖xi -z j ‖}
[0179] In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category;
[0180] The iterative clustering submodule is used to perform iterative clustering for each classified class, and to modify each cluster center in each iteration:
[0181]
[0182] Where N j represents the number of data points in the jth category;
[0183] The classification submodule is used to reclassify according to the obtained new cluster center. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering result, and the first data is obtained based on the clustering result of the data to be classified, so as to classify the initial data according to the nature and purpose of the data.
[0184] 402. A data encryption module, configured to encrypt the first data based on a hash algorithm to obtain encrypted data, generate corresponding blocks from the encrypted data, verify the blocks, determine the corresponding relationship between the off-chain data and the on-chain block records, complete the chain after verification, and store the encrypted data on the blockchain to obtain second data;
[0185] Specifically, this embodiment includes:
[0186] The initial value submodule is used to divide the first data into blocks of fixed length, quantize and convert characters for each block, and use the converted character code as the initial value of the chaotic hash algorithm mapping to perform chaotic mapping. The dual mapping equation can be expressed as:
[0187]
[0188] Where x and y represent the input values of the dual mapping, μ1 and μ2 represent the corresponding control parameters under the dual mapping conditions, xn and yn represent the x value and y value at the nth iteration, respectively, and xn+1 and yn+1 represent the x value and y value at the n+1th iteration, respectively;
[0189] The iterative submodule is used to perform iterative processing according to the number of iterations and precision, generate arrays and produce chaotic sequences X and Y, and obtain the final sequence Z = [XY], where the relationship between the number of iterations and precision is expressed as:
[0190] Ln+1=2*Ln+Lλ
[0191] In the formula, Ln represents the current iteration parameter, and Lλ represents the current accuracy;
[0192] The encryption submodule is used to store the decimal values of the final sequence in a one-dimensional array, group and set the seed according to the number of bits of the hash summary, determine the size between the array sequence and the number of bits, and perform encryption processing to obtain the hash summary;
[0193] A submodule is obtained, which is used to use the array sequence generated by the previous iteration as a new initial parameter, perform iterative processing to generate another hash summary, and iterate in sequence to obtain the final hash summary sequence to complete the encryption processing of the first data and obtain the encrypted data.
[0194] Specifically, the encryption submodule in this embodiment includes:
[0195] The extraction unit is used to select two unequal values and perform extraction function processing on the two unequal values:
[0196]
[0197] In the formula, f represents the extraction function, X represents the data to be transmitted, represents iterative behavior, c and b represent two unequal values, G′ represents the new function obtained by extracting function from f, which is the subkey for data encryption transmission, and mod(f) represents the remainder operation on f;
[0198] A gathering unit is used to gather the data length in a hexadecimal mechanism so that the common factor of two unequal values after subtracting 1 respectively reaches a minimum value, thereby obtaining an encryption parameter of the RSA algorithm;
[0199] The update unit is used to update the subkey according to the size of the array sequence and the number of bits, generate a pair of public and private keys for encryption and decryption, and obtain the hash summary:
[0200]
[0201] In the formula, S represents the encrypted data, h represents the public key matrix, l represents the key length, hl represents the random number, and Pl represents the data to be encrypted.
[0202] 403. A construction module, used to access the second data in the blockchain, and construct a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology;
[0203] Specifically, this embodiment includes
[0204] The token submodule is used for the system that constructs the virtual digital space of the Metaverse to send access requests to the blockchain, generate corresponding one-time authentication tokens based on the access requests, and delete the previous authentication token before generating a new one-time authentication token each time, and delete the access rights of the deleted token at the same time:
[0205] C→η,η={τ}
[0206] In the formula, C represents the system for constructing the virtual digital space of the metaverse, η represents a one-time authentication token, and τ represents a large prime number;
[0207] The verification submodule is used to verify the conditional attributes of the system that builds the virtual digital space of the Metaverse after the token is verified, determine the identity security of the system access that builds the virtual digital space of the Metaverse after verification, and obtain the access token: (some characteristics of the client, such as IP address, browser version, etc.)
[0208]
[0209] Where g represents the authentication function; W, U, Denotes the known authentication key, one-time token, and conditional attributes, W′, U′, Represents the authentication key, one-time token and conditional attributes corresponding to the system that constructs the virtual digital space of the Metaverse;
[0210] A submodule is established for accessing the second data in the blockchain based on the access token, and establishing a tamper-proof signature transaction to create a transaction record on the blockchain:
[0211] Data=h(t)‖C‖h block
[0212] In the formula, Data represents the content of the required signature, h(t) represents the hash value of the timestamp, C represents the content of the smart contract, and h block represents the hash value of the block in the current blockchain, and ‖·‖ represents the linking operation, which connects the transaction data and signature together.
[0213] Specifically, in this embodiment, the server obtains the data points of the smart city by scanning through virtual reality technology, and generates an intermediate digital twin model in a preset three-dimensional model format corresponding to the smart city based on the data points using three-dimensional modeling technology. The server determines the model of the smart city based on the smart city through the digital twin model operation module, imports the intermediate digital twin model into the model of the smart city for simulation operation, and uses the digital twin model adjustment module to adjust the intermediate digital twin model based on the simulation operation results to obtain the target digital twin model. The server constructs a metaverse virtual digital space that is compatible with the target digital twin model through the virtual scene construction module.
[0214] 404. A data prediction module, for constructing a GAN-LSTM intelligent prediction model through a GAN adversarial network, an LSTM network and an improved dung beetle optimization algorithm, and performing data prediction on the second data using the GAN-LSTM intelligent prediction model in a virtual digital space of the metaverse to obtain a prediction result;
[0215] Specifically, this embodiment includes:
[0216] A mapping submodule is used to input the data samples of the smart city into the GAN adversarial network. In the generation of the GAN adversarial network, Gaussian random noise is added to the generator, and the spatial mapping principle of the generator is used to map the Gaussian noise space to a high-dimensional saturation space field, and generate data in the generator;
[0217] The training submodule is used to input the data samples of the smart city into the discriminator network and train it using the trainer in the GAN adversarial network. The trained discriminator is used to reversely adjust the data generated by the generator, and the balance point of the GAN adversarial network is obtained by alternating the training of the discriminator and the generator.
[0218] The parameter optimization submodule is used to connect the GAN adversarial network generator with the output layer of the LSTM network, and use the improved dung beetle optimization algorithm to perform parameter optimization to obtain the GAN-LSTM intelligent prediction model;
[0219] The feature extraction submodule is used to input the second data into the GAN-LSTM intelligent prediction model and use the GAN adversarial network generator to map the time series spatial feature extraction results to the saturation field of the next time series, and repeat the operation until the final prediction result is obtained, wherein the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
[0220] Specifically, in this embodiment, the parameter optimization submodule includes:
[0221] The initialization unit is used to set the population size and the maximum number of iterations. During the initialization position update process, the Piecewise chaotic mapping is used to initialize the position of the dung beetle.
[0222] The calculation unit is used to calculate the fitness value of each dung beetle and determine whether the fitness value is less than 0.9. If so, the position of the rolling dung beetle is updated by the following formula:
[0223]
[0224] In the formula, represents the position of the i-th dung beetle in the j-th dimension in the first stage, X i,j Indicates the starting position of the rolling dung beetle, SF i,j represents the scale factor used to control the moving speed of the rolling dung beetle, r i,j Represents a random number from 0 to 1, I i,j Indicates that the inertia weight is 0 or 1;
[0225] Otherwise, update the position of the rolling dung beetle using the following formula:
[0226] X i (t+1)=X i (t)+|X i (t)-X i (t-1)|tanθ
[0227] Where, X i (t+1) represents the position of the i-th ball beetle at the t+1th iteration, X i (t) represents the position of the i-th ball beetle at the t-th iteration, X i (t-1) represents the position of the i-th ball-rolling dung beetle at the t-1th iteration, and tanθ represents the jumping angle of the ball-rolling dung beetle;
[0228] The update unit is used to update the positions of breeding dung beetles (a female dung beetle will lay a brood ball in the egg-laying area in one iteration), the positions of young dung beetles (newly grown dung beetles will crawl out of the nest to look for food), and the positions of stealing dung beetles (in the dung beetle population, some dung beetles will steal the dung balls of other dung beetles), make boundary judgments for each dung beetle, calculate the fitness value of each dung beetle, and find the optimal solution, where the ratio of rolling dung beetles, breeding dung beetles, young dung beetles, and stealing dung beetles is 6:6:7:11;
[0229] The perturbation unit is used to perturb the current optimal solution using an adaptive T-distribution perturbation strategy to generate a new solution. If it is better than the optimal value, it is updated to the optimal value. It is determined whether the current number of iterations is less than the maximum number of iterations. If so, it continues to iterate. If not, it outputs the optimal position and fitness value, and assigns them to the GAN adversarial network and LSTM network to obtain the GAN-LSTM intelligent prediction model.
[0230] 405. Access module, used for users to access the data of smart cities through virtual reality devices or mobile terminals in the virtual digital space of the metaverse according to their own needs, and the smart city makes personalized recommendations.
[0231] Specifically, in this embodiment, the user wears a VR helmet or glasses and is transported to the virtual world of the smart city. The virtual world of the smart city not only reproduces the geographical layout and architectural style of the real city, but also incorporates elements of future technology, such as air traffic and holographic projection advertising. Using interactive technologies such as gesture recognition and eye tracking, users can freely walk and explore in the virtual space, and even directly "touch" and operate virtual objects, such as querying public facility information, environmental information, traffic information, urban energy information, urban safety information, urban planning schemes, etc. Smart city applications intelligently adjust the interface layout and recommended content based on user preferences and historical behaviors. For example, for users who commute frequently, the application may give priority to displaying real-time traffic conditions, optimal route planning and other information.
[0232] The metaverse virtual digital space of smart cities uses big data analysis and artificial intelligence technology to deeply mine users' behavior data, location information, interest preferences, etc. to build user portraits. The portrait not only reflects the current needs of users, but also predicts their potential needs. Based on user portraits, smart cities can push personalized services and information to users. For example, based on the user's shopping habits, recommend nearby discounted merchants; based on the user's health data, provide personalized exercise advice or medical service appointments; predict traffic congestion based on traffic conditions and send it to the user's interactive device; based on the city's environmental information, the city's current air quality, temperature, weather conditions, etc., and conduct environmental monitoring and early warning for abnormal weather conditions, such as typhoon weather, high temperature weather, etc., and send early warning information to the user's interactive device; based on the city's energy information, obtain the city's electricity and heat energy information, manage and predict the user's housing energy based on the electricity and heat energy information, obtain the latest urban public safety hazards, such as fires and floods, through urban safety information, and manage and predict the user's personal and property safety based on fires or floods.
[0233] The metaverse virtual digital space of the smart city also has the ability to self-learn and optimize. It can continuously adjust recommendation algorithms and strategies based on user feedback and real-time data to ensure the accuracy and timeliness of recommended content, further improving user experience.
[0234] The beneficial effect is that, through the implementation of the above scheme, personalized recommendation services can be realized, and users can directly access the data of smart cities through virtual reality devices or mobile terminals, and obtain personalized recommendation services according to their own needs, thereby improving user experience and service efficiency. Promoting the sustainable development of smart cities, the present invention not only helps to improve the data management level of smart cities, but also constructs an intuitive metaverse virtual digital space through virtual reality technology and three-dimensional modeling technology, which provides strong support for urban planning and resource allocation, and is conducive to promoting the development of smart cities in the direction of intelligence.
[0235] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A data management method based on blockchain and metaverse, characterized in that: The data management method based on blockchain and metaverse includes the following steps: Using smart devices to collect initial data in the smart city, preprocessing the initial data to complete the preprocessing operation through data cleaning processing, standardization processing, data labeling processing and data clustering processing to obtain first data; Encrypting the first data based on a hash algorithm to obtain encrypted data, generating corresponding blocks from the encrypted data, verifying the blocks, determining the correspondence between off-chain data and on-chain block records, and completing the chain after verification to store the encrypted data on the blockchain to obtain second data; Accessing the second data in the blockchain, and constructing a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology; A GAN-LSTM intelligent prediction model is constructed by using a GAN adversarial network, an LSTM network, and an improved dung beetle optimization algorithm, and the GAN-LSTM intelligent prediction model is used to perform data prediction on the second data in a virtual digital space of the metaverse to obtain a prediction result; In the virtual digital space of the Metaverse, users access smart city data through virtual reality devices according to their needs, and the smart city makes personalized recommendations.
2. A data management method based on blockchain and metaverse as claimed in claim 1, characterized in that: The method of using smart devices to collect initial data in the smart city and preprocessing the initial data to complete the preprocessing operation through data cleaning, standardization, data labeling and data clustering to obtain first data includes: Using smart devices to collect initial data in the smart city, performing data cleaning on the initial data to remove noise and outliers in the initial data, and using interpolation to fill in missing values; The cleaned initial data is subjected to standardization and data annotation processing to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes data collection time, data collection location and collection equipment; Different data points are randomly selected from the data to be classified as the initial clustering centers, and the minimum distance rule is used for the remaining data points in the data to be classified to obtain S j clusters; S j =min{‖x i -z j ‖} In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category; Perform iterative clustering for each classified class, and modify each cluster center in each iteration: Where N j represents the number of data points in the jth category; Reclassification is performed based on the obtained new cluster center. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering result, and the first data is obtained based on the clustering result of the data to be classified, so as to classify the initial data according to the data nature and purpose.
3. A data management method based on blockchain and metaverse as claimed in claim 1, characterized in that: The step of encrypting the first data based on a hash algorithm to obtain encrypted data includes: The first data is divided into blocks of fixed length, each block is quantized and converted into characters, and the converted character code is used as the initial value of the chaotic hash algorithm mapping to perform chaotic mapping. The dual mapping equation can be expressed as: Where x and y represent the input values of the dual mapping, μ1 and μ2 represent the corresponding control parameters under the dual mapping conditions, xn and yn represent the x value and y value at the nth iteration, respectively, and xn+1 and yn+1 represent the x value and y value at the n+1th iteration, respectively; Iteration is performed according to the number of iterations and precision, an array is generated and chaotic sequences X and Y are produced, and the final sequence Z = [XY] is obtained, where the relationship between the number of iterations and precision is expressed as: Ln+1=2*Ln+Lλ In the formula, Ln represents the current iteration parameter, and Lλ represents the current accuracy; The decimal values of the final sequence are stored in a one-dimensional array, and grouped and seeded according to the number of digits of the hash summary, the size between the array sequence and the number of digits is determined, and encryption is performed to obtain the hash summary; The array sequence generated by the previous iteration is used as a new initial parameter, and an iterative process is performed to generate another hash summary. The final hash summary sequence is obtained by iterating in sequence to complete the encryption process of the first data and obtain the encrypted data.
4. A data management method based on blockchain and metaverse as claimed in claim 3, characterized in that: The decimal values of the final sequence are stored in a one-dimensional array, grouped and seeded according to the number of digits of the hash summary, the size between the array sequence and the number of digits is determined, and encryption is performed to obtain the hash summary, including: Select two unequal values and perform extraction function processing on the two unequal values: In the formula, f represents the extraction function, X represents the data to be transmitted, represents iterative behavior, c and b represent two unequal values, G ′ It means that the new function obtained by extracting the function of f is the subkey for data encryption transmission, and mod(f) means the remainder operation of f; The data length is aggregated using a hexadecimal mechanism so that the common factor of two unequal values minus 1 reaches the minimum value, and the encryption parameters of the RSA algorithm are obtained; According to the size of the array sequence and the number of bits, the subkey is updated to generate a pair of public and private keys for encryption and decryption to obtain the hash summary: In the formula, S represents the encrypted data, h represents the public key matrix, l represents the key length, hl represents the random number, and Pl represents the data to be encrypted.
5. A data management method based on blockchain and metaverse as claimed in claim 1, characterized in that: The accessing of the second data in the blockchain, and constructing a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology, includes: The system that constructs the virtual digital space of the Metaverse sends an access request to the blockchain, and generates a corresponding one-time authentication token based on the access request. Before each new one-time authentication token is generated, the previous authentication token is deleted, and the access rights of the deleted token are deleted at the same time: C→η,η={τ} In the formula, C represents the system for constructing the virtual digital space of the metaverse, η represents a one-time authentication token, and τ represents a large prime number; After token verification, the conditional attributes of the system that builds the virtual digital space of the Metaverse are verified. After verification, the identity security of the system access that builds the virtual digital space of the Metaverse is determined, and the access token is obtained: Where g represents the authentication function; W, U, Denotes the known authentication key, one-time token, and conditional attributes, W′, U′, Represents the authentication key, one-time token and conditional attributes corresponding to the system that constructs the virtual digital space of the Metaverse; Access the second data in the blockchain based on the access token, and establish a tamper-proof signed transaction to create a transaction record on the blockchain: Data=h(t)‖C‖h block In the formula, Data represents the content of the required signature, h(t) represents the hash value of the timestamp, C represents the content of the smart contract, and h block represents the hash value of the block in the current blockchain, and ‖·‖ represents the linking operation, which connects the transaction data and signature together.
6. A data management method based on blockchain and metaverse as claimed in claim 1, characterized in that: The GAN-LSTM intelligent prediction model is constructed by using the GAN adversarial network, the LSTM network and the improved dung beetle optimization algorithm, and the GAN-LSTM intelligent prediction model is used to perform data prediction on the second data in the virtual digital space of the metaverse to obtain a prediction result, including: The data samples of the smart city are input into the GAN adversarial network. In the generation of the GAN adversarial network, Gaussian random noise is added to the generator. The spatial mapping principle of the generator is used to map the Gaussian noise space to a high-dimensional saturation space field, and data is generated in the generator. Input smart city data samples into the discriminator network and train them using the GAN adversarial network trainer. Use the trained discriminator to reversely adjust the data generated by the generator. Use the alternating training of the discriminator and the generator to obtain the equilibrium point of the GAN adversarial network. The GAN adversarial network generator is connected to the output layer of the LSTM network, and the improved dung beetle optimization algorithm is used to optimize the parameters to obtain the GAN-LSTM intelligent prediction model; The second data is input into the GAN-LSTM intelligent prediction model and the GAN adversarial network generator is used to map the time series spatial feature extraction results to the saturation field of the next time series. The operation is repeated until the final prediction result is obtained, wherein the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
7. A data management method based on blockchain and metaverse as claimed in claim 6, characterized in that: The GAN adversarial network generator is connected to the output layer of the LSTM network, and the improved dung beetle optimization algorithm is used to optimize the parameters to obtain the GAN-LSTM intelligent prediction model, including: Set the population size and the maximum number of iterations. During the initialization of the position update process, use the Piecewise chaotic mapping to initialize the position of the dung beetle. Calculate the fitness value of each dung beetle and determine whether the fitness is less than 0.
9. If so, update the position of the rolling dung beetle using the following formula: In the formula, represents the position of the i-th dung beetle in the j-th dimension in the first stage, Xi ,j Indicates the starting position of the rolling dung beetle, SF i,j represents the scale factor used to control the moving speed of the rolling dung beetle, r i,j Represents a random number from 0 to 1, I i,j Indicates that the inertia weight is 0 or 1; Otherwise, update the position of the rolling dung beetle using the following formula: X i (t+1)=X i (t)+|X i (t)-X i (t-1)|tanθ Where, X i (t+1) represents the position of the i-th ball beetle at the t+1th iteration, X i (t) represents the position of the i-th ball beetle at the t-th iteration, X i (t-1) represents the position of the i-th ball-rolling dung beetle at the t-1th iteration, and tanθ represents the jumping angle of the ball-rolling dung beetle; Update the positions of breeding dung beetles, small dung beetles and thieving dung beetles, make boundary judgments for each dung beetle, calculate the fitness value of each dung beetle, and find the optimal solution, where the ratio of rolling dung beetles, breeding dung beetles, small dung beetles and thieving dung beetles is 6:6:7:11; An adaptive T-distribution perturbation strategy is used to perturb the current optimal solution to generate a new solution. If it is better than the optimal value, it is updated to the optimal value. It is judged whether the current number of iterations is less than the maximum number of iterations. If so, the iteration continues. Otherwise, the optimal position and fitness value are output, and the GAN adversarial network and LSTM network are assigned to obtain the GAN-LSTM intelligent prediction model.
8. A data management system based on blockchain and metaverse, characterized in that: The data management system based on blockchain and metaverse includes a data preprocessing module, a data encryption module, a construction module, a data prediction module and an access module, wherein: A data preprocessing module, used to collect initial data in the smart city using smart devices, and preprocess the initial data to complete the preprocessing operation through data cleaning processing, standardization processing, data labeling processing and data clustering processing to obtain first data; A data encryption module is used to encrypt the first data based on a hash algorithm to obtain encrypted data, generate corresponding blocks from the encrypted data, verify the blocks, determine the corresponding relationship between the off-chain data and the on-chain block records, complete the chain after verification, so as to store the encrypted data on the blockchain to obtain second data; A construction module, used to access the second data in the blockchain, and construct a metaverse virtual digital space of a smart city based on the second data in the blockchain using virtual reality technology and three-dimensional modeling technology; A data prediction module, used to construct a GAN-LSTM intelligent prediction model through a GAN adversarial network, an LSTM network and an improved dung beetle optimization algorithm, and to perform data prediction on the second data using the GAN-LSTM intelligent prediction model in a virtual digital space of the metaverse to obtain a prediction result; The access module is used to enable users to access smart city data through virtual reality devices in the virtual digital space of the metaverse according to their needs, and the smart city will make personalized recommendations.
9. A data management system based on blockchain and metaverse as claimed in claim 8, characterized in that: The data preprocessing module includes a data cleaning processing submodule, a data labeling processing submodule, a selection submodule, an iterative clustering submodule and a classification submodule, wherein: The data cleaning processing submodule is used to collect initial data in the smart city using smart devices, perform data cleaning on the initial data to remove noise and outliers in the initial data, and fill in missing values using interpolation; The data annotation processing submodule is used to perform standardization and data annotation processing on the cleaned initial data to add corresponding metadata information to obtain data to be classified, wherein the metadata information at least includes the data collection time, data collection location and collection equipment; The selection submodule is used to randomly select different data points from the data to be classified as the initial clustering center, and use the minimum distance rule for the remaining data points in the data to be classified to obtain S j clusters; S j =min{‖x i -z j ‖} In the formula, x i represents the i-th data point, z j represents the cluster center of the jth category, S j represents the set of data points in the jth category, ‖x i -z j ‖ represents the Euclidean distance between the i-th data point and the j-th category cluster center, and the min symbol means finding the distance x among all categories. i The smallest category; The iterative clustering submodule is used to perform iterative clustering for each classified class, and to modify each cluster center in each iteration: Where N j represents the number of data points in the jth category; The classification submodule is used to reclassify according to the obtained new cluster center. When the clustering of the sampling points reaches the maximum set number of iterations, the iteration is terminated to obtain the clustering result, and the first data is obtained based on the clustering result of the data to be classified, so as to classify the initial data according to the nature and purpose of the data.
10. A data management system based on blockchain and metaverse as claimed in claim 8, characterized in that: The data prediction module includes a mapping submodule, a training submodule, a parameter optimization submodule and a feature extraction submodule, wherein: A mapping submodule is used to input the data samples of the smart city into the GAN adversarial network. In the generation of the GAN adversarial network, Gaussian random noise is added to the generator, and the spatial mapping principle of the generator is used to map the Gaussian noise space to a high-dimensional saturation space field, and generate data in the generator; The training submodule is used to input the data samples of the smart city into the discriminator network and train it using the trainer in the GAN adversarial network. The trained discriminator is used to reversely adjust the data generated by the generator, and the balance point of the GAN adversarial network is obtained by alternating the training of the discriminator and the generator. The parameter optimization submodule is used to connect the GAN adversarial network generator with the output layer of the LSTM network, and use the improved dung beetle optimization algorithm to perform parameter optimization to obtain the GAN-LSTM intelligent prediction model; The feature extraction submodule is used to input the second data into the GAN-LSTM intelligent prediction model and use the GAN adversarial network generator to map the time series spatial feature extraction results to the saturation field of the next time series, and repeat the operation until the final prediction result is obtained, wherein the prediction result at least includes traffic congestion prediction, environmental monitoring and early warning, energy management prediction, and safety management prediction.
Citation Information
Cited By
Block chain power data security sharing method
CN121479842A
Blockchain power data security sharing method
CN121479842B