CN112910985B - Protocol conversion method, device, equipment and storage medium based on intelligent contract - Google Patents

Protocol conversion method, device, equipment and storage medium based on intelligent contract Download PDF

Info

Publication number
CN112910985B
CN112910985B CN202110117087.0A CN202110117087A CN112910985B CN 112910985 B CN112910985 B CN 112910985B CN 202110117087 A CN202110117087 A CN 202110117087A CN 112910985 B CN112910985 B CN 112910985B
Authority
CN
China
Prior art keywords
protocol conversion
protocol
intelligent contract
target
transaction
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.)
Active
Application number
CN202110117087.0A
Other languages
Chinese (zh)
Other versions
CN112910985A (en
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.)
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software Co Ltd
Original Assignee
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software 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 Shenzhen ZNV Technology Co Ltd, Nanjing ZNV Software Co Ltd filed Critical Shenzhen ZNV Technology Co Ltd
Priority to CN202110117087.0A priority Critical patent/CN112910985B/en
Publication of CN112910985A publication Critical patent/CN112910985A/en
Application granted granted Critical
Publication of CN112910985B publication Critical patent/CN112910985B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Abstract

The invention discloses a protocol conversion method, a device, equipment and a storage medium based on an intelligent contract, wherein the method comprises the following steps: when a protocol conversion instruction is received, acquiring a protocol conversion transaction corresponding to the protocol conversion instruction, and sending the protocol conversion transaction to the target block chain; executing an operation function corresponding to the protocol conversion transaction to trigger a target intelligent contract corresponding to the protocol conversion transaction and download a protocol conversion service in the target intelligent contract; and running the protocol conversion service to complete protocol conversion. According to the invention, conversion service among different data access protocols is written in the target intelligent contract, the target intelligent contract is deployed in the target block chain and is managed by multiple parties, and conversion among the data access protocols of different manufacturer equipment in the environment of the Internet of things is realized.

Description

