Method and device for generating hardware scheme block diagram, electronic equipment and medium
By reading the hardware requirement table and matching and placing the target modules, the hardware solution block diagram is automatically generated, which solves the problems of low drawing efficiency and difficulty in adjustment in the existing technology, and achieves efficient and accurate hardware solution block diagram drawing and development process acceleration.
Patent Information
- Application Number
- CN202410836120.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-17
AI Technical Summary
The existing method of drawing hardware solution block diagrams is inefficient and prone to errors and omissions, and requires manual redrawing when the hardware solution is adjusted, which slows down the project development progress.
By reading the hardware requirements table, matching and placing the target modules, automatically generating hardware solution block diagrams based on connection information, using standardized table formats and project mold libraries to reduce errors, supporting module level attributes and geometric information to determine target coordinates, and realizing automatic layout and connection.
It improves the efficiency of hardware solution block diagram drawing, reduces manual errors, simplifies the solution modification process, and improves project development efficiency and hardware development process.
Smart Images

Figure CN118657846A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and medium for generating a hardware solution block diagram. Background Art
[0002] The hardware solution block diagram is a diagram that displays the design and composition of the hardware system. It outlines the structure and components of the project system, clarifies the functions of different components in the project, facilitates communication between different designers, and helps guide designers to develop projects efficiently and improve project development efficiency.
[0003] The current method for drawing hardware solution block diagrams is to manually write a hardware requirement form based on actual hardware requirements, and then use drawing tools to draw solution block diagrams and assign interfaces for each module based on the project system composition and structural division reflected in the hardware requirement form, and then further check the completed solution block diagram in combination with the hardware requirement form.
[0004] On the one hand, the manual method of drawing hardware solution block diagrams is bound to have errors and omissions; on the other hand, when the hardware solution is adjusted or changed, the solution block diagram needs to be manually redrawn or modified, which is time-consuming and labor-intensive; in summary, the existing efficiency of drawing hardware solution block diagrams is relatively low, which has slowed down the project development progress to a certain extent. Summary of the invention
[0005] The present application provides a method, device, electronic device and medium for generating a hardware solution block diagram, which can improve the efficiency of drawing a hardware solution block diagram, improve the project development efficiency to a certain extent, and thus speed up the hardware development process.
[0006] In a first aspect, the present application provides a method for generating a hardware solution block diagram, the method comprising:
[0007] Reading a hardware requirement table based on the module serial number to obtain a data matrix, wherein the hardware requirement table includes an initial module and the module serial number, and the data matrix is used to store an initial module name and connection information of the initial module;
[0008] Match the initial module name of the initial module in the data matrix with the target module name in the data list to obtain the target module and target geometry information corresponding to the initial module; the data list is obtained by parsing the project mold library, the project mold library includes multiple target modules, and the data list is used to store the target module name and the target geometry information of each target module in the multiple target modules;
[0009] Calculating the target coordinates of the initial module according to the first preset function and the target geometric information;
[0010] Calling the first preset function to obtain the target module from the project mold library, and placing the target module on the drawing interface based on the target coordinates;
[0011] The target modules are connected based on the connection information to generate a hardware solution block diagram.
[0012] Optionally, the initial module includes an initial primary module, the target geometric information includes target area information, the target coordinates include target primary coordinates, and calculating the target coordinates of the initial module according to the first preset function and the target geometric information includes:
[0013] Determine the initial level one module according to the hardware requirement table, the initial level one module being a module having the largest area information among the multiple initial modules;
[0014] Determine the target first-level coordinates of the initial first-level module as the origin coordinates.
[0015] Optionally, the calling of the first preset function to obtain the target module from the project mold library, and placing the target module on the drawing interface based on the target coordinates includes:
[0016] Acquire a target first-level module from the project mold library, wherein the target first-level module corresponds to the initial first-level module;
[0017] The target first-level module is placed on the drawing interface based on the origin coordinates.
[0018] Optionally, the initial module includes an initial secondary module, the target geometric information includes target length information and target width information, the target coordinates include target secondary coordinates, and calculating the target coordinates of the initial module according to the first preset function and the target geometric information includes:
[0019] The target secondary coordinates of the initial secondary module are calculated according to the first preset function, the target length information, and the target width information.
[0020] Optionally, the calling of the first preset function to obtain the target module from the project mold library, and placing the target module on the drawing interface based on the target coordinates includes:
[0021] Acquire a target secondary module from the project mold library, wherein the target secondary module corresponds to the initial secondary module;
[0022] The target secondary module is placed on the drawing interface based on the target secondary coordinates.
[0023] Optionally, the initial module includes an initial first-level module submodule, the initial module name includes an initial first-level module name, and the method further includes:
[0024] Obtain the initial first-level module name of the initial first-level module;
[0025] Perform fuzzy matching between the initial first-level module name and the data list according to a second preset function, and obtain a first matching result based on a preset threshold, wherein the first matching result is used to characterize the initial first-level module submodule that matches the initial first-level module name;
[0026] Acquire a target first-level module submodule from the project mold library, the target first-level module submodule corresponding to the initial first-level module submodule;
[0027] The target primary module submodule is placed inside the target primary module.
[0028] Optionally, the initial module includes an initial secondary module submodule, the initial module name includes an initial secondary module name, and the method further includes:
[0029] Obtaining the initial secondary module name of the initial secondary module;
[0030] Fuzzy matching is performed on the initial secondary module name and the data list according to a third preset function, and a second matching result is obtained based on a preset threshold, wherein the second matching result is used to characterize the initial secondary module submodule that matches the initial secondary module name;
[0031] Acquire a target secondary module submodule from the project mold library, the target secondary module submodule corresponding to the initial secondary module submodule;
[0032] The target secondary module submodule is placed inside the target secondary module.
[0033] Optionally, the connection information includes an arrangement order, the initial module includes an initial three-level module, and the method further includes:
[0034] Obtaining the target three-level modules corresponding to the initial three-level modules and the arrangement order;
[0035] Obtaining target three-level module coordinates according to the first preset function and the arrangement order of the initial three-level modules;
[0036] The target level 3 module is obtained from the project mold library, and the target level 3 module is placed based on the coordinates of the target level 3 module.
[0037] Optionally, the connection information includes a cross-line connector and a connection order, and the connecting the target modules based on the connection information includes:
[0038] If the target modules are connected to different secondary module channels, the target modules are connected based on the cross-row connector;
[0039] If the target modules are connected in the same secondary module channel, the target modules are naturally connected or connected in the arrangement order.
[0040] In a second aspect, the present application further provides a device for generating a hardware solution block diagram, the device comprising:
[0041] A reading unit, used for reading a hardware requirement table based on a module serial number to obtain a data matrix, wherein the hardware requirement table includes an initial module and the module serial number, and the data matrix is used for storing an initial module name and connection information of the initial module;
[0042] a matching unit, used for matching the initial module name of the initial module in the data matrix with the target module name in the data list, to obtain the target module and target geometry information corresponding to the initial module; the data list is obtained by parsing the project mold library, the project mold library includes a plurality of target modules, and the data list is used for storing the target module name and the target geometry information of each target module in the plurality of target modules;
[0043] A calculation unit, configured to calculate the target coordinates of the initial module according to a first preset function and the target geometric information;
[0044] An acquisition unit, configured to call the first preset function to acquire the target module from the project mold library, and place the target module on a drawing interface based on the target coordinates;
[0045] A generating unit is used to connect the target modules based on the connection information to generate a hardware solution block diagram.
[0046] Optionally, the initial module includes an initial primary module, the target geometric information includes target area information, the target coordinates include target primary coordinates, and the calculation unit is specifically used to:
[0047] Determine the initial level one module according to the hardware requirement table, the initial level one module being a module having the largest area information among the multiple initial modules;
[0048] Determine the target first-level coordinates of the initial first-level module as the origin coordinates.
[0049] Optionally, the acquiring unit is specifically used for:
[0050] Acquire a target first-level module from the project mold library, wherein the target first-level module corresponds to the initial first-level module;
[0051] The target first-level module is placed on the drawing interface based on the origin coordinates.
[0052] Optionally, the initial module includes an initial secondary module, the target geometric information includes target length information and target width information, the target coordinates include target secondary coordinates, and the calculation unit is specifically used for:
[0053] The target secondary coordinates of the initial secondary module are calculated according to the first preset function, the target length information, and the target width information.
[0054] Optionally, the acquiring unit is specifically used for:
[0055] Acquire a target secondary module from the project mold library, wherein the target secondary module corresponds to the initial secondary module;
[0056] The target secondary module is placed on the drawing interface based on the target secondary coordinates.
[0057] Optionally, the initial module includes an initial first-level module submodule, the initial module name includes an initial first-level module name, and the device further includes a first submodule placement unit, specifically configured to:
[0058] Obtain the initial first-level module name of the initial first-level module;
[0059] Perform fuzzy matching between the initial first-level module name and the data list according to a second preset function, and obtain a first matching result based on a preset threshold, wherein the first matching result is used to characterize the initial first-level module submodule that matches the initial first-level module name;
[0060] Acquire a target first-level module submodule from the project mold library, the target first-level module submodule corresponding to the initial first-level module submodule;
[0061] The target primary module submodule is placed inside the target primary module.
[0062] Optionally, the initial module includes an initial secondary module submodule, the initial module name includes an initial secondary module name, and the device further includes a second submodule placement unit, specifically configured to:
[0063] Obtaining the initial secondary module name of the initial secondary module;
[0064] Fuzzy matching is performed on the initial secondary module name and the data list according to a third preset function, and a second matching result is obtained based on a preset threshold, wherein the second matching result is used to characterize the initial secondary module submodule that matches the initial secondary module name;
[0065] Acquire a target secondary module submodule from the project mold library, the target secondary module submodule corresponding to the initial secondary module submodule;
[0066] The target secondary module submodule is placed inside the target secondary module.
[0067] Optionally, the connection information includes an arrangement order, the initial module includes an initial three-level module, and the acquisition unit is further used to:
[0068] Obtaining the target three-level modules corresponding to the initial three-level modules and the arrangement order;
[0069] Obtaining target three-level module coordinates according to the first preset function and the arrangement order of the initial three-level modules;
[0070] The target level 3 module is obtained from the project mold library, and the target level 3 module is placed based on the coordinates of the target level 3 module.
[0071] Optionally, the connection information includes an inter-row connector and a connection order, and the generating unit includes a connection module, and the connection module is specifically used to:
[0072] If the target modules are connected to different secondary module channels, the target modules are connected based on the cross-row connector;
[0073] If the target modules are connected in the same secondary module channel, the target modules are naturally connected or connected in the arrangement order.
[0074] In a third aspect, the present application further provides an electronic device, the electronic device comprising a processor and a memory:
[0075] The memory is used to store computer programs;
[0076] The processor is used to execute the method for generating a hardware solution block diagram provided in the first aspect according to the computer program.
[0077] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method for generating a hardware solution block diagram provided in the first aspect above.
[0078] It can be seen that this application has the following beneficial effects:
[0079] The present application provides a method, device, electronic device and medium for generating a hardware solution block diagram. In the method, a hardware requirement table is read based on a module serial number to obtain a data matrix, the hardware requirement table includes an initial module and a module serial number, and the data matrix is used to store an initial module name and connection information of the initial module; the initial module name of the initial module in the data matrix is matched with a target module name in a data list to obtain a target module corresponding to the initial module and target geometry information; the data list is obtained by parsing a project mold library, the project mold library includes multiple target modules, and the data list is used to store the target module name and target geometry information of each target module in the multiple target modules; the target coordinates of the initial module are calculated according to a first preset function and the target geometry information; the first preset function is called to obtain the target module from the project mold library, and the target module is placed in the drawing interface based on the target coordinates; the target modules are connected based on the connection information to generate a hardware solution block diagram.
[0080] This application obtains the initial module information and the connection information between different modules in the initial module that need to be covered in the hardware solution block diagram by reading and analyzing the hardware requirement table, and then matches the module information that needs to be placed in the hardware solution block diagram with the project mold library that is pre-established and has completed the analysis, determines the target coordinates according to the level attributes and geometric information of the initial module, and then drags and drops the target module corresponding to the initial module from the project mold library to the drawing interface, places the target module according to the target coordinates, and connects the modules according to the connection information, so as to realize automatic drawing of the hardware solution block diagram. In this way, the standardized hardware requirement table format and project mold library can reduce mistakes, accurately draw the hardware solution block diagram, and improve the efficiency of drawing the hardware solution block diagram. In addition, when adjusting or changing the scheme, it is only necessary to modify the corresponding position in the hardware requirement table to complete the change or redrawing of the hardware requirement block diagram, simplifying the process of scheme modification, improving the project development efficiency to a certain extent, thereby speeding up the hardware development process. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0082] Figure 1 A flowchart of a method for generating a hardware solution block diagram in an embodiment of the present application;
[0083] Figure 2A flowchart of an embodiment of a method for generating a hardware solution block diagram in an embodiment of the present application;
[0084] Figure 3 This is an example diagram of a project mold library in an embodiment of the present application;
[0085] Figure 4 This is an example diagram of a hardware requirement table in an embodiment of the present application;
[0086] Figure 5 A schematic diagram of the composition of a drawing interface in an embodiment of the present application;
[0087] Figure 6 A schematic diagram of the composition of a hardware solution block diagram in an embodiment of the present application;
[0088] Figure 7 A schematic diagram of the structure of a device 700 for generating a hardware solution block diagram provided in an embodiment of the present application;
[0089] Figure 8 A schematic diagram of the structure of an electronic device 800 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0090] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0091] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, it should be noted that, for ease of description, only the parts related to the present application are shown in the accompanying drawings, not all structures.
[0092] In the prior art, a hardware requirement form is compiled based on the actual hardware requirements, and then based on the project system composition and structural division reflected in the hardware requirement form, drawing tools such as Visio are used to draw the solution block diagram and allocate interfaces for each module, starting from the main control chip. After the drawing is completed, the block diagram is further checked in combination with the requirement form. However, the manual method of drawing the hardware solution block diagram is time-consuming and labor-intensive, prone to errors and omissions, and when the hardware solution requirements are adjusted or changed, the hardware solution block diagram needs to be manually redrawn or modified, which slows down the project development progress to a certain extent.
[0093] Based on this, the present application provides a method, device, electronic device and medium for generating a hardware solution block diagram. In this method, by reading and analyzing the hardware requirement table, the initial module information that needs to be covered in the generation of the hardware solution block diagram and the connection information between different modules in the initial module are obtained, and then the module information that needs to be placed in the hardware solution block diagram is matched with the project mold library that has been established and parsed in advance, and the target coordinates are determined according to the level attributes and geometric information of the initial module. Then, the target module corresponding to the initial module is dragged and dropped from the project mold library to the drawing interface, and the target module is placed and laid out according to the target coordinates. The modules are connected according to the connection information, thereby realizing the automatic drawing of the hardware solution block diagram.
[0094] In this way, in the pre-sales stage of hardware project development, standardized hardware requirements table formats and project mold libraries can reduce errors, accurately draw hardware solution block diagrams, and improve the efficiency of drawing hardware solution block diagrams. In addition, when adjusting or changing the solution, you only need to modify the corresponding position in the hardware requirements table to complete the change or redrawing of the hardware requirements block diagram, which simplifies the solution modification process, improves project development efficiency to a certain extent, and thus speeds up the hardware development process.
[0095] To facilitate understanding of the specific implementation of the method for generating a hardware solution block diagram provided in an embodiment of the present application, an explanation will be given below with reference to the accompanying drawings.
[0096] It should be noted that the subject implementing the method of generating a hardware solution block diagram may be a device for generating a hardware solution block diagram provided in an embodiment of the present application, or may be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method of generating a hardware solution block diagram in the embodiment of the present application, for example, an Internet of Things (IoT) device.
[0097] See also Figure 1 , Figure 1 A flowchart of a method for generating a hardware solution block diagram provided in an embodiment of the present application is provided. The method can be applied to a device for generating a hardware solution block diagram. The device for generating a hardware solution block diagram can be, for example, Figure 7 The device 700 for generating a hardware solution block diagram shown in FIG. 1 may also be integrated in Figure 8 Functional modules of the electronic device 800 are shown.
[0098] In the embodiment of the present application, for example, the following steps may be included:
[0099] S101: Read a hardware requirement table based on the module serial number to obtain a data matrix, where the hardware requirement table includes an initial module and a module serial number, and the data matrix is used to store an initial module name and connection information of the initial module.
[0100] It should be noted that the hardware requirement table is written according to actual needs. The hardware requirement table uses column indexes to explain the information contained. The hardware requirement table includes 6 column indexes: interface definition, comment, #, power, row_connect and device. Among them, the "interface definition" column is a description of the definition of each channel of the chip in the hardware solution block diagram; the "comment" column is the name of the first-level module and the second-level module; the "#" column increases from #0 in sequence, which is the first-level module number and the second-level module number. #0 represents the first-level module, and #1 starts as the second-level module number, which is also a sign of the change of different second-level module units; the "power" column is the power supply of each peripheral chip Type; The "Row_connect" column is a cross-row connection mark, which is used to describe the different channels that need to be connected within a single secondary module or the channels that need to be connected between different secondary modules. The channels that need to be connected within a single module are described by the channel number, and the channels between different modules are described in the format of "secondary module number to be connected / / channel number". Positions that do not need to be connected are marked with "*"; The "Device" index column has multiple columns, which are descriptions of the names of the third-level modules connected to each channel of the second-level module in the order of appearance. That is to say, there are several channels in the current second-level module, and there are several rows in the "Device" column after it. The corresponding positions without third-level module connections are indicated by "*".
[0101] It should be noted that the hardware requirement table of the specified format is read first, and the format of the read hardware requirement table is checked. If the check is correct, the data is read and processed to ensure that the data conforms to the specification, thereby avoiding the inability to import or use the data normally due to incorrect format, which improves the accuracy and efficiency of subsequent data processing to a certain extent. Specifically, the data table is read by column to check whether the number of rows corresponding to different columns is consistent, such as Figure 4 Each row in the "power" column shown should correspond to multiple rows in the same secondary module. The embodiment of the present application reads the data in the hardware requirement table by column to obtain a data matrix of multiple columns of data contained in the hardware requirement table; then, the first-level module name is first identified by the "#0" module serial number identifier, and then the read data matrix is divided by row starting from "#1" according to the index change of the "#" column, and the entire data matrix is sliced into multiple small matrices (i.e., data matrices) with the same number of columns, including the secondary module name corresponding to the current index, the secondary module power supply, the channel connection mark (also a cross-row connector or cross-row connection mark) and the corresponding connected third-level module name.
[0102] S102: Match the initial module name of the initial module in the data matrix with the target module name in the data list to obtain the target module corresponding to the initial module and the target geometry information.
[0103] It should be noted that the data list is obtained by parsing the project mold library, which includes multiple target modules. The data list is used to store the target module name and target geometry information of each target module in the multiple target modules. Specifically, the name, length, width and area of all modules in the current project mold library are parsed and obtained, and the parsed data is stored in the data list. The data list is a 4-column matrix, the first column is the module name, the second column is the length, the third column is the width, and the fourth column is the area. The number of rows in the matrix is the number of modules included in the project mold library.
[0104] It should be noted that the project mold library is a Visio library file for a series of projects of the same type. The file suffix is usually .vss, .vssx, .vsd or .vsdx. The project mold library contains various modules required to generate the hardware solution block diagram of this type of project. The name of each module in the project mold library is a unique mark to identify different modules. The naming of the module is exactly the same as the naming of the module in the hardware requirement table. According to the functional priority, the modules in the project mold library are divided into three levels: primary module, secondary module and tertiary module. The primary module refers to the main control chip in the entire project, the secondary module refers to peripheral chips such as high-drive chips or power chips, and the tertiary module refers to other electronic components in the project, such as diodes. The module area is the mark for dividing the modules into three levels. The primary module has the largest area, and the areas of the secondary and tertiary modules decrease in turn.
[0105] It should be noted that the project mold library provided in the embodiment of the present application can be changed according to the needs of generating a hardware solution block diagram. That is to say, when establishing a project mold library, modules can be extracted or redrawn from the existing project solution block diagram under the premise of meeting the above rules. The established project mold library can be reused in the same type of project without the need for repeated establishment. After the project type changes, the embodiment of the present application can maintain and update the project mold library by adding new module shapes. For example, if a diode is required to generate a hardware solution block diagram for a second type of project, the project mold library is updated to ensure that it contains various modules required to generate the hardware solution block diagram for the second type of project.
[0106] It should be noted that, in order to distinguish the module names in the project mold library from the module names in the hardware requirement table, the module names in the project mold library are called target module names, and the module names in the hardware requirement table are called initial module names. The initial module, target module, etc. are named similarly. In order to illustrate the interface correspondence between the main control chip and the peripheral chip in the hardware solution block diagram and the power connection type of the secondary module, the project mold library can also include corresponding primary module submodules, secondary module submodules and power modules. The naming format of the primary module submodule can be "primary module name_corresponding interface function_corresponding connected secondary module", and the naming format of the secondary module submodule can be "secondary module name_corresponding interface function", and the power module is named according to the actual power type.
[0107] During the specific implementation process, the embodiment of the present application matches the initial module names of all data matrices with the data list, and can obtain the lengths, widths and areas corresponding to all modules in the current hardware requirement table.
[0108] S103: Calculate the target coordinates of the initial module according to the first preset function and the target geometric information.
[0109] It should be noted that the first preset function can be used to calculate the target coordinates and obtain the corresponding target module from the project mold library. The first preset function provided in the embodiment of the present application can be a preset tem_place function, of course, it can also be other functions that can implement the embodiment of the present application, which does not affect the implementation of the embodiment of the present application.
[0110] In a possible implementation, the initial module includes an initial level module, the target geometric information includes target area information, and the target coordinates include target level coordinates. S103 may include S311: determining the initial level module according to the hardware requirement table, the initial level module being the module with the largest area information among the multiple initial modules; S312: determining the target level coordinates of the initial level module as the origin coordinates. Specifically, the embodiment of the present application reads the areas of all the initial modules in the hardware requirement table, and may determine the initial level module with the largest area.
[0111] In one possible implementation, the initial module includes an initial secondary module, the target geometric information includes target length information and target width information, the target coordinates include target secondary coordinates, and S103 may include S321: calculating the target secondary coordinates of the initial secondary module according to the first preset function, the target length information and the target width information.
[0112] It should be noted that the target length information and target width information of the target primary module need to be obtained to calculate the target secondary coordinates, and then combined with the target length information and target width information of the target secondary coordinates. The secondary modules are symmetrically arranged on both sides of the primary module according to the number of secondary modules. For example, if there are 17 secondary modules, the secondary modules 1-9 are arranged from top to bottom on the left side, and the secondary modules 10-17 are arranged from top to bottom on the right side. If there are 18 secondary modules, the secondary modules 1-9 are arranged from top to bottom on the left side, and the secondary modules 10-18 are arranged from top to bottom on the right side according to the placement order from left to right.
[0113] In one implementation, the first preset function may be called to calculate the target secondary coordinates (the center coordinates of the target secondary module) on the left side based on the formula shown in formula (1), and the first preset function may be called to calculate the target secondary coordinates on the right side based on the formula shown in formula (2), wherein formula (1) and formula (2) are as follows:
[0114]
[0115] In formula (1), x 1l is the horizontal coordinate of the center point of the left secondary module, y 1l is the ordinate of the center point of the left secondary module, x f is the width of the first-level module, x s is the width of the current secondary module, y f is the length of the primary module, y s is the length of the current secondary module, a is the horizontal distance between the primary module and the secondary module and the vertical distance between the secondary modules, y is ind is the longitudinal position parameter of the current secondary module, y ind The initial value is 0, and the subsequent increment relationship is: ind =y ind +y s +a. It should be noted that the a value can be set according to the actual situation. It is usually between (1, 10). The smaller the value, the more compact the block diagram, and the larger the value, the more dispersed the block diagram.
[0116]
[0117] In formula (2), x 1r is the horizontal coordinate of the center point of the secondary module on the right, y 1r It is the vertical coordinate of the center point of the secondary module on the right.
[0118] S104: calling a first preset function to obtain a target module from a project mold library, and placing the target module on a drawing interface based on the target coordinates.
[0119] In a possible implementation, S104 provided in the embodiment of the present application may include S411: obtaining a target first-level module from a project mold library, where the target first-level module corresponds to the initial first-level module; S412: placing the target first-level module in the drawing interface based on the origin coordinates.
[0120] As an example, the embodiment of the present application calls the tem_place function. First, the target first-level module is called from the project mold library, and the target first-level module is placed at the coordinate origin (0, 0) of the drawing interface based on the coordinates of the center point of the target first-level module, which serves as the basis for the placement of other modules later.
[0121] In a possible implementation, S104 provided in the embodiment of the present application may include S421: obtaining a target secondary module from a project mold library, where the target secondary module corresponds to the initial secondary module; and S422: placing the target secondary module based on the target secondary coordinates in the drawing interface. It should be noted that the target secondary module is usually placed after the target primary module is placed.
[0122] As an example, after obtaining the center coordinates of the corresponding secondary module according to the method shown in S103, the method continues to call the tem_place function to extract the corresponding secondary module from the project mold library and place it at the corresponding coordinate position in the current drawing interface.
[0123] In one possible implementation, the initial module includes an initial first-level module sub-module, and the initial module name includes an initial first-level module name. The method provided in the embodiment of the present application may also include: obtaining the initial first-level module name of the initial first-level module; fuzzy matching the initial first-level module name with the data list according to a second preset function, and obtaining a first matching result based on a preset threshold, and the first matching result is used to characterize the initial first-level module sub-module that meets the initial first-level module name; obtaining a target first-level module sub-module from the project mold library, and the target first-level module sub-module corresponds to the initial first-level module sub-module; placing the target first-level module sub-module inside the target first-level module.
[0124] In one possible implementation, the initial module includes an initial secondary module sub-module, and the initial module name includes an initial secondary module name. The method provided in the embodiment of the present application may also include: obtaining an initial secondary module name of the initial secondary module; fuzzy matching the initial secondary module name with the data list according to a third preset function, and obtaining a second matching result based on a preset threshold, and the second matching result is used to characterize the initial secondary module sub-module that meets the initial secondary module name; obtaining a target secondary module sub-module from the project mold library, and the target secondary module sub-module corresponds to the initial secondary module sub-module; placing the target secondary module sub-module inside the target secondary module.
[0125] It should be noted that the second preset function may be, for example, the f_member_mcu function, and the third preset function may be, for example, the f_member function. The preset threshold is set based on the needs of the staff, for example, 65% or 70%. Then, a similarity of 65% or 70% with the initial first-level module name in the data list can be regarded as a match, thereby determining whether the current second-level module has corresponding second-level module sub-module and first-level module sub-module. If so, the second-level module sub-module is placed inside the current second-level module shape, and the corresponding first-level module sub-module is placed inside the first-level module at the corresponding position.
[0126] It should be noted that the center point coordinates of the left secondary module submodule, the center point coordinates of the left secondary module corresponding to the primary module submodule, the center point coordinates of each secondary module submodule on the right side, and the center point coordinates of the right secondary module corresponding to the primary module submodule are shown in formula (3), formula (4), formula (5) and formula (6), respectively:
[0127]
[0128] In formula (3), x 2ls is the horizontal coordinate of the center point of the left secondary module submodule, y 2ls is the ordinate of the center point of the left secondary module submodule, l m is the number of submodules of the current secondary module, l s The sequence number of the current submodule.
[0129]
[0130] In formula (4), x 2lf is the horizontal coordinate of the center point of the submodule of the first-level module corresponding to the second-level module on the left, y 2lf It is the ordinate of the center point of the submodule of the first-level module corresponding to the second-level module on the left.
[0131]
[0132] In formula (5), x 2rs is the horizontal coordinate of the center point of the right secondary module submodule, y 2rs It is the ordinate of the center point of the submodule of the secondary module on the right.
[0133]
[0134] In formula (6), x 2rf is the horizontal coordinate of the center point of the submodule of the first-level module corresponding to the second-level module on the right, y 2rf It is the ordinate of the center point of the submodule of the first-level module corresponding to the second-level module on the right.
[0135] It should be noted that after obtaining the corresponding center point coordinates, the embodiment of the present application continues to call the f_member_mcu function or the f_member function to extract the corresponding sub-module from the project mold library and place it at the corresponding position of the current drawing interface.
[0136] In a possible implementation, after placing the submodules, the power supplies corresponding to the secondary modules can be placed. The power supplies of the secondary modules described in the "Power" column are placed. The center point coordinates of the left power module and the center point coordinates of the right power module are shown in formula (7) and formula (8) respectively:
[0137]
[0138] In formula (7), x pl y is the horizontal coordinate of the center point of the power module corresponding to the left secondary module, pl The ordinate of the center point of the power module corresponding to the left secondary module;
[0139]
[0140] In formula (8), x pr y is the horizontal coordinate of the center point of the power module corresponding to the secondary module on the right side, pr It is the ordinate of the center point of the power module corresponding to the right secondary module.
[0141] It should be noted that after obtaining the center coordinates of the power module, the embodiment of the present application calls the tem_place function, extracts the corresponding target power module from the project mold library, and places it at the corresponding position of the current drawing interface to realize the placement of the power module of the secondary module.
[0142] In one possible implementation, the connection information includes an arrangement order, and the initial module includes an initial three-level module. Then, after placing the secondary module, sub-module or power module, the method provided in the embodiment of the present application may further include: obtaining a target three-level module and an arrangement order corresponding to the initial three-level module; obtaining the target three-level module coordinates according to a first preset function and the arrangement order of the initial three-level module; obtaining the target three-level module from the project mold library, and placing the target three-level module based on the target three-level module coordinates.
[0143] Among them, the third-level modules corresponding to the second-level modules are placed on the left and on the right. The center point coordinates of the left third-level module and the center point coordinates of the right third-level module are shown in formula (9) and formula (10) respectively:
[0144]
[0145] In formula (9), x 3l is the horizontal coordinate of the center point of the left third-level module, y3l is the ordinate of the center point of the left third-level module, b represents the distance parameter between the unit module and the small module and between the small modules (that is, the distance parameter between the second-level module and the third-level module and between the third-level modules), x t is the width of the three-level module, c r Indicates the number of channels of the current secondary module, i indicates the channel number corresponding to the current tertiary module, x ind Indicates the small module position parameter, the initial value is 0, and the subsequent increment relationship is: x ind =x ind +x t +a.
[0146]
[0147] In formula (10), x 3r is the horizontal coordinate of the center point of the third-level module on the right, y 3r It is the vertical coordinate of the center point of the third-level module on the right.
[0148] It should be noted that after obtaining the center coordinates of the third-level module, the embodiment of the present application continues to call the tem_place function, extracts the corresponding third-level module from the project mold library, places it at the corresponding position of the current drawing interface, and completes the placement layout of the third-level module.
[0149] S105: Connect the target modules based on the connection information to generate a hardware solution block diagram.
[0150] In one possible implementation, the connection information includes an inter-row connector and a connection order. S105 provided in the embodiment of the present application may include: if the target modules have a connection relationship located in different secondary module channels, the target modules are connected based on the inter-row connector; if the target modules have a connection relationship located in the same secondary module channel, the target modules are naturally connected or connected in order of arrangement.
[0151] It should be noted that the connection relationship provided by the embodiment of the present application that exists in the same secondary module channel can be a primary module and a secondary module, a secondary module and a tertiary module, adjacent tertiary modules located in the same secondary module channel, and the same secondary module submodule and the primary module submodule corresponding to the current secondary module. The natural connection of the embodiment of the present application generally refers to the connection between the primary module and the secondary module. When the modules are connected, if there are submodules in the secondary module, a connection relationship can be established with the primary module through the connection between the corresponding submodules, and there is no need to establish a connection with the primary module separately. The arrangement order of the embodiment of the present application may refer to the arrangement order between the tertiary modules, and the connection is achieved in sequence according to the arrangement order of the tertiary modules in the data matrix.
[0152] The embodiment of the present application connects the modules with connection relationship through straight lines, and the starting point and end point of the connection line are the midpoints of the adjacent vertical sides of the modules to be connected. For some special module shapes such as diodes and motors, the upper end points of the adjacent vertical sides are taken as the starting point or end point. The coordinates of the starting point and end point can be obtained by adding or subtracting 1 / 2 of the length or width of the center point coordinates of the corresponding module according to the position of the module to be connected. According to the coordinates of the starting point and the end point, the embodiment of the present application calls the tem_place function to draw the connection line of the corresponding position in the current drawing interface according to the corresponding starting point and end point coordinates, thereby realizing the connection between different modules.
[0153] It should be noted that cross-row connection refers to the connection between two chips on the same side of the block diagram or different channels of the same chip that may need to be processed. The information required to establish cross-row connection is obtained by reading "Row_connect" in the requirement table. The connection between different chips is described by, for example, "#2 / / 1". #2 refers to the chip module number to which the current chip channel needs to be connected, and "1" refers to the corresponding chip channel that needs to be connected. Within the same chip module, only the channel number needs to be described, such as "2". The embodiment of the present application will recognize the information filled in this column and establish cross-row connection by drawing lines. The schematic diagram of cross-row connection can be seen in Figure 6 .
[0154] In the embodiment of the present application, the connection relationship between channels located in different secondary modules can be obtained through the "Row_connect" column. First, it is determined whether there is a cross-row connection requirement and the type of connection requirement for the current secondary module channel. If it is determined that the current module channel has a connection relationship, the tem_place function is called to horizontally lead out a connection line 1 with a length of (b·m) from the end of the corresponding starting channel to be connected in the current drawing interface, where m is the sum of the number of channels and secondary modules between the connecting channels; then, a connection line 2 is vertically led out upward or downward from the end point of the connection line 1 according to the channel position to be established, and the ordinate of the end point of the connection line 2 corresponds to the ordinate of the end channel to be connected; finally, a connection line is horizontally led out from the end point of the connection line 2 to the end channel to be connected to the end of the channel, so as to complete the cross-row connection of the channels within the same secondary module or between different secondary modules.
[0155] As an example, assume that module #2 has 6 channels and module #5 has 6 channels, and these two modules are in the same column. If you want to establish a cross-row connection between channel 2 of module #2 and channel 3 of module #5, you need to fill in #5 / / 3 in the position corresponding to channel 2 of module #2 in the Row_connect column. The value of m is: 4 (used to indicate that there are 4 channels after channel 2 of module #2) + 2 (used to indicate that there are two channels before channel 3 of module #5) + 2 (used to indicate that there are two channels #3 and #4 between #2 and #5) = 8.
[0156] In one possible implementation, after completing the module layout and inter-module connections in the hardware solution block diagram, text annotation is performed, that is, the interface definition and the name of each secondary module in the hardware solution block diagram are placed, and the tem_place function is called to place the interface definition and the name of each secondary module in text form above the last tertiary module in each secondary module channel and next to the corresponding module, thereby completing the annotation of the interface definition and module name in the hardware solution block diagram.
[0157] In this way, the embodiments of the present application can reduce errors, accurately draw hardware solution block diagrams, and improve the efficiency of drawing hardware solution block diagrams through the standardized hardware requirement table format and project mold library. In addition, when adjusting or changing the solution, it is only necessary to modify the corresponding position in the hardware requirement table to complete the change or redrawing of the hardware requirement block diagram, which simplifies the process of solution modification, improves the project development efficiency to a certain extent, and thus speeds up the hardware development process.
[0158] See also Figure 2 , Figure 2 A flowchart of an embodiment of a method for generating a hardware solution block diagram provided in an embodiment of the present application is shown below. The flowchart of the embodiment of the present application is specifically described in combination with a specific scenario. For example, the following steps may be included:
[0159] Step 1: Create a project mold library as required.
[0160] To establish restriction rules based on the mold library, see Figure 3 , Figure 3 A project mold library provided for an embodiment of the present application includes a primary module, a secondary module, a tertiary module, a power module, and corresponding primary module sub-modules and secondary module sub-modules.
[0161] Step 2: Fill in the hardware requirements form according to the rule restrictions.
[0162] Fill in the hardware requirement form according to the current actual hardware requirements, see Figure 4 , Figure 4 A hardware requirement table is provided for an embodiment of the present application, and the hardware requirement table includes column information such as "Interface Definition", "Comment", "#", "Power", "Row_connect" and "Device". The number of rows in the hardware requirement table is proportional to the current level of hardware requirements. If the hardware requirements change subsequently, you only need to modify the corresponding position of the hardware requirement table to achieve the modification or redrawing of the hardware solution block diagram.
[0163] As an example, the secondary module with module serial number #1, the interface of one channel is defined as main driver_lumbar support side air pump 1, Comment is TPS2HB35-q1, power is UB2, Row_inter is #3 / 2, which is used to indicate the 2 channels of the secondary module with module serial number #3, Device1 is diode, Device2 is X, and the * of Device3 and Device4 indicates empty; the interface of the second channel is defined as main driver_lumbar support channel 1, Comment is TPS2HB35-q1, power is UB2, Row_inter is #2 / 2, which is used to indicate the 2 channels of the secondary module with module serial number #2, Device1 is diode, Device2 is X, and the * of Device3 and Device4 indicates empty.
[0164] As another example, the secondary module with module serial number #2, in which the interface of one channel is defined as main driver_lumbar support side wing air pump 2, Comment is TPS2HB35-q1, power is VBD1, and Row_inter is 2, which is used to indicate the 2 channels connected to this secondary module, Device1 is diode, Device2 is X, and the * of Device3 and Device4 indicates empty; the interface of the second channel is defined as main driver_lumbar support channel 3, Comment is TPS2HB35-q1, power is VBD1, and Row_inter is *, which is used to indicate the channel not connected to any secondary module, Device1 is diode, Device2 is X, and the * of Device3 and Device4 indicates empty.
[0165] Step 3: Read and analyze the mold library.
[0166] Call the Templ_para class method to read and parse the current project template library, obtain the name, length, width and area information of the module in the project template library, and store the corresponding information in the data list. Figure 3 The project mold library shown contains 35 modules. The parsed module name, length, width and area data are stored in the na, h, w, ar_ tuple.
[0167] Step 4: Reading and data processing of hardware requirement table.
[0168] Call the Aly_demand class method to read, process and store the hardware demand table, such as Figure 4 The tabular data shown is read and stored in the matrix Q2, and then the div function is called to divide the data of Q2 by row according to the column index to obtain the data matrix.
[0169] Step 5: Matching and obtaining hardware solution block diagram data.
[0170] After completing the reading of the hardware requirement table and data segmentation in step 4, call the maintem_para function and other_para function with the module name as the mark, match the hardware requirement table data stored in the data matrix with the na, h, w, ar_tuple data obtained in step 3, and obtain the length, width and area information of each module required in the current hardware solution block diagram.
[0171] Step 6: Placement and layout of primary and secondary modules.
[0172] Based on step 5, combined with the parsed module information, the tem_place function is called to place the secondary module based on the data stored in the data matrix. The coordinates of the center point of the primary module are fixed to (0, 0). If a=5 and b=3 are set, then Figure 4 Take the secondary module FS2620 as an example. The length of the FS2620 module is 9.776 and the width is 2.659. The center coordinates of the FS2620 module are (-8.9128, 39.9083). Figure 5 , Figure 5 A drawing interface is provided in an embodiment of the present application. The tem_place function calls the FS2620 module from the project mold library and then places it at the (-8.9128, 39.9083) position of the drawing interface.
[0173] Step 7: Placement and layout of corresponding sub-modules.
[0174] On the basis of step 6, call f_member and f_member_mcu functions to determine and place the secondary module submodule of the current secondary module and the primary module submodule corresponding to the current secondary module. Taking the FS2620 module as an example, the matching threshold is set to 65%. After retrieval, the submodules and corresponding center point coordinates of the FS2620 module are FS2620_BOOST (-8.4696, 43.8187), FS2620_BUCK (-8.4696, 41.8635), FS2620_VDD (-8.4696, 39.9083), FS2620_LDO2 (-8.4696, 3 7.9531) and FS2620_LDO1 (-8.4696, 35.9979); the first-level module sub-modules and corresponding center point coordinates of the corresponding FS2620 module are MCU_FS2620_BOOST (-1.2916, 43.8187), MCU_FS2620_BUCK (-1.2916, 41.8635), MCU_FS2620_VDD (-1.2916, 39.9083), MCU_FS2620_LDO2 (-1.2916, 37.9531) and MCU_FS2620_LDO1 (-1.2916, 35.9979). Figure 5 , the tem_place function will call the corresponding submodule from the project mold library and place it at the corresponding coordinate position.
[0175] Step 8: Placement and layout of the secondary module power supply.
[0176] After placing the secondary module, call the power function to determine and place the power module of the current secondary module. Taking the FS2620 module as an example, the power module of the secondary module is UB_2, and the center point coordinates of the UB_2 module shape are (-8.1151, 44.7963). Figure 5 As shown, call the tem_place function to extract the corresponding power module from the project mold library and place it at the corresponding coordinate position.
[0177] Step 9: Placement layout of the third-level modules.
[0178] After placing the secondary module, call the tem_place function to place the tertiary module corresponding to the current secondary module. Taking the FS2620 module as an example, the center point coordinates of the first tertiary module diode corresponding to channel 1 of the FS2620 module are (-13.4983, 43.9817). Figure 5 As shown, the tem_place function extracts the corresponding third-level module from the project template library and places it at the corresponding coordinate position of the drawing interface.
[0179] Step 10: Establish the connection relationship between corresponding modules.
[0180] Based on steps 6, 7, 8, and 9, call the tem_place function to establish connection lines for models with connection relationships. Taking the FS2620 module as an example, the starting and ending coordinates of the connection line between the FS2620_BOOST module shape and the MCU_FS2620_BOOST module shape are (-7.7534, 43.8187) and (-2.6212, 43.8187). The starting and ending coordinates of the connection line between the FS2620 module and the diode module are (-10.2424, 43.9817) and (-13.2424, 43.9817). Figure 6 As shown, the tem_place function will draw connecting lines at corresponding positions on the drawing interface according to the corresponding starting and ending point coordinates.
[0181] Step 11: Make cross-row connections between secondary module channels.
[0182] On the basis of steps 6, 7, 8, and 9, the tem_place function is called to establish corresponding cross-row connections for the secondary module channels with cross-row connection relationships according to the data stored in the data matrix. Taking the FS2620 module as an example, the starting and ending coordinates of the three connection lines established between channel 1 and channel 3 are (-29.9117, 43.9817), (-23.9117, 43.9817), (-29.9117, 40.723), (-29.9117, 43.9817), (-23.91 17, 40.723), (-29.9117, 40.723); Channel 2 of the FS2620 module is connected to Channel 2 of the TPS2H1335-q1 module with index "#1". The starting and ending coordinates of the three connecting lines are (-17.14, 57.8967), (-54.14, 57.8967), (-52.14, 57.8967), (-52.14, 42.3523), (-52.14, 42.3523), (-17.14, 42.3523). Figure 6 As shown, the tem_place function will draw connecting lines at corresponding positions on the drawing interface according to the corresponding starting and ending point coordinates.
[0183] Step 12: Add a text logo.
[0184] Call the tem_place function to place the interface information and module name and other annotation information stored in the data matrix in the hardware solution block diagram in text form. Taking the FS2620 module as an example, the center coordinates of the text information of channel 5 of the module are (-29.1749, 36.0279). Figure 6As shown, the tem_place function will place the relevant text information stored in the data matrix to the corresponding position of the drawing interface according to the corresponding center point coordinates.
[0185] In this way, through the method provided in the embodiment of the present application, 1. The Python program is used to realize the fully automatic generation of the hardware solution block diagram. Compared with the manual drawing method, the use of software for automatic drawing can significantly improve the drawing efficiency; 2. The mold library specifications and the hardware requirement table format are standardized, which can effectively reduce drawing errors and improve the standardization of the design process; 3. When adjusting or changing the solution, it is only necessary to modify the corresponding position in the requirement table to complete the change or redrawing of the hardware requirements, simplifying the process of solution modification and reducing the corresponding workload; 4. It can be reused in similar projects, and different types of projects can also be reused by upgrading and maintaining the mold library, which has good universality and robustness.
[0186] See also Figure 7 The embodiment of the present application further provides a device 700 for generating a hardware solution block diagram, the device 700 comprising:
[0187] A reading unit 701 is used to read a hardware requirement table based on a module serial number to obtain a data matrix, wherein the hardware requirement table includes an initial module and the module serial number, and the data matrix is used to store an initial module name and connection information of the initial module;
[0188] A matching unit 702 is used to match the initial module name of the initial module in the data matrix with the target module name in the data list to obtain the target module and target geometry information corresponding to the initial module; the data list is obtained by parsing the project mold library, the project mold library includes multiple target modules, and the data list is used to store the target module name and the target geometry information of each target module in the multiple target modules;
[0189] A calculation unit 703, configured to calculate the target coordinates of the initial module according to a first preset function and the target geometric information;
[0190] An acquisition unit 704 is configured to call the first preset function to acquire the target module from the project mold library, and place the target module on a drawing interface based on the target coordinates;
[0191] The generating unit 705 is used to connect the target modules based on the connection information to generate a hardware solution block diagram.
[0192] Optionally, the initial module includes an initial primary module, the target geometric information includes target area information, the target coordinates include target primary coordinates, and the calculation unit 703 is specifically used to:
[0193] Determine the initial level one module according to the hardware requirement table, the initial level one module being a module having the largest area information among the multiple initial modules;
[0194] Determine the target first-level coordinates of the initial first-level module as the origin coordinates.
[0195] Optionally, the acquiring unit 704 is specifically configured to:
[0196] Acquire a target first-level module from the project mold library, wherein the target first-level module corresponds to the initial first-level module;
[0197] The target first-level module is placed on the drawing interface based on the origin coordinates.
[0198] Optionally, the initial module includes an initial secondary module, the target geometric information includes target length information and target width information, the target coordinates include target secondary coordinates, and the calculation unit 703 is specifically used to:
[0199] The target secondary coordinates of the initial secondary module are calculated according to the first preset function, the target length information, and the target width information.
[0200] Optionally, the acquiring unit 704 is specifically configured to:
[0201] Acquire a target secondary module from the project mold library, wherein the target secondary module corresponds to the initial secondary module;
[0202] The target secondary module is placed on the drawing interface based on the target secondary coordinates.
[0203] Optionally, the initial module includes an initial first-level module submodule, the initial module name includes an initial first-level module name, and the device 700 further includes a first submodule placement unit, which is specifically used to:
[0204] Obtain the initial first-level module name of the initial first-level module;
[0205] Perform fuzzy matching between the initial first-level module name and the data list according to a second preset function, and obtain a first matching result based on a preset threshold, wherein the first matching result is used to characterize the initial first-level module submodule that matches the initial first-level module name;
[0206] Acquire a target first-level module submodule from the project mold library, the target first-level module submodule corresponding to the initial first-level module submodule;
[0207] The target primary module submodule is placed inside the target primary module.
[0208] Optionally, the initial module includes an initial secondary module submodule, the initial module name includes an initial secondary module name, and the apparatus 700 further includes a second submodule placement unit, specifically configured to:
[0209] Obtaining the initial secondary module name of the initial secondary module;
[0210] Fuzzy matching is performed on the initial secondary module name and the data list according to a third preset function, and a second matching result is obtained based on a preset threshold, wherein the second matching result is used to characterize the initial secondary module submodule that matches the initial secondary module name;
[0211] Acquire a target secondary module submodule from the project mold library, the target secondary module submodule corresponding to the initial secondary module submodule;
[0212] The target secondary module submodule is placed inside the target secondary module.
[0213] Optionally, the connection information includes an arrangement order, the initial module includes an initial three-level module, and the acquisition unit 704 is further used to:
[0214] Obtaining the target three-level modules corresponding to the initial three-level modules and the arrangement order;
[0215] Obtaining target three-level module coordinates according to the first preset function and the arrangement order of the initial three-level modules;
[0216] The target level 3 module is obtained from the project mold library, and the target level 3 module is placed based on the coordinates of the target level 3 module.
[0217] Optionally, the connection information includes an inter-row connector and a connection order, and the generating unit 705 includes a connection module, and the connection module is specifically used to:
[0218] If the target modules are connected to different secondary module channels, the target modules are connected based on the cross-row connector;
[0219] If the target modules are connected in the same secondary module channel, the target modules are naturally connected or connected in the arrangement order.
[0220] It should be noted that the specific implementation method of the device 700 and the technical effects achieved can be found in Figure 1 or Figure 2 The relevant description in the method shown.
[0221] In addition, the present application embodiment also provides an electronic device 800, such as Figure 8 As shown, the electronic device 800 includes a processor 801 and a memory 802:
[0222] The memory 802 is used to store computer programs;
[0223] The processor 801 is used to execute according to the computer program Figure 1 or Figure 2 Provides a method for generating a hardware solution block diagram.
[0224] In addition, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the method for generating a hardware solution block diagram provided in an embodiment of the present application.
[0225] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0226] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the goals of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0227] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope of the present application.
Claims
1. A method for generating a hardware solution block diagram, characterized in that: The method comprises: Reading a hardware requirement table based on the module serial number to obtain a data matrix, wherein the hardware requirement table includes an initial module and the module serial number, and the data matrix is used to store an initial module name and connection information of the initial module; Match the initial module name of the initial module in the data matrix with the target module name in the data list to obtain the target module and target geometry information corresponding to the initial module; the data list is obtained by parsing the project mold library, the project mold library includes multiple target modules, and the data list is used to store the target module name and the target geometry information of each target module in the multiple target modules; Calculating the target coordinates of the initial module according to the first preset function and the target geometric information; Calling the first preset function to obtain the target module from the project mold library, and placing the target module on the drawing interface based on the target coordinates; The target modules are connected based on the connection information to generate a hardware solution block diagram.
2. The method according to claim 1, characterized in that The initial module includes an initial primary module, the target geometric information includes target area information, the target coordinates include target primary coordinates, and calculating the target coordinates of the initial module according to the first preset function and the target geometric information includes: Determine the initial level one module according to the hardware requirement table, the initial level one module being a module having the largest area information among the multiple initial modules; Determine the target first-level coordinates of the initial first-level module as the origin coordinates.
3. The method according to claim 2, characterized in that The calling of the first preset function to obtain the target module from the project mold library and placing the target module on the drawing interface based on the target coordinates includes: Acquire a target first-level module from the project mold library, wherein the target first-level module corresponds to the initial first-level module; The target first-level module is placed on the drawing interface based on the origin coordinates.
4. The method according to claim 1, characterized in that The initial module includes an initial secondary module, the target geometric information includes target length information and target width information, the target coordinates include target secondary coordinates, and calculating the target coordinates of the initial module according to the first preset function and the target geometric information includes: The target secondary coordinates of the initial secondary module are calculated according to the first preset function, the target length information, and the target width information.
5. The method according to claim 4, characterized in that The calling of the first preset function to obtain the target module from the project mold library and placing the target module on the drawing interface based on the target coordinates includes: Acquire a target secondary module from the project mold library, wherein the target secondary module corresponds to the initial secondary module; The target secondary module is placed on the drawing interface based on the target secondary coordinates.
6. The method according to claim 5, characterized in that The connection information includes an arrangement order, the initial module includes an initial three-level module, and the method further includes: Obtaining the target three-level modules corresponding to the initial three-level modules and the arrangement order; Obtaining target three-level module coordinates according to the first preset function and the arrangement order of the initial three-level modules; The target level 3 module is obtained from the project mold library, and the target level 3 module is placed based on the coordinates of the target level 3 module.
7. The method according to claim 1, characterized in that The connection information includes a cross-line connector and a connection order, and the connecting the target modules based on the connection information includes: If the target modules are connected to different secondary module channels, the target modules are connected based on the cross-row connector; If the target modules are connected in the same secondary module channel, the target modules are naturally connected or connected in the arrangement order.
8. A device for generating a hardware solution block diagram, characterized in that: The device comprises: A reading unit, used for reading a hardware requirement table based on a module serial number to obtain a data matrix, wherein the hardware requirement table includes an initial module and the module serial number, and the data matrix is used for storing an initial module name and connection information of the initial module; a matching unit, used for matching the initial module name of the initial module in the data matrix with the target module name in the data list, to obtain the target module and target geometry information corresponding to the initial module; the data list is obtained by parsing the project mold library, the project mold library includes a plurality of target modules, and the data list is used for storing the target module name and the target geometry information of each target module in the plurality of target modules; A calculation unit, configured to calculate the target coordinates of the initial module according to a first preset function and the target geometric information; An acquisition unit, configured to call the first preset function to acquire the target module from the project mold library, and place the target module on a drawing interface based on the target coordinates; A generating unit is used to connect the target modules based on the connection information to generate a hardware solution block diagram.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 7 according to the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.
