CN117349885A - Data processing method and device based on intelligent contract and storage medium - Google Patents

Data processing method and device based on intelligent contract and storage medium Download PDF

Info

Publication number
CN117349885A
CN117349885A CN202311325305.5A CN202311325305A CN117349885A CN 117349885 A CN117349885 A CN 117349885A CN 202311325305 A CN202311325305 A CN 202311325305A CN 117349885 A CN117349885 A CN 117349885A
Authority
CN
China
Prior art keywords
data
newly added
hash value
preset type
newly
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311325305.5A
Other languages
Chinese (zh)
Inventor
皮峰
吴定林
段平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Thalys Automobile Co ltd
Original Assignee
Thalys Automobile Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Thalys Automobile Co ltd filed Critical Thalys Automobile Co ltd
Priority to CN202311325305.5A priority Critical patent/CN117349885A/en
Publication of CN117349885A publication Critical patent/CN117349885A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application relates to the technical field of blockchain and discloses a data processing method, device and storage medium based on intelligent contracts, wherein the method comprises the following steps: detecting whether the newly added data is the data of a preset type which allows modification; if yes, detecting whether historical preset type data associated with the newly added data exists or not; if detecting that the history preset type data associated with the newly added data exists, generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data; and storing the newly added data and the hash value corresponding to the newly added data in the block chain to finish the data newly added processing. The embodiment of the invention is applied to a block chain scene, the newly added data and the historical preset type data are connected through the hash value, and the data of the same type are constructed into a complete data chain, so that after any data in the data chain is tampered, the hash value corresponding to all the subsequent data is changed, and the data tamper resistance is improved.

Description