Protocol conversion method, device, equipment and storage medium based on intelligent contract
Technical Field
The invention relates to the field of Internet of things, in particular to a protocol conversion method, a protocol conversion device, protocol conversion equipment and a storage medium based on an intelligent contract.
Background
With the popularization of artificial intelligence technology and large data application, massive multi-source heterogeneous data is increased rapidly, at present, a large number of different data access protocols exist in the market, in the process of data butt joint of an internet of things data processing platform and various manufacturers, the challenges of cost waste caused by repeated data conversion, difficulty in maintaining data conversion protocols, difficulty in unifying data standards and the like exist, a large number of access protocols of devices of different manufacturers exist in access service, different device manufacturers have own protocols, different regions have different customized access protocols, complicated conversion of the protocols enables the service to be overstaffed, complicated operation efficiency to be low and the error probability to be large, and therefore, how to convert a large number of different data protocols becomes a technical problem to be solved urgently.
Disclosure of Invention
The invention mainly aims to provide a protocol conversion method, a device, equipment and a storage medium based on an intelligent contract, aiming at achieving the method for sharing and maintaining the same conversion access protocol on a platform which is trusted by all parties and is public to a certain extent, realizing the sharing of a data conversion method and saving the resource cost of independent and repeated conversion of all parties.
The method is characterized in that:
the intelligent contract-based protocol conversion method is based on a block chain network, has the characteristics of decentralization, consensus maintenance, non-falsification and the like of a block chain technology, utilizes an intelligent contract deployed on the block chain network, writes a conversion protocol method on the intelligent contract from multiple parties, and realizes the conversion method of sharing multiple access protocols by all participants.
The related equipment manufacturer and the data processing platform are registered to be a block chain node to be added into a block chain network, a plurality of methods for converting access protocols are deployed in a plurality of intelligent contracts, the intelligent contracts define trigger conditions, and the data processing platform executes downloading response through the trigger conditions and downloads the conversion protocols for use.
The data protocol conversion method is defined on an intelligent contract, the intelligent contract is deployed on all nodes of a block chain network, a manufacturer and a data processing platform are used as a block chain node sharing conversion method, meanwhile, the protocol on the block chain network is traceable, version updating and tracing are facilitated, the longer the accumulation is, the more perfect the protocol library is, the higher the quality is, and the benign development is.
The new manufacturer or the data processing platform does not need to independently perform the consumption of manpower or material resources for data conversion, the access protocol conversion service provided by the method can be used as long as the block chain network is added and little cost is paid, and the block chain network has the characteristics of multi-party maintenance and common verification, so that the data conversion efficiency can be effectively improved, and the error rate of data conversion is reduced.
In addition, in order to achieve the above object, the present invention further provides a protocol conversion method based on an intelligent contract, which includes the following steps:
when a protocol conversion instruction is received, acquiring a protocol conversion transaction corresponding to the protocol conversion instruction, and sending the protocol conversion transaction to the target block chain;
executing an operation function corresponding to the protocol conversion transaction to trigger a target intelligent contract corresponding to the protocol conversion transaction and download a protocol conversion service in the target intelligent contract;
and running the protocol conversion service to complete protocol conversion.
Optionally, before the step of acquiring a protocol conversion transaction corresponding to the protocol conversion instruction and sending the protocol conversion transaction to the target block chain when the protocol conversion instruction is received, the method includes:
when a block chain adding instruction is received, acquiring a data processor and a target block chain corresponding to the block chain adding instruction, and creating a target block chain node corresponding to the data processor on the target block chain;
and when a service writing instruction is received, receiving protocol conversion service formulated by the data processing party, and writing the protocol conversion service into a target intelligent contract in the target block chain.
Optionally, after the step of acquiring the data processor and the target blockchain corresponding to the blockchain joining instruction and creating the target blockchain node corresponding to the data processor on the target blockchain when the blockchain joining instruction is received, the method includes:
when a data access protocol uploaded to the target block chain is detected, storing the data access protocol to a protocol library in the target block chain;
and when a protocol conversion instruction triggered by the data processing party is received, sending a target data access protocol corresponding to the protocol conversion instruction in the protocol library to the data processing party so that the data processing party formulates a protocol conversion service based on the target data access protocol.
Optionally, before the step of acquiring a protocol conversion transaction corresponding to the protocol conversion instruction and sending the protocol conversion transaction to the target block chain when the protocol conversion instruction is received, the method includes:
when a function definition instruction is received, acquiring a target block chain corresponding to the function definition instruction;
and determining an operation function and a consensus node according to a preset consensus mechanism and a miner node on the target block chain, and storing the operation function in the consensus node.
Optionally, after the step of acquiring a protocol conversion transaction corresponding to the protocol conversion instruction and sending the protocol conversion transaction to the target block chain when the protocol conversion instruction is received, the method includes:
inquiring the consensus node, and judging whether the consensus node stores an operation function corresponding to the protocol conversion transaction;
and if the common node stores the operation function and receives a trigger instruction corresponding to the operation function, acquiring the operation function to execute the operation function.
Optionally, the step of executing the operation function corresponding to the protocol conversion transaction to trigger the target intelligent contract corresponding to the protocol conversion transaction, and downloading the protocol conversion service in the target intelligent contract includes:
executing an operation function corresponding to the protocol conversion transaction, and searching a target intelligent contract corresponding to the protocol conversion transaction in the target block chain;
and downloading the protocol conversion service in the target intelligent contract when receiving the trigger instruction corresponding to the target intelligent contract.
Optionally, the step of executing an operation function corresponding to the protocol conversion transaction and searching for a target intelligent contract corresponding to the protocol conversion transaction in the target block chain includes:
executing an operation function corresponding to the protocol conversion transaction, and inquiring a target protocol to be converted and a target conversion protocol contained in the protocol conversion transaction;
screening out a first intelligent contract deployed in the target block chain, acquiring a first protocol conversion service deployed in the first intelligent contract, a first protocol to be converted corresponding to the first protocol conversion service and a first conversion protocol, and taking the first intelligent contract as a target intelligent contract corresponding to the protocol conversion transaction, wherein the first protocol to be converted is the same as the target protocol to be converted, and the first conversion protocol is the same as the target conversion protocol.
In addition, in order to achieve the above object, the present invention further provides a protocol conversion device based on an intelligent contract, including:
the protocol conversion transaction sending module is used for acquiring a protocol conversion transaction corresponding to a protocol conversion instruction when the protocol conversion instruction is received, and sending the protocol conversion transaction to the target block chain;
the protocol conversion service downloading module is used for executing the operation function corresponding to the protocol conversion transaction so as to trigger the target intelligent contract corresponding to the protocol conversion transaction and download the protocol conversion service in the target intelligent contract;
and the protocol conversion service operation module is used for operating the protocol conversion service so as to complete protocol conversion.
In addition, in order to achieve the above object, the present invention further provides a protocol conversion device based on an intelligent contract, including: the intelligent contract-based protocol conversion method comprises a memory, a processor and an intelligent contract-based protocol conversion program which is stored on the memory and can run on the processor, wherein the intelligent contract-based protocol conversion program realizes the steps of the intelligent contract-based protocol conversion method when being executed by the processor.
In addition, in order to achieve the above object, the present invention further provides a storage medium, on which a protocol conversion program based on a smart contract is stored, and the protocol conversion program based on the smart contract, when executed by a processor, implements the steps of the protocol conversion method based on the smart contract as described above.
The embodiment of the invention provides a protocol conversion method, a device, equipment and a storage medium based on an intelligent contract. In the embodiment of the invention, when a protocol conversion program based on an intelligent contract receives a protocol conversion instruction, a protocol conversion transaction corresponding to the protocol conversion instruction is obtained and sent to a target block chain, a target intelligent contract corresponding to the protocol conversion transaction is triggered by executing an operation function corresponding to the protocol conversion transaction in the target block chain, a protocol conversion service in the target intelligent contract is downloaded, and finally, the protocol conversion is completed by operating the protocol conversion service corresponding to the protocol conversion transaction in the target intelligent contract.
Drawings
Fig. 1 is a schematic hardware structure diagram of an implementation manner of a protocol conversion device based on an intelligent contract according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a protocol conversion method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a protocol conversion method based on intelligent contracts according to the present invention;
fig. 4 is a functional module diagram of an embodiment of the protocol conversion apparatus based on the intelligent contract according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The protocol conversion terminal (called terminal, equipment or terminal equipment) based on the intelligent contract can be a terminal with a program writing function, such as a personal computer.
As shown in fig. 1, the terminal may include: a processor 1001, e.g. a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a protocol conversion program based on a smart contract.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the intelligent-contract-based protocol conversion program stored in the memory 1005, and when the intelligent-contract-based protocol conversion program is executed by the processor, the intelligent-contract-based protocol conversion program implements the operations in the intelligent-contract-based protocol conversion method provided in the following embodiments.
Based on the hardware structure of the equipment, the embodiment of the protocol conversion method based on the intelligent contract is provided.
Referring to fig. 2, in a first embodiment of the intelligent contract-based protocol conversion method of the present invention, the intelligent contract-based protocol conversion method includes:
step S10, when receiving a protocol conversion instruction, obtaining a protocol conversion transaction corresponding to the protocol conversion instruction, and sending the protocol conversion transaction to the target block chain.
The protocol conversion method based on the intelligent contract in the embodiment is applied to the protocol conversion terminal based on the intelligent contract, wherein the protocol conversion terminal based on the intelligent contract can be a terminal with a programming function, such as a personal computer.
In this embodiment, a specific application scenario is given, in an internet of things environment, a plurality of devices simultaneously accessing a same internet of things platform have different data access protocols, and a problem occurs when data interaction is performed between two devices having different data access protocols, in this case, a data processing party (i.e., a party that performs mutual conversion on different data access protocols) triggers a protocol conversion instruction, receives the protocol conversion instruction through a protocol conversion program based on an intelligent contract, obtains a transaction corresponding to the protocol conversion instruction, and further, if it is determined that the transaction corresponding to the protocol conversion instruction is a protocol conversion transaction, it indicates that the transaction that the data processing party wants to do is to perform mutual conversion on different data access protocols, and the protocol conversion program based on the intelligent contract sends the protocol conversion transaction to a target block chain, thereby performing a process of performing mutual conversion on different data access protocols, this process is described in detail in the examples below.
Step S20, executing the operation function corresponding to the protocol conversion transaction to trigger the target intelligent contract corresponding to the protocol conversion transaction, and downloading the protocol conversion service in the target intelligent contract.
In this embodiment, a plurality of target intelligent contracts are deployed in a target blockchain, a protocol conversion service written by a plurality of parties (which may be device parties having different data access protocols) exists in a target intelligent contract, and after a protocol conversion transaction is sent to the target blockchain, an operation function corresponding to the protocol conversion transaction needs to be executed to trigger the target intelligent contract corresponding to the protocol conversion transaction, it is known that the operation function is completed by related nodes (nodes related to data access protocol conversion) on the target blockchain together, so that data consistency in a blockchain network of the target blockchain is ensured, and the target intelligent contract includes wisdom and heartburn of a data processing party, and therefore, a condition for triggering the intelligent contract may be set as payment, that is, the operation function corresponding to the protocol conversion transaction is executed to determine the target intelligent contract corresponding to the protocol conversion transaction, and outputting payment information, and triggering the target intelligent contract after the user who wants to download the protocol conversion service in the target intelligent contract completes payment, thereby downloading the protocol conversion service.
Step S30, the protocol conversion service is run to complete the protocol conversion.
The intelligent contract returns an address when deployed on the blockchain, each address corresponds to a protocol conversion transaction, the intelligent contract is uniquely called through the address, each contract defines a specific conversion method of the protocol, the conversion method is defined through an operation function, after the calling, a predefined trigger condition (for example, a payment mechanism) in the intelligent contract triggers a response (for example, downloading), that is, the conversion method is downloaded to the local, and after the target intelligent contract is downloaded, conversion between different data access protocols is completed by running a protocol conversion service corresponding to the protocol conversion transaction in the target intelligent contract, as can be known, the protocol conversion service in the embodiment includes a conversion method between different data access protocols, either between two data access protocols or between multiple data access protocols, one intelligent contract can be written with only one protocol conversion service or a plurality of protocol conversion services, and when a user who wants to convert different data access protocols downloads and runs the protocol conversion service in the target intelligent contract, the user can autonomously complete the conversion of the different data access protocols.
Specifically, the step of S20 refinement includes:
step a1, executing the operation function corresponding to the protocol conversion affair, and searching the target intelligent contract corresponding to the protocol conversion affair in the target block chain.
Step a2, downloading the protocol conversion service in the target intelligent contract when receiving the trigger instruction corresponding to the target intelligent contract.
Specifically, after the operation function corresponding to the protocol conversion transaction is executed, the protocol conversion program based on the intelligent contract searches whether a target intelligent contract corresponding to the protocol conversion transaction exists in the target block chain, the protocol conversion transaction carries specific information for converting one data access protocol into another data access protocol, and according to the information, the protocol conversion program based on the intelligent contract searches whether a target intelligent contract corresponding to the protocol conversion transaction exists in the target block chain And if the contract is matched with the target intelligent contract, the protocol conversion transaction corresponds to the target intelligent contract, when a trigger instruction corresponding to the target intelligent contract is received, the target intelligent contract is found in the target block chain, and then the protocol conversion service in the target intelligent contract is downloaded.
Specifically, the step a1 is detailed as follows:
step b1, executing the operation function corresponding to the protocol conversion transaction, and querying the target protocol to be converted and the target conversion protocol contained in the protocol conversion transaction.
Step b2, screening out a first intelligent contract deployed in the target blockchain, and acquiring a first protocol conversion service deployed in the first intelligent contract, and a first protocol to be converted and a first conversion protocol corresponding to the first protocol conversion service, and taking the first intelligent contract as a target intelligent contract corresponding to the protocol conversion transaction, wherein the first protocol to be converted is the same as the target protocol to be converted, and the first conversion protocol is the same as the target protocol to be converted.
It can be known that, after sending the protocol conversion transaction to the target block chain, the target intelligent contract corresponding to the protocol conversion transaction needs to be triggered by executing the operation function corresponding to the protocol conversion transaction, and the method for finding the deployed target intelligent contract in the target block chain is that, first, the target protocol to be converted and the target conversion protocol included in the protocol conversion transaction are queried, wherein the target conversion protocol is a protocol converted from the target protocol to be converted, the direction of protocol conversion is defined, i.e. from the target protocol to be converted to the target conversion protocol, and the target protocol to be converted and the target conversion protocol are two different data access protocols, then, screening is performed in the target block chain to screen out the first intelligent contract in the target block chain, wherein the first intelligent contract is written with the first protocol conversion service, and the first protocol conversion service includes a method for converting the first protocol to be converted into the first conversion protocol, the first protocol to be converted is the same as the target protocol to be converted, the first conversion protocol is the same as the target protocol to be converted, the first protocol to be converted and the first conversion protocol are two different data access protocols, and the direction of protocol conversion is also specified, namely the first protocol to be converted is the first conversion protocol, namely, the protocol correspondence is the same, namely, the condition of screening out the target intelligent contract corresponding to the protocol conversion transaction from the target block chain.
In this embodiment, when a protocol conversion program based on an intelligent contract receives a protocol conversion instruction, a protocol conversion transaction corresponding to the protocol conversion instruction is acquired, the protocol conversion transaction is sent to a target block chain, a target intelligent contract corresponding to the protocol conversion transaction is triggered by executing an operation function corresponding to the protocol conversion transaction in the target block chain, the target intelligent contract is downloaded, and finally, protocol conversion is completed by operating a protocol conversion service corresponding to the protocol conversion transaction in the target intelligent contract.
Further, referring to fig. 3, on the basis of the above-mentioned embodiment of the present invention, a second embodiment of the protocol conversion method based on the intelligent contract according to the present invention is provided.
This embodiment is a step before step S10 in the first embodiment, and the difference between this embodiment and the above-described embodiment of the present invention is:
step S40, when receiving a block chain joining instruction, acquiring a data processor and a target block chain corresponding to the block chain joining instruction, and creating a target block chain node corresponding to the data processor on the target block chain.
And step S50, when receiving a service writing instruction, receiving the protocol conversion service formulated by the data processing party, and writing the protocol conversion service into the target intelligent contract in the target block chain.
It can be known that a data processing party refers to a processing party that converts different data access protocols, and in an environment of the internet of things, the data processing party may be a responsible party accessing multiple devices of the same internet of things platform, and in order to facilitate data management, an intelligent contract is deployed on a target block chain, and the data processing party may register as a node of the target block chain so as to manage an intelligent contract and a defined function deployed in the target block chain, and when receiving a block chain join instruction, determine a data processing party and a target block chain corresponding to the block chain join instruction, and create a target block chain node corresponding to the data processing party on the target block chain, and when receiving a service write instruction, receive a protocol conversion service formulated by the data processing party, write the protocol conversion service into the target intelligent contract, and deploy the target intelligent contract written into the protocol conversion service to each node of the target block chain, for management by the data processor.
Specifically, steps subsequent to step S40 include:
step c1, when detecting the data access protocol uploaded to the target block chain, storing the data access protocol to the protocol library in the target block chain.
Step c2, when receiving a protocol conversion instruction triggered by the data processing party, sending a target data access protocol corresponding to the protocol conversion instruction in the protocol library to the data processing party, so that the data processing party formulates a protocol conversion service based on the target data access protocol.
It can be known that all devices which can be accessed to the management platform of the internet of things and have different data access protocols from other devices can upload the data access protocol used by themselves through the target block chain, so that the data processing party can formulate the relevant protocol conversion service according to the uploaded data access protocol, i.e. the method for converting the data access protocol into other data access protocols, it can be known that, for unified management, the data access protocol uploaded through the target block chain is uniformly stored in the protocol library in the target block chain, and when the data processing party wants to formulate the relevant protocol conversion service according to the data access protocol, the protocol conversion program based on the intelligent contract receives the protocol conversion instruction triggered by the data processing party and sends the target data access protocol corresponding to the protocol conversion instruction in the protocol library to the block chain link point corresponding to the data processing party, and then, after the data processing party formulates protocol conversion service based on the target data access protocol, the formulated data conversion service is uploaded to the target block chain and written into a certain intelligent contract deployed in the target block chain.
Specifically, the steps before step S10 include:
and d1, when receiving the function definition instruction, acquiring the target block chain corresponding to the function definition instruction.
And d2, determining an operation function and a consensus node according to a preset consensus mechanism and the miner node on the target block chain, and storing the operation function in the consensus node.
It should be noted that the miners' nodes in this embodiment refer to nodes maintained by a network formed by a plurality of "miners" together, and the "miners" contribute their own equipment capacity to obtain rewards, and the preset consensus mechanism completes operation verification and confirmation in a short time by voting of a special node, which is a consensus node and is a node that achieves consensus with other unrelated nodes.
Specifically, steps subsequent to step S10 include:
and e1, querying the consensus node, and determining whether the consensus node stores the operation function corresponding to the protocol conversion transaction.
Step e2, if the common node stores the operation function and receives the trigger instruction corresponding to the operation function, acquiring the operation function to execute the operation function.
It should be noted that the operation function in this embodiment is completed by all the miners' nodes in the target block chain through the consensus mechanism, and the target intelligent contract in the target block chain provides an automatic mechanism for program management, which can implement complex logic by defining the operation function and allow the trigger condition and response of the operation function to be predefined, and when the operation function is triggered by some event, the response of the operation function will be executed, it is understood that the operation function completed through the consensus mechanism is stored in the consensus node, and when the protocol conversion transaction is sent to the target block chain, the protocol conversion program based on the intelligent contract will query the consensus node and determine whether the consensus node stores the operation function corresponding to the protocol conversion transaction, if the consensus node stores the operation function, and receives the trigger instruction corresponding to the operation function, an operation function is obtained and the response of the operation function is executed.
In this embodiment, the operation function is completed by all miners' nodes in the target block chain through a consensus mechanism, and is stored in the consensus node, so that consistency and uniformity of data in the target block chain network are ensured.
In addition, referring to fig. 4, an embodiment of the present invention further provides a protocol conversion apparatus based on an intelligent contract, where the protocol conversion apparatus based on an intelligent contract includes:
a protocol conversion transaction sending module 10, configured to, when a protocol conversion instruction is received, obtain a protocol conversion transaction corresponding to the protocol conversion instruction, and send the protocol conversion transaction to the target block chain;
a protocol conversion service downloading module 20, configured to execute an operation function corresponding to the protocol conversion transaction, so as to trigger a target intelligent contract corresponding to the protocol conversion transaction, and download a protocol conversion service in the target intelligent contract;
a protocol conversion service operation module 30, configured to operate the protocol conversion service to complete protocol conversion.
Optionally, the protocol conversion apparatus based on the smart contract includes:
the block link point creating module is used for acquiring a data processor and a target block chain corresponding to a block chain adding instruction when the block chain adding instruction is received, and creating a target block chain node corresponding to the data processor on the target block chain;
and the protocol conversion service writing module is used for receiving the protocol conversion service formulated by the data processing party when receiving a service writing instruction, and writing the protocol conversion service into the target intelligent contract in the target block chain.
Optionally, the intelligent contract-based protocol conversion apparatus includes:
the data access protocol storage module is used for storing the data access protocol to a protocol library in the target block chain when the data access protocol uploaded to the target block chain is detected;
and the target data access protocol sending module is used for sending a target data access protocol corresponding to the protocol conversion instruction in the protocol library to the data processing party when receiving the protocol conversion instruction triggered by the data processing party so as to enable the data processing party to make a protocol conversion service based on the target data access protocol.
Optionally, the intelligent contract-based protocol conversion apparatus includes:
the function definition instruction acquisition module is used for acquiring a target block chain corresponding to a function definition instruction when the function definition instruction is received;
and the operation function storage module is used for determining an operation function and a consensus node according to a preset consensus mechanism and the miner node on the target block chain, and storing the operation function to the consensus node.
Optionally, the protocol conversion apparatus based on the smart contract includes:
a consensus node query module, configured to query the consensus node and determine whether the consensus node stores an operation function corresponding to the protocol conversion transaction;
and the trigger instruction receiving module is used for acquiring the operation function to execute the operation function if the common node stores the operation function and receives a trigger instruction corresponding to the operation function.
Optionally, the protocol conversion service downloading module 20 includes:
a target intelligent contract searching unit, configured to execute an operation function corresponding to the protocol conversion transaction, and search a target intelligent contract corresponding to the protocol conversion transaction in the target block chain;
and the target intelligent contract downloading unit is used for downloading the target intelligent contract when receiving the trigger instruction corresponding to the target intelligent contract.
Optionally, the target intelligent contract searching unit includes:
a conversion protocol query unit, configured to execute an operation function corresponding to the protocol conversion transaction, and query a target protocol to be converted and a target conversion protocol included in the protocol conversion transaction;
the intelligent contract screening unit is used for screening out a first intelligent contract deployed in the target block chain and acquiring a first protocol conversion service deployed in the first intelligent contract, and a first protocol to be converted and a first conversion protocol corresponding to the first protocol conversion service, and taking the first intelligent contract as a target intelligent contract corresponding to the protocol conversion transaction, wherein the first protocol to be converted is the same as the target protocol to be converted, and the first conversion protocol is the same as the target conversion protocol.
In addition, an embodiment of the present invention further provides a storage medium, where a protocol conversion program based on an intelligent contract is stored on the storage medium, and when executed by a processor, the protocol conversion program based on the intelligent contract implements the operations in the protocol conversion method based on the intelligent contract provided in the foregoing embodiment.
The method executed by each program module can refer to each embodiment of the method of the present invention, and is not described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity/action/object from another entity/action/object without necessarily requiring or implying any actual such relationship or order between such entities/actions/objects; the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or system in which the element is included.
For the apparatus embodiment, since it is substantially similar to the method embodiment, it is described relatively simply, and reference may be made to some description of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, in that elements described as separate components may or may not be physically separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be substantially or partially embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above, and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the protocol conversion method based on the smart contract according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A protocol conversion method based on intelligent contracts is characterized in that the protocol conversion method based on intelligent contracts is applied to a target block chain, and comprises the following steps:
when a protocol conversion instruction is received, acquiring a protocol conversion transaction corresponding to the protocol conversion instruction, and sending the protocol conversion transaction to the target block chain;
executing an operation function corresponding to the protocol conversion transaction to trigger a target intelligent contract corresponding to the protocol conversion transaction and download a protocol conversion service in the target intelligent contract;
and running the protocol conversion service to complete protocol conversion.
2. The intelligent contract-based protocol conversion method according to claim 1, wherein the step of acquiring a protocol conversion transaction corresponding to a protocol conversion instruction and sending the protocol conversion transaction to the target block chain when the protocol conversion instruction is received, comprises:
when a block chain adding instruction is received, acquiring a data processor and a target block chain corresponding to the block chain adding instruction, and creating a target block chain node corresponding to the data processor on the target block chain;
and when a service writing instruction is received, receiving protocol conversion service formulated by the data processing party, and writing the protocol conversion service into a target intelligent contract in the target block chain.
3. The intelligent contract-based protocol conversion method according to claim 2, wherein after the step of obtaining the data handler and the target blockchain corresponding to the blockchain joining instruction and creating the target blockchain node corresponding to the data handler on the target blockchain when the blockchain joining instruction is received, the method comprises:
when a data access protocol uploaded to the target block chain is detected, storing the data access protocol to a protocol library in the target block chain;
and when a protocol conversion instruction triggered by the data processing party is received, sending a target data access protocol corresponding to the protocol conversion instruction in the protocol library to the data processing party so that the data processing party formulates a protocol conversion service based on the target data access protocol.
4. The intelligent contract-based protocol conversion method according to claim 1, wherein the step of acquiring a protocol conversion transaction corresponding to a protocol conversion instruction and sending the protocol conversion transaction to the target block chain when the protocol conversion instruction is received, comprises:
when a function definition instruction is received, acquiring a target block chain corresponding to the function definition instruction;
and determining an operation function and a consensus node according to a preset consensus mechanism and a miner node on the target block chain, and storing the operation function in the consensus node.
5. The intelligent contract-based protocol conversion method according to claim 4, wherein after the step of acquiring a protocol conversion transaction corresponding to the protocol conversion instruction and sending the protocol conversion transaction to the target block chain when the protocol conversion instruction is received, the method comprises:
inquiring the consensus node, and judging whether the consensus node stores an operation function corresponding to the protocol conversion transaction;
and if the common node stores the operation function and receives a trigger instruction corresponding to the operation function, acquiring the operation function to execute the operation function.
6. The intelligent contract-based protocol conversion method according to claim 1, wherein the step of executing the operation function corresponding to the protocol conversion transaction to trigger the target intelligent contract corresponding to the protocol conversion transaction and download the protocol conversion service in the target intelligent contract comprises:
executing an operation function corresponding to the protocol conversion transaction, and searching a target intelligent contract corresponding to the protocol conversion transaction in the target block chain;
and downloading the protocol conversion service in the target intelligent contract when receiving the trigger instruction corresponding to the target intelligent contract.
7. The intelligent contract-based protocol conversion method of claim 6, wherein the step of executing the operation function corresponding to the protocol conversion transaction and searching the target block chain for the target intelligent contract corresponding to the protocol conversion transaction comprises:
executing an operation function corresponding to the protocol conversion transaction, and inquiring a target protocol to be converted and a target conversion protocol contained in the protocol conversion transaction;
screening out a first intelligent contract deployed in the target block chain, acquiring a first protocol conversion service deployed in the first intelligent contract, a first protocol to be converted corresponding to the first protocol conversion service and a first conversion protocol, and taking the first intelligent contract as a target intelligent contract corresponding to the protocol conversion transaction, wherein the first protocol to be converted is the same as the target protocol to be converted, and the first conversion protocol is the same as the target conversion protocol.
8. An intelligent contract-based protocol conversion apparatus, characterized in that the intelligent contract-based protocol conversion apparatus comprises:
the protocol conversion transaction sending module is used for acquiring a protocol conversion transaction corresponding to a protocol conversion instruction when the protocol conversion instruction is received, and sending the protocol conversion transaction to a target block chain;
the protocol conversion service downloading module is used for executing the operation function corresponding to the protocol conversion transaction so as to trigger the target intelligent contract corresponding to the protocol conversion transaction and download the protocol conversion service in the target intelligent contract;
and the protocol conversion service operation module is used for operating the protocol conversion service so as to complete protocol conversion.
9. A protocol conversion device based on an intelligent contract, characterized in that the protocol conversion device based on the intelligent contract comprises: a memory, a processor and a protocol conversion program based on intelligent contracts, which is stored on the memory and can run on the processor, wherein the protocol conversion program based on intelligent contracts realizes the steps of the protocol conversion method based on intelligent contracts according to any one of claims 1 to 7 when being executed by the processor.
10. A storage medium, characterized in that the storage medium has stored thereon a protocol conversion program based on an intelligent contract, which when executed by a processor carries out the steps of the protocol conversion method based on an intelligent contract as claimed in any one of claims 1 to 7.
CN202110117087.0A 2021-01-27 2021-01-27 Protocol conversion method, device, equipment and storage medium based on intelligent contract Active CN112910985B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110117087.0A CN112910985B (en) 2021-01-27 2021-01-27 Protocol conversion method, device, equipment and storage medium based on intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110117087.0A CN112910985B (en) 2021-01-27 2021-01-27 Protocol conversion method, device, equipment and storage medium based on intelligent contract

