Blockchain data visualization method and system based on greedy snake model

Through the blockchain data visualization method based on the snake model, the problem of insufficient real-time and dynamic display of blockchain data visualization in the existing technology is solved, and the intuitive display and user experience of blockchain information are realized. The ability to reflect blockchain changes and large-scale data processing in real time.

WO2024230204A1PCT designated stage expired Publication Date: 2024-11-14TIANJIN UNIVERSITY OF TECHNOLOGY

Patent Information

Application Number
PCT/CN2024/070017
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-08
Filing Date
2024-01-02
Publication Date
2024-11-14

AI Technical Summary

Technical Problem

The existing blockchain data visualization technology has shortcomings in real-time, dynamic display and user experience, and cannot effectively display the real-time changes and dynamic generation process of blockchain, and it is difficult to intuitively present a large amount of data, which limits users' operations and Experience.

Method used

Using the blockchain data visualization method based on the Snake model, the blockchain data logic is mapped to the Snake Logic by establishing a connection with the blockchain backend, obtaining real-time data and parsing and processing. The elements of the computer use JavaScript to draw visual graphics, show the dynamic changes and growth process of the blockchain, and draw the mouse prompt box on the screen.

Benefits of technology

It realizes the intuitive display of blockchain information, reflects the process of adding new blocks in real time, can process large-scale data, and improves user experience through visual effects, providing interactiveness and data exploration capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024070017_14112024_PF_FP_ABST
    Figure CN2024070017_14112024_PF_FP_ABST
Patent Text Reader

Abstract

A blockchain data visualization method and system based on a greedy snake model. The method comprises the steps: establishing a connection with a back end of a blockchain, acquiring real-time data, and parsing the data to adapt to a data structure of a greedy snake model; constructing and continuously updating the greedy snake model; performing logical mapping on the greedy snake model and the data, and then constructing a blockchain data visualization mechanism to obtain a blockchain data visualization result; and drawing a mouse prompt box on a screen according to the blockchain data visualization result. The present invention has the effects: blockchain information can be converted into elements in a greedy snake game, food is used to simulate block generation, a greedy snake is used to simulate a chain structure of a blockchain, the movement of the snake is used to simulate the extension of the blockchain, and the blockchain packaging process is visually displayed on a screen, so that people can more clearly know the process of adding a new block into the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

A blockchain data visualization method and system based on the snake model Technical Field

[0001] The present invention belongs to the field of blockchain technology, and in particular relates to a blockchain data visualization method and system based on a snake model. Background Art

[0002] Blockchain is an emerging advanced database mechanism that lacks a single controlling body and allows participants to transparently share information, making data more open and secure. Its decentralized, immutable, and consensus-based nature ensures greater trust, security, and efficiency, leading to its adoption in various industries, including energy, finance, and real estate. However, due to the high barrier to entry for blockchain technology and its complex concepts and implementation, mastering it requires specialized knowledge and technical expertise. Non-professionals often find themselves at a loss when viewing blockchain data, leading to the emergence of blockchain data visualization technology.

[0003] In terms of real-time performance, many current blockchain data visualization technologies are based on static data and can only present data that already exists in the blockchain. They are unable to perform real-time data updates and cannot understand the latest status of the blockchain. Therefore, they are insufficient in terms of real-time performance.

[0004] From a technical perspective, the generation and merging process of blockchains is dynamic and requires continuous calculation and updating. However, current blockchain data visualization technology can usually only display the current state of the blockchain, but cannot show the evolutionary process of the blockchain's gradual generation and merging. Therefore, it is impossible to vividly express the generation and merging of blocks.

[0005] From the perspective of user experience, blockchain data visualization currently only uses basic charts, which makes it difficult to present large amounts of blockchain data. The visualization effect is subject to certain limitations and lacks sufficient visual effects, making it difficult to attract users more effectively and unable to interact with users. Users cannot explore and interact with the data according to their needs and interests, which limits user operations and experience. Summary of the Invention

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

