Data acquisition method, device and equipment based on internet of things, and storage medium
By constructing a data acquisition method for the parent blockchain, the problem of data interaction between blockchains in the Internet of Things is solved, enabling data interaction between child blockchains and reducing costs, thereby improving the security and efficiency of data transmission.
Patent Information
- Application Number
- CN202011626620.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2040-12-31
AI Technical Summary
In the Internet of Things (IoT), the decentralized processing of blockchain makes it difficult for data between blockchains to interact, resulting in a need for significant investment in data center infrastructure.
By constructing multiple child blockchains and virtual blockchain nodes to form a parent blockchain, a data acquisition method is implemented, including receiving, parsing, sending, and judging data acquisition requests. This ensures data interaction between child blockchains and achieves secure and reliable data transmission through permission detection, abnormal fluctuation analysis, and consensus negotiation.
It reduces the maintenance cost of sub-blockchains and enables data interaction between various sub-blockchains, improving the efficiency and security of data transmission.
Smart Images

Figure CN112685502B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of the Internet of Things (IoT), and in particular to a data acquisition method, apparatus, device, and storage medium based on the IoT. Background Technology
[0002] As service demands increase and the number of devices in the Internet of Things (IoT) grows, managing them using traditional centralized network models would lead to expensive investments in data center infrastructure construction and maintenance. Currently, to save costs, IoT is being implemented using blockchain to achieve decentralized control, significantly reducing investment costs. However, the IoT field often sees multiple blockchains coexisting. Due to the decentralized processing of blockchain, data interaction between blockchains is difficult. Even if all blockchains are combined into a single large blockchain, substantial investment in data center infrastructure is still required. Summary of the Invention
[0003] The main objective of this invention is to provide a data acquisition method, apparatus, device, and storage medium based on the Internet of Things, aiming to solve the problem that data interaction between blockchains is difficult due to the decentralized processing of blockchain.
[0004] This invention provides a data acquisition method based on the Internet of Things (IoT), wherein the IoT includes multiple sub-blockchains, each sub-blockchain includes virtual blockchain nodes, and each virtual blockchain node constitutes a parent blockchain. The method includes:
[0005] The first virtual blockchain node receives data uploaded by users to obtain information; wherein, the first virtual blockchain node is a node in the first sub-level blockchain;
[0006] The data acquisition information is analyzed to determine the target data to be acquired and the second-level blockchain information where the target data is located.
[0007] A request to acquire target data is sent to the second virtual blockchain node based on the information of the second sub-level blockchain; wherein, the second virtual blockchain node is a node in the second sub-level blockchain;
[0008] Determine whether the target data received is the feedback from the second virtual blockchain node based on the target data acquisition request;
[0009] If the target data is received, the target data is uploaded to the first sub-level blockchain.
[0010] Further, before the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located, the following steps are included:
[0011] Obtain the permission information from the data acquisition information;
[0012] Check whether the permission information meets the data acquisition requirements;
[0013] If the data acquisition requirements are met, then the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located is executed.
[0014] Furthermore, after the step of uploading the target data to the first sub-level blockchain if the target data is received, the method further includes:
[0015] Obtain the invocation information of the target data;
[0016] Based on the invoked information, obtain the time elapsed from the last time the target data was invoked to the current time;
[0017] Determine whether the time duration exceeds a preset time value;
[0018] If the preset time value is exceeded, the target data will be deleted from the first sub-level blockchain.
[0019] Furthermore, the method also includes:
[0020] Detect data changes in the first sub-level blockchain;
[0021] Determine whether there is a first abnormal fluctuation based on the changes in the data;
[0022] If the abnormal fluctuation occurs, the data that caused the first abnormal fluctuation will be sent to the parent blockchain;
[0023] In the parent blockchain, determine whether the remaining second virtual blockchain nodes have second abnormal fluctuations;
[0024] If the second abnormal fluctuation exists, analyze whether the data changes of the first abnormal fluctuation and the second abnormal fluctuation are similar;
[0025] If they are similar, then the first abnormal fluctuation is determined to be a normal fluctuation.
[0026] Furthermore, before the step of sending a target data acquisition request to the second virtual blockchain node based on the second sub-level blockchain information, the method further includes:
[0027] Determine whether consensus response information has been received from the second virtual blockchain node based on the target data acquisition request;
[0028] If the consensus response information is received, then negotiate consensus with the second virtual blockchain node;
[0029] The consensus is synchronized to the parent blockchain as a credential for receiving the target data.
[0030] Further, the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located includes:
[0031] The data is segmented into words using a text classifier.
[0032] The segmented data acquisition information is vectorized to obtain the multidimensional coordinates X = (x1, x2, x3…x) of the data acquisition vector corresponding to the data acquisition information. n );
[0033] According to the formula Calculate the cosine value between the data acquisition vector and each sub-blockchain, where the multidimensional coordinates of each sub-blockchain are Y = (y1, y2, y3…y…). n );
[0034] The sub-blockchain with the largest cosine value is selected as the second sub-blockchain.
[0035] The present invention also provides a data acquisition device based on the Internet of Things (IoT), wherein the IoT includes multiple sub-level blockchains, each sub-level blockchain includes virtual blockchain nodes, and each virtual blockchain node constitutes a parent blockchain. The device includes:
[0036] The receiving module is used to receive data acquisition information uploaded by the user; wherein, the first virtual blockchain node is a node in the first sub-level blockchain.
[0037] The parsing module is used to parse the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located;
[0038] The sending module is used to send a target data acquisition request to the second virtual blockchain node according to the second sub-level blockchain information; wherein, the second virtual blockchain node is a node in the second sub-level blockchain;
[0039] The judgment module is used to determine whether the target data has been received from the second virtual blockchain node based on the target data acquisition request.
[0040] An upload module is used to upload the target data to the first sub-level blockchain if the target data is received.
[0041] Furthermore, the device also includes:
[0042] The permission information acquisition module is used to acquire permission information from the data acquisition information;
[0043] The permission information detection module is used to detect whether the permission information meets the data acquisition requirements;
[0044] An execution module is used to, if the data acquisition requirements are met, execute the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located.
[0045] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.
[0046] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the methods described above.
[0047] The beneficial effects of this invention are as follows: By establishing a parent blockchain through the first virtual blockchain node of the first sub-blockchain and the second virtual blockchain node of the second sub-blockchain, the first virtual blockchain node will only send a data retrieval request to the second virtual blockchain node when a user sends a data retrieval request. The data center infrastructure set up by each sub-blockchain only needs to store its own data information, thereby reducing the maintenance cost of each sub-blockchain and realizing data interaction between each sub-blockchain. Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating a data acquisition method based on the Internet of Things according to an embodiment of the present invention;
[0049] Figure 2 This is a schematic block diagram of the structure of a data acquisition device based on the Internet of Things according to an embodiment of the present invention;
[0050] Figure 3 This is a schematic block diagram of the structure of a computer device according to an embodiment of this application.
[0051] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0053] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly. The connection can be a direct connection or an indirect connection.
[0054] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, A and B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0055] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0056] Reference Figure 1 This invention proposes a data acquisition method based on the Internet of Things (IoT), wherein the IoT includes multiple sub-blockchains, each sub-blockchain includes virtual blockchain nodes, and each virtual blockchain node constitutes a parent blockchain. The method includes:
[0057] S1: The first virtual blockchain node receives data uploaded by the user to obtain information; wherein, the first virtual blockchain node is a node in the first sub-level blockchain;
[0058] S2: Analyze the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located;
[0059] S3: Send a target data acquisition request to the second virtual blockchain node based on the information of the second sub-level blockchain; wherein, the second virtual blockchain node is a node in the second sub-level blockchain;
[0060] S4: Determine whether the target data received from the second virtual blockchain node based on the target data acquisition request is received;
[0061] S5: If the target data is received, the target data is uploaded to the first sub-level blockchain.
[0062] As described in step S1 above, the first virtual blockchain node receives data acquisition information uploaded by the user. This data acquisition information includes the target data's information and the second-level blockchain where the target data resides. The user uploads the data by establishing a data connection with the first virtual blockchain node via a terminal to receive the uploaded data acquisition information.
[0063] As described in step S2 above, the data acquisition information is parsed to determine the target data to be acquired and the second-level blockchain information where the target data is located. Since the data acquisition information contains the target data and the second-level blockchain information, these can be obtained by parsing the data acquisition information. The data acquisition information can be processed using encryption. For example, a preset encryption algorithm can be used to calculate the encrypted value of the information, and this encrypted value can be used as the data acquisition information. The encryption algorithm can be any one of one-way hash encryption, symmetric encryption, and asymmetric encryption. Then, the first virtual blockchain node decrypts the data acquisition information according to the corresponding encryption algorithm. Alternatively, an encryption algorithm can be omitted, and the target data and the second-level blockchain information where the target data is located can be directly used as the data acquisition information. The first-level blockchain and the second-level blockchain are different IoT networks.
[0064] As described in step S3 above, a target data acquisition request is sent to the second virtual blockchain node based on the information from the second sub-level blockchain. Specifically, each IoT network is composed of different sub-level blockchains (e.g., a first sub-level blockchain and a second sub-level blockchain). A virtual blockchain node in each sub-level blockchain network constitutes the parent blockchain. The operations and data in each sub-level blockchain do not interfere with each other. When a sub-level blockchain needs to use data from other sub-level blockchains, it issues a data acquisition request in the parent blockchain. Therefore, when the first sub-level blockchain network receives the user's data acquisition information, it sends a target data acquisition request to the second virtual blockchain node to obtain the data information from the second sub-level blockchain.
[0065] As described in step S4 above, it is determined whether the target data received from the second virtual blockchain node based on the target data acquisition request is received. When the second virtual blockchain node receives the target data acquisition request, it will provide feedback. However, the feedback may indicate that the target data acquisition request does not meet the requirements of the second virtual blockchain node. Therefore, the determination can be made based on whether the target data is received. If the target data is received, it means that the target data acquisition request meets the requirements of the second virtual blockchain node; if other feedback information is received, it means that the target data acquisition request does not meet the requirements of the second virtual blockchain node.
[0066] As described in step S5 above, if the target data is received, it is uploaded to the first sub-level blockchain. The upload is performed via a first virtual blockchain node, allowing each blockchain node in the first sub-level blockchain to work based on the target data, thus achieving data sharing. Furthermore, there is no need to acquire other data from the second sub-level blockchain; the data center infrastructure of the first sub-level blockchain only needs to store the target data, without needing to store data from other sub-level blockchains. This achieves data interaction between the various sub-level blockchains while reducing the maintenance costs of the sub-level blockchains.
[0067] In one embodiment, before step S2, which involves parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located, the following steps are included:
[0068] S101: Obtain the permission information from the data acquisition information;
[0069] S102: Detect whether the permission information meets the data acquisition requirements;
[0070] S103: If the data acquisition requirements are met, then execute the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located.
[0071] As described in steps S101-S103 above, permission detection for data acquisition information is implemented. This involves detecting whether a user has the authority to request the acquisition of target data. Therefore, the data acquisition information needs to be detected. This detection can be done by obtaining the user's identity information from the data acquisition information and then obtaining permission information based on that identity information. In some embodiments, the data acquisition information may directly contain permission information, which can be obtained by parsing the content of the data acquisition information. The permission information is the level information set for each user. When a user's permission level reaches the point where they can acquire the target data, or when they meet the requirements for accessing the second-level blockchain, it is considered that the user's permission information meets the data acquisition requirements, and step S2 can continue to be executed, thereby ensuring the security of data between the sub-level blockchains.
[0072] In one embodiment, after step S5 of uploading the target data to the first sub-level blockchain if the target data is received, the method further includes:
[0073] S601: Obtain the invocation information of the target data;
[0074] S602: Obtain the time length from the last time the target data was called to the current time based on the called information;
[0075] S603: Determine whether the time length exceeds a preset time value;
[0076] S604: If the preset time value is exceeded, the target data will be deleted from the first sub-level blockchain.
[0077] As described in steps S601-S604 above, redundant data in the central infrastructure of the first-level blockchain is deleted, freeing up storage space in the central infrastructure. Specifically, after acquiring the target data, because the data from various IoT devices is constantly changing, the effective reference time for the target data is very short. Therefore, the information on when the target data is accessed can be obtained, i.e., the information on how each node in the first-level blockchain uses the target data. Since the effective time of the target data can be seen from the access status of each node, when each node stops accessing the target data, it can be considered that the target data is redundant. Therefore, when the time elapsed since the last access of the target data exceeds a preset time value, the target data can be deleted from the first-level blockchain, freeing up storage space in the central infrastructure of the first-level blockchain and reducing maintenance costs.
[0078] In one embodiment, the above method further includes:
[0079] S001: Detect data changes in the first sub-level blockchain;
[0080] S002: Determine whether there is a first abnormal fluctuation based on the changes in the data;
[0081] S003: If the abnormal fluctuation occurs, the data that caused the first abnormal fluctuation will be sent to the parent blockchain;
[0082] S004: Determine whether the remaining second virtual blockchain nodes in the parent blockchain have second abnormal fluctuations;
[0083] S005: If the second abnormal fluctuation exists, analyze whether the data changes of the first abnormal fluctuation and the second abnormal fluctuation are similar;
[0084] S006: If similar, then the first abnormal fluctuation is determined to be a normal fluctuation.
[0085] As described in steps S001-006 above, the processing of abnormal fluctuation data is implemented. Specifically, it determines whether there is a first abnormal fluctuation based on data changes. This can be achieved by a value exceeding the average value over a period of time, such as sales volume. For example, if the sales volume on a certain day in the first sub-blockchain is ten times the average sales volume of the previous month, then the sales volume on that day can be considered to have experienced the first abnormal fluctuation. Of course, the value triggering the first abnormal fluctuation can be set based on sales data. This achieves monitoring of the data in the first sub-blockchain. The fluctuating data is then sent to the parent blockchain. For example, the fluctuation data for that day is sent to the parent blockchain, and then compared with other sub-blockchains to see if there are other second abnormal fluctuations. For example, if the first abnormal fluctuation is in sales volume, and the second abnormal fluctuation is in sales amount, the changes in sales amount and sales volume are compared in the parent blockchain. Generally, the higher the sales volume, the higher the sales amount. However, if the sales volume increases but the sales amount does not change much, it indicates malicious order manipulation. Therefore, whether the first abnormal fluctuation is a normal fluctuation can be determined by whether the second virtual blockchain node has uploaded any second abnormal fluctuations.
[0086] In one embodiment, before step S3 of sending a target data acquisition request to the second virtual blockchain node based on the second sub-level blockchain information, the method further includes:
[0087] S201: Determine whether consensus response information has been received from the second virtual blockchain node based on the target data acquisition request;
[0088] S202: If the consensus response information is received, then negotiate consensus with the second virtual blockchain node;
[0089] S203: Synchronize the consensus to the parent blockchain as a credential for receiving the target data.
[0090] As described in steps S201-S203 above, the data acquisition status of each child blockchain is recorded in the parent blockchain, and this status is communicated to other nodes in the parent blockchain to ensure the smooth acquisition of target data. Specifically, when a second virtual blockchain node receives a target data acquisition request, it can send a consensus response message to the first virtual blockchain node before receiving the same request. That is, the first virtual blockchain node determines whether it has received the consensus response message from the second virtual blockchain node based on the target data acquisition request. If it has received the consensus response message, it negotiates a consensus with the second virtual blockchain node. This consensus can also be considered as a negotiation between the first and second child blockchains, with the first and second virtual blockchain nodes merely serving as a connecting medium. The consensus is then synchronized to the parent blockchain as proof that the first virtual blockchain node or the first child blockchain receives the target data. Other blockchain nodes in the parent blockchain allow the first virtual blockchain node to acquire the target data based on this consensus, thereby realizing the data interaction protocol.
[0091] In one embodiment, step S2, which involves parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located, includes:
[0092] S211: The information obtained from the data is segmented using a text classifier;
[0093] S212: Vectorize the data acquisition information after word segmentation to obtain the multidimensional coordinates X = (x1, x2, x3…x…) of the data acquisition vector corresponding to the data acquisition information. n );
[0094] S213: According to the formula Calculate the cosine value between the data acquisition vector and each sub-blockchain, where the multidimensional coordinates of each sub-blockchain are Y = (y1, y2, y3…y…). n );
[0095] S214: Select the sub-blockchain with the largest cosine value as the second sub-blockchain.
[0096] As described in step S211 above, the open-source and free Python LibShortText text classifier can be used and customized to replace it with a Chinese word segmenter to segment the text in the data information. The word segmentation can be calculated by any of the following algorithms: decision tree, multilayer perceptron, Naive Bayes (including Bernoulli Bayes, Gaussian Bayes and multinomial Bayes), random forest, AdaBoost, feedforward neural network and LSTM.
[0097] As described in step S212 above, the data acquisition information after word segmentation is vectorized to obtain the multi-dimensional coordinates of the data acquisition vector for subsequent calculations. The data acquisition information can be vectorized using the Googleword2vec tool.
[0098] As described in steps S213-S214 above, the acquisition of information from the second-level blockchain is achieved. According to the formula... The cosine value between the data acquisition vector and each sub-blockchain is calculated. A larger cosine value indicates a higher probability that the data acquisition vector is located in that sub-blockchain. Therefore, the sub-blockchain with the largest cosine value can be selected as the second sub-blockchain to obtain the corresponding target data. It should be understood that the target data may not be the original data; it can be calculated from different original data. This solution only provides a method for obtaining target data that is not original data, i.e., it identifies the second sub-blockchain.
[0099] In one embodiment, the method further includes:
[0100] S11: The first virtual blockchain node receives the target data acquisition request sent by the first virtual blockchain;
[0101] S12: Obtain the corresponding target data from the first sub-level blockchain according to the target data request;
[0102] S13: Feed back the target data to the second virtual blockchain node.
[0103] As described in steps S11-S13 above, the target data is fed back to the second virtual blockchain node. Specifically, when the first virtual blockchain node receives a target data acquisition request from the second virtual blockchain node, it retrieves the corresponding target data from other nodes in the first sub-blockchain according to the request. Then, the first virtual blockchain node synthesizes the target data from each node and sends the target data to the second virtual blockchain node. This achieves a response to target data acquisition requests from other sub-blockchains.
[0104] In one embodiment, step S12, which involves obtaining the corresponding target data from the first sub-level blockchain according to the target data request, includes:
[0105] S121: Analyze the data information of the target data;
[0106] S122: In the first sub-level blockchain, determine the first blockchain node where the data information is located based on the data information;
[0107] S123: Send data retrieval requests to each first blockchain node;
[0108] S124: Receive data information sent by each first blockchain node based on the data acquisition request;
[0109] S125: The data information is integrated and standardized to obtain the target data.
[0110] As described in steps S121-S125 above, the acquisition of target data is achieved. That is, the data information of the target data is first analyzed. Since the target data request contains the corresponding target data information, parsing the target data information can reveal which first blockchain node in the first sub-level blockchain has the target data. Thus, the first blockchain node with the target data is determined, and the corresponding data is obtained from the corresponding first blockchain node. Then, the data information sent by each first blockchain node is obtained, and the data information is integrated to obtain the corresponding target data.
[0111] The present invention also provides a data acquisition device based on the Internet of Things (IoT), wherein the IoT includes multiple sub-level blockchains, each sub-level blockchain includes virtual blockchain nodes, and each virtual blockchain node constitutes a parent blockchain. The device includes:
[0112] The receiving module 10 is used to receive data acquisition information uploaded by the user; wherein, the first virtual blockchain node is a node in the first sub-level blockchain;
[0113] The parsing module 20 is used to parse the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located;
[0114] The sending module 30 is used to send a target data acquisition request to the second virtual blockchain node according to the second sub-level blockchain information; wherein, the second virtual blockchain node is a node in the second sub-level blockchain;
[0115] The judgment module 40 is used to determine whether the target data received from the second virtual blockchain node based on the target data acquisition request is received;
[0116] The upload module 50 is used to upload the target data to the first sub-level blockchain if the target data is received.
[0117] In one embodiment, the apparatus further includes:
[0118] The permission information acquisition module is used to acquire permission information from the data acquisition information;
[0119] The permission information detection module is used to detect whether the permission information meets the data acquisition requirements;
[0120] An execution module is used to, if the data acquisition requirements are met, execute the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located.
[0121] The beneficial effects of this invention are as follows: By establishing a parent blockchain through the first virtual blockchain node of the first sub-blockchain and the second virtual blockchain node of the second sub-blockchain, the first virtual blockchain node will only send a data retrieval request to the second virtual blockchain node when a user sends a data retrieval request. The data center infrastructure set up by each sub-blockchain only needs to store its own data information, thereby reducing the maintenance cost of each sub-blockchain and realizing data interaction between each sub-blockchain.
[0122] Reference Figure 3 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores various IoT data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it can implement the IoT-based data acquisition method described in any of the above embodiments.
[0123] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.
[0124] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, can implement the data acquisition method based on the Internet of Things described in any of the above embodiments.
[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0126] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0127] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying platform, a platform product service layer, and an application service layer.
[0128] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational monitoring. The user management module is responsible for managing the identity information of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between user real identities and blockchain addresses (access management). Furthermore, under authorization, it monitors and audits transactions of certain real identities and provides risk control rule configuration (risk control audit). The basic services module is deployed on all blockchain node devices to verify the validity of business requests. After consensus is reached on valid requests, they are recorded in storage. For a new business request, the basic services first perform interface adaptation parsing and authentication (interface adaptation), and then encrypt the business information through a consensus algorithm (consensus management). After encryption, the data is transmitted completely and consistently to the shared ledger (network communication) and recorded and stored. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Developers can define contract logic using a programming language and publish it to the blockchain (contract registration). According to the contract terms, the key or other events are invoked to trigger execution and complete the contract logic. It also provides functions for contract upgrades and cancellations. The operation monitoring module is mainly responsible for deployment, configuration modification, contract settings, cloud adaptation, and real-time status visualization output during product release, such as alarms, monitoring network conditions, and monitoring the health status of node devices.
[0129] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A data acquisition method based on the Internet of Things, characterized in that, The Internet of Things (IoT) includes multiple sub-level blockchains, each sub-level blockchain includes virtual blockchain nodes, and each virtual blockchain node constitutes a parent blockchain. The method includes: The first virtual blockchain node receives data uploaded by users to obtain information; wherein, the first virtual blockchain node is a node in the first sub-level blockchain; The data acquisition information is analyzed to determine the target data to be acquired and the second-level blockchain information where the target data is located. A request to acquire target data is sent to the second virtual blockchain node based on the information of the second sub-level blockchain; wherein, the second virtual blockchain node is a node in the second sub-level blockchain; Determine whether the target data received is the feedback from the second virtual blockchain node based on the target data acquisition request; If the target data is received, the target data is uploaded to the first sub-level blockchain; wherein, the upload is made through the first virtual blockchain node to the first sub-level blockchain, so that each blockchain node in the first sub-level blockchain can work based on the target data; The step of uploading the target data to the first sub-level blockchain if the target data is received further includes: Obtain the invocation information of the target data; Based on the invoked information, obtain the time elapsed from the last time the target data was invoked to the current time; Determine whether the time duration exceeds a preset time value; If the preset time value is exceeded, the target data will be deleted from the first sub-level blockchain; The method further includes: Detect data changes in the first sub-level blockchain; Determine whether there is a first abnormal fluctuation based on the changes in the data; If the abnormal fluctuation occurs, the data that caused the first abnormal fluctuation will be sent to the parent blockchain; In the parent blockchain, determine whether the remaining second virtual blockchain nodes have second abnormal fluctuations; If the second abnormal fluctuation exists, analyze whether the data changes of the first abnormal fluctuation and the second abnormal fluctuation are similar; If they are similar, then the first abnormal fluctuation is determined to be a normal fluctuation.
2. The data acquisition method based on the Internet of Things as described in claim 1, characterized in that, Before the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located, the following steps are included: Obtain the permission information from the data acquisition information; Check whether the permission information meets the data acquisition requirements; If the data acquisition requirements are met, then the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located is executed.
3. The data acquisition method based on the Internet of Things as described in claim 1, characterized in that, Before the step of sending a target data acquisition request to the second virtual blockchain node based on the second sub-level blockchain information, the method further includes: Determine whether consensus response information has been received from the second virtual blockchain node based on the target data acquisition request; If the consensus response information is received, then negotiate consensus with the second virtual blockchain node; The consensus is synchronized to the parent blockchain as a credential for receiving the target data.
4. The data acquisition method based on the Internet of Things as described in claim 1, characterized in that, The step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located includes: The data is segmented into words using a text classifier. The segmented data acquisition information is vectorized to obtain the multidimensional coordinates X = (x1, x2, x3…x) of the data acquisition vector corresponding to the data acquisition information. n ); According to the formula Calculate the cosine value between the data acquisition vector and each sub-blockchain, where the multidimensional coordinates of each sub-blockchain are Y = (y1, y2, y3…y…). n ); The sub-blockchain with the largest cosine value is selected as the second sub-blockchain.
5. A data acquisition device based on the Internet of Things, characterized in that, The Internet of Things (IoT) includes multiple sub-level blockchains, each sub-level blockchain including virtual blockchain nodes, and each virtual blockchain node constituting a parent blockchain. The device includes: The receiving module is used to receive data and information uploaded by users; wherein, the first virtual blockchain node is a node in the first sub-level blockchain; The parsing module is used to parse the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located; The sending module is used to send a target data acquisition request to the second virtual blockchain node according to the second sub-level blockchain information; wherein, the second virtual blockchain node is a node in the second sub-level blockchain; The judgment module is used to determine whether the target data has been received from the second virtual blockchain node based on the target data acquisition request. An upload module is used to upload the target data to the first sub-level blockchain if the target data is received. The upload is made through the first virtual blockchain node, so that each blockchain node in the first sub-level blockchain can work based on the target data. The step of uploading the target data to the first sub-level blockchain if the target data is received further includes: Obtain the invocation information of the target data; Based on the invoked information, obtain the time elapsed from the last time the target data was invoked to the current time; Determine whether the time duration exceeds a preset time value; If the preset time value is exceeded, the target data will be deleted from the first sub-level blockchain; The method further includes: Detect data changes in the first sub-level blockchain; Determine whether there is a first abnormal fluctuation based on the changes in the data; If the abnormal fluctuation occurs, the data that caused the first abnormal fluctuation will be sent to the parent blockchain; In the parent blockchain, determine whether the remaining second virtual blockchain nodes have second abnormal fluctuations; If the second abnormal fluctuation exists, analyze whether the data changes of the first abnormal fluctuation and the second abnormal fluctuation are similar; If they are similar, then the first abnormal fluctuation is determined to be a normal fluctuation.
6. The data acquisition device based on the Internet of Things as described in claim 5, characterized in that, The device further includes: The permission information acquisition module is used to acquire permission information from the data acquisition information; The permission information detection module is used to detect whether the permission information meets the data acquisition requirements; An execution module is used to, if the data acquisition requirements are met, execute the step of parsing the data acquisition information to determine the target data to be acquired and the second-level blockchain information where the target data is located.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Distributed storage method and device for archive information, electronic equipment and medium
CN110417918A