[go: up one dir, main page]

CN111813999A - A method to improve the scalability of Ethereum smart contract fields - Google Patents

A method to improve the scalability of Ethereum smart contract fields Download PDF

Info

Publication number
CN111813999A
CN111813999A CN202010813185.3A CN202010813185A CN111813999A CN 111813999 A CN111813999 A CN 111813999A CN 202010813185 A CN202010813185 A CN 202010813185A CN 111813999 A CN111813999 A CN 111813999A
Authority
CN
China
Prior art keywords
field
fields
character string
improving
smart contract
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.)
Granted
Application number
CN202010813185.3A
Other languages
Chinese (zh)
Other versions
CN111813999B (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.)
Guangdong Likang Technology Development Co ltd
Original Assignee
Guangzhou Kechuang Space Information Technology Co ltd
Guangzhou Tungkong Security Printing 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 Guangzhou Kechuang Space Information Technology Co ltd, Guangzhou Tungkong Security Printing Co ltd filed Critical Guangzhou Kechuang Space Information Technology Co ltd
Priority to CN202010813185.3A priority Critical patent/CN111813999B/en
Publication of CN111813999A publication Critical patent/CN111813999A/en
Application granted granted Critical
Publication of CN111813999B publication Critical patent/CN111813999B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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/03Protocol definition or specification 
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method for improving the expansibility of an Ether house intelligent contract field, which comprises the following steps: defining fields needing to be stored on a block chain; classifying and integrating fields needing to be linked up, and extracting similar fields; the front-end server integrates the similar fields and carries out Json formatting conversion, so that an object or an array consisting of a plurality of fields is converted into a character string of a single field; calling an intelligent contract Api interface on the block chain to transmit a corresponding character string, and storing the character string on one field of the block chain after the intelligent contract is verified; when the front-end server needs to acquire data, Json analysis is needed on the character strings, and therefore the original storage fields are obtained. The invention makes some standardized designs to the format of the field, and converts a plurality of pieces of information according to a certain rule, thereby improving the data volume stored in a single field, improving the expansibility of the field, and meeting the updating requirement of intelligent contract on business.

Description

一种提高以太坊智能合约字段扩展性的方法A method to improve the scalability of Ethereum smart contract fields

技术领域technical field

本发明涉及区块链技术领域,具体涉及一种提高以太坊智能合约字段扩展性的方法。The invention relates to the technical field of blockchain, in particular to a method for improving the field scalability of an Ethereum smart contract.

背景技术Background technique

Solidity是一个广泛的、开放的编程语言,主要用于以太坊底层的区块链系统中智能合约的开发。当前区块链技术被广泛运用于金融、食品安全、医疗和房地产等诸多领域。而又因为Solidity语言在开发时变量数不能超过16个以及底层的数据合约更新时会过于繁琐,针对具体业务单独开发修改以太坊的底层系统成本高昂,而且合约存储内容过大,对合约存储内容造成了限制。Solidity is a broad, open programming language mainly used for the development of smart contracts in the underlying blockchain system of Ethereum. At present, blockchain technology is widely used in many fields such as finance, food safety, medical care and real estate. And because the number of variables in Solidity language cannot exceed 16 during development and the underlying data contract update will be too cumbersome, it is expensive to develop and modify the underlying system of Ethereum for specific business, and the contract storage content is too large, and the contract storage content is too large. caused restrictions.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种提高以太坊智能合约字段扩展性的方法,对字段的格式进行规范化设计,提高字段的扩展性,减少系统重复建设,保证合约在业务上的更新需求。The purpose of the present invention is to provide a method for improving the extensibility of the field of the Ethereum smart contract, to standardize the design of the field format, to improve the extensibility of the field, to reduce the repeated construction of the system, and to ensure the update requirements of the contract in business.

为达此目的,本发明采用以下技术方案:For this purpose, the present invention adopts the following technical solutions:

提供一种提高以太坊智能合约字段扩展性的方法,包括以下步骤:Provide a method to improve the scalability of Ethereum smart contract fields, including the following steps:

S10、定义区块链上需要存储的字段;S10. Define the fields that need to be stored on the blockchain;

