A blockchain smart contract editor file management method and device in a WebIDE

By leveraging collaborative management between the browser and server sides, and utilizing version numbers and hash values ​​to manage blockchain smart contract editor files, the complexity of loading and editing contract editors in WebIDE is resolved, achieving efficient file management and version consistency.

CN115329227BActive Publication Date: 2026-05-22HANGZHOU RIVTOWER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU RIVTOWER TECH CO LTD
Filing Date
2022-07-06
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

In WebIDE, the loading and editing process of the smart contract editor is time-consuming and complex. How to avoid repeatedly loading the editor, how to manage modified contract editor files, and how to effectively manage contract editor file resources locally and on the server side have become urgent problems to be solved.

Method used

Through the collaborative work of the browser and server, version files of the blockchain smart contract editor are generated and managed. Resource files are managed using version numbers and hash values. After the browser initializes, it checks the local cache. If it is not cached, it loads it from the server. The server updates the version file and pushes it to the browser, ensuring file consistency and efficient management.

Benefits of technology

It enables efficient management of contract editor files, reduces loading time, improves browser loading speed, and ensures timely file updates and version consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115329227B_ABST
    Figure CN115329227B_ABST
Patent Text Reader

Abstract

The application discloses a blockchain smart contract editor file management method and device in a WebIDE, wherein the method comprises the following steps: the smart contract editor comprises a browser end and a server end, the server end generates a smart contract editor resource file and a corresponding smart contract editor version file; the browser end initializes the smart contract editor and obtains a loading version file from the server end; the browser end checks whether the resource file corresponding to the selected version number has been cached locally according to the selected smart contract editor version number; if the browser end does not cache the resource file corresponding to the version number locally, the corresponding resource file is obtained from the server end according to the version number. The management scheme can effectively manage different version contract editor files, accelerate the loading speed of the contract editor file on the browser end, and the server end can timely process the version file to generate a new contract editor version file for the browser end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer software technology, and in particular to a method, apparatus, electronic device, and storage medium for managing files in a blockchain smart contract editor within a WebIDE. Background Technology

[0002] Smart contracts are a fundamental building block in blockchain applications. They are computational programs stored on the blockchain, allowing us to transform traditional contracts into digital contracts. Smart contracts are highly logical, following an "if this then that" structure. This means their behavior is completely consistent with their programming and cannot be changed. Typically, smart contract developers use either a local IDE or a WebIDE. Regardless of the method used, a completed smart contract needs to be edited using a contract editor file before being deployed to the blockchain. Loading and editing the contract editor is a time-consuming and complex process. Therefore, in the context of WebIDE applications, the following technical problems urgently need to be solved: how to organize and cache contract editor files; how to avoid repeatedly loading the editor after the user selects the appropriate version; how to avoid loading cached files of modified contract editors; how to manage these loaded editor files locally to form a good resource configuration file; and how the server updates the cached contract editor files on the browser side. Summary of the Invention

[0003] The purpose of the embodiments in this specification is to address the above-mentioned problems by providing a method, apparatus, electronic device, and storage medium for managing files in a blockchain smart contract editor within a WebIDE.

[0004] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:

[0005] Firstly, a method for managing blockchain smart contract editor files in a WebIDE is proposed. The blockchain smart contract editor includes a browser side and a server side. The server side generates blockchain smart contract editor resource files and corresponding version files of the blockchain smart contract editor. This includes:

[0006] The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server.

[0007] The browser checks whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally.

[0008] If the browser does not cache the resource file corresponding to the version number locally, it retrieves and loads the corresponding resource file from the server based on the version number.

[0009] Secondly, a file management method for a blockchain smart contract editor in a WebIDE is proposed. The blockchain smart contract editor includes a browser side and a server side, and is applied to the server side, including:

[0010] Generate blockchain smart contract editor resource files and corresponding blockchain smart contract editor version files;

[0011] In response to the initialization command of the blockchain smart contract editor browser, the version file is sent to the browser so that the browser can obtain and load the version file;

[0012] In response to the browser's instruction to load the corresponding resource file based on the version number, the resource file is sent to the browser.

[0013] Thirdly, a file management method for a blockchain smart contract editor in a WebIDE is proposed. The blockchain smart contract editor includes a browser side and a server side, and is applied to the browser side, including:

[0014] Initialize the blockchain smart contract editor and obtain and load the version file from the server.

