A blockchain data visualization method and system based on a snake model

By simulating the generation and merging process of blockchain using a snake-like model and combining it with JavaScript to draw visual graphics, the problem of insufficient real-time performance and interactivity of blockchain data is solved, and dynamic display and user-friendliness of blockchain data are achieved.

CN116521797BActive Publication Date: 2025-12-19TIANJIN UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310509129.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-08
Publication Date
2025-12-19
Estimated Expiration
2043-05-08

AI Technical Summary

Technical Problem

Existing blockchain data visualization technologies cannot achieve real-time data updates, cannot display the generation and merging process of blockchains, and lack user interactivity and visualization effects, making it difficult to meet the needs of non-professional users.

Method used

The blockchain data is transformed into snake game elements using a snake model. The movement of the snake simulates the generation and merging process of the blockchain. Combined with JavaScript to draw visual graphics and add mouse tooltips, the blockchain data can be visualized in real time.

Benefits of technology

It enables real-time updates and dynamic display of blockchain data, enhances user interactivity and visualization, and allows users to clearly understand the changes in the blockchain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521797B_ABST
    Figure CN116521797B_ABST
Patent Text Reader

Abstract

A blockchain data visualization method and system based on a snake model. The method comprises the steps of establishing a connection with a blockchain backend, obtaining real-time data, and performing analysis and processing on the data to adapt it to the data structure of the snake model; building and continuously updating the snake model; logically mapping the snake model with the data, then building a blockchain data visualization mechanism to obtain a blockchain data visualization result; and drawing a mouse prompt box on the screen according to the blockchain data visualization result. The application has the effect that the blockchain information can be converted into elements in the snake game, food is used to simulate block generation, the snake is used to simulate the chain structure of the blockchain, and the movement of the snake simulates the extension of the blockchain. The process of packing the blockchain is intuitively displayed on the screen, helping people more clearly understand the process of adding a new block to the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of blockchains, and particularly relates to a blockchain data visualization method and system based on a snake model. BACKGROUND

[0002] A blockchain is a new advanced database mechanism without a single control mechanism, allowing participants to transparently share information, making data more open and secure, and having the functions of decentralization, immutability and consensus, thus having higher trust, security and efficiency, so that this technology is adopted in many industries such as energy, finance and real estate. However, due to the high threshold of blockchain technology, the concept and implementation method are relatively complex, and certain professional knowledge and technical reserves are required to master it. Non-professionals often feel lost when viewing the blockchain, so the blockchain data visualization technology emerges as the times require.

[0003] In terms of real-time performance, many current blockchain data visualization technologies are based on static data, and can only present data already existing in the blockchain, and cannot perform real-time data updates, so that the latest situation of the blockchain cannot be understood, and thus the real-time performance is insufficient.

[0004] In terms of technical implementation, the generation and merging process of the blockchain is dynamic, and needs to be continuously calculated and updated. However, the current blockchain data visualization technology can only display the current state of the blockchain, and cannot display the evolution process of the gradual generation and merging of the blockchain, so that the generation and merging of the blocks cannot be visually expressed.

[0005] In terms of user experience, the current blockchain data visualization only uses basic chart display, which is difficult to present a large amount of blockchain data, and the visualization effect is limited, and lacks sufficient visual effects, which is difficult to more effectively attract users, and cannot interact with users, so that users cannot explore and interact with the data according to their own needs and interests, thereby limiting the operation and experience of users. SUMMARY

[0006] In order to solve the above problems, the purpose of the present application is to provide a blockchain data visualization method and system based on a snake model.

[0007] In order to achieve the above purpose, the blockchain data visualization method based on the snake model provided by the present application comprises the following steps in sequence:

[0008] Step S1: connecting with a blockchain backend, acquiring real-time data, and performing analysis and processing on the data to adapt the data structure to the snake model;

[0009] Step S2: constructing and continuously updating the snake model;

[0010] Step S3: logically mapping the snake model in step S2 with the parsed data in step S1, then constructing a blockchain data visualization mechanism to obtain a blockchain data visualization result;

