Search

CN-113961647-B - Data deserializing method, device and related equipment

CN113961647BCN 113961647 BCN113961647 BCN 113961647BCN-113961647-B

Abstract

The application discloses a data deserializing method which comprises the steps of obtaining intelligent contract data, analyzing the intelligent contract data to obtain an ABI parameter identifier, determining a target data type according to the ABI parameter identifier, and deserializing the intelligent contract data according to the target data type to obtain a processing result. By applying the technical scheme provided by the application, the object data type can be determined through the ABI parameter identification in the intelligent contract data, and then the reverse serialization of the intelligent contract data is realized based on the object data type. The application also discloses a data anti-serialization device, equipment and a computer readable storage medium, which have the beneficial effects.

Inventors

  • Guo Jindai
  • ZHANG YIFENG

Assignees

  • 中钞信用卡产业发展有限公司杭州区块链技术研究院
  • 中钞信用卡产业发展有限公司

Dates

Publication Date
20260512
Application Date
20211109

Claims (9)

  1. 1. A method of deserializing data, comprising: acquiring intelligent contract data, wherein the intelligent contract data is data after serialization processing; analyzing the intelligent contract data to obtain an ABI parameter identifier, wherein the ABI parameter identifier is specifically a hash value of an ABI parameter, and the ABI parameter is specifically an ABI parameter which only contains a parameter list and does not contain a method name; determining a target data type according to the ABI parameter identifier; and performing deserialization processing on the intelligent contract data according to the target data type to obtain a processing result.
  2. 2. The method of claim 1, wherein the obtaining smart contract data comprises: invoking an intelligent contract method to initiate a data request to a block chain; and receiving the intelligent contract data fed back by the blockchain according to the data request.
  3. 3. The method of claim 1, wherein said determining a target data type from said ABI parameter identification comprises: and inquiring and obtaining the target data type corresponding to the ABI parameter identifier from a mapping database.
  4. 4. A data de-serialization method according to claim 3, characterized in that the hash value of the ABI parameter and the mapping database are generated by enumerating the parameter type and the number of parameters of the smart contract data.
  5. 5. The data deserializing method of claim 1, wherein the deserializing the smart contract data according to the target data type to obtain a processing result, comprising: And carrying out deserialization processing on the intelligent contract data based on the target data type by combining a data assembly protocol to obtain the processing result.
  6. 6. A data de-serializing apparatus, comprising: The system comprises a data acquisition module, a data processing module and a data processing module, wherein the data acquisition module is used for acquiring intelligent contract data which is the data after serialization processing; The data analysis module is used for analyzing the intelligent contract data to obtain an ABI parameter identifier, wherein the ABI parameter identifier is specifically a hash value of an ABI parameter, and the ABI parameter is specifically an ABI parameter which only contains a parameter list and does not contain a method name; The type determining module is used for determining a target data type according to the ABI parameter identifier; and the deserialization module is used for deserializing the intelligent contract data according to the target data type to obtain a processing result.
  7. 7. The device of claim 6, wherein the data acquisition module is configured to invoke an intelligent contract method to initiate a data request to a blockchain, and to receive the intelligent contract data fed back by the blockchain according to the data request.
  8. 8. A data de-serialization apparatus, comprising: A memory for storing a computer program; A processor for implementing the steps of the data de-serialization method according to any one of claims 1 to 5 when executing the computer program.
  9. 9. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the data de-serialization method according to any one of claims 1 to 5.

Description

Data deserializing method, device and related equipment Technical Field The present application relates to the field of blockchain technologies, and in particular, to a data deserializing method, and further, to a data deserializing apparatus, device, and computer readable storage medium. Background On the blockchain, the reading of the smart contract related data requires the use of ABI (application binary interface application binary interface), otherwise the corresponding data cannot be parsed. Thus, without ABI, it becomes difficult to directly read the resolved blockchain smart contract data. In the related art, an intelligent contract ABI hash identifier is added to a transaction message, a database of the ABI hash identifier and the ABI is maintained by a community, and the commonly used ABI is uploaded to the database. When the related data of the blockchain intelligent contract is analyzed, the database is used for inquiring the ABI hash mark to obtain the required ABI, and then the data is deserialized to obtain the data original text. However, since the ABI is composed of a method name and a parameter list, and the same parameter list may correspond to different method names, the inconsistency of the method names may cause the inconsistency of the ABI, thereby reducing the hit rate of the query ABI. Therefore, how to effectively improve the hit rate of the query ABI, and further improve the success rate of data deserialization is a problem to be solved by those skilled in the art. Disclosure of Invention The application aims to provide a data deserializing method which can effectively improve the hit rate of query ABI and further improve the success rate of data deserializing, and the application also aims to provide a data deserializing device, equipment and a computer readable storage medium which all have the beneficial effects. In a first aspect, the present application provides a method for deserializing data, comprising: acquiring intelligent contract data; analyzing the intelligent contract data to obtain an ABI parameter identifier; determining a target data type according to the ABI parameter identifier; and performing deserialization processing on the intelligent contract data according to the target data type to obtain a processing result. Preferably, the acquiring the smart contract data includes: invoking an intelligent contract method to initiate a data request to a block chain; and receiving the intelligent contract data fed back by the blockchain according to the data request. Preferably, the determining the target data type according to the ABI parameter identifier includes: and inquiring and obtaining the target data type corresponding to the ABI parameter identifier from a mapping database. Preferably, the ABI parameter identifier is specifically a hash value of the ABI parameter. Preferably, the hash value of the ABI parameter and the mapping database are generated by enumerating the parameter type and the parameter number of the smart contract data. Preferably, the performing deserialization processing on the smart contract data according to the target data type to obtain a processing result includes: And carrying out deserialization processing on the intelligent contract data based on the target data type by combining a data assembly protocol to obtain the processing result. In a second aspect, the present application also discloses a device for reverse serializing data, which includes: the data acquisition module is used for acquiring intelligent contract data; the data analysis module is used for analyzing the intelligent contract data to obtain an ABI parameter identifier; The type determining module is used for determining a target data type according to the ABI parameter identifier; and the deserialization module is used for deserializing the intelligent contract data according to the target data type to obtain a processing result. Preferably, the data acquisition module is specifically configured to invoke an intelligent contract method to initiate a data request to a blockchain, and receive the intelligent contract data fed back by the blockchain according to the data request. In a third aspect, the present application also discloses a data deserializing device, including: A memory for storing a computer program; A processor for implementing the steps of any of the data de-serialization methods described above when executing the computer program. In a fourth aspect, the present application also discloses a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the data de-serialization methods described above. The data deserializing method comprises the steps of obtaining intelligent contract data, analyzing the intelligent contract data to obtain an ABI parameter identifier, determining a target data type according to the ABI parameter identifier, and deserializing the intelligent