Data uplink method, system, device and medium of terminal device
By activating a trusted entity on the terminal device on the blockchain, generating an initial account and updating permissions, and combining trusted execution environment signatures and hardware unique numbers, the problems of insufficient private key security and device uniqueness binding in terminal device data uploading are solved, achieving efficient and secure data uploading.
Patent Information
- Application Number
- CN202111676903.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing methods for uploading terminal device data to the blockchain suffer from insufficient private key security, inability to achieve unique device binding, and lack of fine-grained permission management, resulting in low efficiency and poor security for data uploading to the blockchain.
By activating a trusted entity on the terminal device on the blockchain, an initial account is generated and permissions are updated. Combined with a trusted execution environment signature and a unique hardware number, data is uploaded to the blockchain, and permission management and firmware upgrades are supported.
It improves the efficiency and security of data uploading from terminal devices to the blockchain, ensures the security of private keys, and enables unique device binding and fine-grained permission management.
Smart Images

Figure CN114462099B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, in particular to a data chaining method, system and device of a terminal equipment, a computer equipment and a medium. BACKGROUND
[0002] There are various technical solutions for the current terminal equipment data chaining method, which are as follows:
[0003] Solution 1: The equipment sends data to a cloud server, and the cloud server receives the data and signs it using a private key stored in the cloud server and sends it to the blockchain.
[0004] Solution 2: The equipment stores a private key locally, signs the collected data, and sends it to the blockchain.
[0005] Solution 3: The equipment stores the private key in a trusted execution environment in an unreadable manner, signs the data, and sends it to the blockchain.
[0006] The defects of the three solutions are as follows: the first solution stores the private key in the cloud server instead of the terminal equipment, which entrusts the security of the private key to the cloud server. If the server is attacked, all physical devices hosted by the server will be listed as untrusted devices, and the data uploaded by the devices will not be listed as trusted data. The second solution stores the private key in the internal or external storage in plaintext, which is easy to be read maliciously, and the signing process is performed in an open environment, which is easy to be tampered with maliciously, thus there is a security risk. The third solution stores the private key in an unreadable manner, which can prevent malicious access, and ensures the confidentiality, integrity and access permission of resources and data in the trusted execution environment, thus ensuring the security of the signature. However, the defect is that it cannot strongly bind the device unique information with the blockchain address. When the device replaces the public and private keys, the blockchain address also changes, which cannot truly realize the uniqueness of the device on the blockchain.
[0007] In addition, there is currently a lack of device permission management mechanism in the existing technology, which cannot achieve fine-grained management of the device, for example, it cannot limit the use of the public and private keys of the device that has been produced but not enabled for the blockchain data chaining and storage function, and it cannot limit the device to call other functions of the blockchain except the storage function. SUMMARY
[0008] The embodiments of the present application provide a terminal equipment data chaining method, system, device, computer equipment and storage medium to improve the efficiency and security of terminal equipment data chaining.
[0009] To solve the above technical problems, the application provides a data uplink method of a terminal device, comprising the following steps performed by a block chain system:
[0010] When receiving registration transaction information of the terminal device, a registration transaction contained in the registration transaction information is acquired, and the registration transaction is used for activation processing on a block chain to obtain a trusted entity, wherein the registration transaction carries signature information generated in a trusted execution environment, a batch number and encrypted information;
[0011] An account of the trusted entity is activated and on-chain permission is updated;
[0012] When receiving collected data of the trusted entity, the collected data is stored to the block chain, wherein the data type includes data flow and parsed data.
[0013] Optionally, the activation processing of the device information on the block chain to obtain the trusted entity comprises:
[0014] A unified batch key corresponding to the batch number is acquired;
[0015] The encrypted information is decrypted to obtain a public key and a hardware unique number;
[0016] The signature information is verified by using the public key, and if the verification is passed, an initial account corresponding to the terminal device is generated based on the hardware unique number, and permission information corresponding to the initial account is updated.
[0017] Optionally, the account activation and on-chain permission update of the trusted entity comprise:
[0018] When receiving an update permission request carrying the hardware unique number, the update permission request is verified for transaction legality to obtain a legality verification result;
[0019] When the legality verification result is passed, an initial account corresponding to the trusted entity is queried based on the hardware unique number, and a target permission management strategy is generated based on a query result;
[0020] The target permission management strategy is sent to the block chain for voting, and after the voting ends, the update of the permission is determined according to a voting result obtained and a content of the target permission management strategy.
[0021] Optionally, after the registration transaction information of the terminal device is received, the registration transaction contained in the registration transaction information is acquired, and the registration transaction is used for activation processing on the block chain to obtain the trusted entity, the data uplink method of the terminal device further comprises:
[0022] If the upgrade firmware package containing the signature information sent by the management end is received, the signature information of the upgrade firmware package is verified for upgrade legality;
[0023] When the upgrade legality verification passes, a unique version number of the upgrade firmware package is generated, and the firmware upgrade package is stored;
[0024] Receiving the hardware unique number and the unique version number of the upgrade firmware package sent by the management end, obtaining the to-be-upgraded trusted entity firmware information;
[0025] After the trusted entity is started, a query transaction is constructed, and it is judged whether the trusted entity needs to be upgraded based on the to-be-upgraded trusted entity firmware information;
[0026] If the trusted entity needs to be upgraded, the to-be-upgraded trusted entity firmware information corresponding to the trusted entity is obtained, and based on the unique version number, the corresponding firmware upgrade package is obtained as a target firmware upgrade package;
[0027] The target firmware upgrade package is used to perform firmware upgrade on the trusted entity.
[0028] In order to solve the above technical problems, the embodiment of the application further provides a data chaining method of a terminal device, comprising the following steps executed by a terminal system:
[0029] When the data is obtained, the response content in the data interaction is listened to according to the mode corresponding to the data type, and message data is obtained;
[0030] The message data is pre-processed to obtain target data;
[0031] The target data is packaged in a self-defined format to obtain a packaged message, and a notarization transaction is generated;
[0032] The packaged message and the hardware unique number are sent to a trusted environment for signature to obtain a signature result;
[0033] The signature result, the permission corresponding to the trusted entity, and the transaction content of the notarization transaction are verified for validity, and if the validity verification passes, the transaction content of the notarization transaction is stored as collection data to a block chain.
[0034] Optionally, the data pre-processing of the message data to obtain the target data comprises:
[0035] The message data is filtered and cleaned to obtain cleaned message data;
[0036] The cleaned message data is assembled and parsed to obtain the target data.
[0037] To solve the above technical problems, the embodiment of the present application also provides a data uplink system of a terminal device, comprising a hardware layer, a system layer and an application layer, wherein,
[0038] The hardware layer is used for collecting data and performing trusted execution environment signature on the data, and communicating with a block chain through a network, and comprises a system running and monitoring module, a data collection and analysis module, a password management and calculation module and a network sending and receiving module;
[0039] The system layer is used for controlling normal execution logic and exception handling of the system, and analyzing message data;
[0040] The application layer comprises a trusted device account management module, a key update module and a permission update module, and is used for managing accounts, permissions and firmware of the trusted device.
[0041] To solve the above technical problems, the embodiment of the present application also provides a data uplink device of a terminal device, a block chain system, and the block chain system comprises:
[0042] An entity registration module is configured to, when receiving registration transaction information of a terminal device, acquire a registration transaction contained in the registration transaction information, and perform activation processing on the block chain by using the registration transaction to obtain a trusted entity, wherein the registration transaction carries signature information generated in a trusted execution environment, a batch number and encrypted information;
[0043] A permission update module is configured to activate an account and update on-chain permissions for the trusted entity;
[0044] A data uplink module is configured to, when receiving collected data of the trusted entity, store the collected data to the block chain, wherein the data type comprises data flow and parsed data.
[0045] Optionally, the entity registration module comprises:
[0046] A batch key acquisition unit is configured to acquire a unified batch key corresponding to the batch number;
[0047] An encrypted information decryption unit is configured to decrypt the encrypted information to obtain a public key and a hardware unique number;
[0048] An account permission generation unit is configured to use the public key to verify the signature information, and if the verification is passed, generate an initial account corresponding to the terminal device based on the hardware unique number, and update permission information corresponding to the initial account.
[0049] Optionally, the permission update module comprises:
[0050] The permission legality verification unit is configured to perform transaction legality verification on the update permission request when the update permission request carrying the hardware unique number is received, and obtain a legality verification result.
[0051] The permission policy generation unit is configured to query an initial account corresponding to the trusted entity based on the hardware unique number when the legality verification result is passed, and generate a target permission management policy based on a query result.
[0052] The permission update unit is configured to send the target permission management policy to the chain for voting, and determine the update of the permission according to a voting result obtained and content of the target permission management policy after the voting ends.
[0053] Optionally, the data chaining device of the terminal device further includes:
[0054] The upgrade legality verification module is configured to perform upgrade legality verification on signature information of the upgrade firmware package if the upgrade firmware package containing the signature information sent by the management end is received.
[0055] The unique version number generation module is configured to generate a unique version number of the upgrade firmware package and store the firmware upgrade package when the upgrade legality verification is passed.
[0056] The to-be-upgraded trusted entity information production module is configured to receive a hardware unique number and a unique version number of an upgrade firmware package sent by the management end, and obtain to-be-upgraded trusted entity firmware information.
[0057] The upgrade judgment module is configured to construct a query transaction after detecting that the trusted entity is started, and judge whether the trusted entity needs to be upgraded based on the to-be-upgraded trusted entity information.
[0058] The upgrade package acquisition module is configured to acquire the to-be-upgraded trusted entity information corresponding to the trusted entity if the trusted entity needs to be upgraded, and acquire a corresponding firmware upgrade package based on the unique version number of the upgrade firmware package in the to-be-upgraded trusted entity information, as a target firmware upgrade package.
[0059] The firmware upgrade module is configured to perform firmware upgrade on the trusted entity by using the target firmware upgrade package.
[0060] To solve the above technical problems, the embodiment of the present application further provides a data chaining device of a terminal device, including a terminal device, the terminal device including: a message acquisition module, configured to, when data is acquired, according to a data type corresponding mode, listen to response content in data interaction, and obtain message data.
[0061] The data preprocessing module is configured to perform data preprocessing on the message data, and obtain target data.
[0062] a transaction generation module, configured to encapsulate the target data in a custom format to obtain an encapsulated message, and generate a storage evidence transaction;
[0063] a message signature module, configured to send the encapsulated message and the hardware unique number into a trusted environment for signature to obtain a signature result;
[0064] a data verification storage module, configured to perform validity verification on the signature result, the permission corresponding to the trusted entity, and the transaction content of the storage evidence transaction, and if the validity verification passes, store the transaction content of the storage evidence transaction as collection data to a block chain.
[0065] Optionally, the data preprocessing module comprises:
[0066] a data cleaning unit, configured to filter and clean the message data to obtain cleaned message data;
[0067] a data assembly and analysis unit, configured to assemble and analyze the cleaned message data to obtain the target data.
[0068] To solve the above technical problems, the embodiment of the application further provides a computer device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the steps of the data chaining method of the terminal device.
[0069] To solve the above technical problems, the embodiment of the application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to realize the steps of the data chaining method of the terminal device.
[0070] The data chaining method, device, computer device and storage medium of the terminal device provided by the embodiment of the application, when receiving the registration transaction information of the terminal device, obtain the registration transaction contained in the registration transaction information, and perform activation processing on the registration transaction in the block chain to obtain a trusted entity, activate the account of the trusted entity and update the on-chain permission, when receiving the collection data of the trusted entity, store the collection data to the block chain, so that any terminal device can quickly perform data chaining, and the data chaining efficiency and security of the terminal device are improved. BRIEF DESCRIPTION OF DRAWINGS
[0071] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings described in the following are only some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor under the premise of the drawings.
[0072] Figure 1 is an exemplary system architecture diagram to which the present application can be applied;
[0073] Figure 2 is a flow chart of one embodiment of the data on-chain method of the terminal device of the present application;
[0074] Figure 3 is a structural schematic diagram of one embodiment of the data on-chain device of the terminal device according to the present application;
[0075] Figure 4 is a structural schematic diagram of one embodiment of the computer device according to the present application. DETAILED DESCRIPTION
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs; the terminology used in the specification of the application is only for the purpose of describing specific embodiments and is not intended to limit the present application; the terms "include" and "have" and any variations thereof in the specification of the present application and claims and the above description of drawings are intended to cover non-exclusive inclusion. The terms "first", "second" and the like in the specification and claims of the present application and the above description of drawings are used to distinguish different objects, not to describe a specific order.
[0077] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily mutually exclusive of other embodiments. It is explicitly and implicitly understood that the embodiments described herein can be combined with other embodiments.
[0078] The technical solutions of the embodiments of the present application will be described clearly and completely in the following in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0079] Please refer to Figure 1 , for example,Figure 1 As shown, Figure 1 is an application environment diagram of a process node management method of bidding in an embodiment of the application. The bidding process node management method provided by the application can be applied in an application environment as shown in Figure 1 The blockchain is composed of a plurality of nodes capable of communicating with each other. Each node can be regarded as a block storage. Each block storage is used to store data. Each data node contains all data. The block storage data has complete historical records and can be quickly restored and expanded. The blockchain is divided into a public chain, a private chain and a consortium chain. The public chain is open to any node. Each institution / node can participate in the blockchain calculation, and any institution / node can download the complete blockchain data. The private chain is not open to the public. It is suitable for internal data management and auditing of specific institutions or open testing. The consortium chain is a permissioned blockchain where each node has complete equality. In the case of not requiring complete mutual trust, data can be exchanged in a trusted manner. Each node of the consortium chain usually has a corresponding entity organization. After authorization, the node can join and exit the network. In the process of using the entire blockchain backup system, a digital signature is required. The digital signature designs a hash function, a sender's public key and a sender's private key. The blockchain has complete distributed storage characteristics. It is actually a larger network data storage that uses a "hash algorithm" form of data structure to save basic data.
[0080] Please refer to Figure 2 , Figure 2 A data chaining method of a terminal device is shown. The details are as follows:
[0081] S201: When receiving the registration transaction information of the terminal device, the registration transaction contained in the registration transaction information is obtained, and the registration transaction is used for activation processing on the blockchain to obtain a trusted entity. The registration transaction carries signature information generated in a trusted execution environment, a batch number and encrypted information.
[0082] Specifically, a batch of public key certificates and batch uniform keys signed by an authorized factory CA are built in an account manager in the blockchain. After the device is powered on for the first time, the device first reads the hardware unique number, reads the public key from the trusted storage environment, and reads the built-in batch uniform key. Then, the device encrypts the public key, hardware unique number, and batch number with the uniform key, and then sends the registration transaction composed of the batch number and encrypted information to the trusted execution environment for signature. The device sends the signed registration transaction to the blockchain. The blockchain first obtains the batch key according to the batch number, then decrypts the encrypted information, verifies that the batch numbers are the same, and then verifies the signature information with the public key. If the verification is legal, the device generates a blockchain account according to the hardware unique number, opens the life cycle management of the account, and gives the account related permissions. If the verification is not legal, the device returns the activation result to the device end by going through the above steps.
[0083] Optionally, the device information is used for activation processing on the blockchain, and the trusted entity includes:
[0084] The batch number corresponding uniform batch key is obtained.
[0085] The encrypted information is decrypted to obtain the public key and the hardware unique number.
[0086] The signature information is verified with the public key. If the verification is passed, the initial account corresponding to the terminal device is generated based on the hardware unique number, and the permission information corresponding to the initial account is updated.
[0087] S202: Account activation and on-chain permission update of the trusted entity.
[0088] Optionally, the account activation and on-chain permission update of the trusted entity includes:
[0089] When the update permission request carrying the hardware unique number is received, the update permission request is verified for transaction legality to obtain a legality verification result.
[0090] When the legality verification result is passed, the initial account corresponding to the trusted entity is queried based on the hardware unique number, and a target permission management strategy is generated based on the query result.
[0091] The target permission management strategy is sent to the chain for voting, and after the voting is completed, the update of the permission is determined according to the obtained voting result and the content of the target permission management strategy.
[0092] S203: When the collection data of the trusted entity is received, the collection data is stored to the blockchain, wherein the data type includes data stream and parsed data.
[0093] In another specific embodiment, after obtaining the data, the terminal device performs a listening check on the data, and when the check result is qualified, stores the data to the block chain, specifically including:
[0094] Upon receiving the data, according to the mode corresponding to the data type, the response content in the data interaction is listened to to obtain the message data;
[0095] The message data is pre-processed to obtain the target data;
[0096] The target data is encapsulated in a custom format to obtain an encapsulated message, and a proof storage transaction is generated;
[0097] The encapsulated message and the hardware unique number are sent to the trusted environment for signature to obtain a signature result;
[0098] The signature result, the permission corresponding to the trusted entity, and the transaction content of the proof storage transaction are verified for validity, and if the validity verification is passed, the transaction content of the proof storage transaction is stored as the collected data to the block chain.
[0099] Further, the data preprocessing of the message data to obtain the target data includes:
[0100] The message data is filtered and cleaned to obtain cleaned message data;
[0101] The cleaned message data is assembled and parsed to obtain the target data.
[0102] In this embodiment, when receiving the registration transaction information of the terminal device, the registration transaction contained in the registration transaction information is obtained, and the registration transaction is activated on the block chain to obtain a trusted entity. The account of the trusted entity is activated and the on-chain permission is updated. When receiving the collected data of the trusted entity, the collected data is stored to the block chain, so that any terminal device can quickly perform data chaining, and the data chaining efficiency and security of the terminal device are improved.
[0103] In a specific optional implementation, after step S203, that is, when receiving the registration transaction information of the terminal device, the registration transaction contained in the registration transaction information is obtained, and the registration transaction is activated on the block chain to obtain a trusted entity, the data chaining method of the terminal device further includes:
[0104] If the signature information containing the upgrade firmware package sent by the management end is received, the signature information of the upgrade firmware package is verified for upgrade legality;
[0105] When the upgrade legality verification is passed, a unique version number of the upgrade firmware package is generated, and the firmware upgrade package is stored;
[0106] receive the hardware unique number and the unique version number of the upgrade firmware package sent by the management end, and obtain the firmware information of the trust entity to be upgraded;
[0107] After the trust entity is started, it constructs a query transaction, and judges whether the trust entity needs to be upgraded based on the firmware information of the trust entity to be upgraded;
[0108] If the trust entity needs to be upgraded, the firmware information of the trust entity to be upgraded corresponding to the trust entity is obtained, and based on the unique version number of the upgrade firmware package in the firmware information of the trust entity to be upgraded, the corresponding firmware upgrade package is obtained as the target firmware upgrade package;
[0109] The target firmware upgrade package is used to upgrade the firmware of the trust entity.
[0110] Optionally, the method further comprises unregistering the trust entity, specifically including active unregistering and passive unregistering, wherein the active unregistering comprises:
[0111] An unregistering transaction is initiated by carrying the hardware unique number, the transaction is signed by a private key, and then sent to the blockchain;
[0112] The blockchain verifies the legality of the transaction, and after verification, the account is unregistered, the rights of the account are cancelled, and the unregistering result is returned to the terminal device.
[0113] The passive unregistering process is as follows:
[0114] An unregistering transaction is initiated by the blockchain account administrator by carrying the hardware unique number directly on the blockchain, the transaction is signed by a private key, and then sent to the blockchain;
[0115] The blockchain verifies the legality of the transaction, and after verification, the account is unregistered, the rights of the account are cancelled, and the unregistering result is returned to the administrator.
[0116] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiment of the application.
[0117] Figure 3 The principle block diagram of the data on-chain device of the terminal device corresponding to the data on-chain method of the terminal device in the above embodiment is shown. As shown in Figure 3 The data on-chain device of the terminal device includes a blockchain system, which includes an entity registration module 31, a right updating module 32 and a data on-chain module 33. The functions of each module are described as follows:
[0118] The entity registration module 31 is configured to, when receiving registration transaction information of a terminal device, acquire a registration transaction contained in the registration transaction information, and perform activation processing on the registration transaction on a blockchain to obtain a trusted entity, wherein the registration transaction carries signature information generated in a trusted execution environment, a batch number, and encrypted information;
[0119] The permission updating module 32 is configured to perform account activation and on-chain permission updating on the trusted entity.
[0120] The data chaining module 33 is configured to, when receiving collected data of the trusted entity, store the collected data to the blockchain, wherein the data type includes data flow and parsed data.
[0121] Optionally, the entity registration module 31 comprises:
[0122] The batch key acquisition unit is configured to acquire a unified batch key corresponding to the batch number.
[0123] The encrypted information decryption unit is configured to decrypt the encrypted information to obtain a public key and a hardware unique number.
[0124] The account permission generation unit is configured to verify the signature information by using the public key, and if the verification passes, generate an initial account corresponding to the terminal device based on the hardware unique number, and update permission information corresponding to the initial account.
[0125] Optionally, the permission updating module 32 comprises:
[0126] The permission legality verification unit is configured to, when receiving an update permission request carrying the hardware unique number, perform transaction legality verification on the update permission request to obtain a legality verification result.
[0127] The permission policy generation unit is configured to, when the legality verification result is passed, query an initial account corresponding to the trusted entity based on the hardware unique number, and generate a target permission management policy based on a query result.
[0128] The permission updating unit is configured to send the target permission management policy to the chain for voting, and after the voting ends, determine the update of the permission according to a voting result obtained and a content of the target permission management policy.
[0129] Optionally, the data chaining apparatus of the terminal device further comprises:
[0130] The upgrade legality verification module is configured to, if receiving an upgrade firmware package sent by the management end and containing the signature information, perform upgrade legality verification on the signature information of the upgrade firmware package.
[0131] The unique version number generation module is configured to, if the upgrade legality verification passes, generate a unique version number of the upgrade firmware package, and store the firmware upgrade package.
[0132] The to-be-upgraded trusted entity information production module is configured to receive the hardware unique number and the unique version number of the upgrade firmware package sent by the management end, and obtain the to-be-upgraded trusted entity firmware information;
[0133] The upgrade judgment module is configured to, after the trusted entity is started, construct a query transaction, and judge whether the trusted entity needs to be upgraded based on the to-be-upgraded trusted entity information.
[0134] The upgrade package acquisition module is configured to, if the trusted entity needs to be upgraded, acquire the to-be-upgraded trusted entity information corresponding to the trusted entity, and acquire the corresponding firmware upgrade package as a target firmware upgrade package based on the unique version number of the upgrade firmware package in the to-be-upgraded trusted entity information.
[0135] The firmware upgrade module is configured to perform firmware upgrade on the trusted entity by using the target firmware upgrade package.
[0136] The data chaining device of the terminal device further comprises a terminal device, and the terminal device comprises:
[0137] The message acquisition module is configured to, when the data is acquired, listen to the response content in the data interaction according to the mode corresponding to the data type, and obtain message data.
[0138] The data preprocessing module is configured to perform data preprocessing on the message data, and obtain target data.
[0139] The transaction generation module is configured to encapsulate the target data in a self-defined format, obtain an encapsulated message, and generate a storage evidence transaction.
[0140] The message signature module is configured to send the encapsulated message and the hardware unique number into a trusted environment for signature, and obtain a signature result.
[0141] The data verification and storage module is configured to perform validity verification on the signature result, the permission corresponding to the trusted entity, and the transaction content of the storage evidence transaction, and if the validity verification is passed, store the transaction content of the storage evidence transaction to a block chain.
[0142] Optionally, the data preprocessing module comprises:
[0143] The data cleaning unit is configured to filter and clean the message data, and obtain cleaned message data.
[0144] The data assembly and analysis unit is configured to assemble and analyze the cleaned message data, and obtain target data.
[0145] The specific definition of the data uplink device of the terminal device can be referred to the definition of the data uplink method of the terminal device in the above, which will not be repeated here. Each module in the data uplink device of the terminal device described above can be realized by software, hardware and their combination in whole or in part. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in the form of software, so that the processor calls to execute the operation corresponding to each module.
[0146] To solve the above technical problems, the embodiment of the application further provides a data uplink system of a terminal device, which comprises a hardware layer, a system layer and an application layer, wherein,
[0147] The hardware layer is used for collecting data and performing trusted execution environment signature on the data, and communicating with the block chain through the network, and comprises a system running and monitoring module, a data collection and analysis module, a password management and calculation module and a network sending and receiving module;
[0148] The system layer is used for controlling the normal execution logic and exception handling of the system, and analyzing the message data;
[0149] The application layer comprises a trusted device account management module, a key update module and a permission update module, and is used for managing the account, permission and firmware of the trusted device.
[0150] Specifically, the hardware layer can be divided into a system running and monitoring module, a data collection and analysis module, a password management and calculation module, and a network sending and receiving module. The system running and monitoring module is composed of CPU, UART, RTC, SD, GPIO, USB and other hardware devices and their circuits, the CPU is responsible for executing system running instructions, the UART is responsible for communicating with peripherals, the RTC is responsible for real-time clock management, the SD is responsible for external storage, the GPIO is responsible for peripheral control, and the USB is responsible for communicating with the host computer and debugging; the data collection and analysis module is composed of I2C, SPI, Bluetooth, RS485, CAN, RFID and other hardware interfaces, which can interact and communicate with external data sources through the interfaces to achieve the purpose of data acquisition; the password management and calculation module is composed of a trusted execution environment and a trusted storage environment, the trusted execution environment is responsible for performing password calculation operations in a secure environment, and the trusted storage environment is responsible for securely storing keys to prevent key theft; the network sending module is composed of 2G / 4G, Wifi and other hardware devices and their circuits, the 2G / 4G is responsible for communicating with the block chain through the 2G / 4G network, and the Wifi is responsible for communicating with the block chain through the wifi network.
[0151] The system layer can be divided into a system operation and monitoring module, a data acquisition and analysis module, a password management and calculation module, and a network sending and receiving module. The system operation and monitoring module is composed of software logic such as a running state machine, a file system, system monitoring, and peripheral device drivers. The running state machine is responsible for controlling the normal execution logic and exception handling of the system. The file system is responsible for managing and storing files in Fat32 format. The system monitoring is responsible for real-time monitoring and tracking of the system state. The peripheral device drivers are responsible for driving peripheral hardware to enable normal operation and interaction with the CPU. The data acquisition and analysis module is composed of software logic such as signal monitoring, hardware driving, logic interaction, and message analysis. The signal monitoring is responsible for monitoring the level signals on the hardware interface, thereby triggering the relevant running logic in a timely manner when data arrives. The hardware driving is responsible for driving the hardware interface to enable normal operation and interaction with data sources having similar hardware interfaces. The logic interaction module is responsible for implementing the interaction logic of specific communication protocols. The message analysis module is responsible for disassembling and packaging data messages into physical values with actual significance according to the communication protocol. The password management and calculation module is composed of software logic such as security signature and key escrow. The security signature is responsible for sending the data to be signed into a trusted execution environment for signature and obtaining the signature result. The key escrow is responsible for generating a public-private key pair in a trusted storage environment through a true random number generator and obtaining public key information and other publicly available information from the trusted storage environment. The network sending and receiving module is composed of software logic such as HTTP / HTTPS and MQTT. The HTTP / HTTPS is responsible for implementing the http and https protocols. The MQTT is responsible for implementing the mqtt protocol.
[0152] The application layer can be divided into device registration activation, device account deregistration, device key update, device permission update, data acquisition and processing, and remote upgrade functions. The device registration activation is responsible for activating the device on the blockchain. The device account deregistration is responsible for deregistering the device on the blockchain. The device key update is responsible for updating the key on the blockchain. The device permission update is responsible for updating the access permission of the device on the blockchain. The data acquisition and processing is responsible for collecting external data and system state data and sending them to the blockchain for evidence after signing. The remote upgrade is responsible for performing trusted upgrade on the device through the blockchain.
[0153] To solve the above technical problems, the embodiments of the present application also provide a computer device. For details, please refer to Figure 4 , Figure 4 The basic structure block diagram of the computer device of the present embodiment is shown in the figure.
[0154] The computer device 4 includes a memory 41, a processor 42, and a network interface 43, which are communicatively connected to each other through a system bus. It should be noted that the computer device 4 is only shown with the components of the memory 41, the processor 42, and the network interface 43, but it should be understood that not all of the shown components are required to be implemented, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device herein is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0155] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The computer device can interact with the user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, and the like.
[0156] The memory 41 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or D interface display memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Of course, the memory 41 can also include both the internal storage unit and the external storage device of the computer device 4. In the present embodiment, the memory 41 is generally used to store an operating system and various application software installed in the computer device 4, such as program codes for controlling electronic files, and the like. In addition, the memory 41 can also be used to temporarily store various data that have been output or will be output.
[0157] The processor 42 may, in some embodiments, be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In the present embodiment, the processor 42 is configured to run program code stored in the memory 41 or process data, such as program code for controlling the operation of an electronic file.
[0158] The network interface 43 may include a wireless network interface or a wired network interface, and is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0159] The present application also provides another embodiment, i.e., a computer readable storage medium storing an interface display program, which can be executed by at least one processor to make the at least one processor perform the steps of the data chaining method of the terminal device as described above.
[0160] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software and a general hardware platform, and of course, they can also be implemented by hardware, but in many cases, the former is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a number of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device) execute the methods described in the various embodiments of the present application.
[0161] Obviously, the above-described embodiments are only some of the embodiments of the present application, rather than all the embodiments, and the preferred embodiments of the present application are given in the drawings, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some technical features. Any equivalent structure made by referring to the contents of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A data uplink method of a terminal device, characterized by, Applied to a blockchain, a data chaining method of the terminal device comprises the following steps executed by a blockchain system: Upon receiving registration transaction information of the terminal device, a registration transaction included in the registration transaction information is obtained, wherein the registration transaction carries signature information generated in a trusted execution environment, a batch number, and encrypted information; A unified batch key corresponding to the batch number is obtained; The encrypted information is decrypted to obtain a public key and a hardware unique number; The signature information is verified using the public key, and if the verification is passed, an initial account corresponding to the terminal device is generated based on the hardware unique number, and the permission information corresponding to the initial account is updated to obtain a trusted entity; If a signature information containing an upgrade firmware package sent by the management end is received, the signature information of the upgrade firmware package is verified for upgrade legality; When the upgrade legality verification is passed, a unique version number of the upgrade firmware package is generated, and the upgrade firmware package is stored; A hardware unique number and a unique version number of the upgrade firmware package sent by the management end are received to obtain trusted entity firmware information to be upgraded; After the trusted entity is started, it actively constructs a query transaction, and determines whether the trusted entity needs to be upgraded based on the trusted entity firmware information to be upgraded; If the trusted entity needs to be upgraded, the trusted entity firmware information to be upgraded corresponding to the trusted entity is obtained, and a corresponding firmware upgrade package is obtained based on the unique version number of the upgrade firmware package in the trusted entity firmware information to be upgraded, as a target firmware upgrade package; The trusted entity is upgraded using the target firmware upgrade package; The trusted entity is activated and the on-chain permission is updated; Upon receiving collected data of the trusted entity, the collected data is stored to the blockchain, wherein the data types include data streams and parsed data.
2. The data uplink method of a terminal device according to claim 1, wherein, The account activation and on-chain permission update of the trusted entity comprise: Upon receiving an update permission request carrying the hardware unique number, the update permission request is verified for transaction legality to obtain a legality verification result; When the legality verification result is passed, the initial account corresponding to the trusted entity is queried based on the hardware unique number, and a target permission management strategy is generated based on the query result; The target permission management strategy is sent to the chain for voting, and after the voting ends, the update of the permission is determined according to the voting result obtained and the content of the target permission management strategy.
3. A data uplink apparatus of a terminal device, characterized by comprising: The data chaining device of the terminal device comprises: An entity registration module is configured to, upon receiving registration transaction information of a terminal device, obtain a registration transaction included in the registration transaction information, wherein the registration transaction carries signature information generated in a trusted execution environment, a batch number, and encrypted information, obtain a unified batch key corresponding to the batch number, decrypt the encrypted information to obtain a public key and a hardware unique number, and verify the signature information using the public key. If the verification is passed, an initial account corresponding to the terminal device is generated based on the hardware unique number, and the permission information corresponding to the initial account is updated to obtain a trusted entity. The firmware upgrade module is configured to receive an upgrade firmware package containing signature information sent by the management end, and then perform upgrade legality verification on the signature information of the upgrade firmware package; when the upgrade legality verification is passed, generate a unique version number of the upgrade firmware package, and store the upgrade firmware package; receive a hardware unique number and a unique version number of the upgrade firmware package sent by the management end, and obtain firmware information of a trusted entity to be upgraded; after the trusted entity is started, the trusted entity actively constructs a query transaction, judges whether the trusted entity needs to be upgraded based on the firmware information of the trusted entity to be upgraded; if the trusted entity needs to be upgraded, the firmware information of the trusted entity to be upgraded corresponding to the trusted entity is obtained, and based on the unique version number of the upgrade firmware package in the firmware information of the trusted entity to be upgraded, a corresponding firmware upgrade package is obtained as a target firmware upgrade package; and the trusted entity is upgraded by using the target firmware upgrade package; The permission update module is configured to perform account activation and on-chain permission update on the trusted entity. The data chaining module is configured to store collected data of the trusted entity to a blockchain when the collected data is received, wherein the data types include data flow and parsed data.
4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the data chaining method of the terminal device according to any one of claims 1 to 2.
5. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the data chaining method of the terminal device according to any one of claims 1 to 2.
Citation Information
Patent Citations
Authority management method and device
CN108712423A
Device management method and device management system based on block chain
CN110493039A
Transaction processing method and device based on block chain and electronic equipment
CN111461883A
Method, device and system for verifying reliability of data source
CN112560073A
Software updates distribution to vehicles via v2v communication and verification by community of vehicles
CN113454584A