[0011] Step S4: drawing a mouse prompt box on the screen according to the blockchain data visualization result obtained in step S3.

[0012] In step S1, the connection with the blockchain backend is established, real-time data is obtained, and the data is parsed and processed to adapt to the data structure of the snake model, which includes the following steps:

[0013] Step S11: calling the API interface provided by the blockchain backend to realize the connection and interaction with the blockchain backend, and obtaining real-time data;

[0014] Step S12: parsing the real-time data obtained in step S11, integrating each block and its detailed information currently waiting to be packaged and chained into a transaction and placing it in the latest block array, and placing all block arrays of the current blockchain that have been chained in the block list according to the proportion of the snake length and the number of blockchain blocks;

[0015] Step S13: listening to the occurrence of blockchain transactions and inserting new transactions into the latest block array in step S12.

[0016] In step S12, the detailed information includes block height, generation time, block size, and block hash, and the block list includes all transactions that have been packaged and chained.

[0017] In step S2, the snake model is built and continuously updated, which includes the following steps:

[0018] Specifically, the following steps are included:

[0019] Step S21: initializing the snake model;

[0020] Step S211: determining the current state;

[0021] The current state S t is a tuple (x t , y t , d t , L t , F t , v t , c t ), where x t and y t are the horizontal and vertical coordinates of the current snake head, d t is the current snake movement direction, pointing to one of the four directions of up, down, left, and right, Lt This is the current length of the snake, indicating how many blocks are currently on the snake's body. (F) t It is the current food coordinate, v t c is the current speed of the snake. t It is the current body color of the snake;

[0022] Step S212: Determine the current action based on the current state;

[0023] Current action A t In the current state S t An operation performed in the middle includes moving up, down, left, or right;

[0024] Step S213: Determine the state transition function based on the current state and the current action to obtain the new state;

[0025] The state transition function T represents the state transition function in the current state S. t China takes current action A t The new state S obtained afterwards t+1 ;

[0026] Step S214: Determine the reward function based on the new state;

[0027] The reward function R represents the reward in the current state S. t China takes current action A t Gain new state S t+1 The new x and y coordinates of the snake's head after the game are... t+1 and y t+1 With the new food coordinates F t+1 When they coincide, set a new state S. t+1 The length of the snake in the game is increased to the new snake length L. t+1 If the new snake's length is L t+1 Once the set threshold u is reached, the length L of the new snake is shortened by an appropriate ratio. t+1 And set a new snake body color. ct+1 To deepen the understanding on the original basis:

[0028] Step S22: At each time step t, the snake will adjust its state according to the current state S. t Move to the new state S via the state transition function T. t+1 ;

[0029] Step S23: Update the new state S in step S22 t+1 Attributes;

[0030] Step S231: Set the new state S in step S22 t+1 The new direction of the snake's movement d t+1 New state St+1 The new snake movement direction d t+1 It should be based on the new food coordinates F t+1 And the new horizontal and vertical coordinates x and y of the snake's head in the game. t+1 and y t+1 Select the shortest path and set it accordingly;

[0031] Step S232: Set the new state S in step S22 t+1 The new Snake game's movement speed v t+1 New state S t+1 The new snake's movement speed v t+1 The new x and y coordinates of the snake's head should be used as a basis for the game. t+1 and y t+1 Reach the new food coordinates F t+1 Required time step setting; if the required time step is too small, appropriately increase the interval time of the spacer and decrease the movement speed of the new snake v. t+1 Conversely, appropriately reducing the interval time of the spacer and increasing the movement speed of the new snake (v) t+1, To ensure it arrives just in time for the next packing;

[0032] Step S24: Determine the new state S in step S23 t+1 If the reward function R is satisfied, update the new state S again. t+1 Attributes.

[0033] In step S3, the logical mapping between the snake model in step S2 and the parsed data in step S1, and then the construction of a blockchain data visualization mechanism to obtain the blockchain data visualization result, specifically includes the following steps:

