Block graph system simulation method and device, equipment and storage medium
By presetting the block data structure of the block diagram system and generating the target block diagram based on the input parameters, the problem that blockchain simulation in the prior art is not universally applicable, and efficient block diagram simulation and consensus judgment are achieved.
Patent Information
- Application Number
- CN202411860378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-17
AI Technical Summary
The existing technology does not have universal applicability to simulate blockchains or block diagrams, resulting in inefficient simulations and cannot be applied to various different types of blockchains or block diagrams.
By presetting the block data structures corresponding to each block diagram system, when receiving the block diagram simulation instructions, the corresponding block data structure is determined based on the block simulation parameters input in the interactive interface, the target block diagram is generated, and consensus is made on it.
It realizes simulation generation and consensus judgment of different types of block diagram systems, which improves the universal applicability and efficiency of block diagram simulation.
Smart Images

Figure CN119728449A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of block diagram technology, and in particular to a block diagram system simulation method, device, equipment and storage medium. Background Art
[0002] At present, the simulation of blockchain systems is usually based on a specific consensus scheme to implement an algorithm to simulate and verify the validity of a specific blockchain or block graph. Its application scope is limited and it cannot be applied to various types of blockchains or blocks. When simulating different types of blockchains or block graphs, the corresponding algorithm needs to be redesigned, resulting in low efficiency in the simulation of blockchains or block graphs. Summary of the invention
[0003] In view of this, the present invention provides a block diagram system simulation method, device, equipment and storage medium to solve the problem that the current simulation of blockchain or block diagram is not universally applicable and the simulation efficiency is low.
[0004] In a first aspect, the present invention provides a block diagram system simulation method, the method comprising:
[0005] In response to the network generation instruction, a target network is generated based on the network simulation parameters input in the interactive interface, and the target network is displayed in the interactive interface;
[0006] In response to the block diagram simulation instruction, based on the block data structure and target network corresponding to the block simulation parameters input in the interactive interface, a target block diagram is generated and displayed in the interactive interface;
[0007] A consensus is made on the blocks included in the target block graph to obtain the target block set corresponding to the target block graph and display it in the interactive interface.
[0008] In an optional implementation, the network simulation parameters include network scale parameters and network structure parameters; generating a target network based on the network simulation parameters input in the interactive interface includes:
[0009] Based on the network structure parameters, determine the topology of the target network;
[0010] Based on the network size parameters, determine the number of nodes in the target network;
[0011] Generate a target network based on the topology and number of nodes of the target network.
[0012] In an optional implementation, the network simulation parameters further include node configuration parameters; generating a target network based on the network simulation parameters input in the interactive interface further includes:
[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 block simulation parameters and the target network input in the interactive interface, generating a target block diagram includes:
[0015] Based on the system selection parameters, determine the target simulation system, 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 block generation strategy, the network nodes in the target network are simulated to generate simulated blocks;
[0017] Based on the generated simulation blocks, a target block diagram is constructed.
[0018] In an optional implementation, based on the block data structure and the block generation strategy, a block simulation is performed on a network node in a target network to generate a simulated block, including:
[0019] Based on the block generation strategy, a target node is determined in the target network; the target node is a network node for performing block simulation;
[0020] Call the block data structure to generate a simulated block 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 define the block diagram structure of the corresponding simulation system;
[0022] The reference information includes the main reference information and the common reference information of the corresponding simulation system.
[0023] In an optional implementation, after 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, the method further includes:
[0024] Sort the simulation blocks in the target block set to obtain an arrangement order;
[0025] The simulation blocks in the target block set are numbered according to the arrangement order.
[0026] In a second aspect, the present invention provides a block diagram system simulation device, the device comprising:
[0027] A network generation module, for generating a target network in response to a network generation instruction based on network simulation parameters input in the interactive interface, and displaying the target network in the interactive interface;
[0028] A block diagram generation module, for responding to a block diagram simulation instruction, generating a target block diagram based on a block data structure and a target network corresponding to block simulation parameters input in the interactive interface, and displaying the target block diagram in the interactive interface;
[0029] The consensus determination module is used to perform consensus determination on the blocks included in the target block diagram, obtain the target block set corresponding to the target block diagram, and display it in the interactive interface.
[0030] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the block diagram system simulation method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0031] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the block diagram system simulation method of the first aspect or any corresponding embodiment thereof.
[0032] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the block diagram system simulation method of the first aspect or any corresponding embodiment thereof.
[0033] The block diagram system simulation method provided by the embodiment of the present invention pre-sets the block data structure corresponding to each block diagram system, and when receiving a block diagram simulation instruction, determines the corresponding block data structure according to the block simulation parameters input in the interactive interface, simulates and generates the target block diagram according to the corresponding block data structure, and performs consensus determination on the target block diagram, thereby being able to perform simulation generation and consensus determination on different types of block diagram systems, thereby improving the universal applicability and efficiency of block diagram simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 is a flow chart of a block diagram system simulation method according to an embodiment of the present invention;
[0036] Figure 2 is a schematic diagram of an interactive interface according to an embodiment of the present invention;
[0037] Figure 3 is a schematic diagram showing a target network in an interactive interface according to an embodiment of the present invention;
[0038] Figure 4 is a schematic diagram showing a target block diagram in an interactive interface according to an embodiment of the present invention;
[0039] Figure 5 is a flow chart of another block diagram system simulation method according to an embodiment of the present invention;
[0040] Figure 6 is a flowchart of another block diagram system simulation method according to an embodiment of the present invention;
[0041] Figure 7 is a schematic diagram of the structure of a block diagram system simulation system according to an embodiment of the present invention;
[0042] Figure 8 is a structural block diagram of a block diagram system simulation device according to an embodiment of the present invention;
[0043] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] At present, the simulation of blockchain systems is usually based on a specific consensus scheme to implement an algorithm to simulate and verify the validity of a specific blockchain or block graph. Its application scope is limited and it cannot be applied to various types of blockchains or blocks. When simulating different types of blockchains or block graphs, the corresponding algorithm needs to be redesigned, resulting in low efficiency in the simulation of blockchains or block graphs.
[0046] Based on this, an embodiment of the present invention provides a block diagram system simulation method, which responds to a network generation instruction, generates a target network based on the network simulation parameters input in the interactive interface, and displays it in the interactive interface; responds to a block diagram simulation instruction, generates a target block diagram based on the block data structure and the target network corresponding to the block simulation parameters input in the interactive interface, and displays it in the interactive interface; performs consensus determination on the blocks included in the target block diagram, obtains a target block set corresponding to the target block diagram, and displays it in the interactive interface. In this way, by presetting the block data structure corresponding to each block diagram system, when receiving a block diagram simulation instruction, 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 being able to simulate and generate different types of block diagram systems and perform consensus determination, thereby improving the universal applicability and efficiency of block diagram simulation.
[0047] According to an embodiment of the present invention, a block diagram system simulation method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0048] In this embodiment, a block diagram system simulation method is provided. Figure 1 is a flowchart of a block diagram system simulation method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0049] Step S101, 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.
[0050] In the embodiment of the present invention, the network simulation parameters are used to configure the structure, number of nodes and nodes in the generated target network. A parameter input and selection module is provided in the interactive interface, in which the user can input the corresponding network simulation parameters according to the requirements, and after clicking the network generation control, 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 the target network based on the network simulation parameters, and displays it in the interactive interface, thereby realizing the visualization of the target network, allowing the user to clearly understand the network finally generated by the network simulation parameters input by the user, so that the user can confirm whether the generated target network meets the requirements.
[0051] In an optional embodiment, Figure 2 is a schematic diagram of an interactive interface according to an embodiment of the present invention, such as Figure 1As shown in the figure, in the interactive interface, the console area is the module for parameter input and selection. In the console area, users can set the network simulation parameters of the target network. After clicking the generatenetwork control, the background system obtains the network simulation parameters entered 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 entered by the user. Figure 2 Taking the network simulation parameters input in the console area as an example, the generated target network is finally displayed in the node network diagram as follows Figure 3 shown.
[0052] Step S102, in response to the block diagram simulation instruction, based on the block data structure and target network corresponding to the block simulation parameters input in the interactive interface, a target block diagram is generated and displayed in the interactive interface.
[0053] In the embodiment of the present invention, Figure 2 As shown, the console area in the interactive interface can also input block simulation parameters. Block simulation parameters are configuration parameters related to the structure and generation of the block diagram system. After entering the block simulation parameters, the user clicks the block diagram simulation control. 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 based on the block simulation parameters, determines the corresponding block data structure from the preset block data structure, and at the same time, combined with the target network generated in the above step S101, simulates and drives the nodes in the target network, generates simulation blocks in the nodes, and thus constructs the target block diagram according to the generated simulation blocks, and displays it in the interactive interface.
[0054] Step S103, consensus determination is performed on the blocks included in the target block diagram, a target block set corresponding to the target block diagram is obtained, and the target block set is displayed in the interactive interface.
[0055] In the embodiment of the present invention, the consensus interface is called to obtain the consensus determination algorithm corresponding to the block simulation parameters, and the consensus determination is performed on the blocks included in the target block diagram. The simulation blocks that reach consensus in the target block diagram are used as target blocks, and a target block set is formed and displayed in the interactive interface.
[0056] In an optional implementation, since the simulation blocks in the target block map are continuously generated, the consensus determination of the simulation blocks in the target block map is also continuously performed, that is, when a new simulation block is generated in the target block map, the consensus determination algorithm will be used to perform a consensus determination on the simulation blocks contained in the current target block map.
[0057] In an optional implementation, the simulation blocks in the target block set can be displayed in the interactive interface in a manner different from the simulation blocks in the target block diagram, such as highlighting, coloring, or other display forms. Figure 4 is a schematic diagram showing a target block diagram in an interactive interface according to an embodiment of the present invention, such as Figure 4 As shown, the generated target block diagram is displayed in the block diagram display area. In the displayed target block diagram, the simulation blocks marked by the bold rectangular frame are the simulation blocks that have reached consensus, so that the simulation blocks that have reached consensus are directly and clearly displayed to the user on the interactive interface.
[0058] In an optional implementation, the consensus determination algorithm called by the consensus interface will not only make consensus determinations on the simulated blocks in the target block map, but also sort the simulated blocks that have reached 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 map, sort the simulated blocks in the target block set to obtain the arrangement order; according to the arrangement order, number the simulated blocks in the target block set.
[0059] In an optional implementation, the sorting results of the simulation blocks in the target block set, that is, the numbers of the simulation blocks, can be synchronously displayed in the interactive interface. Figure 4 As shown, the simulation blocks marked by the bold rectangular boxes are numbered respectively, and the numbers represent the sorting results of the simulation blocks in the target block set.
[0060] In an optional embodiment, if Figure 2-Figure 4 As shown, the logs in the process of generating the block diagram can also be exported and displayed in the log output area of the interactive interface. Similarly, the logs in the process of generating the block diagram can be displayed in the statistical results of the interactive interface.
[0061] In this embodiment, a block diagram system simulation method is provided. Figure 5 is a flowchart of another block diagram system simulation method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0062] Step S501, 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.
[0063] In the embodiment of the present invention, the network simulation parameters include network structure parameters and network scale parameters. The network structure parameters are used to characterize the topological structure of the target network, and the network scale parameters can characterize the network scale of the target network, for example, the number of nodes can be used to measure. Accordingly, step S501 includes:
[0064] Step S5011, determining the topology of the target network based on the network structure parameters.
[0065] In the embodiment of the present invention, based on the network structure parameters input in the interactive interface, the topological structure corresponding to the network structure parameters is determined, and the topological structure is used as the topological structure of the target network.
[0066] In one embodiment, the network type can be used as a network structure parameter, and multiple types of topological structures can be preset in the background system for users to choose from; a network type selection box can be set in the console to provide users with a channel for selecting network types. Figure 2 For example, Figure 2 If PeerNet is selected in the select network selection box, the network structure parameter, or the network type, is PeerNet, thereby determining the topology of the target network to be the topology of the PeerNet type network.
[0067] Step S5012, based on the network scale parameter, determine the number of nodes in the target network.
[0068] In the embodiment of the present invention, the number of nodes can be used as the network scale parameter, and accordingly, the network scale parameter input by the user can be used as the number of nodes in the target network. Figure 2 and Figure 3 For example, Figure 2 The number of nodes entered in the network scale input box is 6, so the corresponding Figure 3 The target network generated in contains 6 network nodes.
[0069] Step S5013: Generate a target network based on the topological structure and number of nodes of the target network.
[0070] In the embodiment of the present invention, corresponding to the topological structure of the target network, a corresponding number of network nodes are set according to the number of nodes of the target network, thereby generating the target network.
[0071] In an optional embodiment, the network simulation parameters also 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 limitations and configurations of the structure of the target network, and the node configuration parameters are the limitations and configurations of the data transmission of the target network. Accordingly, based on the network simulation parameters input in the interactive interface, the target network is generated, and the step of configuring each network node in the target network based on the node configuration parameters is also included. Among them, the node configuration parameters may include a node computing power coefficient (hash rate) and a network transmission delay (propagation delay); the node computing power coefficient is used to characterize the probability that a network node in the target network is selected to generate a new block, and the network transmission delay is used to simulate the time consumed to transmit data in the target network.
[0072] Step S502, in response to the block diagram simulation instruction, based on the block data structure and target network corresponding to the block simulation parameters input in the interactive interface, generate a target block diagram and display it in the interactive interface. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0073] Step S503: perform consensus determination on the blocks included in the target block diagram, obtain the target block set corresponding to the target block diagram, and display it in the interactive interface. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0074] In this embodiment, a block diagram system simulation method is provided. Figure 6 is a flowchart of another block diagram system simulation method according to an embodiment of the present invention, such as Figure 5 As shown, the process includes the following steps:
[0075] Step S601, in response to the network generation instruction, based on the network simulation parameters input in the interactive interface, generate the target network and display it in the interactive interface. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0076] Step S602, in response to the block diagram simulation instruction, based on the block data structure and target network corresponding to the block simulation parameters input in the interactive interface, a target block diagram is generated and displayed in the interactive interface.
[0077] In the embodiment of the present invention, the block simulation parameters include system selection parameters, wherein the system selection parameters are used to characterize the block diagram system that the user wants to simulate, and the user can input the system selection parameters into the interactive interface by selecting a specific system name in the selection box of the system selection (choose system) in the console area. Accordingly, step S602 includes:
[0078] Step S6021, based on the system selection parameters, determine the target simulation system, and the block data structure and block generation strategy corresponding to the target simulation system.
[0079] In the embodiment of the present invention, the corresponding target simulation system is determined based on the system simulation parameters. The background system presets the block data structures and block generation interfaces corresponding to various simulation systems. 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 can be 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 define the block diagram structure of the corresponding simulation system; the reference information includes the main reference information and common reference information of the corresponding simulation system. The main reference information corresponds to the reference content of the main chain of the block diagram, which only references one block; the common reference information corresponds to the additional reference content in the block diagram, which references a block set containing multiple blocks.
[0081] In an optional implementation, different types of simulation systems have different reference information. For a divergent block diagram system, the main reference information is empty, and the ordinary reference information is the specific reference content. For a parallel block diagram system, the main reference information is not empty, and the ordinary 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 ordinary reference information can be empty; in particular, the simulation of the blockchain can be used as a special case of simulating a convergent block diagram system, that is, the main reference information is not empty, and the ordinary reference information is empty. Therefore, by using different reference information structures, it is possible to perform block diagram simulation on different types of simulation systems.
[0082] In an optional implementation, the block data structure also 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 to generate a simulation block.
[0083] In an optional embodiment, the block data structure also includes a block size of a simulation block, and the block size is used to characterize the amount of data of the corresponding simulation block, which can be used to simulate the delay of data transmission, that is, the time required to transmit data of the block size. In the process of actual block diagram simulation, the delay of data transmission between a simulation block and other simulation blocks is actually determined by two aspects, which are the superposition of the network transmission delay of the target network and the transmission delay corresponding to the block size of the simulation block.
[0084] In an optional implementation, the block data structure may also include transaction information and consensus determination information. The transaction information is used to characterize the transaction content contained in the simulation block, which is used to expand the function of the simulation system; the consensus determination information is used to record the consensus determination.
[0085] Step S6022: Based on the block data structure and block generation strategy, block simulation is performed on the network nodes in the target network to generate simulated blocks.
[0086] In the embodiment of the present invention, based on the block generation strategy, a target node is determined in the target network, a block data structure is called, and a simulation block is generated in the target node, wherein the target node is a network node for performing block simulation.
[0087] Step S6023, constructing a target block diagram based on the generated simulation block.
[0088] In the embodiment of the present invention, according to the contextual association of the generated simulation blocks, a graph structure is used to associate and organize these simulation blocks to obtain a target block graph.
[0089] Step S603: Perform consensus determination on the blocks included in the target block diagram, obtain the target block set corresponding to the target block diagram, and display it in the interactive interface. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0090] The block diagram system simulation method provided by the embodiment of the present invention generates a target network based on the network simulation parameters input in the interactive interface in response to the network generation instruction, and displays it in the interactive interface; generates a target block diagram based on the block data structure and the target network corresponding to the block simulation parameters input in the interactive interface in response to the block diagram simulation instruction, and displays it in the interactive interface; performs consensus determination on the blocks included in the target block diagram, obtains a target block set corresponding to the target block diagram, and displays it in the interactive interface. In this way, by presetting the block data structure corresponding to each block diagram system, when receiving the block diagram simulation instruction, 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 being able to simulate and generate different types of block diagram systems and perform consensus determination, thereby improving the universal applicability and efficiency of block diagram simulation.
[0091] In this embodiment, a block diagram system simulation system is also provided, such as Figure 7 As shown, the system may include an interaction module 701, a simulation module 702, a network module 703, a node module 704, and a data module 705. The interaction module 701 provides an interaction interface to the outside world, and serves as an intermediary for the interaction between the simulation module 702, the network module 703, the node module 704, and the data module 705 and the user. On the one hand, it obtains the network simulation parameters and block simulation parameters input by the user, and on the other hand, it displays the generated target network and target block diagram, etc. The simulation module 702 is used to drive the simulation of the target network and the target block diagram. Specifically, after receiving the network generation instruction issued by the interaction module 701, the network module 703 is driven to generate the corresponding target network according to the network simulation parameters. After receiving the block diagram simulation instruction issued by the interaction module 701, the node module is driven to generate the corresponding target block diagram according to the block simulation parameters. Node module 704 is the core of generating the target block diagram, which defines the basic behavior of the network nodes in the target network, including generating new blocks, receiving blocks sent by other nodes through network transmission, and making consensus algorithm judgments based on the local block diagram. It also includes the block generation interface and consensus interface corresponding to various simulation systems. When it is necessary to generate a block diagram of a new simulation system, it is only necessary to provide the block generation interface and consensus interface of the simulation system so that the node module 704 can call it, and then the block diagram of the simulation system can be generated. Data module 705 is used to provide a block data structure. When node module 704 generates a simulation block, node module 704 will call the block data structure in data module 705.
[0092] In this embodiment, a block diagram system simulation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0093] This embodiment provides a block diagram system simulation device, such as Figure 8 As shown, including:
[0094] The network generation module 801 is used to generate a target network in response to a network generation instruction based on network simulation parameters input in the interactive interface, and display the target network in the interactive interface;
[0095] The block diagram generation module 802 is used to generate a target block diagram in response to the block diagram simulation instruction based on the block data structure and target network corresponding to the block simulation parameters input in the interactive interface, and display it in the interactive interface;
[0096] The consensus determination module 803 is used to perform consensus determination on the blocks included in the target block diagram, obtain a target block set corresponding to the target block diagram, and display it in the interactive interface.
[0097] In an optional implementation, the network simulation parameters include network scale parameters and network structure parameters; the network generation module 801 includes:
[0098] A topology determination unit, used to determine the topology of the target network based on the network structure parameters;
[0099] A node quantity determination unit, used for determining the number of nodes of a target network based on a network scale parameter;
[0100] The target network generation unit is used to generate the target network based on the topological structure and the number of nodes of the target network.
[0101] In an optional implementation, the network simulation parameters further include node configuration parameters; based on the network simulation parameters input in the interactive interface, the network generation module 801 further includes:
[0102] The node configuration unit is used to configure each network node in the target network based on the node configuration parameters.
[0103] In an optional implementation, the block simulation parameters include system selection parameters; the block diagram generation module 802 includes:
[0104] A simulation system determination unit, used to determine a target simulation system, and a block data structure and a block generation strategy corresponding to the target simulation system based on a system selection parameter;
[0105] A simulation block generation unit, used to perform block simulation on network nodes in the target network based on the block data structure and block generation strategy to generate simulation blocks;
[0106] The block diagram construction unit is used to construct a target block diagram based on the generated simulation blocks.
[0107] In an optional implementation, the simulation block generation unit includes:
[0108] The target node generation subunit is used to determine the target node in the target network based on the block generation strategy; the target node is the network node for performing block simulation;
[0109] The simulation block generation subunit is used to call the block data structure and generate a simulation block in the target node.
[0110] In an optional implementation, the block data structure includes reference information corresponding to the simulation system, and the reference information is used to define the block diagram structure of the corresponding simulation system;
[0111] The reference information includes the main reference information and the common reference information of the corresponding simulation system.
[0112] In an optional embodiment, the device further includes:
[0113] A sorting module is used to sort the simulation blocks in the target block set to obtain an arrangement order;
[0114] The numbering module is used to number the simulation blocks in the target block set according to the arrangement order.
[0115] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0116] The block diagram system simulation device in this embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0117] The embodiment of the present invention also provides a computer device having the above Figure 8 A block diagram of the system simulation device is shown.
[0118] See also Fig. 9, Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9 As shown, the computer device includes: 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 connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0119] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0120] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0121] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0122] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0123] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0124] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or 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 a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0125] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0126] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the present invention.
Claims
1. A block diagram system simulation method, characterized in that: The method comprises: In response to the network generation instruction, a target network is generated based on the network simulation parameters input in the interactive interface, and the target network is displayed in the interactive interface; In response to the 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; A consensus determination is performed on the blocks included in the target block diagram to obtain a target block set corresponding to the target block diagram, and the target block set is displayed in the interactive interface.
2. The method according to claim 1, characterized in that The network simulation parameters include network scale 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, determining the topology of the target network; Based on the network scale parameter, determining the number of nodes of the target network; The target network is generated based on the topological structure of the target network 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 generation of the target network based on the network simulation parameters input in the interactive interface also 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 block data structure corresponding to the block simulation parameters input in the interactive interface and the target network are used to generate a target block diagram, including: Based on the system selection parameters, determine a target simulation system, and a block data structure and a block generation strategy corresponding to the target simulation system; Based on the block data structure and the block generation strategy, perform block simulation on the network nodes in the target network to generate simulated blocks; Based on the generated simulation blocks, the target block diagram is constructed.
5. The method according to claim 4, characterized in that The performing block simulation on the network nodes in the target network based on the block data structure and the block generation strategy to generate simulation blocks includes: Based on the block generation strategy, determining a target node in the target network; the target node is a network node for performing block simulation; The block data structure is called to generate the simulation block in the target node.
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 define the block diagram structure of the corresponding simulation system; The reference information includes main reference information and common reference information of the corresponding simulation system.
7. The method according to claim 1, characterized in that After the 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, the method further includes: Sorting the simulation blocks in the target block set to obtain an arrangement order; The simulation blocks in the target block set are numbered according to the arrangement order.
8. A block diagram system simulation device, characterized in that: The device comprises: A network generation module, for generating a target network in response to a network generation instruction based on network simulation parameters input in the interactive interface, and displaying the target network in the interactive interface; A block diagram generation module, for responding to a block diagram simulation instruction, generating 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 displaying the target block diagram in the interactive interface; The consensus determination module is used to perform consensus determination on the blocks included in the target block diagram, obtain a target block set corresponding to the target block diagram, and display it in the interactive interface.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the block diagram 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, and the computer instructions are used to enable a computer to execute the block diagram 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
Block chain protocol verification platform supporting multiple consensus protocols and cross-fragmentation mechanism
CN116582244A
Block chain simulation device and method, and block chain performance evaluation system and method
CN116775432A
Eye massager
KR102311560B1