Publications (2)

Publication Number Publication Date
CN112910985A CN112910985A (en) 2021-06-04
CN112910985B true CN112910985B (en) 2022-06-03

Family

ID=76119509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110117087.0A Active CN112910985B (en) 2021-01-27 2021-01-27 Protocol conversion method, device, equipment and storage medium based on intelligent contract

Country Status (1)

Country Link
CN (1) CN112910985B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645211B (en) * 2021-08-02 2023-02-28 安徽中科晶格技术有限公司 Universal data uplink credit system and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889558A (en) * 2017-12-06 2019-06-14 广州华旻信息科技有限公司 Data transmission method, middleware and the system of internet of things oriented application
CN111311255B (en) * 2020-01-19 2023-07-25 杭州云象网络技术有限公司 Intelligent contract formalization verification and error correction method based on prophetic machine
CN112202715A (en) * 2020-08-31 2021-01-08 北京锐格信安技术有限公司 System, method and device for credible interaction between Internet of things and block chain

Also Published As

Publication number Publication date
CN112910985A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
US9967343B2 (en) Method for providing internet of things service
CN105744466B (en) A kind of connection method of Bluetooth device and bluetooth equipment
CN110032512B (en) Debugging method of small program, related equipment and terminal
CN110875850B (en) Firmware upgrading method and system, readable storage medium and terminal equipment
CN111859470B (en) Business data chaining method and device
KR102036420B1 (en) Managing application relationships in machine-to-machine systems
CN104765591A (en) Method and system for updating software configuration parameter, and terminal server
CN110018860B (en) Workflow management method, device, equipment and computer storage medium
CN106201610A (en) Web application accesses the method and device of the primary function of terminal
CN106851758B (en) Communication network switching method and terminal equipment
CN114785685A (en) Software differential upgrading method and device, electronic equipment and readable storage medium
CN114465998A (en) Multi-device file transmission method and device, terminal device and readable storage medium
CN112910985B (en) Protocol conversion method, device, equipment and storage medium based on intelligent contract
CN113168332B (en) Data processing method and device and mobile terminal
CN113259942B (en) Connection method, connection device, electronic equipment, connection system and computer-readable storage medium
CN114090483A (en) Protocol-based RDMA (remote direct memory Access) communication method and device and storage medium
CN106020945A (en) Shortcut item adding method and device
CN106454299A (en) Screen projection method and device between terminals, and terminal
CN115375396A (en) Intelligent rent management method, electronic equipment and readable storage medium
CN114357066A (en) Block chain cross-chain interaction method, device, equipment and storage medium
CN114090127A (en) Electronic device, loading method and medium of configuration file of electronic device
KR102506155B1 (en) Electronic device, application executing system and control methods thereof
CN105681927A (en) Application sorting method and system, mobile terminal and smart television
US11695632B1 (en) Management and control across heterogeneous edge devices of a client network using device abstractions
CN113805958B (en) Third party service access method and system based on OSB API specification

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
GR01 Patent grant
GR01 Patent grant