Data processing method and device based on block chain, storage medium and electronic equipment
By standardizing asset metadata and smart contract processing on the blockchain, combining cross-chain mapping and multi-signature mechanisms, the problems of high user threshold, poor compatibility and low efficiency in blockchain game asset data processing are solved, and the problem of high user threshold, poor compatibility and low efficiency in blockchain game asset data processing is achieved. Efficient and secure interoperability of cross-platform game asset data.
Patent Information
- Application Number
- CN202411317402.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-10
AI Technical Summary
The existing blockchain game asset data processing methods have problems such as high user threshold, poor compatibility and low efficiency. Especially when data interactions between different game platforms, complex negotiation and unified data formats are required, resulting in low processing efficiency. And the safety risk is high.
By entering asset metadata in the user interface, converting and verifying according to pre-set specifications and formats, calling smart contract functions to perform asset creation and processing operations on the blockchain, realizing cross-platform game asset data processing, and introducing cross-chain Asset mapping and multi-signature mechanisms for security.
It reduces the complexity of user operations, improves data processing efficiency and compatibility, enhances the transparency and security of the transaction process, and ensures that the assets of different game platforms can be interoperable and interchangeable.
Smart Images

Figure CN119106090A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based data processing method, device, storage medium and electronic device. Background Art
[0002] With the rapid development of the Internet and the gaming industry, more and more players are participating in games of different platforms and types, which has increased the value of processing game asset data, such as virtual item data, prop data, currency data, etc. However, due to the lack of unified standards among major gaming platforms, it is difficult to share and circulate game asset data between different gaming platforms. If asset data processing is required between different games, it is necessary to rely on a third-party platform, which not only makes the processing cost of game asset data high, but also poses a greater security risk.
[0003] Blockchain is a decentralized distributed ledger technology that uses cryptography to achieve functions such as information addressing, verification, storage and transaction through a peer-to-peer blockchain network. With its decentralized, transparent, traceable and tamper-proof characteristics, it is widely used in smart contract transactions including encrypted asset data processing, thereby using blockchain technology to achieve shared management and processing of game asset data across game platforms.
[0004] In related technologies, the game asset platform based on blockchain technology mainly realizes cross-platform processing of game asset data through the following methods:
[0005] For blockchain game asset platforms such as Enjin and WAX, by providing software development kits (SDK, Software Development Kit) and application programming interfaces (API, Application Programming Interface), users can process on the blockchain, such as creating, managing and trading game asset data. For blockchain game asset platforms such as Uniswap and OpenSea, based on cross-chain protocols and using smart contract technology on the blockchain, users can process different game asset data in decentralized exchanges.
[0006] Although the above-mentioned blockchain-based game asset data processing method has achieved cross-platform processing of game asset data to a certain extent, it still has the following shortcomings:
[0007] 1. High user threshold: Blockchain technology and decentralized exchanges in related technologies require both parties to negotiate in advance and use the same data format when interacting with game asset data. The operation is relatively complicated and the technical threshold is high, which prevents many users from processing game asset data, resulting in low data processing efficiency and affecting the user experience.
[0008] 2. Poor compatibility of game asset data: Different game platforms have different asset data types and standards, and lack unified specifications, resulting in low compatibility in cross-platform game asset data processing.
[0009] 3. Low efficiency in asset data processing: Due to the performance limitations of the blockchain platform, the speed of interaction processing is slow, especially when the network is congested, which may lead to processing, for example, long transaction confirmation time, affecting the user experience. Summary of the invention
[0010] In view of this, the present invention provides a data processing method, device, storage medium and electronic device based on blockchain.
[0011] Specifically, the present invention is achieved through the following technical solutions:
[0012] According to a first aspect of the present invention, a data processing method based on blockchain is provided, and the data processing method based on blockchain includes:
[0013] The asset metadata input through the user interface is converted into standardized format asset metadata according to the preset metadata specifications and formats;
[0014] Call the asset creation API and the asset management contract function in the smart contract to generate an asset identifier based on the standardized format asset metadata;
[0015] Call the asset creation function of the smart contract so that the asset creation function performs the asset creation operation on the blockchain based on the asset metadata and asset identifier in the standardized format;
[0016] Receive an asset data processing request, and standardize and format the asset data carried in the asset data processing request according to the pre-set asset data specification;
[0017] According to the source user and destination user corresponding to the asset data processing type in the asset data processing request, the asset management contract function of the smart contract is called to construct the asset data processing request;
[0018] The asset data processing request is sent to the blockchain so that the blockchain calls the asset exchange contract function of the smart contract and performs asset data processing based on the asset data of the source user and the asset data of the destination user.
[0019] The conversion into a standardized format asset metadata according to the preset metadata specification and format includes:
[0020] According to the preset metadata structure specification, the asset metadata is normalized to obtain normalized asset metadata;
[0021] Verify the integrity and validity of the standardized asset metadata according to the pre-set metadata verification specifications;
[0022] According to a preset data format, the format of the normalized asset metadata that has passed the verification is converted to obtain the normalized format asset metadata, and the normalized format asset metadata is stored.
[0023] Optionally, storing the asset metadata in a standardized format includes:
[0024] The standardized format asset metadata is encrypted using the Advanced Encryption Standard encryption algorithm, and the encrypted standardized format asset metadata is stored in the blockchain.
[0025] Optionally, sending the asset data processing request to the blockchain includes:
[0026] The asset data processing request is encrypted using the transport layer security protocol encryption algorithm, and the encrypted asset data processing request is sent to the blockchain.
[0027] Optionally, the asset data processing based on the asset data of the source user and the asset data of the destination user includes:
[0028] According to the exchange ratio corresponding to the asset data processing request described in the smart contract, determine whether the resources to be exchanged in the source user's asset data meet the requirements of the exchange ratio;
[0029] Obtain the asset data of the target user from the blockchain, and determine whether the resources to be exchanged in the asset data of the target user meet the requirements of the exchange ratio;
[0030] According to the exchange ratio, the asset data of the source user and the asset data of the destination user are updated respectively, a transaction record is generated, and the asset metadata of the source user and the destination user are updated respectively.
[0031] Optionally, after the asset data carried in the asset data processing request is normalized and formatted, and before the asset data processing request is sent to the blockchain, the method further includes:
[0032] Determine whether the source user and the destination user in the asset data processing request are in the same blockchain;
[0033] If they are located on the same blockchain, executing the step of sending the asset data processing request to the blockchain;
[0034] If they are not located in the same blockchain, based on the pre-set cross-chain asset mapping specification, the asset data processing request is subjected to cross-chain asset mapping processing and then sent to the cross-platform blockchain of the destination user through the cross-chain interface, so that the cross-platform blockchain calls the asset exchange contract function of the smart contract, interacts with the blockchain, and processes the asset data based on the asset data of the source user and the asset data of the destination user.
[0035] Optionally, the method further comprises:
[0036] The asset data processing request and the asset data carried in the asset data processing request are verified separately.
[0037] According to a second aspect of the present invention, a data processing device based on blockchain is provided, and the data processing device based on blockchain includes:
[0038] The metadata format processing module is used to convert the asset metadata input through the user interface into the standardized format asset metadata according to the preset metadata specification and format;
[0039] The asset identification configuration module is used to call the asset management contract function in the asset creation application program interface and the smart contract to generate asset identification based on the standardized format asset metadata;
[0040] The asset creation module is used to call the asset creation function of the smart contract so that the asset creation function performs the asset creation operation on the blockchain according to the standardized format asset metadata and asset identifier;
[0041] A data specification module is used to receive an asset data processing request and to standardize and format the asset data carried in the asset data processing request according to a preset asset data specification;
[0042] The asset data request module is used to call the asset management contract function of the smart contract according to the source user and the destination user corresponding to the asset data processing type in the asset data processing request to construct the asset data processing request;
[0043] The asset data processing module is used to send an asset data processing request to the blockchain so that the blockchain calls the asset exchange contract function of the smart contract and performs asset data processing based on the asset data of the source user and the asset data of the destination user.
[0044] According to a third aspect of the present invention, there is provided a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the blockchain-based data processing method in any possible implementation of the first aspect.
[0045] According to a fourth aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the blockchain-based data processing method in any possible implementation of the first aspect are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] Figure 1 A flowchart of a data processing method based on blockchain provided by an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of a process for generating an asset identifier in a blockchain-based data processing method provided in an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of the process of asset exchange in a blockchain-based data processing method provided by an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of a blockchain-based data processing device provided by an embodiment of the present invention;
[0052] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] In the related technologies, blockchain-based data processing, such as game asset data processing methods, has high technical requirements for users and relatively complex operations, which prevents many users from processing game asset data, resulting in low data processing efficiency. At the same time, due to the different types and standards of asset data on different game platforms, the compatibility of cross-platform game asset data processing is low. Furthermore, when the network is congested, it may take a long time for processing.
[0055] In this embodiment, a cross-platform game asset data processing method based on blockchain is proposed, and a cross-platform game asset data processing method and device based on blockchain are constructed by unifying the game asset data standard design, smart contract design, user interface design, security mechanism design, and cross-platform asset compatibility and interaction design. In this way, by constructing a standardized design of cross-platform game asset data, the game asset data is regulated and standardized, ensuring that the game asset data of different games and different platforms can be interoperable and compatible, thereby improving data processing efficiency during interactive processing.
[0056] See also Figure 1 , an embodiment of the present invention provides a data processing method based on blockchain, which may include the following steps:
[0057] S101, converting the asset metadata input through the user interface into standardized format asset metadata according to a preset metadata specification and format;
[0058] In this embodiment, the specification and format of the asset metadata are pre-set. As an optional embodiment, when a user needs to create an asset, he or she uses the user interface to input the metadata corresponding to the asset to be created, and after receiving the asset metadata provided by the user through the user interface, the data specification and format conversion is performed.
[0059] In this embodiment, as an optional embodiment, the asset metadata is converted into a standardized format according to a preset metadata specification and format, including:
[0060] A11, normalizing the asset metadata according to a preset metadata structure specification to obtain normalized asset metadata;
[0061] In this embodiment, as an optional embodiment, the metadata specification includes: metadata structure specification and metadata verification specification, wherein:
[0062] Metadata structure specifications include but are not limited to:
[0063] Image Uniform Resource Locator URL (ImgaeUrl): A link to an image associated with an asset, used to show the appearance of the asset;
[0064] Description: A detailed description of the asset, for example, its background and purpose;
[0065] Price: asset price information;
[0066] Owner ID: the owner ID of the current asset;
[0067] Creation Time: The timestamp when the asset was created;
[0068] Transaction History: records the transaction history of assets, including transaction time, transaction parties, transaction amount, etc.
[0069] In this embodiment, the asset metadata input by the user is organized according to the metadata structure specification.
[0070] A12, verify the integrity and validity of the standardized asset metadata according to the pre-set metadata verification specifications;
[0071] In this embodiment, as an optional embodiment, the metadata verification specification includes but is not limited to: integrity verification and validity verification (authenticity verification).
[0072] In this embodiment, the authenticity check verifies the authenticity of the standardized asset metadata through digital signature technology to ensure that the metadata has not been tampered with. After the authenticity check passes, the integrity check is performed: the standardized asset metadata is hashed and the hash value is stored on the blockchain to ensure the integrity and immutability of the standardized asset metadata.
[0073] A13, according to a preset data format, convert the format of the normalized asset metadata that has passed the verification to obtain normalized format asset metadata, and store the normalized format asset metadata.
[0074] In this embodiment, as an optional embodiment, the normalized asset metadata that has passed the verification is converted into data in JSON format.
[0075] In this embodiment, the user interface is used to call the API service to create assets and implement interface functions. As an optional embodiment, the interface functions include: asset display function and exchange interface function.
[0076] Asset display function: displays all assets currently held by the user, and supports viewing asset details and historical asset data processing records.
[0077] Exchange interface function: Provides an asset exchange interface, displays a list of interactively processable (e.g., exchangeable) assets and exchange ratios, and supports users to select and confirm exchanges.
[0078] In this embodiment, the user experience can be improved through user interface design. As an optional embodiment, the user interface design includes:
[0079] Simple interface design: Design a simple and intuitive user interface to facilitate users to quickly complete asset data processing operations.
[0080] Guidance process design: Provide clear user guidance to help users complete asset data management and interactive processing processes.
[0081] In this embodiment, as an optional embodiment, storing the asset metadata in a standardized format includes:
[0082] The standardized format asset metadata is encrypted using the Advanced Encryption Standard encryption algorithm, and the encrypted standardized format asset metadata is stored in the blockchain.
[0083] S102, calling the asset creation application program interface and the asset management contract function in the smart contract to generate an asset identifier based on the standardized format asset metadata;
[0084] In this embodiment, the application program interface (API interface) is used for game developers to call to realize the creation, query, transfer and exchange functions of asset metadata and asset data. As an optional embodiment, the asset identifier (ID) is used to characterize the asset category to which the standardized format asset metadata belongs. For game assets, the corresponding asset categories include but are not limited to: weapons, props, and characters.
[0085] In this embodiment, the smart contract is deployed in the blockchain. The asset management contract function is responsible for creating, querying, transferring and destroying game asset data.
[0086] In this embodiment, as an optional embodiment, the asset management contract function plays a core role in the cross-platform game asset data processing method based on blockchain, and is responsible for the creation, management, transfer and cross-platform exchange of game assets.
[0087] In this embodiment, as an optional embodiment, the asset management contract function for creating a new asset is: createAsset(assetID, owner, metadata); wherein,
[0088] assetID: unique identifier of the asset;
[0089] owner: asset owner ID;
[0090] metadata: metadata of the asset.
[0091] In this embodiment, after deploying the smart contract, the method further includes:
[0092] Security verification of smart contracts, including but not limited to: code auditing, unit testing and integration testing, among which:
[0093] Code audit is used to conduct a comprehensive smart contract code audit before deploying the smart contract to check for potential security vulnerabilities and logical errors.
[0094] Unit testing is used to write unit test code to cover various functional modules of the smart contract to ensure that the smart contract can run normally under various circumstances.
[0095] Integration testing is used to simulate real operating scenarios in a test environment and conduct integration testing to ensure the stability and security of smart contracts in actual deployment.
[0096] S103, calling the asset creation function of the smart contract, so that the asset creation function performs the asset creation operation on the blockchain according to the standardized format asset metadata and asset identifier;
[0097] In this embodiment, smart contracts are used to create assets, and the results of the asset creation operation are returned to the user. For example, by sending a request to create an asset to a smart contract, the smart contract is triggered to perform the operation of creating an asset on the blockchain according to the asset creation function and asset metadata, and the creation result is returned; the triggering API service returns the creation result to the user interface through the asset API, so that the user interface displays the creation result.
[0098] In this embodiment, as an optional embodiment, a multi-signature mechanism and a handling fee mechanism are pre-set in the smart contract, wherein:
[0099] Multi-signature mechanism is used to set up multiple signatures for asset data transfer and interaction processing to enhance security.
[0100] The handling fee mechanism is used to ensure the rationality of asset data interaction and the continuous operation of the system.
[0101] As an optional embodiment, the multi-signature mechanism includes but is not limited to: a multi-signature wallet mechanism, an operation process execution mechanism and a signature verification mechanism, wherein:
[0102] The multi-signature wallet mechanism is used to implement multi-signatures in smart contracts, with multiple signer addresses and a minimum number of signatures.
[0103] The operation process execution mechanism is used for pre-set key operations (for example, the transfer and exchange of asset data) that must be signed by multiple signatories before they can be executed. After each signer signs the asset transaction data, the smart contract checks whether the minimum number of signatures is met, and only executes the transaction if it is met.
[0104] A signature verification mechanism is used to ensure that each signature is verified to prevent signature forgery.
[0105] S104, receiving an asset data processing request, and normalizing and formatting the asset data carried in the asset data processing request according to a preset asset data specification;
[0106] In this embodiment, the asset data processing request is an asset transaction request. As an optional embodiment, the asset data includes but is not limited to: virtual asset data, item asset data. Among them, the virtual asset data includes but is not limited to game asset data, for example, including game asset information, transaction price, and game asset transaction volume. As an optional embodiment, the asset data processing request is written into the blockchain.
[0107] In this embodiment, taking game asset data as an example, asset data specifications are pre-set to standardize game asset data of different formats and types, thereby achieving standardization of game asset data.
[0108] In this embodiment, for each game asset, a unique identifier, namely, asset ID (AssetId), is set when performing an asset creation operation to ensure that the game asset can be uniquely identified. As an optional embodiment, game assets include but are not limited to: weapons, props, and characters.
[0109] In this embodiment, as an optional embodiment, similar to the processing of asset metadata, standardized game asset data is set, that is, for each asset data, the asset data is converted into standardized game asset data including the following options:
[0110] Name: asset name;
[0111] Type: Asset categories: including but not limited to: weapons, props, characters, etc.;
[0112] Rarity: The rarity level of an asset, which is used to indicate the scarcity of the asset, including but not limited to: Common, Rare, Epic, etc.
[0113] Attributes: The specific attributes of an asset, including but not limited to: attack power, defense power, durability, etc.;
[0114] Game: The name or ID of the game to which the asset belongs.
[0115] In this embodiment, the standardized asset data includes: asset identification, asset name, asset category, rarity, attribute, and game ID. As an optional embodiment, the standardized asset data exists in a table form, wherein the columns of the table are respectively an asset identification column, an asset name column, an asset category column, a rarity column, an attribute column, and a game ID column, and each row of the table corresponds to an asset data.
[0116] In this embodiment, the normalized asset data obtained by the normalization process is converted into normalized format asset data in a preset format. In order to ensure the compatibility of the asset data formats corresponding to assets between different game platforms, as an optional embodiment, the asset data format adopts a universal data format, including but not limited to: JSON format.
[0117] In this embodiment, as an optional embodiment, an example of standardized format asset data is as follows:
[0118] {
[0119] "assetID":"12345-abcde-67890-fghij",
[0120] "name":"Dragon Sword",
[0121] "type":"Weapon",
[0122] "rarity":"Epic",
[0123] "attributes":{
[0124] "attack":50,
[0125] "defense":20,
[0126] "durability":100
[0127] },
[0128] "game":"Fantasy World"
[0129] }
[0130] In this embodiment, as an optional embodiment, after receiving the asset data processing request, the method further includes:
[0131] The asset data processing request and the asset data carried in the asset data processing request are verified separately.
[0132] S105. Based on the source user and the destination user corresponding to the asset data processing type in the asset data processing request, the asset management contract function of the smart contract is called to construct an asset data processing request;
[0133] In this embodiment, the asset data processing request is used to request asset data exchange processing. As an optional embodiment, the asset data processing types include but are not limited to: exchange, donation, transfer, query, destruction, etc. For exchange, donation, and transfer, it is necessary to call the asset management contract function of the smart contract to construct the asset data processing request.
[0134] In this embodiment, as an optional embodiment, the constructed asset data processing request is a request to transfer the ownership of asset data. An example of a request to transfer the ownership of asset data is as follows:
[0135] transferAsset(assetID,from,to); where,
[0136] from: current asset owner ID (source user);
[0137] to: The new asset owner ID (destination user).
[0138] In this embodiment, an example of constructing a query asset data request based on the asset management contract function of the smart contract is as follows:
[0139] Query asset data request: getAssetInfo(assetID).
[0140] An example of constructing a request for destroying asset data based on the asset management contract function of a smart contract is as follows:
[0141] Destroy asset data request: burnAsset(assetID).
[0142] S106. Send the asset data processing request to the blockchain, so that the blockchain calls the asset exchange contract function of the smart contract and performs asset data processing based on the asset data of the source user and the asset data of the destination user.
[0143] In this embodiment, the asset exchange contract function is used to implement interactive processing between different game asset data.
[0144] In this embodiment, as an optional embodiment, an example of an asset exchange contract function is as follows:
[0145] Execute asset exchange: exchangeAssets(assetID1,assetID2,user);
[0146] assetID1: asset ID provided by the user (source user);
[0147] assetID2: the asset ID that the user wants to redeem;
[0148] user: The user ID that performs the exchange (destination user).
[0149] In this embodiment, as an optional embodiment, sending the asset data processing request to the blockchain includes:
[0150] The asset data processing request is encrypted using the transport layer security protocol encryption algorithm, and the encrypted asset data processing request is sent to the blockchain.
[0151] In this embodiment, when data is transmitted, the data to be transmitted is encrypted using a transport layer security protocol encryption algorithm.
[0152] In this embodiment, as an optional embodiment, asset data processing is performed based on the asset data of the source user and the asset data of the destination user, including:
[0153] According to the exchange ratio corresponding to the asset data processing request described in the smart contract, determine whether the resources to be exchanged in the source user's asset data meet the requirements of the exchange ratio;
[0154] Obtain the asset data of the target user from the blockchain, and determine whether the resources to be exchanged in the asset data of the target user meet the requirements of the exchange ratio;
[0155] According to the exchange ratio, the asset data of the source user and the asset data of the destination user are updated respectively, a transaction record is generated, and the asset metadata of the source user and the destination user are updated respectively.
[0156] In this embodiment, based on the exchange ratio corresponding to the smart contract, verification is performed according to the verification exchange condition function in the smart contract to ensure that the assets can be legally exchanged.
[0157] In this embodiment, as an optional embodiment, an example of a function for verifying the redemption condition is as follows:
[0158] validateExchange(assetID1,assetID2);
[0159] assetID1: asset ID provided by the user;
[0160] assetID2: The ID of the asset that the user wants to redeem.
[0161] In this embodiment, after the asset transaction is successful, the transaction success information (transaction record) is written into the blockchain. As an optional embodiment, the transaction information and transaction success information are written into the blockchain using a smart contract.
[0162] In this embodiment, based on the asset data processing request and the exchange ratio, the asset ID provided by the user is exchanged for the asset ID that the user wants to exchange, that is, the asset provided by the user is migrated to the asset that the user wants to exchange.
[0163] In this embodiment, as another optional embodiment, before performing asset data processing based on the asset data of the source user and the asset data of the destination user, the method further includes:
[0164] Verify the asset data of the source user and the asset data of the destination user.
[0165] In this embodiment, as another optional embodiment, after the asset data carried in the asset data processing request is normalized and formatted, and before the asset data processing request is sent to the blockchain, the method further includes:
[0166] Determine whether the source user and the destination user in the asset data processing request are in the same blockchain;
[0167] If they are located on the same blockchain, executing the step of sending the asset data processing request to the blockchain;
[0168] If they are not located in the same blockchain, based on the pre-set cross-chain asset mapping specification, the asset data processing request is subjected to cross-chain asset mapping processing and then sent to the cross-platform blockchain of the destination user through the cross-chain interface, so that the cross-platform blockchain calls the asset exchange contract function of the smart contract, interacts with the blockchain, and processes the asset data based on the asset data of the source user and the asset data of the destination user.
[0169] In this embodiment, for cross-platform asset data processing, by designing cross-chain specifications including cross-chain protocols, cross-chain asset mapping specifications, and cross-chain APIs, it is possible to ensure that asset data between different blockchain networks (platforms) can be interactively processed safely and effectively. As an optional embodiment, the cross-chain specifications include: cross-chain interfaces, cross-chain asset mapping specifications, where:
[0170] Cross-chain interface, used to support asset data interaction with different blockchain networks.
[0171] The cross-chain asset mapping specification is used to implement the asset mapping mechanism, mapping asset data on different blockchain networks to asset data in a unified standard format to facilitate cross-chain interaction processing.
[0172] In this embodiment, in order to ensure the security of cross-platform game asset data processing based on blockchain, as another optional embodiment, the method further includes:
[0173] Based on the pre-set security mechanism, asset data processing requests are securely encrypted and transmitted.
[0174] In this embodiment, as an optional embodiment, the pre-set security mechanism includes but is not limited to: data encryption, identity authentication, smart contract security, and multi-signature mechanism, wherein:
[0175] Data encryption includes but is not limited to: transmission encryption and storage encryption.
[0176] Regarding transmission encryption, in this embodiment, as an optional embodiment, the Transport Layer Security (TLS) protocol is used to encrypt the communication data (asset data) between the user and the server to ensure that the communication data is not eavesdropped or tampered with during transmission.
[0177] Regarding storage encryption, in this embodiment, as an optional embodiment, the Advanced Encryption Standard (AES) encryption algorithm is used to encrypt and store user sensitive data and processing records to ensure that the stored data remains safe even when the storage medium is obtained.
[0178] Authentication, including but not limited to: multi-factor authentication, biometrics, and session management, including:
[0179] For multi-factor authentication, in this embodiment, as an optional embodiment, multiple identity authentication methods (password, SMS verification code, Google Authenticator) are combined to improve security. For example, when a user logs in or performs a pre-set key operation, the user verifies the identity in multiple ways.
[0180] Biometric technology is used to use biometric technologies such as fingerprint recognition and facial recognition to further enhance the security of identity authentication.
[0181] Session management is used to implement strong session management policies and check and update session tokens according to pre-set time periods to prevent session hijacking.
[0182] Figure 2 A flowchart of generating an asset identifier in a blockchain-based data processing method provided in an embodiment of the present invention. Figure 2 As shown, the method includes:
[0183] S201, a user provides asset metadata through a user interface;
[0184] S202, receiving and verifying asset metadata, and sending it to the API service;
[0185] S203, the API service performs identity authentication;
[0186] S204, the API service stores the asset metadata in the blockchain network;
[0187] S205, the user interface calls the API service to create an asset API;
[0188] S206. The API service generates an asset ID according to the asset metadata;
[0189] S207, the API service calls the create asset function (CreateAsset) to the smart contract;
[0190] S208, the smart contract executes the asset creation operation on the blockchain network;
[0191] S209, the smart contract returns the creation result to the API service;
[0192] S210, the API service returns the creation result to the user interface;
[0193] S211. The user interface returns the creation result to the user.
[0194] Figure 3 A schematic diagram of the process of asset exchange in a blockchain-based data processing method provided in an embodiment of the present invention.
[0195] like Figure 3 As shown, the method includes:
[0196] S301, receiving an asset exchange request selected by a user through a user interface;
[0197] S302, the user interface sends the received asset exchange request to the API service;
[0198] S303, the API service performs identity authentication;
[0199] In this embodiment, if the identity authentication is passed, the subsequent steps are continued; otherwise, the identity authentication failure information is returned to the user interface.
[0200] S304, API service obtains user asset data from the smart contract;
[0201] In this embodiment, the backend server (API service) obtains the user's asset data based on the asset exchange request, and queries the asset data information held by the user through the blockchain.
[0202] S305. The smart contract returns the user asset data to the user interface through the API service;
[0203] S306. The user interface returns the user asset data to the user;
[0204] In this embodiment, the blockchain returns the user's asset data information to the back-end server, and the back-end server returns the received user's asset data information to the front-end user interface for display for user selection.
[0205] S307. The user confirms the choice of asset exchange in the user interface;
[0206] S308. The user interface sends an exchange transaction request to the API service;
[0207] In this embodiment, after the user interface receives the confirmation exchange asset information selected by the user according to the display, the front-end user interface sends an exchange transaction request to the back-end server (API service).
[0208] S309, the API service calls the exchange contract function (exchangeAssets) in the smart contract;
[0209] S310, smart contracts execute on-chain operations on the blockchain network;
[0210] In this embodiment, the backend server executes smart contracts through blockchain to process asset exchange, and triggers cross-chain interaction if cross-chain operations are involved;
[0211] When cross-chain operations are involved, cross-chain interactions are carried out between the back-end server and the blockchain to complete cross-chain asset transfers.
[0212] S311. The smart contract returns the exchange result to the API service;
[0213] S312, API service updates transaction status;
[0214] S313. The API service returns the redemption result to the user interface;
[0215] S314. The user interface returns the redemption result to the user.
[0216] In this embodiment, after the transaction is successful, the backend server updates the transaction status and returns the transaction result to the frontend user interface;
[0217] The front-end user interface displays the transaction results to show users the information that the exchange is completed.
[0218] In this embodiment, by providing a user-friendly operation interface and a simple and easy-to-understand operation process, the threshold for users to use blockchain technology is lowered and the user experience is improved. At the same time, by formulating a unified asset standard, the assets of different games and platforms have higher compatibility, which facilitates cross-platform exchange and transactions, and ensures that the assets of different games and platforms can be interoperable. Furthermore, by using the automated management of smart contracts to reduce human intervention in the asset data processing process, it not only improves transaction efficiency and shortens transaction confirmation time, but also enhances the transparency and security of the transaction process. Moreover, by introducing a multi-level security mechanism, such as multi-signature and identity authentication, the security of the transaction process is ensured, the risk of asset theft or loss is effectively prevented, and the security of asset data is enhanced.
[0219] Based on the same inventive concept, Figure 4 As shown, an embodiment of the present invention further provides a data processing device based on blockchain, the device comprising:
[0220] The metadata format processing module 401 is used to convert the asset metadata input through the user interface into standardized format asset metadata according to the preset metadata specification and format;
[0221] In this embodiment, as an optional embodiment, the metadata format processing module 401 is specifically used for:
[0222] According to the preset metadata structure specification, the asset metadata is normalized to obtain normalized asset metadata;
[0223] Verify the integrity and validity of the standardized asset metadata according to the pre-set metadata verification specifications;
[0224] According to a preset data format, the format of the normalized asset metadata that has passed the verification is converted to obtain the normalized format asset metadata, and the normalized format asset metadata is stored.
[0225] In this embodiment, as an optional embodiment, the metadata format processing module 401 uses the Advanced Encryption Standard encryption algorithm to encrypt the standardized format asset metadata, and stores the encrypted standardized format asset metadata in the blockchain.
[0226] The asset identification configuration module 402 is used to call the asset management contract function in the asset creation application program interface and the smart contract to generate an asset identification according to the standardized format asset metadata;
[0227] The asset creation module 403 is used to call the asset creation function of the smart contract so that the asset creation function performs the asset creation operation on the blockchain according to the standardized format asset metadata and asset identifier;
[0228] The data standardization module 404 is used to receive an asset data processing request and standardize and format the asset data carried in the asset data processing request according to a preset asset data specification;
[0229] In this embodiment, as an optional embodiment, the data specification module 404 is further used to:
[0230] Determine whether the source user and the destination user in the asset data processing request are in the same blockchain;
[0231] If they are located on the same blockchain, executing the step of sending the asset data processing request to the blockchain;
[0232] If they are not located in the same blockchain, based on the pre-set cross-chain asset mapping specification, the asset data processing request is subjected to cross-chain asset mapping processing and then sent to the cross-platform blockchain of the destination user through the cross-chain interface, so that the cross-platform blockchain calls the asset exchange contract function of the smart contract, interacts with the blockchain, and processes the asset data based on the asset data of the source user and the asset data of the destination user.
[0233] In this embodiment, as another optional embodiment, the data specification module 404 is further used to:
[0234] The asset data processing request and the asset data carried in the asset data processing request are verified separately.
[0235] The asset data request module 405 is used to call the asset management contract function of the smart contract according to the source user and the destination user corresponding to the asset data processing type in the asset data processing request to construct the asset data processing request;
[0236] The asset data processing module 406 is used to send an asset data processing request to the blockchain so that the blockchain calls the asset exchange contract function of the smart contract and performs asset data processing based on the asset data of the source user and the asset data of the destination user.
[0237] In this embodiment, as an optional embodiment, the asset data processing module 406 uses the transport layer security protocol encryption algorithm to encrypt the asset data processing request and sends the encrypted asset data processing request to the blockchain.
[0238] In this embodiment, as another optional embodiment, the asset data processing module 406 is specifically used for:
[0239] According to the exchange ratio corresponding to the asset data processing request described in the smart contract, determine whether the resources to be exchanged in the source user's asset data meet the requirements of the exchange ratio;
[0240] Obtain the asset data of the target user from the blockchain, and determine whether the resources to be exchanged in the asset data of the target user meet the requirements of the exchange ratio;
[0241] According to the exchange ratio, the asset data of the source user and the asset data of the destination user are updated respectively, a transaction record is generated, and the asset metadata of the source user and the destination user are updated respectively.
[0242] Based on the same inventive concept, an embodiment of the present invention further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the blockchain-based data processing method in any possible implementation manner described above are implemented.
[0243] Alternatively, the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0244] Based on the same inventive concept, see Figure 5 , an embodiment of the present invention further provides an electronic device, including a memory 101 (such as a non-volatile memory), a processor 102, and a computer program stored in the memory 101 and executable on the processor 102. When the processor 102 executes the program, the steps of the data processing method based on blockchain in any possible implementation method described above can be equivalent to the data processing device based on blockchain as described above. Of course, the processor can also be used to process other data or operations. The electronic device can be a PC, a server, a terminal, and other devices.
[0245] like Figure 5 As shown, the electronic device may also generally include: a memory 103, a network interface 104, and an internal bus 105. In addition to these components, other hardware may also be included, which will not be described in detail.
[0246] It should be pointed out that the above-mentioned blockchain-based data processing device can be implemented through software. As a device in a logical sense, it is formed by the processor 102 of the electronic device in which it is located reading the computer program instructions stored in the non-volatile memory into the memory 103 for execution.
[0247] The embodiments of the subject matter and functional operations described in this specification may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. The embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules in computer program instructions encoded on a tangible non-temporary program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by a data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
[0248] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform the corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application specific integrated circuits), and the apparatus can also be implemented as special purpose logic circuits.
[0249] Computers suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0250] Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. The processor and memory may be supplemented by, or incorporated in, special purpose logic circuitry.
[0251] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although the features may work as above in certain combinations and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.
[0252] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
[0253] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.
[0254] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0255] The above is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be 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 the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A data processing method based on blockchain, characterized in that: include: The asset metadata input through the user interface is converted into standardized format asset metadata according to the preset metadata specifications and formats; Call the asset creation API and the asset management contract function in the smart contract to generate an asset identifier based on the standardized format asset metadata; Call the asset creation function of the smart contract so that the asset creation function performs the asset creation operation on the blockchain based on the asset metadata and asset identifier in the standardized format; Receive an asset data processing request, and standardize and format the asset data carried in the asset data processing request according to the pre-set asset data specification; According to the source user and destination user corresponding to the asset data processing type in the asset data processing request, the asset management contract function of the smart contract is called to construct the asset data processing request; The asset data processing request is sent to the blockchain so that the blockchain calls the asset exchange contract function of the smart contract and performs asset data processing based on the asset data of the source user and the asset data of the destination user.
2. The data processing method based on blockchain according to claim 1 is characterized in that: The conversion into a standardized format asset metadata according to the preset metadata specification and format includes: According to the preset metadata structure specification, the asset metadata is normalized to obtain normalized asset metadata; Verify the integrity and validity of normalized asset metadata based on pre-set metadata verification specifications; According to a preset data format, the format of the normalized asset metadata that has passed the verification is converted to obtain the normalized format asset metadata, and the normalized format asset metadata is stored.
3. The data processing method based on blockchain according to claim 2 is characterized in that: The storage of standardized format asset metadata includes: The standardized format asset metadata is encrypted using the Advanced Encryption Standard encryption algorithm, and the encrypted standardized format asset metadata is stored in the blockchain.
4. The blockchain-based data processing method according to any one of claims 1 to 3, characterized in that: The sending of the asset data processing request to the blockchain includes: The asset data processing request is encrypted using the transport layer security protocol encryption algorithm, and the encrypted asset data processing request is sent to the blockchain.
5. The blockchain-based data processing method according to any one of claims 1 to 3, characterized in that: The asset data processing based on the asset data of the source user and the asset data of the destination user includes: According to the exchange ratio corresponding to the asset data processing request described in the smart contract, determine whether the resources to be exchanged in the source user's asset data meet the requirements of the exchange ratio; Obtain the asset data of the target user from the blockchain, and determine whether the resources to be exchanged in the asset data of the target user meet the requirements of the exchange ratio; According to the exchange ratio, the asset data of the source user and the asset data of the destination user are updated respectively, a transaction record is generated, and the asset metadata of the source user and the destination user are updated respectively.
6. The blockchain-based data processing method according to any one of claims 1 to 3, characterized in that: After the asset data carried in the asset data processing request is normalized and formatted, and before the asset data processing request is sent to the blockchain, the method further includes: Determine whether the source user and the destination user in the asset data processing request are in the same blockchain; If they are located on the same blockchain, executing the step of sending the asset data processing request to the blockchain; If they are not located in the same blockchain, based on the pre-set cross-chain asset mapping specification, the asset data processing request is subjected to cross-chain asset mapping processing and then sent to the cross-platform blockchain of the destination user through the cross-chain interface, so that the cross-platform blockchain calls the asset exchange contract function of the smart contract, interacts with the blockchain, and processes the asset data based on the asset data of the source user and the asset data of the destination user.
7. The data processing method based on blockchain according to claim 1 is characterized in that: The method further comprises: The asset data processing request and the asset data carried in the asset data processing request are verified separately.
8. A data processing device based on blockchain, characterized in that: The blockchain-based data processing device comprises: The metadata format processing module is used to convert the asset metadata input through the user interface into the standardized format asset metadata according to the preset metadata specification and format; The asset identification configuration module is used to call the asset management contract function in the asset creation application program interface and the smart contract to generate asset identification based on the standardized format asset metadata; The asset creation module is used to call the asset creation function of the smart contract so that the asset creation function performs the asset creation operation on the blockchain according to the standardized format asset metadata and asset identifier; A data specification module is used to receive an asset data processing request and to standardize and format the asset data carried in the asset data processing request according to a preset asset data specification; The asset data request module is used to call the asset management contract function of the smart contract according to the source user and the destination user corresponding to the asset data processing type in the asset data processing request to construct the asset data processing request; The asset data processing module is used to send an asset data processing request to the blockchain so that the blockchain calls the asset exchange contract function of the smart contract and performs asset data processing based on the asset data of the source user and the asset data of the destination user.
9. A storage medium, characterized in that: The storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the blockchain-based data processing method as described in any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the blockchain-based data processing method described in any one of claims 1 to 7 are implemented.