[0034] Step S31: Map the blockchain to a game of Snake. The entire blockchain is viewed as the snake in the Snake game model, and the packaged blocks are viewed as food in the Snake game model. Let B represent the set of block arrays currently contained in the blockchain. Assume that some block arrays already exist in the blockchain, B = {B1, B2, B3, ..., B...}. i}, where i represents the number of blocks in the set, and the current state S of the snake model obtained in step S2 is... t The length L of the snake in the game t Logically map the block array number i in proportion to the block array number;

[0035] Step S32: Based on the above logical mapping relationship, establish a visualization mechanism and use JavaScript to draw visual graphics on the screen;

[0036] Step S33: After the block is successfully packaged, a new block array is added to the blockchain;

[0037] Step S34: put the latest block array into the block list and update the latest block array to be empty, so that the number of block arrays i in the block chain increases, and the current length L of the snake t Also changes; when the current length L t Exceeds the set threshold, the new snake length L t+1 And the new snake body color c t+1 Is calculated according to the number of block arrays i in set B, and then the snake length and snake body color information in the current state S t Are updated.

[0038] Step S35: generate a new food coordinate using a random number generation algorithm, and then assign it to the current food coordinate F t In the current state S t Of the snake model.

[0039] Step S36: update the state of the snake model and redraw the graphics to obtain the block chain data visualization result.

[0040] In step S4, the block chain data visualization result obtained in step S3 is drawn on the screen with a mouse prompt box, which includes the following steps:

[0041] Step S41: draw a prompt box on the screen to prompt the user that the mouse is in the figure representing the block information;

[0042] Step S42: use JavaScript to control the display and hiding of the prompt box, and display the prompt box when the mouse moves over the snake body or the food.

[0043] The block chain data visualization system based on the snake model provided by the application includes a block synchronization module, a block data model mapping module and a mapping data visualization module.

[0044] The block synchronization module includes a collection unit, an object integration and generation unit and a listening unit.

[0045] The collection unit is used to connect with the block chain backend, access the interface provided by the block chain backend to collect information and synchronize real-time data;

[0046] The object integration and generation unit is used to analyze the real-time data provided by the collection unit, integrate each transaction and its detailed information currently waiting to be packaged and chained into an object and put it into the latest block array, and place all block arrays already chained in the current block chain in the block list according to the proportion;

[0047] The listening unit is used to listen to the occurrence of block chain transactions and synchronize the data of new transactions, and then analyze the data by the object integration and generation unit and insert the transaction into the latest block array.

[0048] The block data model mapping module comprises a model construction unit and a mapping establishment unit.

[0049] The model construction unit is configured to construct a snake model according to the design of the snake model.

[0050] The mapping establishment unit is configured to map the data of the block list as the body part of the snake, and map the data of the latest block number as the food of the snake; each packaging is mapped as the snake eating one block, and the length of the snake body is continuously increased, reflecting the growth process of the block chain.

[0051] The mapping data visualization module comprises a visual graphics drawing unit and a mouse prompt box adding unit.

[0052] The visual graphics drawing unit is configured to draw the block chain data visualization graphics on the screen through JavaScript based on the snake model established by the block data model mapping module (2).

[0053] The mouse prompt box adding unit is configured to control the display and hiding of the prompt box by using JavaScript, and display the prompt box when the mouse moves in.

[0054] The snake model-based block chain data visualization method and system provided by the application have the following beneficial effects:

[0055] 1. The information of the block chain can be converted into elements in the snake game, the generation of blocks is simulated by using food, the chain structure of the block chain is simulated by using the snake, the extension of the block chain is simulated by the movement of the snake, and the process of packaging the block chain is intuitively displayed on the screen, helping people more clearly understand the process of adding new blocks to the block chain.

[0056] 2. The dynamic changes of the block chain can be intuitively displayed, when new blocks are added to the block chain, the length of the snake body will also increase accordingly, so that the changes of the block chain can be reflected in real time, and the accuracy of the data is ensured.

[0057] 3. As the project is continuously running, the amount of data on the block chain is also growing, the application can process large-scale data by changing the ratio of the length of the snake body to the number of blocks on the block chain, and the color of the snake body can be deepened by simulating the heat map. DETAILED DESCRIPTION