[0015] Based on the selected version number of the blockchain smart contract editor, check whether the resource file corresponding to the selected version number has been cached locally;

[0016] If the resource file corresponding to the version number is not cached locally, the corresponding resource file is retrieved from the server based on the version number and loaded.

[0017] Fourthly, a file management device for a blockchain smart contract editor in a WebIDE is proposed. The blockchain smart contract editor includes a browser side and a server side, comprising:

[0018] The first module is used to generate a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file on the server side.

[0019] The second module is used to initialize the blockchain smart contract editor on the browser side and obtain and load the version file from the server side.

[0020] The third module is used by the browser to check whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally.

[0021] The fourth module is used to retrieve and load the corresponding resource file from the server based on the version number if the browser does not cache the resource file corresponding to the version number locally.

[0022] Fifthly, a file management device for a blockchain smart contract editor in a WebIDE is proposed. The blockchain smart contract editor includes a browser side and a server side, and is applied to the server side, including:

[0023] The first module is used to generate blockchain smart contract editor resource files and corresponding blockchain smart contract editor version files;

[0024] The second module is used to respond to the initialization command of the blockchain smart contract editor browser and send the version file to the browser so that the browser can obtain and load the version file.

[0025] The third module is used to respond to the instruction from the browser to load the corresponding resource file according to the version number and send the resource file to the browser.

[0026] Sixthly, a file management device for a blockchain smart contract editor in a WebIDE is proposed. The blockchain smart contract editor includes a browser side and a server side, and is applied to the browser side, including:

[0027] The first module is used to initialize the blockchain smart contract editor and obtain and load the version file from the server.

[0028] The second module is used to search locally for whether a resource file corresponding to the selected version number of the blockchain smart contract editor has been cached based on the selected version number.

[0029] The third module is used to retrieve and load the corresponding resource file from the server based on the version number if the resource file corresponding to the version number is not cached locally.

[0030] Seventhly, a WebIDE blockchain smart contract editor is proposed, including a file management module, which comprises a browser side and a server side.

[0031] The server generates a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file; in response to the initialization command of the blockchain smart contract editor browser, it sends the version file to the browser so that the browser can obtain and load the version file; in response to the command of the browser to load the corresponding resource file according to the version number, it sends the resource file to the browser.

[0032] The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server. Based on the selected version number of the blockchain smart contract editor, it checks whether the resource file corresponding to the selected version number is cached locally. If the resource file corresponding to the version number is not cached locally, the browser retrieves and loads the corresponding resource file from the server based on the version number.

[0033] Eighthly, an electronic device is proposed, comprising: a processor; and

[0034] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the first aspect.

[0035] Ninthly, an electronic device is proposed, comprising: a processor; and

[0036] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the second aspect.

[0037] In a tenth aspect, an electronic device is proposed, comprising: a processor; and

[0038] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the third aspect.

[0039] Eleventhly, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the method described in the first aspect.

[0040] In a twelfth aspect, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the method described in the second aspect.

[0041] In a thirteenth aspect, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the method described in the third aspect.

[0042] This manual can achieve at least the following technical effects:

[0043] This invention provides a file management solution for blockchain smart contract editors under WebIDE, which can effectively manage different versions of contract editor files, speed up the loading of contract editor files on the browser, and enable the server to process version files in a timely manner to generate new contract editor version files for browser use. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is one of the schematic diagrams illustrating the file management method of the blockchain smart contract editor in the WebIDE provided in the embodiments of this specification.

[0046] Figure 2 This is the second schematic diagram of the file management method for the blockchain smart contract editor in WebIDE provided in the embodiments of this specification.

[0047] Figure 3 This is the third schematic diagram of the file management method for the blockchain smart contract editor in WebIDE provided in the embodiments of this specification.

[0048] Figure 4 This is the fourth schematic diagram of the file management method for the blockchain smart contract editor in WebIDE provided in the embodiments of this specification.

[0049] Figure 5 This is the fifth illustration of the file management method for the blockchain smart contract editor in the WebIDE provided in the embodiments of this specification.

[0050] Figure 6 This is the sixth illustration of the file management method for the blockchain smart contract editor in WebIDE provided in the embodiments of this specification.

[0051] Figure 7 This is one of the schematic diagrams of a file management device for a blockchain smart contract editor in WebIDE provided in the embodiments of this specification.