S20、对需要上链的所述字段进行分类整合,提取出相似字段;S20, classifying and integrating the fields that need to be uploaded, and extracting similar fields;

S30、前端服务器对所述相似字段进行整合并进行Json格式化转换,使得由多个字段组成的对象或者数组转换为单一字段的字符串;S30, the front-end server integrates the similar fields and performs Json format conversion, so that an object or an array composed of multiple fields is converted into a string of a single field;

S40、调用所述区块链上的智能合约Api接口传入对应的所述字符串,经过智能合约验证过后,将所述字符串存储到所述区块链的一个字段上;S40, calling the smart contract Api interface on the blockchain to pass in the corresponding string, and after verification by the smart contract, store the string in a field of the blockchain;

S50、当所述前端服务器需要获取数据时,所述字符串需要进行Json解析,从而得到原始存储字段。S50. When the front-end server needs to obtain data, the string needs to be parsed by Json, so as to obtain the original storage field.

作为提高以太坊智能合约字段扩展性的方法的一种优选方案,所述步骤S40中,所述前端服务器根据接口提供的URL链接通过HTTP的网络协议以Post方式访问到所述智能合约Api接口。As a preferred solution of the method for improving the scalability of the Ethereum smart contract field, in the step S40, the front-end server accesses the smart contract Api interface in Post mode through the HTTP network protocol according to the URL link provided by the interface.

作为提高以太坊智能合约字段扩展性的方法的一种优选方案,所述步骤S40中,所述智能合约Api接口根据所述URL链接进行一次转接后调用对应的所述智能合约,所述智能合约验证调用的身份,验证通过后执行所述智能合约上的存储逻辑,所述存储逻辑在经过所述区块链的共识机制确认后,所述区块链对此次请求进行存储。As a preferred solution of the method for improving the scalability of the Ethereum smart contract field, in the step S40, the smart contract Api interface performs a transfer according to the URL link and then calls the corresponding smart contract, and the smart contract Api interface calls the corresponding smart contract. The contract verifies the identity of the call, and after the verification is passed, the storage logic on the smart contract is executed. After the storage logic is confirmed by the consensus mechanism of the blockchain, the blockchain stores the request.

作为提高以太坊智能合约字段扩展性的方法的一种优选方案,当所述字符串需要添加新字段时,只需在所述前端服务器上将所述新字段添加进原字段中即可。As a preferred solution of the method for improving the field extensibility of the Ethereum smart contract, when a new field needs to be added to the string, it is only necessary to add the new field to the original field on the front-end server.

本发明的有益效果:本发明通过对字段的格式做一些规范化的设计,让多条信息按照一定的规则进行转换,从而提升单个字段存储的数据量,提高了字段的扩展性,而且减少了在单个函数中因为进行存储而产生的变量,使得合约在系统的限制下可以完成业务上的需求更新,减少系统重复建设,在合约实现上对于存储的所需的字段减少,同时由于对存储字段的设定是字符串大小,当转换前的数据格式需要进行增删时,也不会对存储格式有任何影响,使得存储内容更加灵活,无需修改底层存储合约,增加了合约存储结构的灵活性。Beneficial effects of the present invention: the present invention makes some standardized designs for the format of the fields, so that multiple pieces of information are converted according to certain rules, thereby increasing the amount of data stored in a single field, improving the expansibility of the field, and reducing the amount of data stored in the field. The variables generated by the storage in a single function enable the contract to complete the business requirement update under the constraints of the system, reduce the repeated construction of the system, and reduce the required fields for storage in the contract implementation. The setting is the string size. When the data format before conversion needs to be added or deleted, it will not have any effect on the storage format, making the storage content more flexible, without modifying the underlying storage contract, and increasing the flexibility of the contract storage structure.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍。显而易见地,下面所描述的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to describe the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative efforts.

图1是本发明一实施例所述的提高以太坊智能合约字段扩展性的方法的流程图。FIG. 1 is a flowchart of a method for improving the field scalability of an Ethereum smart contract according to an embodiment of the present invention.

图2是本发明一实施例所述的提高以太坊智能合约字段扩展性的方法的结构示意图(一)。FIG. 2 is a schematic structural diagram (1) of a method for improving the field scalability of an Ethereum smart contract according to an embodiment of the present invention.