[0058] Fig. 1 The snake model-based block chain data visualization method provided by the application is shown in the following steps.

[0059] Fig. 2A workflow diagram of the blockchain data visualization method based on the snake model is provided in the present application.

[0060] Fig. 3 A block diagram of the blockchain data visualization system based on the snake model is provided in the present application. DETAILED DESCRIPTION

[0061] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] As shown in the drawings, Figs. 1-2 The blockchain data visualization method based on the snake model provided in the present application includes the following steps in sequence:

[0063] Step S1: Connect with the blockchain backend, obtain real-time data, and perform parsing processing on the data to adapt it to the data structure of the snake model;

[0064] Specifically, the following steps are included:

[0065] Step S11: The program calls the API interface provided by the blockchain backend to realize the connection and interaction with the blockchain backend and obtain real-time data;

[0066] Step S12: Parse the real-time data obtained in step S11, integrate each block and its detailed information currently waiting to be packaged and chained into a transaction and place it in the latest block array, and place all block arrays of the current blockchain that have been chained in the block list according to the proportion of the snake length and the number of blockchain blocks;

[0067] The detailed information includes block height, generation time, block size, and block hash, among other block basic data; the block list includes all transactions that have been packaged and chained.

[0068] Step S13: Listen for blockchain transactions and insert new transactions into the latest block array of step S12.

[0069] Step S2: Build and continuously update the snake model;

[0070] The snake model can be modeled using a simple discrete-time and spatial dynamic system. In this model, the snake and the food move within a finite grid space, the length and shape of the snake change over time, and the food is regenerated at another location in the grid space at a fixed time.

[0071] Specifically, the following steps are included:

[0072] Step S21: Initialize the snake model;

[0073] Step S211: Determine the current state;

[0074] Current state S t It is a tuple (x t y t d t L t F t v t c t ), where x t and y t d represents the horizontal and vertical coordinates of the current snake's head. t It indicates the current direction of the snake's movement, pointing in one of four directions: up, down, left, or right. (L) t This is the current length of the snake, indicating how many blocks are currently on the snake's body. (F) t It is the current food coordinate, v t c is the current speed of the snake. t It is the current body color of the snake;

[0075] Step S212: Determine the current action based on the current state;

[0076] Current action A t In the current state S t An operation performed in the middle includes moving up, down, left, or right;

[0077] Step S213: Determine the state transition function based on the current state and the current action to obtain the new state;

[0078] The state transition function T represents the state transition function in the current state S. t China takes current action A t The new state S obtained afterwards t+1 ;

[0079] Step S214: Determine the reward function based on the new state;

[0080] The reward function R represents the reward in the current state S. t China takes current action A t Gain new state S t+1 The new x and y coordinates of the snake's head after the game are... t+1 and y t+1 With the new food coordinates F t+1 When they coincide, set a new state S. t+1 The length of the snake in the game is increased to the new snake length L. t+1 If the new snake's length is L t+1 Once the set threshold u is reached, the length L of the new snake is shortened by an appropriate ratio. t+1 And set the new snake's body color c t+1 To deepen the understanding on the original basis;

[0081] Step S22: At each time step t, the snake will adjust its state according to the current state S. t Move to the new state S via the state transition function T. t+1 ;

[0082] Step S23: Update the new state S in step S22 t+1 Attributes;

[0083] Specifically, the following steps are included:

[0084] Step S231: Set the new state S in step S22 t+1 The new direction of the snake's movement d t+1 New state S t+1 The new snake movement direction d t+1 It should be based on the new food coordinates F t+1 And the new horizontal and vertical coordinates x and y of the snake's head in the game. t+1 and y t+1 Select the shortest path and set it accordingly;

[0085] Step S232: Set the new state S in step S22 t+1 The new Snake game's movement speed v t+1 New state S t+1 The new snake's movement speed v t+1 The new x and y coordinates of the snake's head should be used as a basis for the game. t+1 and y t+1 Reach the new food coordinates F t+1 Required time step setting; if the required time step is too small, appropriately increase the interval time of the spacer and decrease the movement speed of the new snake v. t+1 Conversely, appropriately reducing the interval time of the spacer and increasing the movement speed of the new snake (v) t+1, To ensure it arrives just in time for the next packing;