[0052] Figure 8 This is the second schematic diagram of the file management device for the blockchain smart contract editor in the WebIDE provided in the embodiments of this specification.

[0053] Figure 9 This is the third schematic diagram of the file management device for the blockchain smart contract editor in the WebIDE provided in the embodiments of this specification.

[0054] Figure 10 This is the fourth schematic diagram of the file management device for the blockchain smart contract editor in the WebIDE provided in the embodiments of this specification.

[0055] Figure 11 This is the fifth schematic diagram of the file management device for the blockchain smart contract editor in the WebIDE provided in the embodiments of this specification.

[0056] Figure 12 This is a schematic diagram of the WebIDE blockchain smart contract editor provided in the embodiments of this specification.

[0057] Figure 13 This is a schematic diagram of the structure of an electronic device provided as an embodiment of this specification. Detailed Implementation

[0058] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0059] The following section provides a detailed description of a blockchain data security sharing scheme covered in this manual through specific examples.

[0060] Key terms

[0061] WebIDE: In the past, software development required downloading and installing Visual Studio, JetBrains CLion, or CodeLite to write C / C++ programs; Eclipse, IntelliJ IDEA, or NetBeans to write Java programs; and PyCharm, Spyder, or PyDev to write Python programs. Local IDEs often resulted in "two hours of installation, five minutes of coding." WebIDEs, however, provide a web-based interface for editing code within an integrated development environment (IDE). Within a WebIDE, users can edit code files, execute Linux commands in a terminal, run web services to obtain temporary domains, and preview and debug code in a browser. With the full arrival of the cloud computing era, WebIDEs have gradually gained acceptance and popularity among developers. Compared to local IDEs, the biggest advantage of WebIDEs is their ubiquitous availability and superior code security.

[0062] Smart contracts are programs that run within a blockchain system, characterized by automatic execution according to predefined logic and immutable results. A smart contract is a collection of code and data; its entire transaction process is represented by digital code, and transactions are automatically completed when certain conditions are met. The "2018 China Blockchain Industry White Paper" defines smart contracts as: "Event-driven, stateful, multi-party recognized programs that run on a blockchain and can automatically process assets according to preset conditions." Writing smart contract code requires blockchain smart contract application developers to use at least one programming language that supports smart contracts. For example, on the Ethereum blockchain, Solidity or Vyper is chosen for implementation. Integrating smart contract code writing functionality into an Integrated Development Environment (IDE), especially a WebIDE, is an inevitable trend.

[0063] JSON is a lightweight data-interchange format. It is based on a subset of ECMAScript (the JavaScript specification developed by the European Computer Manufacturers Association) and uses a text format that is completely independent of programming languages ​​to store and represent data. Its concise and clear hierarchical structure makes JSON an ideal data exchange language; it is easy for humans to read and write, as well as easy for machines to parse and generate, and effectively improves network transmission efficiency.

[0064] Example 1

[0065] This invention focuses on the process of organizing and caching blockchain smart contract editor files in a WebIDE, specifically how to avoid reloading the editor after a user selects the appropriate version of the contract editor via the browser, how to manage loaded editor files locally, and how the server updates the cached contract editor files on the browser side. In blockchain systems, the development of smart contract functionality is a fundamental building block. Since smart contracts are computational programs stored on the blockchain, traditional contracts need to be converted into digital contracts. Using a WebIDE to develop smart contracts has become one of the effective ways to improve smart contract applications. Writing smart contract code requires editing editor files before deployment to the blockchain; loading and editing the contract editor is a time-consuming and complex process. Therefore, based on the above problem analysis and considering the application characteristics of WebIDE and smart contracts, this invention presents a method for managing blockchain smart contract editor files in a WebIDE. The blockchain smart contract editor includes a browser side and a server side, as described above. Figure 1 As shown, it includes:

[0066] Step 101: The server generates a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file.

[0067] Optionally, the version file and the resource file are stored in the same directory on the server. Specifically, firstly, the server packages all the editor files into a folder and generates a version file. During initialization, the WebIDE browser program issues a command to load the contract editor, including loading the version file list.json. At the same time, a list selector is generated in the browser user interface for the user to select the corresponding version.

[0068] Optionally, the version file is described using a JSON data exchange format, which includes the blockchain smart contract editor version number and the blockchain smart contract editor resource file name corresponding to the version number. Further, the blockchain smart contract editor resource file name includes the blockchain smart contract editor version number and the hash value calculated by a cryptographic hash function algorithm using the blockchain smart contract editor resource file. In a specific embodiment, the version file is in JSON format, stored in a key-value format, where the key is the contract editor version number and the value is the contract editor file name. The contract editor file name is specifically generated by calculating the current editor version number + SHA256 (source file), thus ensuring the uniqueness of each editor version.

[0069] Step 102: The browser initializes the blockchain smart contract editor and obtains and loads the version file from the server.

[0070] Optionally, after the browser obtains and loads the version file, it generates a selector function for parsing the version file and caching the resource files. Specifically, after obtaining the version file, the browser's JavaScript processes it into a JSON object and generates a selector function. When the function is not passed a version, it returns a list of all versions. When a specific version is passed to the function, the selector function first reads the file from the cache function; if the version is not found there, it loads the corresponding resource file from the server. Further, as... Figure 2 The diagram shows the working process of the selector function:

[0071] Step 211: When no selected version is specified as a parameter of the selector function, parse and return all version information;

[0072] Step 212: When a selected version is specified as a parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser side; if it is not cached locally, it sends a request to the server side according to the selected version.

[0073] Step 103: The browser checks whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally.

[0074] Step 104: If the browser does not cache the resource file corresponding to the version number locally, it retrieves and loads the corresponding resource file from the server based on the version number.

[0075] This embodiment proposes another implementation scheme for the file management method of the blockchain smart contract editor in WebIDE, such as... Figure 3 As shown, it also includes:

[0076] Step 105: When the resource file stored on the server is updated, the version file is regenerated and pushed to the browser so that the browser can read the updated resource file based on the version file cache. Specifically, when a new editor file is created on the server, a new list.json file is sent to the browser. In particular, when a file changes, its hash also changes, so the file name changes accordingly, at which point the cache becomes invalid. When a user requests a new contract editor file through the browser, this avoids the modified contract editor loading the old cached file.

[0077] Example 2

[0078] Reference Figure 4 The diagram illustrates a file management method for a blockchain smart contract editor in a WebIDE, as provided in this embodiment. The blockchain smart contract editor includes a browser and a server. The method is applied to the server and includes:

[0079] Step 401: Generate the blockchain smart contract editor resource file and the corresponding blockchain smart contract editor version file.

[0080] Optionally, the version file and the resource file are stored in the same directory on the server. Specifically, firstly, the server packages all the editor files into a folder and generates a version file. During initialization, the WebIDE browser program issues a command to load the contract editor, including loading the version file list.json. At the same time, a list selector is generated in the browser user interface for the user to select the corresponding version.

[0081] Optionally, the version file is described using a JSON data exchange format, which includes the blockchain smart contract editor version number and the blockchain smart contract editor resource file name corresponding to the version number. Further, the blockchain smart contract editor resource file name includes the blockchain smart contract editor version number and the hash value calculated by a cryptographic hash function algorithm using the blockchain smart contract editor resource file. In a specific embodiment, the version file is in JSON format, stored in a key-value format, where the key is the contract editor version number and the value is the contract editor file name. The contract editor file name is specifically generated by calculating the current editor version number + SHA256 (source file), thus ensuring the uniqueness of each editor version.

[0082] Step 402: In response to the initialization command of the blockchain smart contract editor browser, send the version file to the browser so that the browser can obtain and load the version file.

[0083] Optionally, after the browser obtains and loads the version file, it generates a selector function for parsing the version file and caching the resource files. Specifically, after obtaining the version file, the browser's JavaScript processes it into a JSON object and generates a selector function. When the function is not passed a version, it returns a list of all versions. When a specific version is passed to the function, the selector function first reads the file from the cache function; if the version is not found there, it loads the corresponding resource file from the server. Further, as... Figure 2 The diagram shows the working process of the selector function:

[0084] Step 211: When no selected version is specified as a parameter of the selector function, parse and return all version information;

[0085] Step 212: When a selected version is specified as a parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser side; if it is not cached locally, it sends a request to the server side according to the selected version.

[0086] Step 403: In response to the browser's instruction to load the corresponding resource file according to the version number, send the resource file to the browser.

[0087] This embodiment proposes another implementation scheme for the file management method of the blockchain smart contract editor in WebIDE, which also includes:

[0088] Step 405: Deploy a smart contract for secure data sharing, enabling the initiator and / or the participants to invoke the smart contract to perform corresponding operations on the shared data. Specifically, when a new editor file is created on the server side, a new list.json file is sent to the browser. In particular, when a file changes, its hash also changes, and therefore the file name changes as well, rendering the cache invalid. When a user requests a new contract editor file through their browser, the modified contract editor can avoid loading the old cached file.

[0089] Reference Figure 6 As shown in the embodiment of this specification, a method for managing blockchain smart contract editor files in a WebIDE is provided. The blockchain smart contract editor includes a browser side and a server side, and is applied to the browser side, including:

[0090] Step 601: Initialize the blockchain smart contract editor and obtain and load the version file from the server.

[0091] Optionally, after the browser obtains and loads the version file, it generates a selector function for parsing the version file and caching the resource files. Specifically, after obtaining the version file, the browser's JavaScript processes it into a JSON object and generates a selector function. When the function is not passed a version, it returns a list of all versions. When a specific version is passed to the function, the selector function first reads the file from the cache function; if the version is not found there, it loads the corresponding resource file from the server. Further, as... Figure 2 The diagram shows the working process of the selector function:

[0092] Step 211: When no selected version is specified as a parameter of the selector function, parse and return all version information;

[0093] Step 212: When a selected version is specified as a parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser side; if it is not cached locally, it sends a request to the server side according to the selected version.

[0094] Step 602: Based on the selected version number of the blockchain smart contract editor, check whether the resource file corresponding to the selected version number has been cached locally.

[0095] Step 603: If the resource file corresponding to the version number is not cached locally, then the corresponding resource file is retrieved from the server according to the version number and loaded.

[0096] Example 3

[0097] Figure 7 This is a schematic diagram of the structure of a file management device 700 for a blockchain smart contract editor in a WebIDE, provided as an embodiment of this specification. Please refer to... Figure 7 In one embodiment, a blockchain smart contract editor file management device in WebIDE includes a browser and a server, comprising:

[0098] The first module 701 is used to generate a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file on the server side.

[0099] The second module 702 is used to initialize the blockchain smart contract editor on the browser side and obtain and load the version file from the server side.

[0100] The third module 703 is used by the browser to check whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally.

[0101] The fourth module 704 is used to retrieve and load the corresponding resource file from the server according to the version number if the browser does not cache the resource file corresponding to the version number locally.

[0102] This embodiment proposes another implementation scheme for a file management device in a blockchain smart contract editor within a WebIDE, as follows: Figure 8 As shown, it also includes:

[0103] The fifth module 705 is used to regenerate the version file and push it to the browser when the resource file stored on the server is updated, so that the browser can read the updated resource file according to the version file cache.

[0104] It should be understood that the blockchain smart contract editor file management device in the WebIDE embodiments of this specification can also execute... Figures 1 to 6 The method executed by the file management device (or apparatus) of the blockchain smart contract editor in WebIDE, and the implementation of the file management device (or apparatus) of the blockchain smart contract editor in WebIDE. Figures 1 to 6 The functionality of the example shown will not be elaborated upon here.

[0105] Example 4

[0106] Figure 9 This is a schematic diagram of the structure of a file management device 900 for a blockchain smart contract editor in a WebIDE, provided as an embodiment of this specification. Please refer to... Figure 9 In one embodiment, a blockchain smart contract editor file management device in WebIDE includes a browser side and a server side. The device is applied to the server side and includes:

[0107] The first module 901 is used to generate a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file.

[0108] The second module 902 is used to send the version file to the browser in response to the initialization command of the blockchain smart contract editor browser, so that the browser can obtain and load the version file;

[0109] The third module 903 is used to send the resource file to the browser in response to the browser's instruction to load the corresponding resource file according to the version number.

[0110] This embodiment proposes another implementation scheme for a file management device in a blockchain smart contract editor within a WebIDE, as follows: Figure 10 As shown, it also includes:

[0111] The fourth module 904 is used to regenerate the version file and push it to the browser when the resource file is updated, so that the browser can read the updated resource file according to the version file cache.

[0112] It should be understood that the blockchain smart contract editor file management device in the WebIDE embodiments of this specification can also execute... Figures 4 to 5The method executed by the file management device (or apparatus) of the blockchain smart contract editor in WebIDE, and the implementation of the file management device (or apparatus) of the blockchain smart contract editor in WebIDE. Figures 4 to 5 The functionality of the example shown will not be elaborated upon here.

[0113] Figure 11 This is a schematic diagram of the structure of a file management device 1100 for a blockchain smart contract editor in a WebIDE, provided as an embodiment of this specification. Please refer to... Figure 11 In one embodiment, a blockchain smart contract editor file management device in WebIDE includes a browser-side and a server-side, and is applied to the browser-side, comprising:

[0114] The first module 1101 is used to initialize the blockchain smart contract editor and obtain and load the version file from the server.

[0115] The second module 1102 is used to search locally for whether a resource file corresponding to the selected version number of the blockchain smart contract editor has been cached based on the selected version number.

[0116] The third module 1103 is used to retrieve and load the corresponding resource file from the server according to the version number if the resource file corresponding to the version number is not cached locally.

[0117] It should be understood that the blockchain smart contract editor file management device in the WebIDE embodiments of this specification can also execute... Figure 6 The method executed by the file management device (or apparatus) of the blockchain smart contract editor in WebIDE, and the implementation of the file management device (or apparatus) of the blockchain smart contract editor in WebIDE. Figure 6 The functionality of the example shown will not be elaborated upon here.

[0118] Example 5

[0119] Figure 12 The WebIDE blockchain smart contract editor is provided as one embodiment of this specification. See also... Figure 12 As shown, a WebIDE includes a blockchain smart contract editor for writing smart contract code. The file management module of this editor includes a browser side and a server side.

[0120] The server generates a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file; in response to the initialization command of the blockchain smart contract editor browser, it sends the version file to the browser so that the browser can obtain and load the version file; in response to the command of the browser to load the corresponding resource file according to the version number, it sends the resource file to the browser.

[0121] The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server. Based on the selected version number of the blockchain smart contract editor, it checks whether the resource file corresponding to the selected version number is cached locally. If the resource file corresponding to the version number is not cached locally, the browser retrieves and loads the corresponding resource file from the server based on the version number.

[0122] Example 6

[0123] Figure 13 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 13 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0124] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 13 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0125] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0126] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a shared resource access control mechanism at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0127] The blockchain smart contract editor includes a browser client and a server client. The server client generates a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file; including:

[0128] The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server.

[0129] The browser checks whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally.

[0130] If the browser does not cache the resource file corresponding to the version number locally, it retrieves and loads the corresponding resource file from the server based on the version number.

[0131] or,

[0132] Applied to the server side, including:

[0133] Generate blockchain smart contract editor resource files and corresponding blockchain smart contract editor version files;

[0134] In response to the initialization command of the blockchain smart contract editor browser, the version file is sent to the browser so that the browser can obtain and load the version file;

[0135] In response to the browser's instruction to load the corresponding resource file based on the version number, the resource file is sent to the browser.

[0136] or,

[0137] Applied to the browser, including:

[0138] Initialize the blockchain smart contract editor and obtain and load the version file from the server.

[0139] Based on the selected version number of the blockchain smart contract editor, check whether the resource file corresponding to the selected version number has been cached locally;

[0140] If the resource file corresponding to the version number is not cached locally, the corresponding resource file is retrieved from the server based on the version number and loaded.

[0141] The above is as described in this instruction manual. Figures 1 to 6 The illustrated embodiment discloses a file management method for a blockchain smart contract editor in a WebIDE, which can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by software instructions. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0142] Of course, in addition to the software implementation, the electronic devices in the embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0143] Example 7

[0144] This specification also provides an embodiment of a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figures 1 to 6 The method of the illustrated embodiment is specifically used to perform the following method:

[0145] The blockchain smart contract editor includes a browser client and a server client. The server client generates a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file; including:

[0146] The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server.

[0147] The browser checks whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally.

[0148] If the browser does not cache the resource file corresponding to the version number locally, it retrieves and loads the corresponding resource file from the server based on the version number.

[0149] or,

[0150] Applied to the server side, including:

[0151] Generate blockchain smart contract editor resource files and corresponding blockchain smart contract editor version files;

[0152] In response to the initialization command of the blockchain smart contract editor browser, the version file is sent to the browser so that the browser can obtain and load the version file;

[0153] In response to the browser's instruction to load the corresponding resource file based on the version number, the resource file is sent to the browser.