图3是本发明一实施例所述的提高以太坊智能合约字段扩展性的方法的结构示意图(二)。FIG. 3 is a schematic structural diagram (2) of a method for improving the field scalability of an Ethereum smart contract according to an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图并通过具体实施方式来进一步说明本发明的技术方案。The technical solutions of the present invention are further described below with reference to the accompanying drawings and through specific embodiments.

其中,附图仅用于示例性说明,表示的仅是示意图,而非实物图,不能理解为对本专利的限制;为了更好地说明本发明的实施例,附图某些部件会有省略、放大或缩小,并不代表实际产品的尺寸;对本领域技术人员来说,附图中某些公知结构及其说明可能省略是可以理解的。Among them, the accompanying drawings are only used for exemplary description, and they are only schematic diagrams, not physical drawings, and should not be construed as restrictions on this patent; in order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings will be omitted, The enlargement or reduction does not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the accompanying drawings may be omitted.

本发明实施例的附图中相同或相似的标号对应相同或相似的部件;在本发明的描述中,需要理解的是,若出现术语“上”、“下”、“左”、“右”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此附图中描述位置关系的用语仅用于示例性说明,不能理解为对本专利的限制,对于本领域的普通技术人员而言,可以根据具体情况理解上述术语的具体含义。The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left" and "right" appear The orientation or positional relationship indicated by , "inside", "outside", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the indicated device or element must be It has a specific orientation, is constructed and operated in a specific orientation, so the terms describing the positional relationship in the accompanying drawings are only used for exemplary illustration, and should not be construed as a limitation on this patent. situation to understand the specific meaning of the above terms.

在本发明的描述中,除非另有明确的规定和限定,若出现术语“连接”等指示部件之间的连接关系,该术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个部件内部的连通或两个部件的相互作用关系。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, unless otherwise expressly specified and limited, if the term "connection" or the like appears to indicate a connection relationship between components, the term should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection It can be connected or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be an internal connection between two components or an interaction relationship between the two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood in specific situations.

如图1所示,本发明实施例中的提高以太坊智能合约字段扩展性的方法包括以下步骤:As shown in FIG. 1 , the method for improving the field scalability of an Ethereum smart contract in an embodiment of the present invention includes the following steps:

S10、定义区块链上需要存储的字段;S10. Define the fields that need to be stored on the blockchain;

S20、对需要上链的字段进行分类整合,提取出相似字段;S20, classify and integrate the fields that need to be uploaded, and extract similar fields;

S30、前端服务器对相似字段进行整合并进行Json格式化转换,使得由多个字段组成的对象或者数组转换为单一字段的字符串;S30, the front-end server integrates similar fields and performs Json format conversion, so that an object or array composed of multiple fields is converted into a string of a single field;

S40、调用区块链上的智能合约Api接口传入对应的字符串,经过智能合约验证过后,将字符串存储到区块链的一个字段上;S40. Call the smart contract Api interface on the blockchain to pass in the corresponding string, and after verification by the smart contract, store the string in a field of the blockchain;

S50、当前端服务器需要获取数据时,字符串需要进行Json解析,从而得到原始存储字段。S50. When the front-end server needs to obtain data, the string needs to be parsed by Json, so as to obtain the original storage field.

本实施例通过对字段的格式做一些规范化的设计,让多条信息按照一定的规则进行转换,从而提升单个字段存储的数据量,提高了字段的扩展性,而且减少了在单个函数中因为进行存储而产生的变量,使得合约在系统的限制下可以完成业务上的需求更新,减少系统重复建设,在合约实现上对于存储的所需的字段减少,同时由于对存储字段的设定是字符串大小,当转换前的数据格式需要进行增删时,也不会对存储格式有任何影响,使得存储内容更加灵活,无需修改底层存储合约,增加了合约存储结构的灵活性。In this embodiment, some standardized designs are made on the format of the fields, so that multiple pieces of information are converted according to certain rules, thereby increasing the amount of data stored in a single field, improving the expansibility of the field, and reducing the need for a single function. The variables generated by storage enable the contract to complete the update of business requirements under the constraints of the system, reduce the repeated construction of the system, and reduce the fields required for storage in the contract implementation. At the same time, because the setting of the storage field is a string When the data format before conversion needs to be added or deleted, it will not have any impact on the storage format, making the storage content more flexible, without modifying the underlying storage contract, and increasing the flexibility of the contract storage structure.