Data processing method and device based on intelligent contract and storage medium
Technical Field
The embodiment of the application relates to the technical field of blockchains, in particular to a data processing method, device and storage medium based on intelligent contracts.
Background
At present, data related to vehicles are generally stored in a centralized server, and recording and managing the data related to the life cycle of the vehicles are of great importance for protecting the value of the vehicles, tracking the history and ensuring the transparency of transactions.
It is worth noting that the data processing authority of the centralized server belongs to a single service provider, and corresponding supervision measures are lacked, so that related data are easy to be randomly added or tampered, and the security and tamper resistance of the related data are low.
Disclosure of Invention
In view of the above problems, embodiments of the present application provide a data processing method, apparatus and storage medium based on an intelligent contract, so as to improve tamper resistance and security of newly added data.
According to an aspect of the embodiments of the present application, there is provided a data processing method based on an intelligent contract, the data processing method including: detecting whether the newly added data is the data of a preset type which allows modification; if yes, detecting whether historical preset type data associated with the newly added data exists or not; if detecting that the history preset type data associated with the new added data exists, generating a hash value corresponding to the new added data according to the hash value corresponding to the history preset type data; and storing the newly added data and the hash value corresponding to the newly added data in a blockchain to finish the data newly added processing.
In an alternative manner, before the detecting whether the newly added data is the data of the preset type that allows modification, the data processing method further includes: receiving a data newly-added request carrying a digital signature corresponding to a current user; wherein the digital signature is a signature generated according to a private key of a current user; and determining whether the current user has the data newly-added authority according to the digital signature.
In an alternative manner, before the receiving the data new request, the data processing method further includes: generating a corresponding digital account according to the vehicle identity information; configuring a corresponding digital token for the digital account; wherein the digital token acts as a carrier for transferring the digital account information.
In an optional manner, the determining whether the current user has the data newly added authority according to the digital signature further includes: decrypting the digital signature according to the public key; if the decryption is successful, the current user is characterized to have the data newly-added authority; and if the decryption fails, the current user is characterized as not possessing the data newly-added authority.
In an alternative manner, the number of the historical preset type data is a plurality; the generating the hash value corresponding to the newly added data according to the hash value corresponding to the historical preset type data further comprises: taking the data with the rearmost corresponding time sequence in the history preset type data as target history preset type data, and calculating to obtain a target hash value corresponding to the target history preset type data; and generating a hash value corresponding to the newly added data according to the target hash value and the newly added data.
In an optional manner, the detecting whether there is the historical preset type data associated with the new data further includes: and if the history preset type data associated with the new data does not exist, calculating a hash value corresponding to the new data according to the new data.
In an optional manner, the storing the new added data and the hash value corresponding to the new added data in the blockchain to complete the data adding process further includes: storing the target type data in the newly added data and the hash value corresponding to the target type data in a target area in a block chain; and storing other newly added data except the target type data and hash values corresponding to the other newly added data in a non-target area in a block chain.
According to another aspect of the embodiments of the present application, there is provided a data processing apparatus based on a smart contract, the data processing apparatus including: the first detection module is used for detecting whether the newly added data is the data of a preset type which allows modification; the second detection module is used for detecting whether the history preset type data associated with the newly added data exists or not if yes; the generation module is used for generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data if detecting that the history preset type data associated with the newly added data exists; and the processing module is used for storing the newly-added data and the hash value corresponding to the newly-added data in a block chain so as to finish the data newly-added processing.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: a controller; and a memory for storing one or more programs which, when executed by the controller, perform the data processing method described above.
According to an aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having stored thereon computer-readable instructions, which when executed by a processor of a computer, cause the computer to perform the above-described data processing method.
According to an aspect of embodiments of the present application, there is also provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the data processing method described above.
The embodiment of the application is applied to a block chain scene, and only if the newly added data is the data of the preset type which is allowed to be modified, the data newly added operation can be performed, so that the safety of the data modification or the newly added process is improved. If the existence of the history preset type data associated with the newly added data is detected, generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data, and storing the newly added data and the hash value corresponding to the newly added data in a block chain to finish the data newly added processing. According to the embodiment of the application, the newly added data and the historical preset type data are connected through the hash value, the same type of data is constructed into a complete data chain, so that after any one data in the data chain is tampered, the hash value corresponding to all subsequent data is changed, abnormal data can be rapidly located, and meanwhile, the tamper resistance of the data is improved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present application, and may be implemented according to the content of the specification, so that the technical means of the embodiments of the present application can be more clearly understood, and the following detailed description of the present application will be presented in order to make the foregoing and other objects, features and advantages of the embodiments of the present application more understandable.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flow chart illustrating a method of smart contract-based data processing, in accordance with an exemplary embodiment of the present application.
FIG. 2 is a flow chart of another smart contract-based data processing method, shown based on the exemplary embodiment of FIG. 1.
FIG. 3 is a schematic diagram illustrating user blockchain account operation in accordance with an exemplary embodiment of the present application.
Fig. 4 is a schematic diagram of a detection flow of newly added data according to an exemplary embodiment of the present application.
Fig. 5 is a schematic diagram of an application scenario of the smart contract-based data processing method of the present application.
Fig. 6 is a schematic diagram of a data processing apparatus based on a smart contract according to an exemplary embodiment of the present application.
Fig. 7 is a schematic diagram of a computer system of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Reference to "a plurality" in this application means two or more than two. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., a and/or B may represent: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The data processing authority of the existing centralized server belongs to a single service provider, and corresponding supervision measures are lacked, so that related data are easy to be randomly added or tampered, and the security and tamper resistance of the related data are low.
To this end, an aspect of the present application provides a data processing method based on an intelligent contract. Referring specifically to fig. 1, fig. 1 is a schematic flow chart of a data processing method based on smart contracts according to an exemplary embodiment of the present application. The data processing method at least comprises S110 to S140, and is described in detail as follows:
S110: and detecting whether the newly added data is the data of the preset type which allows modification.
The data limiting modification includes, but is not limited to, data such as vehicle name, vehicle model number, and vehicle mileage.
The preset types of data that are allowed to be modified include, but are not limited to, vehicle insurance, vehicle accidents, and vehicle repairs.
S120: if yes, detecting whether historical preset type data associated with the newly added data exists.
For example, if the newly added data is vehicle insurance type data, it is detected whether there is historical vehicle insurance type data.
S130: if the history preset type data associated with the newly added data exists, generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data.
If the associated historical preset type data exists, representing that the current newly-added data is not the data which appears for the first time in the preset type data, and processing the associated historical data in the process of processing the pre-data;
the associated historical data is processed in the pre-data processing process, the associated historical preset type data and the corresponding hash value are stored, and the hash value corresponding to the current newly-added data is generated by introducing the hash value corresponding to the associated historical preset type data, so that the hash value is utilized to establish a connection between the historical preset type data and the hash value. If the historical data is tampered, the hash value corresponding to the current newly added data is changed, so that the abnormal data is rapidly positioned, and the tamper resistance of the data is improved.
In another exemplary embodiment, if it is detected that there is no history preset type data associated with the newly added data, a hash value corresponding to the newly added data is calculated according to the newly added data.
If the associated historical preset type data does not exist, the current newly-added data is characterized as the first data in the preset type data, the preset type data is not processed in the process of processing the front-end data, and the hash value corresponding to the newly-added data can be directly obtained through calculation according to the newly-added data.
S140: and storing the newly added data and the hash value corresponding to the newly added data in the block chain to finish the data newly added processing.
A smart contract is a computer program based on blockchain technology that automatically performs, validates, and executes contract terms. The core idea of the intelligent contract is that by converting contract clauses into programmable codes and executing and recording on a blockchain, an automatic contract executing process is realized, the requirement of an intermediary agency is removed, and the safety and the credibility are enhanced. The method can be used as an execution body of the embodiment to perform the uplink operation on the newly added data and the hash value thereof, namely, the newly added data and the hash value thereof are newly added in the blockchain, so as to improve the security and tamper resistance of the data.
The embodiment is applied to a block chain scene, and only if the newly added data is the data of the preset type which is allowed to be modified, the data newly added operation can be performed so as to improve the safety of the data modification or the newly added process. If the existence of the history preset type data associated with the newly added data is detected, generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data, and storing the newly added data and the hash value corresponding to the newly added data in a block chain to finish the data newly added processing. In the embodiment, the newly added data and the historical preset type data are connected through the hash value, and the same type of data is constructed into a complete data chain, so that after any one data in the data chain is tampered, the hash value corresponding to all subsequent data is changed, abnormal data can be rapidly positioned, and meanwhile, the tamper resistance of the data is improved.
Similarly, the present application may also perform corresponding data processing on the modified data, where the processing steps are similar to those of S110 to S140, and the difference is that S140 performs an update operation on the existing data according to the modified data to complete the data modification processing.
In another exemplary embodiment of the present application, how to perform authority verification on a current user is described in detail, and referring specifically to fig. 2, fig. 2 is a flow chart of another data processing method based on smart contracts, which is shown in the exemplary embodiment of fig. 1. The data processing method further includes S210 to S220 before S110 shown in fig. 1, and is described in detail as follows:
S210: receiving a data newly-added request carrying a digital signature corresponding to a current user; wherein the digital signature is a signature generated from the private key of the current user.
The digital signature is a signature generated according to the identification data of the current user and the private key thereof, and the identification data is specific data capable of representing the identity information of the current user. Meanwhile, the private key is a key which is known by the current user, so that the possibility of fake digital signature is avoided to a certain extent, and the security of the digital signature is further improved.
S220: and determining whether the current user has the data newly-added authority according to the digital signature.
If the user has the data newly-added authority, the step S110 is executed, and if the user does not have the data newly-added authority, the prompt languages such as "the current user does not have the data newly-added authority" are fed back, and the execution of the subsequent steps is terminated.
The embodiment can decrypt the digital signature and verify the authority of the current user according to the decrypted data. The embodiment can also carry out matching operation on the digital signature and the preset digital signature, and determine whether the current user has the data newly-added authority according to the matching result.
The embodiment provides a mode for carrying out authority verification on the current user, and whether the current user has the data newly added authority is determined according to the received digital signature corresponding to the current user. Because the digital signature is generated according to the private key unique to the current user, the possibility of fake digital signature is avoided to a certain extent, and the security of the digital signature is further improved.
In another exemplary embodiment of the present application, how to manage and transfer relevant data of a vehicle is described in detail, specifically, a digital account corresponding to the vehicle is set at the blockchain network side, specifically, the data processing method further includes S21 to S22 before S210 in any of the foregoing exemplary embodiments, which is described in detail as follows:
s21: and generating a corresponding digital account according to the vehicle identity information.
The vehicle identification information includes, but is not limited to, vehicle VIN (Vehicle Identification Number, vehicle identification code), vehicle UUID (Universally Unique Identifie, universally unique identification code), license plate number, and other parameter information.
S22: configuring a digital account with a corresponding digital token; wherein the digital tokens act as carriers for transferring digital account information.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating user blockchain account operation according to an exemplary embodiment of the present application. Each user has a blockchain account, each blockchain account comprises at least one digital account corresponding to a vehicle, and if the same user comprises a plurality of vehicles, the blockchain account comprises a plurality of digital accounts corresponding to the vehicles.
The present embodiment configures a corresponding digital Token NFT (Non-homogeneous Token) for each digital account to be used as a carrier for data transfer in a blockchain network, i.e., a transfer carrier for digital account information. For example, the vehicle a is originally affiliated to the first user, and the first user resells the vehicle to the second user, and then all the data in the digital account corresponding to the vehicle a in the blockchain account needs to be transferred to the blockchain account of the second user, i.e. the digital account corresponding to the vehicle a is bound with the blockchain account of the second user. The digital token is used as a carrier for transferring digital account information, the digital account corresponding to the vehicle A can be quickly and conveniently transferred to the blockchain account of the second user, the whole asset transfer operation can be recorded by the blockchain network and is non-tamperable recorded information, and the passing flow of the vehicle can be tracked according to the recorded information.
In the embodiment, in the blockchain network end, a corresponding digital account is generated according to the identity information of each vehicle, and corresponding digital tokens are configured for the digital account so as to facilitate the transfer of the digital account information.
In another exemplary embodiment of the present application, how to determine whether the current user has the right to add data according to the digital signature is described in detail, that is, S220 in any of the foregoing exemplary embodiments, further includes S2201 to S2203, which are described in detail as follows:
s2201: and carrying out decryption operation on the digital signature according to the public key.
The public key is a key corresponding to the private key of the user, which is a public key. The execution body of the embodiment can acquire the public key from the public channel, decrypt the digital signature by using the public key, and determine whether the current user has the data newly-added authority according to the decryption result.
S2202: and if the decryption is successful, the current user is characterized to have the data newly-added authority.
S2203: if the decryption fails, the current user is characterized as not possessing the data newly-added authority.
Illustratively, as shown in fig. 3, the user accesses the DAPP (Decentralized Application, decentralizing application) through the blockchain account, the DAPP sends the digital signature to the smart contract, the smart contract decrypts the digital signature according to the public key, and if the decryption is successful, the subsequent corresponding data processing is performed; if decryption fails, the intelligent contract can feed back information such as 'the current user does not own the data newly added permission' and the like to the user side through the DAPP, so that the user is informed of failure of permission verification, and the newly added data operation cannot be performed.
If it is detected that the current user has the data newly-added authority, a subsequent detection process is required to be performed on the newly-added data, specifically referring to fig. 4, fig. 4 is a schematic diagram of a detection flow of the newly-added data according to an exemplary embodiment of the present application. The detailed description is as follows:
and if the fact that the current user has the data newly-added authority is detected, selecting a target digital account corresponding to a target vehicle in the current user blockchain account, and judging whether the newly-added data is basic metadata or event metadata.
And respectively carrying out data verification on the metadata of different types, and detecting whether the newly added data is the data of the preset type which allows modification.
And if the newly added data is detected to be the data of the preset type which allows modification, writing the newly added data into the target digital account.
The embodiment further illustrates that the intelligent contract performs decryption operation on the digital signature according to the public key, and determines whether the current user has the data newly-added authority according to the decryption operation result, so that the authority detection can be accurately performed on the current user, the situation that the user without authority adds data randomly is avoided, and the reliability of stored data is improved.
In another exemplary embodiment of the present application, how to generate a hash value corresponding to newly added data according to a hash value corresponding to historical preset type data is described in detail. I.e., S130 in any of the above-described exemplary embodiments, further includes S1301 to S1302. Wherein the number of the historical preset type data is a plurality of; the detailed description is as follows:
S1301: and taking the data with the last corresponding time sequence in the historical preset type data as target historical preset type data, and calculating to obtain a target hash value corresponding to the target historical preset type data.
The plurality of history preset type data may be sequentially stored in the target data list according to a time sequence, and after the time sequence corresponding to the last history preset type data in the target data list is the last, the last history preset type data is used as the target history preset type data, and the last history preset type data is transmitted into a space built-in key ak256 () function in a parameter form to perform hash operation on the data, and the hash value obtained by calculation is returned to be the target hash value.
S1302: and generating a hash value corresponding to the newly added data according to the target hash value and the newly added data.
Illustratively, the target hash value and the newly added data are integrated into a new list element, so as to generate a hash value corresponding to the newly added data, and the newly added data is added into the target data list to obtain an updated target data list.
In some embodiments, the target data list further stores a hash value corresponding to the data, that is, the execution subject may directly obtain the target hash value corresponding to the target history preset type data from the target data list. The hash value corresponding to the newly added data is also added to the target data list, so that the subsequent calculation of the hash value of the newly added data is convenient.
The embodiment provides a method for generating a hash value corresponding to newly added data according to a hash value corresponding to historical preset type data, and the newly added data is connected with the historical preset type data with the rearmost time sequence through the hash value, so that the data of the same type can be constructed into a complete data chain according to the time sequence, after any one data in the data chain is tampered, the hash values corresponding to all subsequent data are changed, so that abnormal data can be rapidly positioned, and meanwhile, the data abnormality occurrence time is positioned, and the method for data abnormality occurrence time is provided, so that the tracking function of the abnormal data is improved.
In another exemplary embodiment of the present application, how to store the new data and the hash value corresponding to the new data in the blockchain to complete the data new processing, that is, S140 in any of the foregoing exemplary embodiments, further includes S1401 to S1402, which are described in detail as follows:
s1401: and storing the target type data in the newly added data and the hash value corresponding to the target type data in a target area in the blockchain.
The target area in this embodiment is a storage area of key data. The target type data comprises basic metadata, event metadata and the like, for example, when events such as accidents, maintenance and the like occur, after corresponding information is input by a user through DAPP, the newly added event metadata and a digital signature block are sent to an intelligent contract in a blockchain network for data verification, and after verification, the newly added event metadata and a hash value corresponding to the newly added event metadata are written into the blockchain network.
S1402: and storing other newly added data except the target type data and hash values corresponding to the other newly added data in a non-target area in the block chain.
Non-target areas include, but are not limited to, IPFS (InterPlanetary File System, interstellar file system), data stored in non-target areas are data that is less useful for data.
Other newly added data includes picture data or video data, and as shown in fig. 3, other newly added data is uploaded to the IPFS. Specifically, different types of data in other newly-added data are split into different IPFS network nodes, and because the IPFS is a distributed storage system based on a blockchain technology, the system can introduce a certification reward of a blockchain, so that more people can be added into the IPFS storage nodes, and the users provide storage space to obtain the reward, so that the storage space of the blockchain network is increased.
According to the embodiment, the new data are stored in a classified mode, so that the target type data and the hash value thereof in the new data are stored in the target area in the blockchain, and the other new data except the target type data in the new data and the hash value thereof are stored in the non-target area, and the utilization rate of the storage space in the blockchain network is effectively improved in a classified storage mode.
In another exemplary embodiment of the present application, an application scenario of the above-mentioned multiple data processing methods is illustrated, and referring specifically to fig. 5, fig. 5 is a schematic diagram of an application scenario of the data processing method based on the smart contract of the present application. Including user blockchain accounts 100, DAPPs 200, smart contracts 300, target areas 400, and non-target areas 500, the connection between them is not limited in this application.
The user blockchain account 100 includes at least one digital account corresponding to the vehicle. DAPP 200 is a decentralised application built based on blockchain technology. The target region 400 and the non-target region 500 are respectively different storage regions in the blockchain network; the non-target area 500 may be an IPFS, and the stored data is data with low data utilization.
The intelligent contract 300 is a computer program based on blockchain technology that can automatically execute, verify and execute contract terms. The core idea of the intelligent contract is that by converting contract clauses into programmable codes and executing and recording on a blockchain, an automatic contract executing process is realized, the requirement of an intermediary agency is removed, and the safety and the credibility are enhanced. The intelligent contract 300 in the application is developed based on an openzeppelin framework referencing ERC721 standard library by taking a solubility as a programming language; including the creation of NFTs, new additions and changes to metadata, asset authorization, asset transfer, etc.
The smart contract 300 may be used as a data processing method as illustrated in any of the above exemplary embodiments, as illustrated below: the smart contract 300 detects whether the newly added data is a preset type of data that allows modification; if so, the intelligent contract 300 detects whether the history preset type data associated with the newly added data exists; if detecting that the history preset type data associated with the newly added data exists, the intelligent contract 300 generates a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data; the smart contract 300 stores the newly added data and hash values corresponding to the newly added data in the blockchain to complete the data newly added processing.
Another aspect of the present application further provides a smart contract-based data processing apparatus, as shown in fig. 6, and fig. 6 is a schematic structural diagram of the smart contract-based data processing apparatus according to an exemplary embodiment of the present application. The data processing apparatus 600 includes:
the first detecting module 610 is configured to detect whether the newly added data is a preset type of data that allows modification.
The second detection module 630 is configured to detect whether there is history preset type data associated with the newly added data if yes.
The generating module 650 is configured to generate a hash value corresponding to the new added data according to the hash value corresponding to the history preset type data if it is detected that the history preset type data associated with the new added data exists.
The processing module 670 is configured to store the newly added data and the hash value corresponding to the newly added data in the blockchain to complete the data addition processing.
In an alternative way, the data processing apparatus 600 further comprises:
the receiving module is used for receiving a data newly-added request carrying a digital signature corresponding to the current user; wherein the digital signature is a signature generated from the private key of the current user.
And the permission determining module is used for determining whether the current user has the data newly-added permission or not according to the digital signature.
In an alternative way, the data processing apparatus 600 further comprises:
and the digital account generation module is used for generating a corresponding digital account according to the vehicle identity information.
The digital token configuration module is used for configuring corresponding digital tokens for the digital account; wherein the digital tokens act as carriers for transferring digital account information.
In an alternative manner, the rights determination module further includes:
and the decryption unit is used for performing decryption operation on the digital signature according to the public key.
And the decryption success unit is used for representing that the current user has the data newly-added authority if the decryption is successful.
And the decryption failure unit is used for indicating that the current user does not have the data newly-added authority if the decryption fails.
In an alternative way, the number of the historical preset type data is a plurality; the generation module 650 further includes:
the first calculation unit is used for taking the data with the last corresponding time sequence in the historical preset type data as the target historical preset type data and calculating to obtain a target hash value corresponding to the target historical preset type data.
And the generating unit is used for generating a hash value corresponding to the newly added data according to the target hash value and the newly added data.
In an alternative manner, the second detection module 630 further includes:
and the second calculation unit is used for calculating a hash value corresponding to the newly added data according to the newly added data if detecting that the historical preset type data associated with the newly added data does not exist.
In an alternative manner, the processing module 670 further includes:
and the target area storage unit is used for storing the target type data in the newly added data and the hash value corresponding to the target type data in the target area in the block chain.
And the non-target area storage unit is used for storing other newly-added data except the target type data and hash values corresponding to the other newly-added data in the non-target area in the blockchain.
The data processing device is applied to a block chain scene, and can perform data addition operation only if the newly added data is the data of the preset type which is allowed to be modified, so that the safety of the data modification or new addition process is improved. If the existence of the history preset type data associated with the newly added data is detected, generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data, and storing the newly added data and the hash value corresponding to the newly added data in a block chain to finish the data newly added processing. According to the data processing device, the newly added data and the historical preset type data are connected through the hash value, the same type of data is constructed into a complete data chain, so that after any one data in the data chain is tampered, the hash value corresponding to all subsequent data is changed, abnormal data can be rapidly located, and meanwhile the tamper resistance of the data is improved.
It should be noted that, the data processing apparatus provided in the foregoing embodiments and the data processing method provided in the foregoing embodiments belong to the same concept, and a specific manner in which each module and unit perform an operation has been described in detail in the method embodiment, which is not described herein again.
Another aspect of the present application also provides an electronic device, including: a controller; and a memory for storing one or more programs which, when executed by the controller, perform the data processing method described above.
Referring to fig. 7, fig. 7 is a schematic diagram of a computer system of an electronic device according to an exemplary embodiment of the present application, which illustrates a schematic diagram of a computer system suitable for implementing the electronic device according to the embodiments of the present application.
It should be noted that, the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a central processing unit (Central Processing Unit, CPU) 701 that can perform various appropriate actions and processes, such as performing the methods in the above-described embodiments, according to a program stored in a Read-Only Memory (ROM) 702 or a program loaded from a storage section 708 into a random access Memory (Random Access Memory, RAM) 703. In the RAM 703, various programs and data required for the system operation are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An Input/Output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. When executed by a Central Processing Unit (CPU) 701, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Another aspect of the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data processing method as before. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone without being incorporated in the electronic device.
Another aspect of the present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the data processing method provided in the above-described respective embodiments.
According to an aspect of the embodiments of the present application, there is also provided a computer system including a central processing unit (Central Processing Unit, CPU) which can perform various appropriate actions and processes, such as performing the method in the above embodiments, according to a program stored in a Read-Only Memory (ROM) or a program loaded from a storage section into a random access Memory (Random Access Memory, RAM). In the RAM, various programs and data required for the system operation are also stored. The CPU, ROM and RAM are connected to each other by a bus. An Input/Output (I/O) interface is also connected to the bus.
The following components are connected to the I/O interface: an input section including a keyboard, a mouse, etc.; an output section including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, and a speaker, and the like; a storage section including a hard disk or the like; and a communication section including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section performs communication processing via a network such as the internet. The drives are also connected to the I/O interfaces as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, and the like are mounted on the drive as needed so that a computer program read therefrom is mounted into the storage section as needed.
The foregoing is merely a preferred exemplary embodiment of the present application and is not intended to limit the embodiments of the present application, and those skilled in the art may make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A data processing method based on intelligent contracts, the data processing method comprising:
Detecting whether the newly added data is the data of a preset type which allows modification;
if yes, detecting whether historical preset type data associated with the newly added data exists or not;
if detecting that the history preset type data associated with the new added data exists, generating a hash value corresponding to the new added data according to the hash value corresponding to the history preset type data;
and storing the newly added data and the hash value corresponding to the newly added data in a blockchain to finish the data newly added processing.
2. The data processing method according to claim 1, wherein before said detecting whether the newly added data is the preset type data which allows modification, the data processing method further comprises:
receiving a data newly-added request carrying a digital signature corresponding to a current user; wherein the digital signature is a signature generated according to a private key of a current user;
and determining whether the current user has the data newly-added authority according to the digital signature.
3. The data processing method according to claim 2, characterized in that before the receiving of the data newly-added request, the data processing method further comprises:
generating a corresponding digital account according to the vehicle identity information;
Configuring a corresponding digital token for the digital account; wherein the digital token acts as a carrier for transferring the digital account information.
4. The data processing method according to claim 2, wherein the determining whether the current user has data newly added authority according to the digital signature, further comprises:
decrypting the digital signature according to the public key;
if the decryption is successful, the current user is characterized to have the data newly-added authority;
and if the decryption fails, the current user is characterized as not possessing the data newly-added authority.
5. The data processing method according to claim 1, wherein the number of the history preset type data is a plurality; the generating the hash value corresponding to the newly added data according to the hash value corresponding to the historical preset type data further comprises:
taking the data with the rearmost corresponding time sequence in the history preset type data as target history preset type data, and calculating to obtain a target hash value corresponding to the target history preset type data;
and generating a hash value corresponding to the newly added data according to the target hash value and the newly added data.
6. The data processing method according to any one of claims 1 to 5, characterized in that the detecting whether there is history preset type data associated with the newly added data, further comprises:
And if the history preset type data associated with the new data does not exist, calculating a hash value corresponding to the new data according to the new data.
7. The method according to any one of claims 1 to 5, wherein storing the newly added data and hash values corresponding to the newly added data in a blockchain to complete data newly added processing, further comprises:
storing the target type data in the newly added data and the hash value corresponding to the target type data in a target area in a block chain;
and storing other newly added data except the target type data and hash values corresponding to the other newly added data in a non-target area in a block chain.
8. A smart contract-based data processing apparatus, the data processing apparatus comprising:
the first detection module is used for detecting whether the newly added data is the data of a preset type which allows modification;
the second detection module is used for detecting whether the history preset type data associated with the newly added data exists or not if yes;
the generation module is used for generating a hash value corresponding to the newly added data according to the hash value corresponding to the history preset type data if detecting that the history preset type data associated with the newly added data exists;
And the processing module is used for storing the newly-added data and the hash value corresponding to the newly-added data in a block chain so as to finish the data newly-added processing.
9. An electronic device, comprising:
a controller;
a memory for storing one or more programs that, when executed by the controller, cause the controller to implement the data processing method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the data processing method of any of claims 1 to 7.
CN202311325305.5A 2023-10-12 2023-10-12 Data processing method and device based on intelligent contract and storage medium Pending CN117349885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311325305.5A CN117349885A (en) 2023-10-12 2023-10-12 Data processing method and device based on intelligent contract and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311325305.5A CN117349885A (en) 2023-10-12 2023-10-12 Data processing method and device based on intelligent contract and storage medium