[0007] To achieve the above objectives, the blockchain data visualization method based on the snake model provided by the present invention includes the following steps performed in sequence:

[0008] Step S1: Establish a connection with the blockchain backend, obtain real-time data, and parse and process the data to adapt it to the data structure of the snake model;

[0009] Step S2: construct and continuously update the snake model;

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

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

[0012] In step S1, establishing a connection with the blockchain backend, acquiring real-time data, and parsing the data to adapt it to the data structure of the snake model specifically includes the following steps:

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

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

[0015] Step S13: Monitor blockchain transactions and insert new transactions into the latest block array of step S12.

[0016] In step S12, the detailed information includes basic block data including block height, generation time, block size and block hash; the block list includes all transactions that have been packaged and uploaded to the chain.

[0017] In step S2, the construction and continuous updating of the snake model specifically includes the following steps:

[0018] The specific steps include:

[0019] Step S21: Initialize the snake model;

[0020] Step S211: Determine the current state;

[0021] Current status 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 is the horizontal and vertical coordinates of the current snake head, d tIs the current movement direction of the snake, pointing to one of the four directions: up, down, left, and right. t is the current length of the snake, indicating how many blocks are on the snake's body. t is the current food coordinate, v t is the current snake movement speed, c t Is the current snake's body color;

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

[0023] Current action A t In the current state S t An action taken in , including movement up, down, left, or right;

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

[0025] The state transition function T represents the current state S t Take the current action A t The new state S obtained after t +1 ;

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

[0027] The reward function R represents the reward function in the current state S t Take the current action A t Get the new state S t +1 The new horizontal and vertical coordinates x of the snake's head t +1 and y t +1 With the new food coordinate F t +1 When overlapped, set the 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 length of the new snake is L t +1 Reach the set threshold u and select the appropriate ratio to shorten the length of the new snake L t +1 , and set the new snake body color c t +1 Deepen on the original basis;

[0028] Step S22: At each time step t, the snake will eat according to the current state S t Move and change to the new state S through the state transition function Tt +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 New snake movement direction d t +1 ; New state S t +1 The new snake movement direction d t +1 The new food coordinates F t +1 And the new horizontal and vertical coordinates x of the snake's head t +1 and y t +1 To select a shortest path and set it accordingly;

[0031] Step S232: Set the new state S in step S22 t +1 New snake movement speed v t +1 ; New state S t +1 New snake movement speed v in t +1 The new horizontal and vertical coordinates x of the snake's head should be t +1 and y t +1 Arrived at the new food coordinate F t +1 The required time step is set; if the required time step is small, increase the interval time of the spacer appropriately and reduce the speed v of the new snake. t +1 On the contrary, appropriately reduce the interval time of the spacer and speed up the movement speed of the new snake v t +1 , to ensure that it arrives just in time for the next packing;

[0032] Step S24: Determine the new state S in step S23 t +1 Does it meet the reward function R? If it does, update the new state S again t +1 Attributes.

[0033] In step S3, the snake model in step S2 is logically mapped to the data parsed in step S1, and then a blockchain data visualization mechanism is constructed. Obtaining the blockchain data visualization result specifically includes the following steps:

[0034] Step S31: The blockchain is mapped to the snake. The entire blockchain is considered as the snake in the snake model, and the packaged blocks are considered as the food in the snake model. Let B represent the set of block arrays in the current blockchain. Assume that there are already some block arrays in the blockchain, B={B1, B2, B3,..., B i}, i represents the number of block arrays 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 t Logically map in proportion to the number of block arrays i;

[0035] 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;

[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 blockchain increases. At this time, the current length of the snake is L t Also changes; when the current length L t When the set threshold is exceeded, the new snake length L is calculated based on the number of block arrays i in set B. t +1 And the new snake body color c t +1 , then update the current state S t The length of the snake and the color of the snake's body;

[0038] 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 The current food coordinates F in t ;

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

[0040] In step S4, drawing a mouse prompt box on the screen according to the blockchain data visualization result obtained in step S3 specifically includes the following steps:

[0041] Step S41: drawing a prompt box on the screen to prompt the user of information about the graphic block where the mouse is located;

[0042] Step S42: Using JavaScript to control the display and hiding of the prompt box, when the mouse moves to the snake's body or food, the prompt box is displayed.

[0043] The blockchain data visualization system based on the snake model provided by the present invention 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 monitoring unit;

[0045] The collection unit is used to establish a connection with the blockchain backend, access the interface provided by the blockchain backend to collect information and synchronize real-time data;

[0046] The object integration and generation unit is used to: parse the real-time data provided by the collection unit, integrate each transaction currently waiting to be packaged and uploaded to the blockchain and its detailed information into an object and place it in the latest block array, and place all block arrays that have been uploaded to the current blockchain in the block list in proportion;

[0047] The monitoring unit is used to monitor the occurrence of blockchain transactions and synchronize the data of new transactions. The object integration and generation unit then parses the data and inserts the transactions into the latest block array;

[0048] The block data model mapping module includes: a model building unit and a mapping establishment unit;

[0049] The model building unit is used to: build a snake model according to the design of the snake model;

[0050] The mapping establishment unit is used to map the data in the block list to the body parts of the snake, and map the data given by the latest block number to the food of the snake; each packaging is mapped to the snake eating a block, and the length of the snake's body continues to grow, reflecting the growth process of the blockchain;

[0051] The mapping data visual module includes: a visual graphics drawing unit and a mouse prompt box adding unit;

[0052] The visual graphics drawing unit is used to: continuously draw blockchain 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 used to: use JavaScript to control the display and hiding of the prompt box, and display the prompt box when the mouse moves in.

[0054] The blockchain data visualization method and system based on the snake model provided by the present invention have the following beneficial effects:

[0055] 1. The blockchain information can be converted into elements in the Snake game. Food is used to simulate the generation of blocks, and the snake is used to simulate the chain structure of the blockchain. The movement of the snake simulates the extension of the blockchain. The process of blockchain packaging is intuitively displayed on the screen, helping people more clearly understand the process of new blocks being added to the blockchain.

[0056] 2. It can intuitively display the dynamic changes of the blockchain. When a new block is added to the blockchain, the length of the snake's body will increase accordingly, thereby reflecting the changes of the blockchain in real time and ensuring the accuracy of the data.

[0057] 3. As the project continues to run, the amount of data on the blockchain is becoming increasingly large. This invention can process large-scale data by changing the ratio of the snake's body length to the number of blockchain blocks, and by simulating a heat map, the snake's body color deepens as the ratio changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] FIG1 is a step diagram of a blockchain data visualization method based on a snake model provided by the present invention;

[0059] FIG2 is a flowchart of a blockchain data visualization method based on a snake model provided by the present invention;

[0060] FIG3 is a block diagram of a blockchain data visualization system based on a snake model provided by the present invention. Implementation Method

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

[0062] As shown in Figures 1 and 2, the blockchain data visualization method based on the snake model provided by the present invention includes the following steps performed in sequence:

[0063] Step S1: Establish a connection with the blockchain backend, obtain real-time data, and parse and process the data to adapt it to the data structure of the snake model;

[0064] The specific steps include:

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

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

[0067] The detailed information includes basic block data including block height, generation time, block size and block hash; the block list includes all transactions that have been packaged and uploaded to the chain.

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

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

[0070] The snake model can be modeled using a simple discrete time and space dynamics system. In this model, both the snake and the food move in a finite grid space. The length and shape of the snake change over time, while the food regenerates at a fixed time at another location in the grid space.

[0071] The specific steps include:

[0072] Step S21: Initialize the snake model;

[0073] Step S211: Determine the current state;

[0074] Current status 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 is the horizontal and vertical coordinates of the current snake head, d t Is the current movement direction of the snake, pointing to one of the four directions: up, down, left, and right. t is the current length of the snake, indicating how many blocks are on the snake's body. t is the current food coordinate, v t is the current snake movement speed, c t Is the current snake's body color;

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

[0076] Current action A t In the current state St An action taken in , including movement up, down, left, or right;

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

[0078] The state transition function T represents the current state S t Take the current action A t The new state S obtained after t +1 ;

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

[0080] The reward function R represents the reward function in the current state S t Take the current action A t Get the new state S t +1 The new horizontal and vertical coordinates x of the snake's head t +1 and y t +1 With the new food coordinate F t +1 When overlapped, set the 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 length of the new snake is L t +1 Reach the set threshold u and select the appropriate ratio to shorten the length of the new snake L t +1 , and set the new snake body color c t +1 Deepen on the original basis;

[0081] Step S22: At each time step t, the snake will eat according to the current state S t Move and change to the new state S through the state transition function T t +1 ;

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

[0083] The specific steps include:

[0084] Step S231: Set the new state S in step S22 t +1 New snake movement direction d t +1; New state S t +1 The new snake movement direction d t +1 The new food coordinates F t +1 And the new horizontal and vertical coordinates x of the snake's head t +1 and y t +1 To select a shortest path and set it accordingly;

[0085] Step S232: Set the new state S in step S22 t +1 New snake movement speed v t +1 ; New state S t +1 New snake movement speed v in t +1 The new horizontal and vertical coordinates x of the snake's head should be t +1 and y t +1 Arrived at the new food coordinate F t +1 The required time step is set; if the required time step is small, increase the interval time of the spacer appropriately and reduce the speed v of the new snake. t +1 On the contrary, appropriately reduce the interval time of the spacer and speed up the movement speed of the new snake v t +1 , to ensure that it arrives just in time for the next packing;

[0086] Step S24: Determine the new state S in step S23 t +1 Does it meet the reward function R? If it does, update the new state S again t +1 Attributes.

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

[0088] The specific steps include:

[0089] Step S31: The blockchain is mapped to the snake. The entire blockchain is considered as the snake in the snake model, and the packaged blocks are considered as the food in the snake model. Let B represent the set of block arrays in the current blockchain. Assume that there are already some block arrays in the blockchain, B={B1, B2, B3,..., B i}, i represents the number of block arrays 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 t Logically map in proportion to the number of block arrays i;

[0090] 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;

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

[0092] 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 blockchain increases. At this time, the current length of the snake is L t Also changes; when the current length L t When the set threshold is exceeded, the new snake length L is calculated based on the number of block arrays i in set B. t +1 And the new snake body color c t +1 , then update the current state S t The length of the snake and the color of the snake's body;

[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 The current food coordinates F in 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 provide a better user experience, the shortening of the snake's length and the change of its color on the screen may be displayed using animation effects.

[0096] Step S4: Draw a mouse prompt box on the screen according to the blockchain data visualization result obtained in step S3;

[0097] The specific steps include:

[0098] Step S41: drawing a prompt box on the screen to prompt the user of information about the graphic block where the mouse is located;

[0099] Step S42: Using JavaScript to control the display and hiding of the prompt box, when the mouse moves to the snake's body or food, the prompt box is displayed.

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

[0101] As shown in FIG3 , the blockchain data visualization system based on the snake model provided by the present invention includes 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 includes: a collection unit 11, an object integration and generation unit 12 and a monitoring unit 13;

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

[0104] The object integration and generation unit 12 is used to: parse the real-time data provided by the collection unit 11, integrate each transaction currently waiting to be packaged and uploaded to the blockchain and its detailed information into an object and put it into the latest block array, and put all the block arrays that have been uploaded to the current blockchain in the block list in proportion;

[0105] The monitoring unit 13 is used to monitor the occurrence of blockchain transactions and synchronize the data of new transactions. The object integration and generation unit 12 then parses the data and inserts the transactions into the latest block array.

[0106] The block data model mapping module 2 includes: a model building unit 21 and a mapping establishment unit 22;

[0107] The model building unit 21 is used to: build a snake model according to the design of the snake model;

[0108] The mapping establishment unit 22 is used to map the data in the block list to the body part of the snake, and map the data given by the latest block number to the food of the snake. Each packaging is mapped to the snake eating a block, and the length of the snake's body continues to grow, reflecting the growth process of the blockchain.

[0109] The mapping data visual module 3 includes: a visual graphics drawing unit 31 and a mouse prompt box adding unit 32;

[0110] The visual graphics drawing unit 31 is used to continuously draw blockchain data visualization graphics 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 used to control the display and hiding of the prompt box using JavaScript, and display the prompt box when the mouse moves in.

Claims

1. A blockchain data visualization method based on the snake model, characterized by: The blockchain data visualization method based on the snake model includes the following steps performed in sequence: Step S1: Establish a connection with the blockchain backend, obtain real-time data, and parse and process the data to adapt it to the data structure of the snake model; Step S2: construct and continuously update the snake model; Step S3: logically map the snake model in step S2 with the data parsed in step S1, and then construct a blockchain data visualization mechanism to 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.

2. The blockchain data visualization method based on the snake model according to claim 1 is characterized in that: In step S1, the steps of establishing a connection with the blockchain backend, acquiring real-time data, and parsing the data to adapt it to the data structure of the snake model specifically include the following steps: Step S11: The program calls the API interface provided by the blockchain backend to achieve connection and interaction with the blockchain backend and obtain real-time data; Step S12: Analyze the real-time data obtained in step S11, integrate each block currently waiting to be packaged and uploaded to the chain and its detailed information into a transaction and put it into the latest block array, and put all the block arrays that have been uploaded to the current blockchain in the block list according to the ratio of the snake length to the number of blockchain blocks; Step S13: Monitor blockchain transactions and insert new transactions into the latest block array of step S12.

3. The blockchain data visualization method based on the snake model according to claim 2 is characterized in that: In step S12, the detailed information includes basic block data including block height, generation time, block size and block hash; the block list includes all transactions that have been packaged and chained.

4. The blockchain data visualization method based on the snake model according to claim 1 is characterized in that: In step S2, the construction and continuous updating of the snake model specifically includes the following steps: The specific steps include: Step S21: Initialize the snake model; Step S211: Determine the current state; Current Status t is a tuple (x t ,y t ,d t ,L t ,F t ,v t ,c t ), where x t and t is the horizontal and vertical coordinates of the current snake head, d t Is the current movement direction of the snake, pointing to one of the four directions: up, down, left, or right. t is the current length of the snake, indicating how many blocks are on the snake's body. t is the current food coordinate, v t is the current movement speed of the snake, c t is the current snake body color; Step S212: determining a current action based on the current state; Current Action A t In the current state S t An action taken in , including movement up, down, left, or right; Step S213: determining a state transition function based on the current state and the current action to obtain a new state; The state transition function T represents the current state S t Take the current action A t The new state S obtained after t +1 ; Step S214: determining a reward function based on the new state; The reward function R represents the reward function in the current state S t Take the current action A t Get the new state S t +1 The new horizontal and vertical coordinates x of the head of the snake t +1 and t +1 With the new food coordinates F t +1 When overlapped, set the 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 length of the new snake is L t +1 When the set threshold u is reached, select an appropriate ratio to shorten the length of the new snake L t +1 , and set the new snake body color c t +1 Deepen on the original basis; Step S22: At each time step t, the snake will eat according to the current state S t Move and change to the new state S through the state transition function T t +1 ; Step S23: Update the new state S in step S22 t +1 Attributes; Step S231: Set the new state S in step S22 t +1 New snake movement direction d t +1 ; New state S t +1 The new snake movement direction d t +1 The new food coordinates F t +1 And the new horizontal and vertical coordinates x of the snake's head t +1 and t +1 To select a shortest path and set it accordingly; Step S232: Set the new state S in step S22 t +1 The new snake movement speed v t +1 ; New state S t +1 The new snake movement speed v in t +1 The new horizontal and vertical coordinates x of the snake head should be t +1 and t +1 Arrive at the new food coordinate F t +1 The required time step is set; if the required time step is small, increase the interval of the spacer appropriately and reduce the speed v of the new snake t +1 On the contrary, appropriately reduce the interval time of the spacer and speed up the movement speed of the new snake v t +1 , to ensure that it arrives just in time for the next packing; Step S24: Determine the new state S in step S23 t +1 Does it meet the reward function R? If it does, update the new state S again t +1 Attributes.

5. The blockchain data visualization method based on the snake model according to claim 1 is characterized in that: In step S3, the snake model in step S2 is logically mapped with the data parsed in step S1, and then a blockchain data visualization mechanism is constructed to obtain a blockchain data visualization result, which specifically includes the following steps: Step S31: The blockchain is matched with the snake. The entire blockchain needs to be regarded as the snake in the snake model, and the packaged blocks are regarded as the food in the snake model. Let B represent the set of block arrays contained in the current blockchain. Assume that there are already some block arrays in the blockchain, B={B1, B2, B3,..., B i }, i represents the number of block arrays 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 t Logically map in proportion to the number of block arrays i; 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 the 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 be empty, so that the number of block arrays i in the blockchain increases. At this time, the current length of the snake is L t Also changes; when the current length L t When the set threshold is exceeded, the new snake length L is calculated based on the number of block arrays i in set B t +1 And the new snake body color c t +1 , then update the current state S t The length of the snake and the color information of the snake's body; 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 The current food coordinates F in t ; Step S36: Update the state of the snake model and redraw the graph to obtain the blockchain data visualization result.

6. The blockchain data visualization method based on the snake model according to claim 1 is characterized in that: In step S4, drawing a mouse prompt box on the screen according to the blockchain data visualization result obtained in step S3 specifically includes the following steps: Step S41: drawing a prompt box on the screen to prompt the user information about the graphic representing the area where the mouse is located; Step S42: Using JavaScript to control the display and hiding of the prompt box, when the mouse moves to the body of the snake or the food, the prompt box is displayed.

7. A system using any one of the blockchain data visualization methods based on the snake model in claims 1 to 6, 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: a collection unit (11), an object integration and generation unit (12) and a monitoring unit (13); The collection unit (11) is used to: establish a connection with the blockchain backend, access the interface provided by the blockchain backend to collect information and synchronize real-time data; The object integration and generation unit (12) is used to: parse the real-time data provided by the collection unit (11), integrate each transaction currently waiting to be packaged and uploaded to the chain and its detailed information into an object and put it into the latest block array, and put all the block arrays that have been uploaded to the current blockchain in the block list in proportion; The monitoring unit (13) is used to monitor the occurrence of blockchain transactions and synchronize the data of new transactions, and then the object integration and generation unit (12) parses the data and inserts the transaction into the latest block array; The block data model mapping module (2) comprises: a model building unit (21) and a mapping establishment unit (22); The model building unit (21) is used to: build a greedy snake model according to the design of the greedy snake model; The mapping establishment unit (22) is used to: map the data in the block list to the body part of the greedy snake, and map the data given by the latest block number to the food of the greedy snake; each packaging is mapped to the greedy snake eating a block, and the length of the greedy snake's body continues to grow, reflecting the growth process of the blockchain; The mapping data visual module (3) comprises: a visual graphics drawing unit (31) and a mouse prompt box adding unit (32); The visual graphics drawing unit (31) is used to: based on the greedy snake model established by the block data model mapping module (2), continuously draw blockchain data visualization graphics on the screen through JavaScript; The mouse prompt box adding unit (32) is used to control the display and hiding of the prompt box using JavaScript, and display the prompt box when the mouse moves in.

Citation Information

Patent Citations

  • Visualization method and browser for operation state of digital currency block chain

    CN108874634A

  • Visual display method for bulk commodity block chain account book

    CN110245189A

  • Visual blockchain browser

    CN110337647A

  • Block chain data visualization method and system based on greedy snake model

    CN116521797A

Cited By

  • Block graph system simulation method and device, equipment and storage medium

    CN119728449A