[0086] Step S24: Determine the new state S in step S23 t+1 If the reward function R is satisfied, update the new state S again. t+1 Attributes.

[0087] Step S3: Logically map the snake model from step S2 with the parsed data from step S1, and then construct a blockchain data visualization mechanism to obtain the blockchain data visualization results;

[0088] Specifically, the steps include the following:

[0089] Step S31: Map the blockchain to a game of Snake. The entire blockchain is viewed as the snake in the Snake game model, and the packaged blocks are viewed as food in the Snake game model. Let B represent the set of block arrays currently contained in the blockchain. Assume that some block arrays already exist in the blockchain, B = {B1, B2, B3, ..., B...}. i}, where i represents the number of blocks in the set, and the current state S of the snake model obtained in step S2 is... t The length L of the snake in the game t Logically map the block array number i in proportion to the block array number;

[0090] Step S32: Based on the above logical mapping relationship, establish a visualization mechanism and use JavaScript to draw visual graphics on the screen;

[0091] Step S33: After the block is successfully packaged, a new block array is added to the blockchain;

[0092] Step S34: Add the latest block array to the block list and update the latest block array to empty, increasing the number of blocks i in the blockchain. At this point, the current length L of the snake is... t It also changes; when the current length L t When the threshold is exceeded, the new snake length L is calculated based on the number of blocks i in set B. t+1 And the new Snake's body color c t+1 Then update the current state S. t The length and body color information of the snake in the game;

[0093] Step S35: Generate a new food coordinate using a random number generation algorithm, and then assign it to the current state S in the snake model. t Current food coordinates F t ;

[0094] Step S36: Update the state of the snake model and redraw the graph to obtain the blockchain data visualization result.

[0095] Optionally, to enhance the user experience, the shortening of the snake's length and the change of its color on the screen can be animated to demonstrate the process.

[0096] Step S4: Draw a mouse tooltip on the screen based on the blockchain data visualization results obtained in step S3;

[0097] Specifically, the following steps are included:

[0098] Step S41: Draw a tooltip on the screen to indicate to the user the information of the area represented by the graphic where the mouse is located;

[0099] Step S42: The display and hiding of the prompt box are controlled by JavaScript, and the prompt box is displayed when the mouse moves over the snake body or the food.

[0100] If the information of the corresponding block is too much to be displayed, a prompt can be displayed, and a region is added next to the block to display the detailed information of the block. CSS or JavaScript can be used to add animation effects when displaying and hiding the information window to improve the interactivity of the blockchain data visualization graph of the snake model display.

[0101] As shown in Fig. 3 The snake model-based blockchain data visualization system provided by the application comprises a block synchronization module 1, a block data model mapping module 2, and a mapping data visualization module 3.

[0102] The block synchronization module 1 comprises a collection unit 11, an object integration and generation unit 12, and a listening unit 13.

[0103] The collection unit 11 is configured to establish a connection with a blockchain backend, access an interface provided by the blockchain backend to collect information, and synchronize real-time data.

[0104] The object integration and generation unit 12 is configured to analyze the real-time data provided by the collection unit 11, integrate each transaction and its detailed information currently waiting to be packaged and chained into an object and put it into a latest block array, and place all block arrays that have been chained on the current blockchain in a block list according to a proportion.

[0105] The listening unit 13 is configured to listen to the occurrence of blockchain transactions and synchronize the data of new transactions, and then analyze the data by the object integration and generation unit 12 and insert the transactions into the latest block array.

[0106] The block data model mapping module 2 comprises a model construction unit 21 and a mapping establishment unit 22.

[0107] The model construction unit 21 is configured to construct a snake model according to the design of the snake model.

[0108] The mapping establishment unit 22 is configured to map the data of the block list as the body part of the snake, and map the data of the latest block number as the food of the snake; each packaging is mapped as the snake eating one block, the length of the snake body is constantly increasing, reflecting the growth process of the blockchain.