[0154] or,

[0155] Applied to the browser, including:

[0156] Initialize the blockchain smart contract editor and obtain and load the version file from the server.

[0157] Based on the selected version number of the blockchain smart contract editor, check whether the resource file corresponding to the selected version number has been cached locally;

[0158] If the resource file corresponding to the version number is not cached locally, the corresponding resource file is retrieved from the server based on the version number and loaded.

[0159] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

[0160] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an electronic data carrier device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0161] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0162] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0163] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A method for managing files in a blockchain smart contract editor within a WebIDE, characterized in that, The blockchain smart contract editor includes a browser client and a server client. The server client generates a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file; including: The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server. After the browser obtains and loads the version file, it generates a selector function for parsing the version file and caching the resource file. The selector function works as follows: when no selected version is specified as a parameter of the selector function, it parses and returns all version information; when a selected version is specified as a parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser; if it is not cached locally, it sends a request to the server based on the selected version. The browser checks whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally. If the browser does not cache the resource file corresponding to the version number locally, it retrieves and loads the corresponding resource file from the server based on the version number.

2. The method according to claim 1, characterized in that, The version file and the resource file are stored in the same directory on the server.

3. The method according to claim 1, characterized in that, The version file is described using a JSON data exchange format, which includes the version number of the blockchain smart contract editor and the resource file name of the blockchain smart contract editor that corresponds to the version number.

4. The method according to claim 3, characterized in that, The resource file name of the blockchain smart contract editor includes the version number of the blockchain smart contract editor and the hash value calculated by the cryptographic hash function algorithm of the blockchain smart contract editor resource file.

5. The method according to claim 1, characterized in that, It also includes regenerating the version file and pushing it to the browser when the resource file stored on the server is updated, so that the browser can read the updated resource file according to the version file cache.

6. A method for managing files in a blockchain smart contract editor within a WebIDE, characterized in that, The blockchain smart contract editor includes a browser side and a server side, and is applied to the server side, including: Generate blockchain smart contract editor resource files and corresponding blockchain smart contract editor version files; In response to the initialization command from the blockchain smart contract editor browser, the version file is sent to the browser so that the browser can obtain and load the version file. After obtaining and loading the version file, the browser generates a selector function for parsing the version file and caching the resource file. The selector function works as follows: when no selected version is specified as a parameter of the selector function, it parses and returns all version information; when a selected version is specified as a parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser; if it is not cached locally, it sends a request to the server based on the selected version. In response to the browser's instruction to load the corresponding resource file based on the version number, the resource file is sent to the browser.

7. The method according to claim 6, characterized in that, The version file and the resource file are stored in the same directory on the server.

8. The method according to claim 7, characterized in that, The version file is described using a JSON data exchange format, which includes the version number of the blockchain smart contract editor and the resource file name of the blockchain smart contract editor that corresponds to the version number.

9. The method according to claim 8, characterized in that, The resource file name of the blockchain smart contract editor includes the version number of the blockchain smart contract editor and the hash value calculated by the cryptographic hash function algorithm of the blockchain smart contract editor resource file.

10. The method according to claim 6, characterized in that, It also includes regenerating the version file and pushing it to the browser when the resource file stored on the server is updated, so that the browser can read the updated resource file according to the version file cache.

11. A method for managing files in a blockchain smart contract editor within a WebIDE, characterized in that, The blockchain smart contract editor includes a browser client and a server client, and is applied to the browser client, including: The blockchain smart contract editor is initialized, and a version file is obtained and loaded from the server. After the browser obtains and loads the version file, a selector function is generated to parse the version file and cache resource files. The selector function works as follows: when no selected version is specified as a parameter, all version information is parsed and returned; when a selected version is specified as a parameter, the selector function first searches for and reads the cached resource file locally on the browser; if it is not cached locally, a request to obtain it is sent to the server according to the selected version. Based on the selected version number of the blockchain smart contract editor, check whether the resource file corresponding to the selected version number has been cached locally; If the resource file corresponding to the version number is not cached locally, the corresponding resource file is retrieved from the server based on the version number and loaded.

12. The method according to claim 11, characterized in that, After obtaining and loading the version file, a selector function is generated for parsing the version file and caching the resource file.

13. The method according to claim 12, characterized in that, The selector function works as follows: When no selected version is specified as a parameter of the selector function, parse and return all version information; When a selected version is specified as a parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser side; If the local cache is not yet available, a retrieval request is sent to the server based on the selected version.

14. A file management device for a blockchain smart contract editor in a WebIDE, characterized in that, The blockchain smart contract editor includes a browser-side and a server-side, including: The first module is used to generate a blockchain smart contract editor resource file and a corresponding blockchain smart contract editor version file on the server side. The second module is used for initializing the blockchain smart contract editor on the browser side and obtaining and loading the version file from the server side. After obtaining and loading the version file, the browser side generates a selector function for parsing the version file and caching the resource file. The selector function works as follows: when no selected version is specified as the parameter of the selector function, it parses and returns all version information; when a selected version is specified as the parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser side; if it is not cached locally, it sends a request to the server side according to the selected version. The third module is used by the browser to check whether the resource file corresponding to the selected version number of the blockchain smart contract editor has been cached locally. The fourth module is used to retrieve and load the corresponding resource file from the server based on the version number if the browser does not cache the resource file corresponding to the version number locally.

15. The apparatus according to claim 14, characterized in that, It also includes a fifth module, which is used to regenerate the version file and push it to the browser when the resource file stored on the server is updated, so that the browser can read the updated resource file according to the version file cache.

16. A file management device for a blockchain smart contract editor in a WebIDE, characterized in that, The blockchain smart contract editor includes a browser side and a server side, and is applied to the server side, including: The first module is used to generate blockchain smart contract editor resource files and corresponding blockchain smart contract editor version files; The second module is used to respond to the initialization command of the blockchain smart contract editor browser by sending the version file to the browser so that the browser can obtain and load the version file. After the browser obtains and loads the version file, it generates a selector function for parsing the version file and caching the resource file. The selector function works as follows: when no selected version is specified as the parameter of the selector function, it parses and returns all version information; when a selected version is specified as the parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser; if it is not cached locally, it sends a request to the server according to the selected version. The third module is used to respond to the instruction from the browser to load the corresponding resource file according to the version number and send the resource file to the browser.

17. The apparatus according to claim 16, characterized in that, It also includes a fourth module, which is used to regenerate the version file and push it to the browser when the resource file is updated, so that the browser can read the updated resource file according to the version file cache.

18. A file management device for a blockchain smart contract editor in a WebIDE, characterized in that, The blockchain smart contract editor includes a browser client and a server client, and is applied to the browser client, including: The first module is used to initialize the blockchain smart contract editor and obtain and load the version file from the server. After the browser obtains and loads the version file, it generates a selector function for parsing the cached resource file of the version file. The selector function works as follows: when no selected version is specified as the parameter of the selector function, it parses and returns all version information; when a selected version is specified as the parameter of the selector function, the selector function first searches for and reads the cached resource file locally on the browser; if it is not cached locally, it sends a request to the server according to the selected version. The second module is used to search locally for whether a resource file corresponding to the selected version number of the blockchain smart contract editor has been cached based on the selected version number. The third module is used to retrieve and load the corresponding resource file from the server based on the version number if the resource file corresponding to the version number is not cached locally.

19. A WebIDE blockchain smart contract editor, including a file management module, characterized in that, The file management module includes a browser client and a server client, wherein, The server generates a blockchain smart contract editor resource file and a corresponding version file for the blockchain smart contract editor. In response to an initialization command from the browser side of the blockchain smart contract editor, the server sends the version file to the browser side, enabling the browser side to obtain and load the version file. After obtaining and loading the version file, the browser side generates a selector function for parsing the version file and caching the resource file. The selector function's operation includes: when no selected version is specified as a parameter, parsing and returning all version information; when a selected version is specified as a parameter, the selector function first searches for and reads the cached resource file locally on the browser side; if it is not cached locally, it sends a request to the server side based on the selected version; in response to the browser side's command to load the corresponding resource file according to the version number, the server sends the resource file to the browser side. The browser initializes the blockchain smart contract editor and retrieves and loads the version file from the server. Based on the selected version number of the blockchain smart contract editor, it checks whether the resource file corresponding to the selected version number is cached locally. If the resource file corresponding to the version number is not cached locally, the browser retrieves and loads the corresponding resource file from the server based on the version number.

20. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 1 to 5.

21. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 6 to 10.

22. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 11 to 13.

23. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 1 to 5.

24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 6 to 10.

25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 11 to 13.