于本实施例中,步骤S40中,前端服务器根据接口提供的URL链接通过HTTP的网络协议以Post方式访问到智能合约Api接口。In this embodiment, in step S40, the front-end server accesses the smart contract Api interface in Post mode through the HTTP network protocol according to the URL link provided by the interface.

于本实施例中,步骤S40中,智能合约Api接口根据URL链接进行一次转接后调用对应的智能合约,智能合约验证调用的身份,验证通过后执行智能合约上的存储逻辑,存储逻辑在经过区块链的共识机制确认后,区块链对此次请求进行存储。In this embodiment, in step S40, the smart contract Api interface performs a transfer according to the URL link and then calls the corresponding smart contract, the smart contract verifies the identity of the call, and executes the storage logic on the smart contract after the verification is passed. After the consensus mechanism of the blockchain is confirmed, the blockchain stores the request.

于本实施例中,当字符串需要添加新字段时,只需在前端服务器上将新字段添加进原字段中即可。In this embodiment, when a new field needs to be added to the string, it is only necessary to add the new field to the original field on the front-end server.

如图2和图3所示,例如需要上链的信息包括邮寄目的地、物流公司、物流单号、链上用户名和上链时间,根据定义好的字段,将上述信息进行分类整合,提取出同一类别下的信息,例如邮寄目的地、物流公司和物流单号,前端服务器将邮寄目的地、物流公司和物流单号信息进行Json格式化转换为Json字符串,然后将Json字符串、链上用户名和上链时间等字符串一同传入区块链上的智能合约Api接口,智能合约Api接口调用对应的智能合约,智能合约验证调用的身份,验证通过后执行合约上的存储逻辑,存储逻辑在经过区块链的共识机制确认后,区块链对此次请求进行存储,从而减少了智能合约执行时产生多个变量去接收这些信息。当如图1中的快递信息需要添加新的字段时,只需在前端服务器转换之前将新的字段添加进去转换即可,对于链上而言,还是由一个字段进行存储,所以接收信息时也仅需一个变量存储即可,无需改动存储合约的字段格式。As shown in Figure 2 and Figure 3, for example, the information that needs to be uploaded to the chain includes the mailing destination, logistics company, logistics order number, user name on the chain and time of the chain. According to the defined fields, the above information is classified and integrated, and the extracted Information under the same category, such as mailing destination, logistics company and logistics order number, the front-end server converts the mailing destination, logistics company and logistics order number information into Json string by Json format, and then converts the Json string, on-chain Strings such as username and on-chain time are passed into the smart contract Api interface on the blockchain together. The smart contract Api interface calls the corresponding smart contract. The smart contract verifies the identity of the call. After the verification is passed, the storage logic on the contract is executed. After being confirmed by the consensus mechanism of the blockchain, the blockchain stores the request, thereby reducing the generation of multiple variables during the execution of the smart contract to receive the information. When a new field needs to be added to the express information as shown in Figure 1, it is only necessary to add the new field to the conversion before the front-end server conversion. For the chain, it is still stored in a field, so when receiving information, it is also Only one variable is needed to store, and there is no need to change the field format of the storage contract.

本实施例通过Solidity语言中支持的string类型,在单个string字段上记录多条信息,在传入存储之前,先将这些信息根据规则进行转换,从而提升单个字段存储的数据量,减少在单个函数中因为进行存储而产生的变量,解决了单个函数超过底层限制的16个变量的问题,从而防止因为使用过多的变量而导致的“stack too deep”错误,使得合约中的逻辑实现时能使用的变量更多,实现的效果更加灵活和提供更多的设计思路。In this embodiment, multiple pieces of information are recorded on a single string field by using the string type supported by the Solidity language, and before being passed into storage, the information is converted according to the rules, thereby increasing the amount of data stored in a single field and reducing the amount of data stored in a single function. The variables generated by storage in the contract solve the problem that a single function exceeds the limit of 16 variables at the bottom layer, thereby preventing the "stack too deep" error caused by using too many variables, so that the logic in the contract can be used when implementing There are more variables, the effect is more flexible and provides more design ideas.