[0109] The mapping data visualization module 3 comprises a visual graph drawing unit 31 and a mouse prompt box adding unit 32.

[0110] The visual graphics drawing unit 31 is configured to draw the visual graphics of the blockchain data on the screen through JavaScript based on the snake model established by the block data model mapping module 2.

[0111] The mouse prompt box adding unit 32 is configured to control the display and hiding of the prompt box by using JavaScript, and the prompt box is displayed when the mouse moves in.

Claims

1.A method for blockchain data visualization based on a snake model, characterized in that: The blockchain data visualization method based on the snake model comprises the following steps in sequence: Step S1: Connect with the blockchain backend, obtain real-time data, and analyze the data to adapt to the data structure of the snake model; Step S2: Build and continuously update the snake model; Step S3: Map the snake model in step S2 with the parsed data in step S1, then build a blockchain data visualization mechanism, and obtain a blockchain data visualization result; Step S4: Draw a mouse prompt box on the screen according to the blockchain data visualization result obtained in step S3; In step S2, the building and continuously updating of the snake model specifically comprises the following steps: Specifically, the following steps are included: Step S21: Initialize the snake model; Step S211: Determine the current state; Current state S t is a tuple (x t , y t , d t , L t , F t , v t , c t ), wherein x t and y t are the horizontal and vertical coordinates of the current snake head, d t is the current snake movement direction, pointing to one of the four directions of up, down, left and right, L t is the current snake length, indicating how many blocks there are on the current snake body, F t is the current food coordinates, v t is the current snake movement speed, and c t is the current snake body color. Step S212: Determine the current action based on the current state; Current action A t is an operation taken in the current state S t , including a move up, down, left or right; Step S213: Determine the state transition function based on the current state and the current action, and obtain a new state; The state transition function T represents the new state S t obtained after taking the current action A t in the current state S t+1 ; Step S214: Determine the reward function based on the new state; The reward function R represents the reward in the current state S. t China takes current action A t Gain new state S t+1 The new x and y coordinates of the snake's head after the game are... t+1 and y t+1 With the new food coordinates F t+1 When they coincide, set a new state S. t+1 The length of the snake in the game is increased to the new snake length L. t+1 If the new snake's length is L t+1 Once the set threshold u is reached, the length L of the new snake is shortened by an appropriate ratio. t+1 And set the new snake's body color c t+1 To deepen the understanding on the original basis; Step S22: At each time step t, the snake will make a move according to the current state S t and become a new state S t+1 by the state transition function T Step S23: updating the new state S in step S22 t+1 of the attribute; Step S231: setting the new direction d of the new state S t+1 of the new snake t+1 ; the new direction d of the new state S t+1 of the new snake t+1 should be set according to the new food coordinate F t+1 and the new horizontal and vertical coordinates x t+1 and y t+1 of the snake head Step S232: Set the new state S in step S22 t+1 The new Snake game's movement speed v t+1 New state S t+1 The new snake in the game moves at a speed of v. t+1 The new x and y coordinates of the snake's head should be used as a basis for the game. t+1 and y t+1 Reach the new food coordinates F t+1 Required time step setting; if the required time step is too small, appropriately increase the interval time of the spacer and decrease the movement speed of the new snake v. t+1 Conversely, appropriately reducing the interval time of the spacer and increasing the movement speed of the new snake (v) t+1 To ensure it arrives just in time for the next packing; Step S24: judging whether the new state S t+1 meets the reward function R, and if so, updating the attributes of the new state S t+1 again; In step S3, the mapping of the snake model in step S2 with the parsed data in step S1, then building a blockchain data visualization mechanism, and obtaining a blockchain data visualization result specifically comprises the following steps: Step S31: Map the blockchain to a game of Snake. The entire blockchain is viewed as the snake in the Snake game model, and the packaged blocks are viewed as food in the Snake game model. Let B represent the set of block arrays currently contained in the blockchain. Assume that some block arrays already exist in the blockchain, B = {B1, B2, B3, ..., B...}. i }, where i represents the number of blocks in the set, and the current state S of the snake model obtained in step S2 is... t The length L of the snake in the game t Logically map the block array number i in proportion to the block array number; Step S32: Based on the above logical mapping relationship, a visualization mechanism is established, and a visualization graph is drawn on the screen using JavaScript; Step S33: After a block is successfully packaged, a new block array is added to the blockchain; Step S34: Put the latest block array into the block list and update the latest block array to empty, increase the number of block arrays i in the block chain, at this time the current length L of the snake t Also changes; when the current length L t Exceeds the set threshold, according to the number of block arrays i in the set B, the new snake length L t+1 And the new snake body color c t+1 Then update the snake length and snake body color information in the current state S t ​ Step S35: generate a new food coordinate using a random number generation algorithm, and then assign it to the current state S in the snake model t current food coordinate F t in the current state S Step S36: Update the state of the snake model and redraw the graph to obtain a blockchain data visualization result. 2.The snake model based blockchain data visualization method of claim 1, wherein: In step S1, the connection with the blockchain backend, the obtaining of real-time data, and the analysis of the data to adapt to the data structure of the snake model specifically comprises the following steps: Step S11: The program calls the API interface provided by the blockchain backend to realize the connection and interaction with the blockchain backend, and obtains real-time data; Step S12: Analyze the real-time data obtained in step S11, integrate each block and its detailed information waiting to be packaged and chained into a transaction and put it into the latest block array, and place all block arrays that have been chained in the block list according to the proportion of the snake length and the number of blocks in the blockchain; Step S13: Listen to the blockchain transaction, and insert the new transaction into the latest block array in step S12. 3.The snake model based blockchain data visualization method of claim 2, wherein: In step S12, the detailed information includes block height, generation time, block size, and block hash, and the block list includes all the transactions that have been packaged and chained. 4.The snake model based blockchain data visualization method of claim 1, wherein: In step S4, the drawing of a mouse prompt box on the screen according to the blockchain data visualization result obtained in step S3 specifically comprises the following steps: Step S41: Draw a prompt box on the screen to prompt the user that the mouse is on the graph representing the block information; Step S42: Use JavaScript to control the display and hiding of the prompt box, and display the prompt box when the mouse moves over the snake body or the food. 5.A system employing the blockchain data visualization method based on the snake model according to any one of claims 1 to 4, characterized in that: The blockchain data visualization system based on the snake model comprises a block synchronization module (1), a block data model mapping module (2), and a mapping data visualization module (3); The block synchronization module (1) comprises an acquisition unit (11), an object integration and generation unit (12), and a listening unit (13); The acquisition unit (11) is configured to establish a connection with a blockchain backend, access an interface provided by the blockchain backend to collect information, and synchronize real-time data; The object integration and generation unit (12) is configured to analyze the real-time data provided by the acquisition unit (11), integrate each transaction and its detailed information currently waiting to be packaged and chained into an object, and place the object in a latest block array, and place all block arrays that have been chained in the current blockchain in a block list according to a proportion; The listening unit (13) is configured to listen to the occurrence of blockchain transactions and synchronize the data of new transactions, and then analyze the data by the object integration and generation unit (12) and insert the transactions into the latest block array; The block data model mapping module (2) comprises a model construction unit (21) and a mapping establishment unit (22); The model construction unit (21) is configured to construct a snake model according to the design of the snake model; The mapping establishment unit (22) is configured to map the data of the block list as the body parts of the snake, and map the data of the latest block number as the food of the snake; each packaging is mapped as the snake eating a block, the length of the snake body is constantly increasing, reflecting the growth process of the blockchain; The mapping data visualization module (3) comprises a visual graphics drawing unit (31) and a mouse prompt box adding unit (32); The visual graphics drawing unit (31) is configured to draw blockchain data visualization graphics on the screen based on the snake model established by the block data model mapping module (2) through JavaScript; The mouse prompt box adding unit (32) is configured to control the display and hiding of the prompt box by using JavaScript, and display the prompt box when the mouse moves in.

Citation Information

Patent Citations

  • Motion excitation method applied to intelligent wearable equipment, and intelligent wearable equipment

    CN108635807A

  • Visual blockchain browser

    CN110337647A