Block diagram system simulation method, apparatus, device, and storage medium
By using the pre-set block graph system's block data structure to generate and perform consensus determination, the problem of the lack of universal applicability of blockchain simulation is solved, and efficient block graph simulation is achieved.
Patent Information
- Application Number
- CN202411860378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-17
AI Technical Summary
Existing technologies for simulating blockchains or block graphs lack universal applicability, resulting in low simulation efficiency. Algorithms need to be redesigned for different types of blockchains or block graphs.
By using the block data structure corresponding to the pre-set block graph system, the target block graph is generated based on the parameters input through the interactive interface, and consensus determination is performed to realize the simulation generation and consensus determination of different types of block graph systems.
It improves the universality and efficiency of block graph simulation, making it applicable to various types of block graph systems.
Smart Images

Figure CN119728449B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of block diagram, and particularly relates to a block diagram system simulation method, device, equipment and storage medium. BACKGROUND
[0002] At present, the simulation of a block chain system is usually based on a specific consensus scheme to implement an algorithm, so as to simulate and verify the effectiveness of a specific block chain or block diagram. The application range is limited, and it cannot be applied to various types of block chains or blocks. When simulating different types of block chains or block diagrams, the corresponding algorithm needs to be redesigned, resulting in low simulation efficiency of the block chain or block diagram. SUMMARY
[0003] Therefore, the present application provides a block diagram system simulation method, device, equipment and storage medium to solve the problems of low simulation efficiency and lack of universal applicability in simulating block chains or block diagrams.
[0004] In a first aspect, the present application provides a block diagram system simulation method, which comprises:
[0005] In response to a network generation instruction, a target network is generated based on network simulation parameters input in an interactive interface, and is displayed in the interactive interface;
[0006] In response to a block diagram simulation instruction, a target block diagram is generated based on a block data structure corresponding to block simulation parameters input in the interactive interface and the target network, and is displayed in the interactive interface;
[0007] Consensus determination is performed on blocks included in the target block diagram, a target block set corresponding to the target block diagram is obtained, and is displayed in the interactive interface.
[0008] In an optional implementation, the network simulation parameters comprise network size parameters and network structure parameters; the target network is generated based on the network simulation parameters input in the interactive interface, comprising:
[0009] The topology structure of the target network is determined based on the network structure parameters;
[0010] The number of nodes of the target network is determined based on the network size parameters;
[0011] The target network is generated based on the topology structure and the number of nodes of the target network.
[0012] In an optional implementation, the network simulation parameters further comprise node configuration parameters; the target network is generated based on the network simulation parameters input in the interactive interface, further comprising:
[0013] Based on the node configuration parameters, each network node in the target network is configured.
[0014] In an optional implementation, the block simulation parameters include system selection parameters; based on the input block simulation parameters in the interactive interface and the target network, a target block diagram is generated, including:
[0015] Based on the system selection parameters, a target simulation system is determined, as well as the block data structure and block generation strategy corresponding to the target simulation system;
[0016] Based on the block data structure and the block generation strategy, the network nodes in the target network are simulated by blocks to generate simulation blocks;
[0017] Based on the generated simulation blocks, the target block diagram is constructed.
[0018] In an optional implementation, based on the block data structure and the block generation strategy, the network nodes in the target network are simulated by blocks to generate simulation blocks, including:
[0019] Based on the block generation strategy, a target node in the target network is determined; the target node is a network node for block simulation;
[0020] The block data structure is called to generate simulation blocks in the target node.
[0021] In an optional implementation, the block data structure includes reference information corresponding to the simulation system, and the reference information is used to limit the block diagram structure of the corresponding simulation system;
[0022] The reference information includes main reference information and general reference information of the corresponding simulation system.
[0023] In an optional implementation, after the consensus determination of the blocks included in the target block diagram is performed to obtain a target block set corresponding to the target block diagram, the method further includes:
[0024] The simulation blocks in the target block set are sorted to obtain an arrangement order;
[0025] According to the arrangement order, the simulation blocks in the target block set are numbered.
[0026] In a second aspect, the present application provides a block diagram system simulation device, which comprises:
[0027] A network generation module is configured to generate a target network based on the network simulation parameters input in the interactive interface and display the target network in the interactive interface in response to a network generation instruction.
[0028] The block diagram generation module is configured to, in response to a block diagram simulation instruction, generate a target block diagram based on a block data structure corresponding to input block simulation parameters in the interactive interface and a target network, and display the target block diagram in the interactive interface.
[0029] The consensus determination module is configured to determine consensus for the blocks included in the target block diagram to obtain a target block set corresponding to the target block diagram, and display the target block set in the interactive interface.
[0030] In a third aspect, the present application provides a computer device, comprising a memory and a processor, the memory and the processor are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the block diagram system simulation method of the first aspect or any of the corresponding embodiments thereof.
[0031] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the block diagram system simulation method of the first aspect or any of the corresponding embodiments thereof.
[0032] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions, and the computer instructions are used to make a computer execute the block diagram system simulation method of the first aspect or any of the corresponding embodiments thereof.
[0033] The block diagram system simulation method provided by the embodiments of the present application can simulate and determine consensus for different types of block diagram systems by presetting block data structures corresponding to each block diagram system, determining the corresponding block data structure according to the input block simulation parameters in the interactive interface when receiving a block diagram simulation instruction, simulating and generating a target block diagram according to the corresponding block data structure, and determining consensus for the target block diagram, thereby improving the universal applicability and efficiency of block diagram simulation. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0035] Figure 1 is a flowchart of the block diagram system simulation method according to the embodiments of the present application;
[0036] Figure 2 is a schematic diagram of the interactive interface according to the embodiments of the present application;
[0037] Figure 3 is a schematic diagram of a target network displayed in an interactive interface according to an embodiment of the present application;
[0038] Figure 4 is a schematic diagram of a target block diagram displayed in an interactive interface according to an embodiment of the present application;
[0039] Figure 5 is a flowchart of another block diagram system simulation method according to an embodiment of the present application;
[0040] Figure 6 is a flowchart of yet another block diagram system simulation method according to an embodiment of the present application;
[0041] Figure 7 is a structural schematic diagram of a block diagram system simulation system according to an embodiment of the present application;
[0042] Figure 8 is a structural block diagram of a block diagram system simulation apparatus according to an embodiment of the present application;
[0043] Figure 9 is a hardware structural schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0045] At present, the simulation of a blockchain system is usually based on a specific consensus scheme to implement an algorithm, so as to simulate and verify the effectiveness of a specific blockchain or block diagram, and the application range is limited, which cannot be applied to various types of blockchains or blocks. When simulating different types of blockchains or block diagrams, the corresponding algorithm needs to be redesigned, resulting in low simulation efficiency of the blockchains or block diagrams.
[0046] Based on this, the embodiment of the present application provides a block diagram system simulation method, in response to a network generation instruction, based on the network simulation parameters input in the interactive interface, a target network is generated and displayed in the interactive interface; in response to a block diagram simulation instruction, based on the block data structure corresponding to the block simulation parameters input in the interactive interface and the target network, a target block diagram is generated and displayed in the interactive interface; the blocks included in the target block diagram are subjected to consensus determination, and a target block set corresponding to the target block diagram is obtained and displayed in the interactive interface. In this way, by predefining the block data structure corresponding to each block diagram system, when the block diagram simulation instruction is received, the corresponding block data structure is determined according to the block simulation parameters input in the interactive interface, the target block diagram is simulated and generated according to the corresponding block data structure, and the target block diagram is subjected to consensus determination, thereby being able to simulate and generate and determine the consensus of different types of block diagram systems, improving the universal applicability and efficiency of block diagram simulation.
[0047] According to the embodiment of the present application, a block diagram system simulation method embodiment is provided, it should be noted that the steps shown in the flowchart of the drawing can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from here.
[0048] In this embodiment, a block diagram system simulation method is provided, Figure 1 is a flowchart of the block diagram system simulation method according to the embodiment of the present application, as Figure 1 shown, the flow includes the following steps:
[0049] Step S101, in response to a network generation instruction, based on the network simulation parameters input in the interactive interface, a target network is generated and displayed in the interactive interface.
[0050] In the embodiment of the present application, the network simulation parameters are used to configure the structure, node quantity and nodes in the generated target network. The interactive interface is provided with a parameter input and selection module, in which the user can input the corresponding network simulation parameters according to the demand, click the network generation control, and the background system of the interactive interface responds to the network generation instruction triggered by the network generation control, obtains the network simulation parameters input by the user in the interactive interface, and generates a target network based on the network simulation parameters, and displays it in the interactive interface, thereby realizing the visualization of the target network, enabling the user to clearly know the network generated by the network simulation parameters input by the user, and enabling the user to confirm whether the generated target network meets the demand.
[0051] In an alternative embodiment, Figure 2 is a schematic diagram of the interactive interface according to the embodiment of the present application, as Figure 1As shown in the figure, in the interactive interface, the console area is a module for parameter input and selection. In the console area, the user can set the network simulation parameters of the target network. After clicking the generate network control, the background system obtains the network simulation parameters input by the user to generate the target network. The node network diagram area in the interactive interface is used to display the target network generated according to the network simulation parameters input by the user, so that the user can understand the network simulation parameters input by the user and the target network generated according to the network simulation parameters. Figure 2 For example, the network simulation parameters input in the console area are used to generate the target network, and the display effect of the target network in the node network diagram is as shown in the figure. Figure 3
[0052] In step S102, in response to the block diagram simulation instruction, a target block diagram is generated based on the block data structure corresponding to the block simulation parameters input in the interactive interface and the target network, and is displayed in the interactive interface.
[0053] As shown in the figure, the console area in the interactive interface can also input block simulation parameters. The block simulation parameters are configuration parameters related to the structure and generation of the block diagram system. After the user inputs the block simulation parameters, the block diagram simulation control is clicked. The background system responds to the block diagram simulation instruction triggered by the block diagram simulation control, obtains the block simulation parameters input by the user, and determines the corresponding block data structure from the preset block data structure based on the block simulation parameters. Meanwhile, the nodes in the target network are simulated and driven in combination with the target network generated in step S101, and the simulation blocks are generated in the nodes, so that the target block diagram is constructed according to the generated simulation blocks, and is displayed in the interactive interface. Figure 2
[0054] In step S103, the blocks included in the target block diagram are subjected to consensus determination, the target block set corresponding to the target block diagram is obtained, and is displayed in the interactive interface.
[0055] In the embodiment of the application, the consensus interface is called to obtain the consensus determination algorithm corresponding to the block simulation parameters, the blocks included in the target block diagram are subjected to consensus determination, the simulation blocks that reach consensus agreement in the target block diagram are taken as the target blocks, and the target block set is formed and displayed in the interactive interface.
[0056] In an optional implementation, since the simulation blocks in the target block diagram are continuously generated, the consensus determination of the simulation blocks in the target block diagram is also continuously performed, that is, when a simulation block is newly generated in the target block diagram, the consensus determination of the simulation blocks included in the current target block diagram is also performed through the consensus determination algorithm.
[0057] In an optional embodiment, the simulation blocks in the target block set can be displayed in the interactive interface in a form different from the simulation blocks in the target block graph, such as being highlighted, colored, or the like. Figure 4 is a schematic diagram of displaying a target block graph in an interactive interface according to an embodiment of the present application, as shown in Figure 4 The generated target block graph is displayed in the block graph display area, and the simulation blocks identified by the bold rectangular frames in the displayed target block graph are the simulation blocks that reach consensus, so that the simulation blocks that reach consensus are directly and clearly displayed to the user on the interactive interface.
[0058] In an optional embodiment, the consensus determination algorithm called by the consensus interface not only determines the consensus of the simulation blocks in the target block graph, but also sorts the simulation blocks that reach consensus, that is, the output after calling the consensus interface is actually an unordered set and an ordered list. Specifically, after obtaining the target block set corresponding to the target block graph, the simulation blocks in the target block set are sorted to obtain the sorting order, and the simulation blocks in the target block set are numbered according to the sorting order.
[0059] In an optional embodiment, the sorting result of the simulation blocks in the target block set, that is, the numbering of the simulation blocks, can be displayed synchronously in the interactive interface. For example, as shown in Figure 4 The simulation blocks identified by the bold rectangular frames are numbered respectively, and the numbering represents the sorting result of the simulation blocks in the target block set.
[0060] In an optional embodiment, as shown in Figure 2-4 Logs in the block graph generation process can also be exported and displayed in the log output area of the interactive interface. Similarly, the logs in the block graph generation process can be displayed in the statistical result of the interactive interface.
[0061] In this embodiment, a block graph system simulation method is provided, Figure 5 is a flowchart of another block graph system simulation method according to an embodiment of the present application, as shown in Figure 5 The flowchart includes the following steps:
[0062] Step S501, in response to a network generation instruction, generating a target network based on network simulation parameters input in the interactive interface and displaying the target network in the interactive interface.
[0063] In the embodiment of the present application, the network simulation parameters include network structure parameters and network scale parameters. The network structure parameters are used to represent the topology of the target network, and the network scale parameters are used to represent the network scale of the target network, which can be measured by the number of nodes, for example. Correspondingly, step S501 includes:
[0064] In step S5011, the topology structure of the target network is determined based on the network structure parameter.
[0065] In the embodiment, the topology structure corresponding to the input network structure parameter in the interactive interface is determined, and the topology structure is taken as the topology structure of the target network.
[0066] In one embodiment, the network type can be taken as the network structure parameter, and a plurality of types of topology structures are preset in the background system for the user to select. The user can be provided with a channel to select the network type by setting a network type selection box in the control console. Figure 2 For example, Figure 2 If the PeerNet is selected in the select network selection box, the network structure parameter, or the network type, is the PeerNet, and thus the topology structure of the target network is determined as the topology structure of the PeerNet type network.
[0067] In step S5012, the node number of the target network is determined based on the network scale parameter.
[0068] In the embodiment, the node number can be taken as the network scale parameter, and the input network scale parameter of the user can be taken as the node number of the target network. For example, Figure 2 and Figure 3 For example, Figure 2 If the node number input in the network scale input box is 6, the target network generated in the Figure 3 contains 6 network nodes.
[0069] In step S5013, the target network is generated based on the topology structure and the node number of the target network.
[0070] In the embodiment, the target network is generated by setting a corresponding number of network nodes according to the topology structure and the node number of the target network.
[0071] In an optional implementation, the network simulation parameters further include node configuration parameters. The node configuration parameters are configurations related to the computing power of the nodes in the target network and the transmission between the nodes in the target network, that is, the network structure parameters and the network scale parameters are the definition and configuration of the structure of the target network, and the node configuration parameters are the definition and configuration of the data transmission of the target network. Correspondingly, based on the network simulation parameters input in the interaction interface, generating the target network further includes the step of configuring each network node in the target network based on the node configuration parameters. The node configuration parameters can include a node computing power coefficient (hash rate) and a network transmission delay (propagation delay). The node computing power coefficient is used to represent the probability of the network node being selected to generate a new block in the target network, and the network transmission delay is used to simulate the time consumed for transmitting data in the target network.
[0072] Step S502, in response to the block graph simulation instruction, generating a target block graph based on the block data structure corresponding to the block simulation parameters input in the interaction interface and the target network, and displaying the target block graph in the interaction interface. For details, please refer to Figure 1 Step S102 of the embodiment shown in the figure will not be repeated here.
[0073] Step S503, performing consensus determination on the blocks included in the target block graph to obtain a target block set corresponding to the target block graph, and displaying the target block set in the interaction interface. For details, please refer to Figure 1 Step S103 of the embodiment shown in the figure will not be repeated here.
[0074] In this embodiment, a block graph system simulation method is provided, Figure 6 is a flowchart of another block graph system simulation method according to an embodiment of the application, as shown in the figure, the flowchart includes the following steps: Figure 5
[0075] Step S601, in response to a network generation instruction, generating a target network based on network simulation parameters input in an interaction interface, and displaying the target network in the interaction interface. For details, please refer to Figure 1 Step S101 of the embodiment shown in the figure will not be repeated here.
[0076] Step S602, in response to a block graph simulation instruction, generating a target block graph based on a block data structure corresponding to block simulation parameters input in an interaction interface and a target network, and displaying the target block graph in the interaction interface.
[0077] In the embodiment of the present application, the block simulation parameter includes a system selection parameter, wherein the system selection parameter is used to represent a block diagram system that the user wants to simulate, and the user can input the system selection parameter into the interactive interface by specifying the system name in the selection box of the system selection (choose system) in the console area. Correspondingly, step S602 includes:
[0078] Step S6021, based on the system selection parameter, determines the target simulation system, and the block data structure and the block generation strategy corresponding to the target simulation system.
[0079] In the embodiment of the present application, the corresponding target simulation system is determined based on the system simulation parameter. The block data structure and the block generation interface corresponding to a plurality of simulation systems are pre-stored in the background system. After the target simulation system is determined, the block data structure corresponding to the target simulation system can be called, and the block data structure corresponding to the target simulation system is called to obtain the corresponding block generation strategy.
[0080] In an optional implementation, the block data structure includes reference information corresponding to the simulation system, and the reference information is used to limit the block diagram structure of the corresponding simulation system. The reference information includes main reference information and general reference information of the corresponding simulation system. The main reference information corresponds to the reference content of the main chain of the block diagram, and only references one block. The general reference information corresponds to the additional reference content in the block diagram, and references a block set containing a plurality of blocks.
[0081] In an optional implementation, the reference information of different types of simulation systems is different. For a divergent block diagram system, the main reference information is empty, and the general reference information is specific reference content. For a parallel block diagram system, the main reference information is not empty, and the general reference information as additional reference content is also not empty. For a convergent block diagram system, the main reference information cannot be empty, and the general reference information can be empty. In particular, the simulation of a block chain can be a special case of simulating a convergent block diagram system, that is, the main reference information is not empty, and the general reference information is empty. Therefore, by using different structures of reference information, different types of simulation systems can be simulated.
[0082] In an optional implementation, the block data structure further includes a block identifier, a block type, and a block generator. The block identifier is used to uniquely identify a simulation block, and the block type is used to distinguish whether the corresponding simulation block is a genesis block or a node generation block. When each simulation block is generated, the block data structure is called and loaded, and various types of information in the block data structure are defined, so as to generate a simulation block.
[0083] In an optional embodiment, the block data structure further comprises a block size of the simulation block, the block size being used to represent a data size of the corresponding simulation block, which can be used to simulate a delay of data transmission, i.e., a time required for transmitting the data of the block size. In the process of actual block graph simulation, the delay of data transmission between one simulation block and other simulation blocks is actually determined by two aspects, i.e., a network transmission delay of the target network and a transmission delay corresponding to the block size of the simulation block.
[0084] In an optional embodiment, the block data structure can further comprise transaction information and consensus determination information. The transaction information is used to represent transaction content contained in the simulation block, which is used to expand the function of the simulation system; and the consensus determination information is used to record the consensus determination.
[0085] In step S6022, the network nodes in the target network are simulated based on the block data structure and the block generation strategy, and the simulation block is generated.
[0086] In the embodiment of the present application, based on the block generation strategy, the target node is determined in the target network, the block data structure is called, and the simulation block is generated in the target node. The target node is the network node for block simulation.
[0087] In step S6023, the target block graph is constructed based on the generated simulation block.
[0088] In the embodiment of the present application, according to the front and rear association of the generated simulation block, the simulation blocks are associated and organized by using the graph structure, and the target block graph is obtained.
[0089] In step S603, the consensus determination is performed on the blocks included in the target block graph, the target block set corresponding to the target block graph is obtained, and is displayed in the interactive interface. For details, please refer to Figure 1 The step S103 of the embodiment shown is not repeated here.
[0090] The block diagram system simulation method provided by the embodiment of the present application responds to a network generation instruction, generates a target network based on network simulation parameters input in an interactive interface, and displays the target network in the interactive interface; responds to a block diagram simulation instruction, generates a target block diagram based on a block data structure corresponding to block simulation parameters input in the interactive interface and the target network, and displays the target block diagram in the interactive interface; and performs consensus determination on blocks included in the target block diagram to obtain a target block set corresponding to the target block diagram and display the target block set in the interactive interface. In this way, by predefining block data structures corresponding to various block diagram systems, when the block diagram simulation instruction is received, the corresponding block data structure is determined according to the block simulation parameters input in the interactive interface, the target block diagram is simulated and generated according to the corresponding block data structure, and consensus determination is performed on the target block diagram, thereby enabling simulation generation and consensus determination of different types of block diagram systems, and improving the universal applicability and efficiency of block diagram simulation.
[0091] In the embodiment, a block diagram system simulation system is also provided, as shown in Figure 7 The system can include an interactive module 701, a simulation module 702, a network module 703, a node module 704, and a data module 705. The interactive module 701 provides an interactive interface to the outside, and serves as an intermediary for the simulation module 702, the network module 703, the node module 704, and the data module 705 to interact with the user, on one hand to obtain network simulation parameters and block simulation parameters input by the user, and on the other hand to display generated target networks and target block diagrams and the like. The simulation module 702 is used to drive simulation of the target network and the target block diagram. Specifically, after receiving a network generation instruction issued by the interactive module 701, the simulation module 702 drives the network module 703 to generate a corresponding target network according to the network simulation parameters, and after receiving a block diagram simulation instruction issued by the interactive module 701, the simulation module 702 drives the node module to generate a corresponding target block diagram according to the block simulation parameters. The node module 704 is the core for generating the target block diagram, and defines basic behaviors of network nodes in the target network, specifically including generating a new block, receiving a block transmitted by other nodes through the network, and performing consensus algorithm determination according to a local block diagram. Meanwhile, the node module 704 also includes block generation interfaces and consensus interfaces corresponding to various simulation systems, so that when a block diagram of a new simulation system needs to be generated, the block generation interfaces and the consensus interfaces of the simulation system are provided, the node module 704 can call them, and the block diagram of the simulation system can be generated. The data module 705 is used to provide block data structures, and when the node module 704 generates a simulation block, the node module 704 calls the block data structures in the data module 705.
[0092] There is also provided in the present embodiment a block diagram system simulation apparatus for implementing the above described embodiments and preferred embodiments, which have been described and will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
[0093] The present embodiment provides a block diagram system simulation apparatus, as shown in Figure 8 comprises:
[0094] The network generation module 801 is configured to generate a target network based on the network simulation parameters input in the interactive interface and display the target network in the interactive interface in response to a network generation instruction;
[0095] The block diagram generation module 802 is configured to generate a target block diagram based on the block data structure corresponding to the block simulation parameters input in the interactive interface and the target network and display the target block diagram in the interactive interface in response to a block diagram simulation instruction;
[0096] The consensus determination module 803 is configured to determine the consensus of the blocks included in the target block diagram to obtain a target block set corresponding to the target block diagram and display the target block set in the interactive interface.
[0097] In an optional embodiment, the network simulation parameters include network size parameters and network structure parameters; and the network generation module 801 comprises:
[0098] The topology determination unit is configured to determine the topology of the target network based on the network structure parameters;
[0099] The node number determination unit is configured to determine the number of nodes of the target network based on the network size parameters;
[0100] The target network generation unit is configured to generate the target network based on the topology of the target network and the number of nodes of the target network.
[0101] In an optional embodiment, the network simulation parameters further include node configuration parameters; and based on the network simulation parameters input in the interactive interface, the network generation module 801 further comprises:
[0102] The node configuration unit is configured to configure each network node in the target network based on the node configuration parameters.
[0103] In an optional embodiment, the block simulation parameters include system selection parameters; and the block diagram generation module 802 comprises:
[0104] The simulation system determining unit is configured to determine a target simulation system based on the system selection parameter, and a block data structure and a block generation strategy corresponding to the target simulation system;
[0105] The simulation block generating unit is configured to perform block simulation on the network nodes in the target network based on the block data structure and the block generation strategy, and generate simulation blocks.
[0106] The block graph constructing unit is configured to construct a target block graph based on the generated simulation blocks.
[0107] In an optional implementation, the simulation block generating unit comprises:
[0108] The target node generating sub-unit is configured to determine a target node in the target network based on the block generation strategy, and the target node is a network node for block simulation.
[0109] The simulation block generating sub-unit is configured to generate a simulation block in the target node by calling the block data structure.
[0110] In an optional implementation, the block data structure comprises reference information corresponding to the simulation system, and the reference information is used to define a block graph structure of the corresponding simulation system.
[0111] The reference information comprises main reference information and common reference information of the corresponding simulation system.
[0112] In an optional implementation, the apparatus further comprises:
[0113] The sorting module is configured to sort the simulation blocks in the target block set to obtain an arrangement order.
[0114] The numbering module is configured to number the simulation blocks in the target block set according to the arrangement order.
[0115] Further function descriptions of the above-mentioned modules and units are the same as those of the above-mentioned corresponding embodiments, and will not be described here.
[0116] The block graph system simulation apparatus in the embodiment is presented in the form of functional units, and the units herein refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories executing one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0117] The embodiment of the application further provides a computer device with the block graph system simulation apparatus shown in the above Figure 8 .
[0118] Please refer to Figure 9, Figure 9 is a structural schematic diagram of a computer device provided by an optional embodiment of the present application. As shown in the figure, the computer device comprises one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are communicatively connected with each other by different buses, and can be installed on a common mainboard or in other manners as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of a GUI on an external input / output device, such as a display device coupled to the interface. In some optional embodiments, multiple processors and / or buses can be used together with multiple memories and multiple memory, if needed. Also, multiple computer devices can be connected, each providing part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 9 The processor 10 is taken as an example in the figure. Figure 9
[0119] The processor 10 can be a central processor, a network processor, or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic device, a general array logic, or any combination thereof.
[0120] The memory 20 stores instructions executable by the at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.
[0121] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function; the data storage area can store data created according to the use of the computer device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some optional embodiments, the memory 20 can optionally include a memory remotely arranged with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0122] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid state disk; and the memory 20 can further include a combination of the above kinds of memories.
[0123] The computer device also comprises a communication interface 30 for communication of the computer device with other devices or communication networks.
[0124] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or be implemented as computer code originally stored in a remote storage medium or non-transitory machine readable storage medium and downloaded to a local storage medium and stored in the local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0125] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be invoked or provided. Those skilled in the art should understand that the form of computer program instructions in a computer readable medium includes but is not limited to source files, executable files, installation package files, etc. Correspondingly, the way of computer program instructions executed by a computer includes but is not limited to: the computer directly executes the instructions, or the computer executes the corresponding compiled program after compiling the instructions, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0126] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the present application.
Claims
1. A method for simulating a block diagram system, characterized in that, The method includes: In response to the network generation command, a target network is generated based on the network simulation parameters input in the interactive interface and displayed in the interactive interface; In response to the block graph simulation command, a target block graph is generated based on the block data structure corresponding to the block simulation parameters input in the interactive interface and the target network, and displayed in the interactive interface; the block data structure corresponding to different types of block graph systems has been preset, and the block data structure includes reference information, which includes main reference information and ordinary reference information. The main reference information corresponds to the reference content of the main chain of the block graph and references only one block. The ordinary reference information corresponds to the additional reference content in the block graph and references a block set containing multiple blocks. Consensus determination is performed on the blocks included in the target block graph to obtain the target block set corresponding to the target block graph, and then displayed in the interactive interface.
2. The method according to claim 1, characterized in that, The network simulation parameters include network size parameters and network structure parameters; the generation of the target network based on the network simulation parameters input in the interactive interface includes: Based on the network structure parameters, the topology of the target network is determined; Based on the network size parameters, the number of nodes in the target network is determined; The target network is generated based on its topology and the number of nodes.
3. The method according to claim 2, characterized in that, The network simulation parameters also include node configuration parameters; the process of generating the target network based on the network simulation parameters input in the interactive interface further includes: Based on the node configuration parameters, each network node in the target network is configured.
4. The method according to claim 1, characterized in that, The block simulation parameters include system selection parameters; the generation of the target block graph based on the block data structure corresponding to the block simulation parameters input in the interactive interface and the target network includes: Based on the system selection parameters, the target simulation system, as well as the block data structure and block generation strategy corresponding to the target simulation system, are determined. Based on the block data structure and the block generation strategy, block simulation is performed on network nodes in the target network to generate simulated blocks; Based on the generated simulated blocks, the target block map is constructed.
5. The method according to claim 4, characterized in that, The step of simulating blocks for network nodes in the target network based on the block data structure and the block generation strategy, and generating simulated blocks, includes: Based on the block generation strategy, a target node is determined in the target network; the target node is a network node that performs block simulation. The simulated block is generated in the target node by invoking the block data structure.
6. The method according to claim 4 or 5, characterized in that, The block data structure includes reference information corresponding to the simulation system, and the reference information is used to limit the block graph structure of the corresponding simulation system. The reference information includes the main reference information and ordinary reference information of the corresponding simulation system.
7. The method according to claim 1, characterized in that, After performing consensus determination on the blocks included in the target block map to obtain the target block set corresponding to the target block map, the method further includes: The simulated blocks in the target block set are sorted to obtain the arrangement order; The simulated blocks in the target block set are numbered according to the stated arrangement order.
8. A block diagram system simulation device, characterized in that, The device includes: The network generation module is used to generate a target network based on the network simulation parameters input in the interactive interface in response to the network generation command, and display the target network in the interactive interface. A block graph generation module is used to respond to a block graph simulation command, generate a target block graph based on the block data structure corresponding to the block simulation parameters input in the interactive interface and the target network, and display it in the interactive interface; the block data structure corresponding to different types of block graph systems is pre-set, the block data structure includes reference information, the reference information includes main reference information and ordinary reference information, the main reference information corresponds to the reference content of the main chain of the block graph, and only references one block, the ordinary reference information corresponds to the additional reference content in the block graph, and references a block set containing multiple blocks; The consensus determination module is used to determine the consensus of the blocks included in the target block graph, obtain the target block set corresponding to the target block graph, and display it in the interactive interface.
9. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the block graph system simulation method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the block graph system simulation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Test method and device for blockchain network structure, terminal and storage medium
CN112134762A
Visual block chain consensus algorithm performance test method
CN113923146A