Publications (1)

Publication Number Publication Date
CN117349885A true CN117349885A (en) 2024-01-05

Family

ID=89367537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311325305.5A Pending CN117349885A (en) 2023-10-12 2023-10-12 Data processing method and device based on intelligent contract and storage medium

Country Status (1)

Country Link
CN (1) CN117349885A (en)

Similar Documents

Publication Publication Date Title
EP3639468B1 (en) Systems and methods for avoiding or reducing cryptographically stranded resources on a blockchain network
US20230334181A1 (en) System and method for interaction object management in a blockchain environment
CN110414268B (en) Access control method, device, equipment and storage medium
US20220337399A1 (en) Controlled cryptographic private key release
CN110766406B (en) Resource transfer method, resource transfer device, storage medium and electronic equipment
EP4089623A1 (en) Blockchain-implemented method and system
US8977844B2 (en) Smartcard formation with authentication keys
CN109948371B (en) Method for issuing identity certificate for block chain node and related device
CN109388957B (en) Block chain-based information transfer method, device, medium and electronic equipment
CN111027028A (en) Copyright data processing method and device based on intelligent contract
CN110909073A (en) Method and system for sharing private data based on intelligent contracts
CN109523045B (en) Method and equipment for providing travel service
CN111292174A (en) Tax payment information processing method and device and computer readable storage medium
CN111801904B (en) Method and apparatus for validating and broadcasting events
US20040143741A1 (en) Multi-stage authorisation system
CN114096966A (en) Scalable, secure, efficient, and adaptable distributed digital ledger transaction network
JP2022525551A (en) Preventing erroneous transmission of copies of data records to distributed ledger systems
CN110599311A (en) Resource processing method and device, electronic equipment and storage medium
US8694434B1 (en) Techniques for unregistering and transferring software licenses
CN111475778A (en) Music data processing method and device based on block chain
WO2019175427A1 (en) Method, device and medium for protecting work based on blockchain
CN110717770B (en) Anti-counterfeiting detection method, device, equipment and storage medium for vehicle parts
CN115396209B (en) Access authorization method, device, electronic equipment and readable storage medium
CN117349885A (en) Data processing method and device based on intelligent contract and storage medium
CN110134837A (en) A kind of approaches to IM and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination