Blockchain usage method, system, device, and storage medium
By using universal resource path identifiers and identity authentication mechanisms, the complexity of blockchain operations is solved, enabling convenient access and simplified processes, lowering the learning threshold, and expanding the popularization of blockchain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- IFLYTEK CO LTD
- Filing Date
- 2023-12-14
- Publication Date
- 2026-06-12
AI Technical Summary
The lack of visual products for blockchain technology makes it complex for users to operate, has a high learning curve, and cannot be used uniformly, resulting in slow adoption and high costs.
It adopts a universal resource path identifier, including chain ID, operation value and parameter list, to quickly locate and call blockchain resources by identifying the resource path identifier, supports identity authentication and simplifies the operation process.
It reduces the learning cost for users, simplifies the blockchain usage process, enables convenient access to resources such as blocks, transactions, and contracts, and expands the applicable scenarios of blockchain.
Smart Images

Figure CN117743333B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and more specifically, to a method, system, device, and storage medium for using blockchain. Background Technology
[0002] With the popularization of blockchain and the rise of various blockchain technologies, blockchain is increasingly coming into the view of ordinary users. However, the technology itself is relatively abstract, and the lack of visual products to provide a good browsing and user experience severely restricts the speed at which blockchain technology is adopted by ordinary users. At the same time, the absence of a unified blockchain usage system means that users need to use different systems for different blockchains, increasing the overall barrier to entry and cost of using blockchain.
[0003] The current blockchain usage system operates as follows: users first need to open the corresponding blockchain usage system based on the blockchain information. Then, depending on the type of resource accessed (e.g., blocks, contracts, transactions), they enter the corresponding subsystem's block browsing, contract browsing, or transaction browsing functions. After entering the corresponding function, users browse or use the blockchain based on information such as block hash, transaction hash, and contract address. The entire process requires users to understand the internal resource concepts of the blockchain and access the corresponding sub-function interfaces according to their needs. The learning curve is relatively high, and depending on the type of resource accessed, users need to navigate through different function pages, making the operation process cumbersome. Summary of the Invention
[0004] In view of the above problems, this application is proposed to provide a method, system, device, and storage medium for using blockchain, so as to reduce the learning threshold for users to use various types of resources in the blockchain and simplify the operation process. The specific solution is as follows:
[0005] Firstly, it provides a method for using blockchain, including:
[0006] Obtain the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed in.
[0007] Identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value;
[0008] Select to enter the blockchain network corresponding to the chain ID, and perform the processing operation corresponding to the operation value according to the type of the operation value, and output the processing result.
[0009] Preferably, when the resource path identifier also includes the parameter list, then the parameter list is obtained after identifying the resource path identifier.
[0010] Preferably, the chain ID and the operation value in the resource path identifier are separated by a first delimiter, and when the resource path identifier contains the parameter list, the operation value and the parameter list are separated by a second delimiter. The parameter list includes at least one key-value pair, and when the parameter list contains more than two key-value pairs, adjacent key-value pairs are separated by a third delimiter.
[0011] Preferably, the operation value includes two types: a first type representing a block hash, transaction hash, or smart contract address, and a second type representing a block height;
[0012] The process of performing a processing operation corresponding to the operation value based on the type of the operation value includes:
[0013] When it is determined that the operation value belongs to the first type, if the resource path identifier does not contain the parameter list, then it is determined that the operation value represents a block hash or transaction hash type, and the block or transaction corresponding to the operation value is queried.
[0014] When it is determined that the operation value belongs to the first type, if the resource path identifier contains the parameter list, then it is determined that the operation value represents a smart contract address type, the smart contract corresponding to the operation value is called, and the called smart contract is processed according to the parameter list;
[0015] When it is determined that the operation value belongs to the second type, the block corresponding to the operation value is queried.
[0016] Preferably, the operation value further includes: a third type representing the blockchain domain name, wherein there is a mapping relationship between the blockchain domain name and the block hash, transaction hash, or smart contract address;
[0017] The process of performing a processing operation corresponding to the operation value based on the type of the operation value further includes:
[0018] When it is determined that the operation value belongs to the third type, the domain name resolution system is invoked to perform domain name resolution on the operation value, and the corresponding processing operation is performed according to the resolution result.
[0019] Preferably, when the resource path identifier includes the parameter list, the resource path identifier, from left to right, consists of the chain ID, the first separator, the operation value, the second separator, and the parameter list;
[0020] The chain ID is composed of any one or more combinations of numbers, letters, and underscores;
[0021] The first type of operation value begins with a first character combination, followed by a hexadecimal value;
[0022] The second type of operation value consists of pure decimal numbers;
[0023] The third type of operation value consists of letters, numbers, and underscores, and contains one or more periods.
[0024] Preferably, the process of determining the type of the identified operation value includes:
[0025] If the identified operation value begins with the first character combination, then the operation value is determined to be of the first type;
[0026] If the identified operation value is a pure number, then the operation value is determined to be of the second type;
[0027] If the identified operation value contains ".", then the operation value is determined to be the third type.
[0028] Preferably, during the execution of the processing operation corresponding to the operation value, if it is detected that identity verification is required, the current user's identity is verified through one or more identity verification mechanisms, and the user's locally hosted blockchain key is invoked for signature authentication only when the verification result is valid.
[0029] Secondly, a blockchain usage system is provided, including:
[0030] The resource path identifier acquisition unit is used to acquire the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity identifier of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the parameter key-value pairs to be passed in.
[0031] A resource path identifier identification unit is used to identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value;
[0032] The resource processing and result output unit is used to select the blockchain network corresponding to the chain ID, and according to the type of the operation value, perform the processing operation corresponding to the operation value, and output the processing result.
[0033] Thirdly, a blockchain-using device is provided, including: a memory and a processor;
[0034] The memory is used to store programs;
[0035] The processor is used to execute the program to implement the various steps of the blockchain usage method as described above.
[0036] Fourthly, a storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the various steps of the blockchain usage method as described above.
[0037] Fifthly, a computer program product is provided, which is tangibly stored in a non-transient computer storage medium and includes machine-executable instructions that, when executed by a device, implement the various steps of the blockchain usage method described in any of the first aspects of this application.
[0038] By employing the above technical solution, this application designs a universal blockchain resource path identifier. The resource path identifier includes at least a chain ID and an operation value. Furthermore, a parameter list can be added to the resource path identifier according to different user requests. The chain ID represents the blockchain's identity, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed. Users can request corresponding block resources through the resource path identifier. This application identifies the corresponding resource path identifier, obtains the chain ID and operation value, determines the type of the identified operation value, selects the blockchain network corresponding to the chain ID, and executes the processing operation corresponding to the operation value based on its type, outputting the processing result. Using the solution of this application, blockchain resources can be quickly located, opened, and invoked through the resource path identifier, enabling convenient use of various blockchain resources such as blocks, transactions, and contracts. This reduces the user's learning cost and eliminates the need for users to navigate to different function pages depending on the resource being accessed, simplifying the blockchain usage process. Attached Figure Description
[0039] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0040] Figure 1 A flowchart illustrating a blockchain usage method provided in an embodiment of this application;
[0041] Figure 2 Another schematic diagram of the blockchain usage method provided in the embodiments of this application;
[0042] Figure 3A schematic diagram of a user query smart contract display interface provided in an embodiment of this application;
[0043] Figure 4 A schematic diagram of a display interface for two-factor authentication when a user invokes a smart contract, provided as an embodiment of this application;
[0044] Figure 5 This application provides a schematic diagram of a blockchain usage system architecture as an embodiment.
[0045] Figure 6 This is a schematic diagram of the structure of a blockchain device provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] This application relates to the application of blockchain technology, including browsing, querying, and invoking smart contracts. It proposes a method for conveniently accessing various blockchain resources, such as blocks, transactions, and contracts, using a universal resource path identifier. This method allows for quick location, opening, and invocation of blockchain resources, supports blockchain user authentication, and can be widely integrated with blockchain browsers, blockchain search engines, blockchain verifiers, blockchain contract invocation systems, and other blockchain application systems.
[0048] The proposed solution can be implemented based on a terminal with data processing capabilities, such as a mobile phone, computer, server, cloud, wearable device, etc.
[0049] Next, combined Figure 1 The blockchain usage method described in this application may include the following steps:
[0050] Step S100: Obtain the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list.
[0051] This embodiment provides a generic blockchain resource path identifier for encoding blockchain usage information. The resource path identifier includes at least a chain ID and an operation value. Furthermore, it may also include a parameter list.
[0052] Wherein, the chain ID represents the identity identifier of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed in.
[0053] Users can manually enter the resource path identifier of the blockchain resource they wish to request, or they can obtain the resource path identifier of the blockchain resource corresponding to the link they clicked from this application.
[0054] The chain ID, operation value, and parameter list in the resource path identifier are represented by the set rules.
[0055] Step S110: Identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value.
[0056] Specifically, by identifying the resource path identifier, the various types of information contained within it can be obtained, including at least the chain ID and operation value. Furthermore, if the resource path identifier also contains a parameter list, the parameter list can be obtained after identifying the resource path identifier.
[0057] Furthermore, the operation value in the resource path identifier can have a variety of different types, for example, it can include a first type representing a block hash, transaction hash, or smart contract address, and a second type representing a block height.
[0058] In some embodiments of this application, considering that smart contract addresses and hash values are difficult to remember, resource path identifiers are difficult to transmit through normal text, and are inconvenient to reference and anchor within blockchain smart contracts, in order to further simplify resource path identifiers, blockchain domain names can also be used. That is, the operation value can also include a third type representing the blockchain domain name. There is a mapping relationship between the blockchain domain name and the smart contract address after the block hash and transaction hash. The expression is more concise, ensuring that it can carry information while being more concise and easy to read.
[0059] Since there are many different types of operation values, after identifying the operation value in this step, we can further determine the type of the operation value, so that different processing operations can be performed for different types of operation values in subsequent steps.
[0060] Step S120: Select the blockchain network corresponding to the chain ID, and perform the processing operation corresponding to the operation value according to the type of the operation value, and output the processing result.
[0061] Specifically, after identifying the chain ID, the system can select and enter the corresponding blockchain network based on the chain ID. Furthermore, depending on the type of operation value, the system executes the processing operation corresponding to the identified operation value and outputs the processing result.
[0062] This application presents a general blockchain resource path identifier. The resource path identifier includes at least a chain ID and an operation value. Furthermore, a parameter list can be added to the resource path identifier based on different user requests. The chain ID represents the blockchain's identity, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed. Users can request corresponding block resources through the resource path identifier. This application identifies the corresponding resource path identifier, obtains the chain ID and operation value, determines the type of the identified operation value, selects the blockchain network corresponding to the chain ID, and executes the processing operation corresponding to the operation value based on its type, outputting the processing result. Using this solution, blockchain resources can be quickly located, opened, and invoked through the resource path identifier, enabling convenient use of various blockchain resources such as blocks, transactions, and contracts. This reduces the user's learning cost and eliminates the need for users to navigate to different function pages depending on the resource being accessed, simplifying the blockchain usage process.
[0063] In some embodiments of this application, resource path identifiers are described in detail.
[0064] To facilitate the identification of various types of information in resource path identifiers, resource path identifiers can be designed according to the following rules:
[0065] From left to right, the sequence consists of the chain ID, the operation value, and the parameter list (it should be noted that the parameter list is optional, meaning that the resource path identifier obtained in step S100 may or may not include the parameter list). Furthermore, the chain ID and the operation value can be separated by a first delimiter, and the operation value and the parameter list can be separated by a second delimiter.
[0066] For a parameter list, if it contains more than two key-value pairs, adjacent key-value pairs can be separated by a third delimiter.
[0067] The resource path identifier can be expressed in the following format:
[0068] Chain ID: / / operation value? parameter1 = value1 & parameter2 = value2…
[0069] In the example format above, the first separator is ": / / ", the second separator is "?", and the third separator is "&". Of course, the above format is only one optional setting method, and those skilled in the art can also choose other forms of separators.
[0070] Referring to Table 1 below, a detailed explanation of each parameter in the resource path identifier of the above format is provided:
[0071] Table 1
[0072]
[0073]
[0074] The examples of operand values in the table above include three types. The first type of operand value begins with 0x, followed by a hexadecimal value. It is understood that "0x" is only one optional example, and those skilled in the art can also choose other character combinations (defined as the first character combination) as the beginning, and the value following it can be hexadecimal or a value using other bases.
[0075] Taking into account the characteristics of various types of data in resource path identifiers, the above embodiments of this application provide the editing rules shown in Table 2, which is a preferred setting method.
[0076] This embodiment provides several complete examples of resource path identifiers:
[0077] Example 1:
[0078] chain01: / / 0x9896e531d86e1f791c77bd20546d6c5c84d2a619a2
[0079] Example 2:
[0080] chain02: / / hello.sol? method=set&value=abc
[0081] Example 3:
[0082] chain03: / / 123
[0083] Based on the foregoing embodiments, it is known that there are many different types of operation values. Therefore, the process of determining the type of the identified operation value in step S110 may include:
[0084] If the identified operation value begins with the first character combination, then the operation value is determined to be of the first type.
[0085] Specifically, when using the editing rules shown in Table 1 above, the first character combination is "0x".
[0086] If the identified operation value is purely numeric, then the operation value is determined to be of the second type.
[0087] Specifically, when using the editing rules shown in Table 1 above, if the operation value is a pure number, it indicates that it is the block height, which is the second type of operation value.
[0088] If the identified operation value contains ".", then the operation value is determined to be the third type.
[0089] Specifically, when using the editing rules shown in Table 1 above, if the operation value contains ".", it means that the operation value is a blockchain domain name, i.e., the third type of operation value.
[0090] Further, step S120, which involves performing a processing operation corresponding to the operation value based on its type, may include:
[0091] When it is determined that the operation value belongs to the first type, if the resource path identifier does not contain a parameter list, it is determined that the operation value represents a block hash or transaction hash type, and then the block or transaction corresponding to the operation value is queried.
[0092] It should be noted that, generally, for block hashes and transaction hashes, only browsing functionality is provided; editing or other processing is not possible. Therefore, when requesting this type of blockchain resource, users only need to enter the block hash or transaction hash, without needing to provide a parameter list. Based on this, in this step, if it is determined that the operation value is of the first type and the resource path identifier does not contain a parameter list, then it can be determined that the current operation value represents a block hash or transaction hash type. Furthermore, the block or transaction corresponding to this operation value can be queried (the values of block hashes and transaction hashes are unique; that is, the current operation value can only be one of block hashes and transaction hashes).
[0093] When it is determined that the operation value belongs to the first type, if the resource path identifier contains the parameter list, then it is determined that the operation value represents a smart contract address type, the smart contract corresponding to the operation value is called, and the called smart contract is processed according to the parameter list.
[0094] As mentioned earlier, users can browse and invoke smart contracts. Invoking a smart contract requires passing a specific list of parameters. Therefore, if the operation value is determined to be of type 1 and the resource path identifier also contains a parameter list, the current operation value can be identified as a smart contract address type. This allows the smart contract corresponding to the operation value to be invoked, and the invoked smart contract can be processed according to the parameter list.
[0095] When it is determined that the operation value belongs to the second type, the block corresponding to the operation value is queried.
[0096] Specifically, when the operation value is determined to be of the second type, it means that the operation value is the block height, so the block corresponding to the operation value can be queried.
[0097] Furthermore, when the operation value is determined to belong to the third type, it indicates that the operation value is a blockchain domain name. Therefore, the domain name resolution system can be invoked to perform domain name resolution on the operation value. The resolution result contains key information such as the specific value, value type, and corresponding parameters. The corresponding processing operation is then executed based on the resolution result.
[0098] In some embodiments of this application, existing blockchain browsing systems, lacking user authentication, can only support querying and browsing blocks, transactions, and smart contracts, and cannot perform more sensitive blockchain operations, such as smart contract calls, severely limiting the applicable scenarios of blockchain. To solve this problem, embodiments of this application provide a blockchain identity authentication mechanism, offering users more diverse functions.
[0099] Reference Figure 2 It illustrates another blockchain usage process, such as... Figure 2 As shown, the method may include:
[0100] Step S200: Obtain the resource path identifier of the blockchain resource requested by the user.
[0101] Step S210: Identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value.
[0102] Step S220: Select the blockchain network corresponding to the chain ID, and perform the processing operation corresponding to the operation value according to the type of the operation value.
[0103] The steps S200-S220 described above correspond one-to-one with steps S100-S120 in the aforementioned embodiments. Please refer to the previous description for details, which will not be repeated here.
[0104] Step S230: Determine whether user identity verification is required based on the system processing return. If yes, proceed to step S240; otherwise, proceed to step S260.
[0105] Specifically, during the processing, the system can determine whether user authentication is required based on the results returned by the system.
[0106] Step S240: Verify the legitimacy of the current user's identity through one or more authentication mechanisms. If the identity is legitimate, proceed to step S250.
[0107] Specifically, when identity verification is required, the current user's identity can be verified using one or more authentication mechanisms, such as password, voiceprint, face, palmprint, fingerprint, or iris recognition. If the verification result is valid, step S250 is executed; if the verification result is invalid, processing can be stopped and an alarm message is output.
[0108] Step S250: Use the blockchain key hosted locally by the user for signature authentication.
[0109] Specifically, users' blockchain keys require highly confidentiality. This application supports storing users' blockchain keys locally, ensuring that the keys will not be illegally stolen by others during transmission and storage on the server. Furthermore, a two-factor authentication process is performed before accessing the local blockchain key to ensure its security. After successful two-factor authentication, the local blockchain key is used for signature authentication, thereby completing sensitive blockchain operations such as smart contract calls.
[0110] Step S260: Display the final blockchain browsing or usage results.
[0111] Specifically, the blockchain usage system displays the final blockchain browsing or usage results based on the processing results of the aforementioned steps.
[0112] The blockchain usage method provided in this embodiment can automatically determine whether user authentication is required based on the resource path identifier processing procedure, and use two-factor authentication to ensure the security of the blockchain key hosted locally by the user. On this basis, some more sensitive blockchain operations can be implemented, such as smart contract invocation.
[0113] See Figure 3 , Figure 3 This example demonstrates a user interface for querying smart contracts. A query input box can be provided in the blockchain system, allowing users to manually enter or copy and paste the resource path identifier they wish to query. Figure 3 The example demonstrates how users can query smart contracts by displaying blockchain resource information corresponding to resource path identifiers on the interface, such as contract interfaces and contract code.
[0114] Furthermore, if a user triggers the "Execute Contract" control, it indicates that the user wants to invoke the smart contract. At this point, user identity verification is required, and the user can be redirected to... Figure 4 The interface shown pops up a dialog box for secondary user authentication, prompting the user to use one or more authentication mechanisms for secondary verification. After successful verification, the user can use a local key for signature authentication, thereby enabling the invocation of smart contracts and ensuring the security of user information.
[0115] The blockchain usage system provided in the embodiments of this application is described below. The blockchain usage system described below can be referred to in correspondence with the blockchain usage method described above.
[0116] See Figure 5 , Figure 5 This is a schematic diagram of a blockchain usage system structure disclosed in an embodiment of this application.
[0117] like Figure 5 As shown, the system may include:
[0118] The resource path identifier acquisition unit 11 is used to acquire the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity identifier of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the parameter key-value pairs to be passed in.
[0119] Resource path identifier identification unit 12 is used to identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value;
[0120] The resource processing and result output unit 13 is used to select the blockchain network corresponding to the chain ID, and according to the type of the operation value, perform the processing operation corresponding to the operation value, and output the processing result.
[0121] Optionally, if the resource path identifier obtained by the resource path identifier acquisition unit also includes the parameter list, then the resource path identifier recognition unit will also obtain the parameter list after recognizing the resource path identifier.
[0122] Optionally, the chain ID and the operation value in the resource path identifier are separated by a first delimiter, and when the resource path identifier contains the parameter list, the operation value and the parameter list are separated by a second delimiter. The parameter list includes at least one key-value pair, and when the parameter list contains more than two key-value pairs, adjacent key-value pairs are separated by a third delimiter.
[0123] Optionally, the operation value includes two types: a first type representing a block hash, transaction hash, or smart contract address, and a second type representing a block height. Based on this, the resource processing and result output unit performs the processing operation corresponding to the operation value according to its type, including:
[0124] When it is determined that the operation value belongs to the first type, if the resource path identifier does not contain the parameter list, then it is determined that the operation value represents a block hash or transaction hash type, and the block or transaction corresponding to the operation value is queried.
[0125] When it is determined that the operation value belongs to the first type, if the resource path identifier contains the parameter list, then it is determined that the operation value represents a smart contract address type, the smart contract corresponding to the operation value is called, and the called smart contract is processed according to the parameter list;
[0126] When it is determined that the operation value belongs to the second type, the block corresponding to the operation value is queried.
[0127] Furthermore, the operation value may also include: a third type representing a blockchain domain name, wherein there is a mapping relationship between the blockchain domain name and a block hash, transaction hash, or smart contract address, and the resource processing and result output unit performs the processing operation corresponding to the operation value according to the type of the operation value, further including:
[0128] When it is determined that the operation value belongs to the third type, the domain name resolution system is invoked to perform domain name resolution on the operation value, and the corresponding processing operation is performed according to the resolution result.
[0129] Optionally, when the resource path identifier includes the parameter list, the resource path identifier, from left to right, consists of the chain ID, the first delimiter, the operation value, the second delimiter, and the parameter list.
[0130] The chain ID is composed of any one or more combinations of numbers, letters, and underscores;
[0131] The first type of operation value begins with a first character combination, followed by a hexadecimal value;
[0132] The second type of operation value consists of pure decimal numbers;
[0133] The third type of operation value consists of letters, numbers, and underscores, and contains one or more periods.
[0134] Optionally, the process by which the resource path identifier identification unit determines the type of the identified operation value includes:
[0135] If the identified operation value begins with the first character combination, then the operation value is determined to be of the first type;
[0136] If the identified operation value is a pure number, then the operation value is determined to be of the second type;
[0137] If the identified operation value contains ".", then the operation value is determined to be the third type.
[0138] Optionally, the system of this application may also include:
[0139] The key invocation unit is used to verify the legitimacy of the current user's identity through one or more authentication mechanisms if it detects that identity verification is required during the execution of the processing operation corresponding to the operation value, and only invokes the blockchain key hosted locally by the user for signature authentication if the verification result is legitimate.
[0140] The blockchain application system provided in this application can be applied to blockchain application devices, such as mobile phones, computers, servers, cloud computing, wearable devices, etc. Optionally, Figure 6 A hardware structure block diagram of a device used in blockchain is shown, with reference to... Figure 6 The hardware structure of a blockchain device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0141] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0142] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0143] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0144] The memory stores a program, which the processor can call. The program is used for:
[0145] Obtain the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed in.
[0146] Identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value;
[0147] Select to enter the blockchain network corresponding to the chain ID, and perform the processing operation corresponding to the operation value according to the type of the operation value, and output the processing result.
[0148] Optionally, the refined and extended functions of the program can be found in the description above.
[0149] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:
[0150] Obtain the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed in.
[0151] Identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value;
[0152] Select to enter the blockchain network corresponding to the chain ID, and perform the processing operation corresponding to the operation value according to the type of the operation value, and output the processing result.
[0153] Optionally, the refined and extended functions of the program can be found in the description above.
[0154] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, 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.
[0155] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0156] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for using blockchain, characterized in that, include: Obtain the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the key-value pairs of parameters to be passed in. Identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value; Select to enter the blockchain network corresponding to the chain ID, and according to the type of the operation value, perform the processing operation corresponding to the operation value, and output the processing result; The operation value includes three types: a first type representing a block hash, transaction hash, or smart contract address; a second type representing a block height; and a third type representing a blockchain domain name. There is a mapping relationship between the blockchain domain name and the block hash, transaction hash, or smart contract address. The process of performing a processing operation corresponding to the operation value based on the type of the operation value includes: When it is determined that the operation value belongs to the first type, if the resource path identifier does not contain the parameter list, then it is determined that the operation value represents a block hash or transaction hash type, and the block or transaction corresponding to the operation value is queried. When it is determined that the operation value belongs to the first type, if the resource path identifier contains the parameter list, then it is determined that the operation value represents a smart contract address type, the smart contract corresponding to the operation value is called, and the called smart contract is processed according to the parameter list; When it is determined that the operation value belongs to the second type, the block corresponding to the operation value is queried.
2. The method according to claim 1, characterized in that, If the resource path identifier also includes the parameter list, then the parameter list is obtained after identifying the resource path identifier.
3. The method according to claim 1, characterized in that, The chain ID and the operation value in the resource path identifier are separated by a first delimiter, and when the resource path identifier contains the parameter list, the operation value and the parameter list are separated by a second delimiter. The parameter list includes at least one key-value pair, and when the parameter list contains more than two key-value pairs, adjacent key-value pairs are separated by a third delimiter.
4. The method according to claim 3, characterized in that, The process of performing a processing operation corresponding to the operation value based on the type of the operation value further includes: When it is determined that the operation value belongs to the third type, the domain name resolution system is invoked to perform domain name resolution on the operation value, and the corresponding processing operation is performed according to the resolution result.
5. The method according to claim 4, characterized in that, When the resource path identifier contains the parameter list, the resource path identifier, from left to right, is the chain ID, the first delimiter, the operation value, the second delimiter, and the parameter list; The chain ID is composed of any one or more combinations of numbers, letters, and underscores; The first type of operation value begins with a first character combination, followed by a hexadecimal value; The second type of operation value consists of pure decimal numbers; The third type of operation value consists of letters, numbers, and underscores, and contains one or more ".".
6. The method according to claim 5, characterized in that, The process of determining the type of the identified operation value includes: If the identified operation value begins with the first character combination, then the operation value is determined to be of the first type; If the identified operation value is a pure number, then the operation value is determined to be of the second type; If the identified operation value contains ".", then the operation value is determined to be the third type.
7. The method according to any one of claims 1-6, characterized in that, During the execution of the processing operation corresponding to the operation value, if it is detected that identity verification is required, the current user's identity is verified through one or more identity verification mechanisms. Only when the verification result is valid will the user's locally hosted blockchain key be invoked for signature authentication.
8. A blockchain usage system, characterized in that, include: The resource path identifier acquisition unit is used to acquire the resource path identifier of the blockchain resource requested by the user. The resource path identifier includes at least the chain ID, the operation value, and the parameter list. The chain ID represents the identity identifier of the blockchain, the operation value represents the identifier of the requested block resource, and the parameter list represents the parameter key-value pairs to be passed in. A resource path identifier identification unit is used to identify the resource path identifier, obtain at least the chain ID and the operation value, and determine the type of the identified operation value; The resource processing and result output unit is used to select the blockchain network corresponding to the chain ID, and according to the type of the operation value, execute the processing operation corresponding to the operation value, and output the processing result; The operation value includes three types: a first type representing a block hash, transaction hash, or smart contract address; a second type representing a block height; and a third type representing a blockchain domain name. There is a mapping relationship between the blockchain domain name and the block hash, transaction hash, or smart contract address. The process by which the resource processing and result output unit performs a processing operation corresponding to the operation value based on the type of the operation value includes: When it is determined that the operation value belongs to the first type, if the resource path identifier does not contain the parameter list, then it is determined that the operation value represents a block hash or transaction hash type, and the block or transaction corresponding to the operation value is queried. When it is determined that the operation value belongs to the first type, if the resource path identifier contains the parameter list, then it is determined that the operation value represents a smart contract address type, the smart contract corresponding to the operation value is called, and the called smart contract is processed according to the parameter list; When it is determined that the operation value belongs to the second type, the block corresponding to the operation value is queried.
9. A blockchain application device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the various steps of the blockchain usage method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the various steps of the blockchain usage method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Interface configuration processing method and device based on block chain, equipment and storage medium
CN110535971A
Data processing method and device of block chain browser
CN111078723A