专有名词的解释:Explanation of proper nouns:

Json:一种与开发语言无关的、轻量级的数据存储格式,全称JavaScript ObjectNotation,一种数据格式的标准规范,起初来源于JavaScript这门语言,后来随着使用的广泛,几乎每门开发语言都有处理Json的Api。Json: A lightweight data storage format independent of development language, the full name is JavaScript ObjectNotation, a standard specification of data format, originally derived from the JavaScript language, and later with the widespread use, almost every development language There are APIs for handling Json.

智能合约Api接口:由区块链底层扩展开发出来的一套符合Restful Api规范的Api接口,提供调用的便利性。Smart contract Api interface: A set of Api interfaces conforming to the Restful Api specification developed by the underlying extension of the blockchain, providing convenience for invocation.

Restful Api规范:是一套用于前后端分离的规范。Restful Api Specification: It is a set of specifications for front-end and back-end separation.

智能合约:是一种旨在以信息化方式传播、验证或执行合同的计算机协议,智能合约允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。Smart Contract: A computer protocol designed to informatively propagate, verify, or execute a contract, a smart contract allows for trusted transactions that are traceable and irreversible without a third party.

URL链接:是因特网的万维网服务程序上用于指定信息位置的表示方法。URL link: It is a representation method used to specify the location of information on the World Wide Web service program of the Internet.

HTTP网络协议:是对于客户端和服务器端请求和应答的标准,主要用于客户端通过页面浏览器或者其他工具发起一个HTTP请求到服务器中指定端口,由服务器收到请求后,返回对应的响应内容。HTTP network protocol: It is the standard for client and server requests and responses. It is mainly used by the client to initiate an HTTP request to the specified port in the server through a web browser or other tools. After the server receives the request, it returns the corresponding response. content.

Post方式:指的是HTTP请求的常用基本方法之一,主要用于向服务器提交数据的一种请求方式。Post method: refers to one of the common basic methods of HTTP request, which is mainly used to submit data to the server.

共识机制:指的是区块链中的一种算法,主要是为了保证一笔交易的正确性。在区块链中,每一次的上链都会由每个用户去检查这次操作是否符合要求,然后由所有用户对这次的操作进行投票,最后达成共识去决定这次的操作是否有误,假如无误的话才会记录到区块链上。Consensus mechanism: refers to an algorithm in the blockchain, mainly to ensure the correctness of a transaction. In the blockchain, each user will check whether the operation meets the requirements every time the chain is uploaded, and then all users will vote on this operation, and finally reach a consensus to determine whether this operation is wrong or not. If it is correct, it will be recorded on the blockchain.

Solidity:是一种运行在以太虚拟机上的智能合约所用的高级编程语言。Solidity: is a high-level programming language for smart contracts running on the Ethereum Virtual Machine.

以太坊:以太坊是一个开源的有智能合约功能的公共区块链平台,通过其专用加密货币以太币提供去中心化的以太虚拟机来处理点对点合约。Ethereum: Ethereum is an open-source public blockchain platform with smart contract capabilities that provides a decentralized Ethereum virtual machine to process peer-to-peer contracts through its dedicated cryptocurrency, Ethereum.

以太虚拟机:以太坊虚拟机是以太网上智能合约的运行环境。以太坊虚拟机是在沙盒中运行,这是和区块链主链完全分开的,代码运行在以太坊虚拟机里没有网络,文件系统或是其他进程的智能合约会被限制访问其他的智能合约。Ethereum Virtual Machine: The Ethereum Virtual Machine is the runtime environment for smart contracts on Ethereum. The Ethereum virtual machine runs in a sandbox, which is completely separate from the main chain of the blockchain. The code runs in the Ethereum virtual machine without a network, and the file system or smart contracts of other processes will be restricted from accessing other smart contracts. contract.

“stack too deep”错误:这个错误是由于以太虚拟机限制了栈最多能取到stack[15],即从栈顶向下第16个栈元素的内容,这就导致了如果一个函数方法的入参、返回值、函数内参数的个数如果大于一定量的时候很可能会触发这个错误,如果合约业务逻辑复杂,便有可能触发“stack too deep”错误。"stack too deep" error: This error is due to the fact that the ether virtual machine restricts the stack to get to stack[15] at most, that is, the content of the 16th stack element from the top of the stack down, which leads to the fact that if the input parameter of a function method , the return value, and the number of parameters in the function are likely to trigger this error if the number is greater than a certain amount. If the contract business logic is complex, it may trigger the "stack too deep" error.

需要声明的是,上述具体实施方式仅仅为本发明的较佳实施例及所运用技术原理。本领域技术人员应该明白,还可以对本发明做各种修改、等同替换、变化等等。但是,这些变换只要未背离本发明的精神,都应在本发明的保护范围之内。另外,本申请说明书和权利要求书所使用的一些术语并不是限制,仅仅是为了便于描述。It should be stated that the above-mentioned specific embodiments are only preferred embodiments of the present invention and applied technical principles. It should be understood by those skilled in the art that various modifications, equivalent substitutions, changes and the like can also be made to the present invention. However, as long as these transformations do not depart from the spirit of the present invention, they should all fall within the protection scope of the present invention. In addition, some terms used in the specification and claims of the present application are not limiting, but are only for convenience of description.

Claims (4)

1. A method for improving the expansibility of an Ethernet intelligent contract field is characterized by comprising the following steps:
s10, defining fields needing to be stored on the block chain;
s20, classifying and integrating the fields needing to be linked, and extracting similar fields;
s30, the front-end server integrates the similar fields and carries out Json formatting conversion, so that an object or an array consisting of a plurality of fields is converted into a character string of a single field;
s40, calling an intelligent contract Api interface on the block chain to transmit the corresponding character string, and storing the character string to a field of the block chain after the character string is verified by the intelligent contract;
and S50, when the front-end server needs to acquire data, the character string needs to be subjected to Json analysis, so that an original storage field is obtained.
2. The method of improving ethernet intelligent contract field expandability of claim 1, wherein in the step S40, the front-end server accesses the intelligent contract Api interface in a Post manner through a network protocol of HTTP according to a URL link provided by the interface.
3. The method of improving the expandability of the smart contract field of the ethernet according to claim 2, wherein in step S40, the Api interface calls the corresponding smart contract after performing a transfer according to the URL link, the smart contract verifies the identity of the call, and executes the storage logic on the smart contract after the verification is passed, and the storage logic stores the request after being confirmed by the consensus mechanism of the blockchain.
4. The method for improving the expandability of the fields of the intelligent contracts of the etherhouses according to claim 3, wherein when a new field needs to be added to the character string, the new field is added to an original field on the front-end server.
CN202010813185.3A 2020-08-13 2020-08-13 A method to improve the scalability of Ethereum smart contract fields Active CN111813999B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010813185.3A CN111813999B (en) 2020-08-13 2020-08-13 A method to improve the scalability of Ethereum smart contract fields

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010813185.3A CN111813999B (en) 2020-08-13 2020-08-13 A method to improve the scalability of Ethereum smart contract fields

Publications (2)

Publication Number Publication Date
CN111813999A true CN111813999A (en) 2020-10-23
CN111813999B CN111813999B (en) 2024-01-05

Family

ID=72859835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010813185.3A Active CN111813999B (en) 2020-08-13 2020-08-13 A method to improve the scalability of Ethereum smart contract fields

Country Status (1)

Country Link
CN (1) CN111813999B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597140A (en) * 2020-12-24 2021-04-02 河南数权科技有限公司 Data registration and credible circulation system, method, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077185A (en) * 2012-12-18 2013-05-01 厦门雅迅网络股份有限公司 Object-based user-defined information-expanding method
CN108694575A (en) * 2018-06-13 2018-10-23 深圳前海微众银行股份有限公司 Verification method of transferring accounts, device and storage medium based on block chain
CN109936569A (en) * 2019-02-21 2019-06-25 领信智链(北京)科技有限公司 A kind of decentralization digital identity login management system based on ether mill block chain
CN110650128A (en) * 2019-09-17 2020-01-03 西安电子科技大学 A system and method for detecting Ethereum digital currency theft attack
CN111190936A (en) * 2019-12-12 2020-05-22 中国科学院计算机网络信息中心 A method for querying trusted identifier association relationship based on blockchain technology and corresponding storage medium and electronic device
US20200250174A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing efficient storage and validation of data and metadata within a blockchain using distributed ledger technology (dlt)

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077185A (en) * 2012-12-18 2013-05-01 厦门雅迅网络股份有限公司 Object-based user-defined information-expanding method
CN108694575A (en) * 2018-06-13 2018-10-23 深圳前海微众银行股份有限公司 Verification method of transferring accounts, device and storage medium based on block chain
US20200250174A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing efficient storage and validation of data and metadata within a blockchain using distributed ledger technology (dlt)
CN109936569A (en) * 2019-02-21 2019-06-25 领信智链(北京)科技有限公司 A kind of decentralization digital identity login management system based on ether mill block chain
CN110650128A (en) * 2019-09-17 2020-01-03 西安电子科技大学 A system and method for detecting Ethereum digital currency theft attack
CN111190936A (en) * 2019-12-12 2020-05-22 中国科学院计算机网络信息中心 A method for querying trusted identifier association relationship based on blockchain technology and corresponding storage medium and electronic device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597140A (en) * 2020-12-24 2021-04-02 河南数权科技有限公司 Data registration and credible circulation system, method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111813999B (en) 2024-01-05

Similar Documents

Publication Publication Date Title
US20200034453A1 (en) Smart contract input mapping
US20100281061A1 (en) Semantic Data Validation of Disjoint Data
CN114219596B (en) Data processing method and related equipment based on decision tree model
CN108280104B (en) Method and device for extracting characteristic information of target object
WO2021223419A1 (en) Smart executable contract construction and execution method and system for legal contract
JP2006285955A (en) Comparison and contrast of business model
CN108009087A (en) Data library test method, device and computer-readable recording medium
TWI729763B (en) System and method for collecting and validating web traffic data
CN101282345B (en) Method for converting XML based on formalization description and state ontroller system
CN102812435A (en) Validating configuration of distributed applications
US20240296350A1 (en) Computed values for knowledge graph
CN115170048B (en) Model-based and rule-based workflow implementation method, system and medium
WO2023109074A1 (en) Method and apparatus for implementing linkage function, device, storage medium, and program
CN114281707A (en) Number creation method, business application testing method and related equipment
CN111813999A (en) A method to improve the scalability of Ethereum smart contract fields
CN115033233B (en) Interface calling method, device, electronic device and storage medium
CN116633653A (en) Financial system firewall management control method, device, system and storage medium
CN116860856A (en) Financial data processing method and device, computer equipment and storage medium
JP2024540113A (en) A rule-based technique for extracting question-answer pairs from data.
CN115484303B (en) Factory microservice system, method, device and storage medium
CN120353711A (en) Test case generation method, device, electronic device and storage medium
WO2025171816A1 (en) Text intention recognition model training and text intention recognition
CN117492752B (en) A page dynamic configuration method, device, computer equipment and storage medium
CN118897675A (en) Component library construction and calling method, device, equipment and storage medium
CN104008058B (en) A kind of framework evaluation method based on prototype emulation

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20231211

Address after: 510700 3rd Floor, No. 31 Guangshan Third Road, Lianhe Street, Huangpu District, Guangzhou City, Guangdong Province (Location: 30506)

Applicant after: Guangzhou Kechuang Space Information Technology Co.,Ltd.

Address before: 510700 No. 5, Nanyun 5th Road, Science City, high tech Industrial Development Zone, Guangzhou, Guangdong

Applicant before: GUANGZHOU TUNGKONG SECURITY PRINTING Co.,Ltd.

Applicant before: Guangzhou Kechuang Space Information Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20251119

Address after: 510663 Guangdong Province Guangzhou City Huangpu District Nanyun Road 2 Building 2 Room 509

Patentee after: Guangdong Likang Technology Development Co.,Ltd.

Country or region after: China

Address before: 510700 3rd Floor, No. 31 Guangshan Third Road, Lianhe Street, Huangpu District, Guangzhou City, Guangdong Province (Location: 30506)

Patentee before: Guangzhou Kechuang Space Information Technology Co.,Ltd.

Country or region before: China