CAN network topological graph generation method and device, equipment, medium and product
By operating CAN network node elements on the rendering interface and generating CAN network topology maps, the problems of low efficiency and high labor cost in generating CAN network topology maps in the prior art are solved, and the effect of quickly generating complex topology maps is achieved.
Patent Information
- Application Number
- CN202510442691.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art is inefficient in generating CAN network topology maps, high labor costs, and it is difficult to quickly generate complex CAN network topology maps.
By obtaining node elements from the CAN network node element library and performing operation instructions (such as node movement instructions and node connection instructions) on the rendering interface, a CAN network topology diagram is generated.
This method greatly improves the generation efficiency of CAN network topology maps, reduces labor costs, and can quickly generate complex CAN network topology maps.
Smart Images

Figure CN119996219A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to industrial Internet technology and simulation technology, and in particular to a method, device, equipment, medium and product for generating a CAN network topology diagram. Background Art
[0002] Controller Area Network (CAN) is a fieldbus network protocol widely used in real-time applications, and is often used in the fields of automobiles, industrial control, etc. Generating a CAN network topology diagram and performing simulation tests on the CAN network topology diagram are prerequisites for ensuring the normal application of the CAN network.
[0003] In some related technologies, designers can draw graphics of each node element in the CAN network one by one based on a web page, and add node attributes to the graphics of each node element drawn one by one, and then connect the graphics of each node element with node attributes to obtain a CAN network topology diagram. Designers edit the icons and attributes of each node element in the CAN network one by one, thereby generating each node element in the CAN network one by one, and connect each node element to generate a CAN network topology diagram. This method of generating a CAN network topology diagram is inefficient and has high labor costs. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, apparatus, device, medium and product for generating a CAN network topology diagram to solve the above-mentioned problems.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for generating a CAN network topology diagram is provided, comprising: Obtain at least one node element from a CAN network node element library; Adding the at least one node element to the rendering interface; Based on the operation instruction for the at least one node element, the operation corresponding to the operation instruction is performed on the at least one node element in the rendering interface to generate a CAN network topology diagram, wherein the operation instruction at least includes a node movement instruction and a node connection instruction.
[0006] In some embodiments of the present disclosure, before acquiring at least one node element from the CAN network node element library, the method further includes: Based on multiple groups of node element parameters, generating multiple node elements, wherein each group of node element parameters includes a node icon and node attributes, and the multiple node elements include at least two of a bus element, a gateway element, and a controller element; The plurality of node elements are stored in the CAN network node element library.
[0007] In some embodiments of the present disclosure, after adding the at least one node element to the rendering interface and before performing, on the rendering interface, an operation corresponding to the operation instruction for the at least one node element to generate a CAN network topology diagram, the process further includes: A node element in the at least one node element is copied or deleted.
[0008] In some embodiments of the present disclosure, based on the operation instruction for the at least one node element, performing the operation corresponding to the operation instruction on the at least one node element in the rendering interface to generate the CAN network topology diagram includes: Based on a node movement instruction for a first target node in the at least one node element, moving the position of the first target node in the rendering interface; Based on the element parameter adjustment instruction for the second target node in the at least one node element, adjusting the element parameter of the second target node in the rendering interface; Based on the node connection instruction for each node in the at least one node element, the nodes are connected to obtain the CAN network topology diagram.
[0009] In some embodiments of the present disclosure, after performing an operation corresponding to the operation instruction on the at least one node element in the rendering interface based on the operation instruction for the at least one node element to generate a CAN network topology diagram, the method further includes: A simulation test is performed based on the CAN network topology diagram to obtain a simulation test result.
[0010] According to a second aspect of an embodiment of the present disclosure, a device for generating a CAN network topology diagram is provided, comprising: A node element acquisition module, used to acquire at least one node element from a CAN network node element library; A node element adding module, used to add the at least one node element to the rendering interface; A topology map generation module is used to generate a CAN network topology map by performing an operation corresponding to the operation instruction on the at least one node element in the rendering interface based on the operation instruction for the at least one node element, wherein the operation instruction includes at least a node movement instruction and a node connection instruction.
[0011] In some embodiments of the present disclosure, the device further includes: A node element generation module, configured to generate a plurality of node elements based on a plurality of sets of node element parameters, wherein each set of the node element parameters comprises a node icon and node attributes, and the plurality of node elements comprises at least two of a bus element, a gateway element, and a controller element; A storage module is used to store the multiple node elements in the CAN network node element library.
[0012] In some embodiments of the present disclosure, the device further includes: The node element editing module is used to copy or delete the node element in the at least one node element.
[0013] In some embodiments of the present disclosure, the topology map generating module includes: A node moving unit, configured to move the position of the first target node in the at least one node element in the rendering interface based on a node moving instruction for the first target node; A parameter adjustment unit, configured to adjust the element parameter of the second target node in the rendering interface based on the element parameter adjustment instruction for the second target node in the at least one node element; The node connection unit is used to connect the nodes based on the node connection instructions for each node in the at least one node element to obtain the CAN network topology diagram.
[0014] In some embodiments of the present disclosure, the device further includes: The simulation test module is used to perform simulation test based on the CAN network topology diagram to obtain simulation test results.
[0015] According to a third aspect of the present disclosure, an electronic device is provided, including: A memory for storing a computer program product; The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method described in the first aspect above is implemented.
[0016] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described in the first aspect is implemented.
[0017] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, enable the processor to execute the method described in the first aspect.
[0018] The method, apparatus, device, medium and product for generating a CAN network topology map in the embodiments of the present disclosure store node elements constituting the CAN network topology map in the CAN network node element library. Therefore, after obtaining at least one required node element from the CAN network node element library and adding it to the rendering interface, the at least one node element is moved and connected according to the operation instructions for the node element input by the user, so that the CAN network topology map can be quickly generated. Compared with drawing the graphics of each node element in the CAN network one by one, adding node attributes to the graphics of each node element drawn one by one, and then connecting the graphics of each node element with node attributes to obtain the CAN network topology map, the generation efficiency of the CAN network topology map can be greatly improved and the labor cost can be reduced.
[0019] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which: Figure 1 A schematic diagram of a process for generating a CAN network topology diagram in some embodiments of the present disclosure; Figure 2 is a flowchart of step S0 in some embodiments of the present disclosure; Figure 3 is a flowchart of step S3 in some embodiments of the present disclosure; Figure 4 It is a structural block diagram of a device for generating a CAN network topology map in some embodiments of the present disclosure; Figure 5 It is a structural block diagram of a device for generating a CAN network topology map in some other embodiments of the present disclosure; Figure 6 is a structural block diagram of a topology map generating module 300 in some embodiments of the present disclosure; Figure 7 It is a structural block diagram of an electronic device in some embodiments of the present disclosure. DETAILED DESCRIPTION
[0022] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0023] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0024] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0025] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0026] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0027] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0028] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0029] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0030] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0031] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0032] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0033] Figure 1 FIG. 1 is a flow chart of a method for generating a CAN network topology diagram in some embodiments of the present disclosure. Figure 1 As shown, the method for generating a CAN network topology diagram includes the following steps: S1: Obtain at least one node element from a CAN network node element library.
[0034] The CAN network node element library stores a plurality of node elements, and each node element in the CAN network node element library has corresponding element parameters.
[0035] In one example of the present disclosure, the node elements stored in the CAN network node element library may include bus elements. The element parameters of the bus element may include bus type, bus width, bus bandwidth, etc. Bus types include data bus, address bus, and control bus. Bus width refers to the number of bits that can simultaneously transmit binary information on the bus, while bandwidth refers to the amount of data that can be transmitted per unit time.
[0036] In another example of the present disclosure, the node elements stored in the CAN network node element library may include CAN gateway elements. The element parameters of the CAN gateway element may include supported communication protocols, communication rates, and power supply parameters, etc. The supported communication protocols may include, for example, CAN2.0A and CAN2.0B protocols. The communication rates may include, for example, 20kbps, 50kbps, 100kbps, 125kbps, 250kbps, 500kbps, 800kbps, and 1Mbps. The power supply parameters may include, for example, a voltage range of 18V to 30V and a maximum power of 3.5W.
[0037] Each node element stored in the CAN network node element library can be regarded as a standard element with corresponding element parameters. In addition, each node element stored in the CAN network node element library can also include an element icon, for example, a bus element has an element icon corresponding to the bus element, a CAN gateway element has an element icon corresponding to the CAN gateway element, and so on.
[0038] You can introduce the mxGraph library in a web application and create an mxGraph instance to manage the creation and display of icons for each node element in the CAN network node element library. After creating icons for each node element in the CAN network node element library, you can add corresponding element parameters for each node element. For example, the element parameters added for bus elements can include bus type, bus width, bus bandwidth, and so on. mxGraph is a powerful JavaScript graphics library for creating and displaying graphs and charts in web applications. It provides rich functionality and a flexible Application Programming Interface (API), enabling developers to easily build interactive and customizable graphics editors, flow charts, organizational charts, Unified Modeling Language (UML) diagrams, and other graphic applications. mxGraph has the following features: Powerful drawing functions: mxGraph provides a wealth of drawing functions, including drawing various shapes, drawing lines, adding text, rotating and scaling graphics, etc. Developers can use these functions to create various types of graphics and charts.
[0039] Customizable appearance and style: mxGraph allows developers to customize the appearance and style of graphs, including color, borders, fonts, shadows, etc. This allows developers to customize the appearance of graphs according to their own needs and design guidelines to achieve personalized effects.
[0040] Interactive editing and manipulation: mxGraph supports interactive graph editing and manipulation, including dragging, scaling, rotating, resizing, deleting, etc. These interactive operations enable users to easily edit and manipulate graphs, improving the user experience.
[0041] Automatic layout and arrangement: mxGraph provides a variety of automatic layout algorithms that can automatically arrange and layout graph elements, such as tree layout, circular layout, grid layout, etc. These automatic layout algorithms can help developers quickly generate beautiful and orderly graph layouts.
[0042] Import and export functions: mxGraph supports importing and exporting graph data in various formats, including Extensible Markup Language (XML), JavaScript Object Notation (JSON), or SVG (Scalable Vector Graphics) formats. This allows developers to easily interact and share graph data with other applications.
[0043] Cross-platform and browser compatibility: mxGraph can run on various operating systems and browsers, for example, mxGraph can run on operating systems such as Windows, Mac, and Linux. mxGraph can run on mainstream web browsers such as Chrome, Firefox, and Safari.
[0044] The electronic device (eg, simulation software) may select at least one node element for generating a CAN network topology diagram from a CAN network node element library according to a node element selection instruction input by a user.
[0045] Electronic devices can obtain network topology backend interface data through Ajax requests and transmit it to the frontend, which renders a CAN simulation system topology diagram instance based on the data. The frontend is the part that users see and interact with, and is mainly responsible for user interface design, page layout, content display, and interactive effects. The backend is the part that users cannot see, and is mainly responsible for core functions such as data processing, server management, and database operations.
[0046] Ajax, or Asynchronous Javascript And XML, is a technology used to create better, faster and more interactive web applications. It uses JavaScript to make requests to the server and process responses without blocking the user's core object XMLHttpRequest. Through this object, JavaScript can exchange data with the web server without reloading the page, that is, without refreshing the page, a partial refresh effect can be produced. In JavaScript, XMLHttpRequest is an API on the client side that provides a convenient channel for the browser to communicate with the server.
[0047] It should be noted that when using other programming languages, the network topology backend interface data can be obtained through the corresponding requests of other programming languages and transmitted to the frontend. For example, when using the Python programming language, the Python requests library can be used to call the API interface to obtain the network topology backend interface data and transmit it to the frontend; when using the PHP (Hypertext Preprocessor) programming language, the PHP backend can transmit data to the frontend by packaging the data into a string in JSON format. The requests library is a Python HTTP client library for sending HTTP requests. It makes it very easy to interact with Web services by providing a simple and intuitive API.
[0048] Simulation software can include software such as CANpro, CANoe and CANape. CANpro is an efficient and professional CAN high-level protocol analysis tool with functions such as message interception and error detection, message sending and bus load monitoring. CANoe is a powerful tool designed for CAN line development and testing, integrating test analysis, simulation and diagnosis, and is a powerful assistant for vehicle test engineers. CANape is used for measurement, calibration, diagnosis and development of electronic equipment, and is particularly suitable for optimizing electronic controller equipment. Its main functions include recording measurement data from various sources, each source is described by a description file (such as A2L, BDC, arXML, etc.). These description files are integrated in the CANape project as devices and recorded using one or more recorders.
[0049] S2: Add at least one node element to the rendering interface.
[0050] The simulation software can use the application program interface provided by the mxGraph library to add at least one node element to the rendering interface. Among them, a Graph canvas can be created in the rendering interface, and at least one node element in the CAN network node element library can be added to the Graph canvas through the data call method corresponding to the CAN network node element library. For example, at least one node element in the CAN network node element library can be added to the Graph canvas through the addcell method. Graph is the carrier of the graph, which contains all the elements on the graph (nodes, edges, etc.), and also mounts the relevant operations of the graph (such as interactive monitoring, element operation, rendering, etc.). The addcell() method is a method in Apache POI, which is used to add cells to an Excel table. In this embodiment, the CAN network node element library can use an Excel table to store data such as icons and element parameters of each node element. Through the addcell() method, the row number, column number, and cell value, style and other attributes of the cell can be specified. Apache POI is a cross-platform API based on Java language open source, which is used to give Java programs the function of reading and writing Office format files.
[0051] S3: Based on the operation instruction for at least one node element, perform an operation corresponding to the operation instruction on at least one node element in the rendering interface to generate a CAN network topology diagram, wherein the operation instruction includes at least a node movement instruction and a node connection instruction.
[0052] The user can input a node moving instruction for at least one node element to the simulation software according to the position of at least one node element in the rendering page. The simulation software moves the node to be moved to a designated position corresponding to the CAN network topology diagram according to the node moving instruction.
[0053] After the simulation software moves at least one node element to a specified position, the simulation software connects at least one node element in a rendering interface according to a connection relationship required by the CAN network topology diagram input by a user to obtain a CAN network topology diagram.
[0054] In this embodiment, since the CAN network node element library stores the node elements that constitute the CAN network topology map, after obtaining at least one required node element from the CAN network node element library and adding it to the rendering interface, at least one node element is moved and connected according to the operation instructions input by the user for the node element, and the CAN network topology map can be quickly generated. Compared with drawing the graphics of each node element in the CAN network one by one, adding node attributes to the graphics of each node element drawn one by one, and then connecting the graphics of each node element with node attributes to obtain the CAN network topology map, the generation efficiency of the CAN network topology map can be greatly improved and the labor cost can be reduced.
[0055] Before step S1, step S0 may also be included: providing a CAN network node element library.
[0056] Figure 2 FIG. 1 is a flow chart of step S0 in some embodiments of the present disclosure. Figure 2 As shown, step S0 may include the following steps: S0-1: Generate multiple node elements based on multiple sets of node element parameters.
[0057] Each set of node element parameters includes a node icon and node attributes.
[0058] The node icon is a graphic identifier of the node element displayed in the CAN network topology diagram. The node icon can be displayed in the rendering interface, and the CAN network topology diagram can be generated by connecting the node icons of each node element.
[0059] The node attributes of the node element may include the type of the node element and specific parameters of the node element, wherein the specific parameters of the node element may include performance parameters, control methods and connection parameters (such as the number of pins and pin polarity, etc.) of the node element.
[0060] The electronic device generates a node element corresponding to each set of node element parameters, thereby generating multiple node elements based on multiple sets of node element parameters. The electronic device can filter out the matching engineering files from the database through Ajax, and then create node elements, and bind them to the node unit according to the relevant attributes of the imported data (i.e., element parameters). In this way, multiple node elements with attributes of element parameters can be generated.
[0061] S0-2: Store multiple node elements in a CAN network node element library.
[0062] In this embodiment, after generating multiple node elements with icons and node attributes according to multiple groups of node element parameters, the multiple node elements are stored in a CAN network node element library. This method of pre-generating node elements helps to obtain the node elements required for the CAN network topology diagram from the CAN network node element library, thereby helping to quickly generate the CAN network topology diagram.
[0063] In some embodiments of the present disclosure, between step S2 and step S3, the following step is also included: copying or deleting a node element in at least one node element.
[0064] When the CAN network topology diagram requires multiple identical node elements, for example, when the simulation software requires multiple BUS segments or multiple controllers, the required node elements can be copied in the rendering interface.
[0065] If a node element is not needed in the CAN network topology, you can delete the unnecessary node element in the rendering interface. For example, when using the mxGraph library for graph editing, you can use the Remove Cell method to delete the node to be removed from the canvas, cache the deleted data, and pass this data to the backend database through Ajax. Deleting a cell (RemoveCell) can be achieved through the following steps: You need to obtain an instance of mxGraph, determine the cell you want to delete (in mxGraph, a cell is usually represented as a node or edge of a graph), and use the API provided by mxGraph to delete the node or edge.
[0066] In this embodiment, by copying and deleting the node elements in the rendering interface, the number of node elements required for the CAN network topology diagram can be quickly generated, thereby improving the generation efficiency of the CAN network topology diagram.
[0067] Figure 3 FIG. 1 is a flow chart of step S3 in some embodiments of the present disclosure. Figure 3 As shown, step S3 includes the following steps: S3-1: Based on a node movement instruction for a first target node in at least one node element, move the position of the first target node in the rendering interface.
[0068] When the user needs to move the first target node in at least one node element in the rendering interface, a moving instruction can be sent to the simulation software, for example, the node moving instruction can be generated by dragging the first target node with a mouse. The first target node can include only one node element or multiple node elements. When the user selects a node element in the rendering interface by clicking the mouse, the first target node only includes the node element selected by the mouse; when the user selects multiple node elements in the rendering interface by box selection, the first target node includes the multiple node elements selected by the box.
[0069] After receiving the node movement instruction, the simulation software moves the first target node to the moving end position corresponding to the node movement instruction. For example, when the node movement instruction includes the moving end coordinate (x1, y1), the simulation software moves the first target node to the moving end coordinate (x1, y1).
[0070] S3-2: Based on the element parameter adjustment instruction for the second target node in the at least one node element, adjust the element parameter of the second target node in the rendering interface.
[0071] When the user needs to adjust the parameters of the second target node in at least one node element in the rendering interface, a parameter adjustment instruction can be sent to the simulation software, and the simulation software adjusts the corresponding parameters of the second target node according to the parameters in the parameter adjustment instruction. Among them, the second target node can include only one node element or multiple node elements. When the user selects a node element in the rendering interface by clicking the mouse, the second target node only includes the node element selected by the mouse; when the user clicks the same node element (such as a BUS bus) multiple times with the mouse, the second target node includes multiple node elements corresponding to the multiple clicks.
[0072] In an example of the present disclosure, after the user inputs a parameter adjustment instruction to adjust parameter (eg, voltage) c1 to parameter c2 for the second target node (eg, all batteries in a battery pack), the simulation software adjusts parameter c1 of the second target node to parameter c2.
[0073] S3-3: Based on the node connection instruction for each node in at least one node element, connect each node to obtain a CAN network topology diagram.
[0074] The node connection function provided by the simulation software can be used to connect the connection objects corresponding to the node connection instructions. For example, if the node connection instructions include a first instruction for connecting the battery pack and the controller, the simulation software connects the battery pack and the controller according to the first instruction.
[0075] In this embodiment, for the node elements in the rendering interface, the position of the node elements can be moved through the node moving instructions, and the parameter values of the node elements can be adjusted according to the parameter adjustment instructions, so as to obtain the node element requirements required for the CAN network topology diagram, and then connect the node elements in the rendering interface to obtain a CAN network topology diagram that meets user needs.
[0076] In some embodiments of the present disclosure, after step S3, the following steps may also be included: S4: Perform simulation test based on the CAN network topology diagram to obtain simulation test results.
[0077] The simulation software obtains node element information corresponding to the simulation test content in the CAN network topology diagram, performs simulation testing according to the node element information corresponding to the simulation test content, obtains simulation test results, and can display the simulation test results to the user in a visual manner.
[0078] In an example of the present disclosure, the node elements included in the CAN network topology diagram include a CAN bus and an oscilloscope, and the object of the simulation test is the CAN bus. The simulation test can be performed by the following steps: Connect the probe: Connect a high-bandwidth differential probe to the CAN_H and CAN_L pins of the CAN bus and ground the probe properly.
[0079] Channel setting: Select the CH1 channel of the oscilloscope and set the corresponding vertical scale (for example, 1 V / div).
[0080] Time base setting: Set the horizontal time base (e.g. 10 us / div) to ensure that the CAN frame can be fully displayed on the oscilloscope screen.
[0081] Trigger settings: Set the trigger source to CH1, the trigger mode to falling edge trigger, and the trigger level to the midpoint of the signal (for example, 2.5 V).
[0082] Capture data: Start the simulation test and capture data. Make sure to capture enough CAN frames (for example, more than 200 frames) for comprehensive analysis. Save and record data: Save the captured waveforms and analysis results, and record all measurement conditions and parameters.
[0083] Error Detection: Enable the error frame detection function to identify error frames on the CAN bus based on the waveform and analysis results, and then generate simulation test results including error frame information and correct frame information.
[0084] In the embodiment of the present disclosure, the simulation test may include two parts: functional test and performance test.
[0085] Functional testing mainly tests the communication function of the CAN bus network, including the following aspects: 1. Node control function: Node is the basic component of CAN bus network, and it can verify whether the node can correctly receive and send CAN messages. For example, CAN message can be sent to the target test node through BUS to detect whether the target test node can correctly receive the CAN message. In addition, it can also check whether the node can enter sleep and wake up state as needed.
[0086] 2. Communication protocol compliance test: The communication protocol of the CAN bus network is open and transparent, and it can be verified whether the developed CAN bus network meets the requirements of the communication protocol. For example, a CAN message can be sent to the target test node through the BUS bus through a preset protocol, and an identifier can be carried in the CAN message to detect whether the target test node can recognize the preset protocol and whether the CAN message carries an identifier. In addition, it is also possible to test whether the target test node has an error handling mechanism when a communication error occurs. For example, after the CAN message is sent, whether the target test node receives the CAN message within a preset time period. If the CAN message is not received within the preset time period. Whether the target test node sends feedback information to the CAN message that the CAN message was not received.
[0087] 3. Fault diagnosis function: Fault diagnosis is one of the important functions of the CAN bus network, which can be verified by verifying whether the fault diagnosis function is normal. During the test, at least one fault condition can be simulated to check whether the nodes in the CAN network can correctly detect the fault and handle it accordingly.
[0088] The performance test mainly tests the performance indicators of the CAN bus network, including the following aspects: 1. Communication rate test: The communication rate of the CAN bus network is one of the important performance indicators. You can test whether its communication rate meets the requirements. During the test, the communication efficiency data of the CAN bus network is recorded, and the communication rate test result of the CAN bus network is determined according to the preset standard communication efficiency parameter threshold.
[0089] 2. Node quantity and load capacity test: The CAN bus network can mount multiple nodes, and its node quantity and load capacity can be tested. During the test, the number of nodes and load can be gradually increased to detect whether the CAN bus network can work normally and meet the real-time requirements.
[0090] 3. Anti-interference ability test: The automotive environment is very complex, and the performance of the CAN bus network under various interference conditions can be tested. During the test, interference conditions such as electromagnetic interference and electrostatic interference can be simulated to detect whether the CAN bus network can work normally and maintain a stable communication rate.
[0091] In this embodiment, the simulation test of the CAN network topology diagram is performed using simulation software, so that the simulation test result of the CAN network topology diagram can be obtained quickly and accurately.
[0092] Figure 4 FIG. 1 is a structural block diagram of a device for generating a CAN network topology diagram in some embodiments of the present disclosure. Figure 4 As shown, the device for generating a CAN network topology diagram includes: The node element acquisition module 100 is used to acquire at least one node element from a CAN network node element library; A node element adding module 200, used to add at least one node element to the rendering interface; The topology map generation module 300 is used to generate a CAN network topology map based on an operation instruction for at least one node element by performing an operation corresponding to the operation instruction on at least one node element in a rendering interface, wherein the operation instruction includes at least a node movement instruction and a node connection instruction.
[0093] Figure 5 FIG. 1 is a structural block diagram of a device for generating a CAN network topology diagram in some other embodiments of the present disclosure. Figure 5 As shown, the device for generating a CAN network topology diagram further includes: A node element generation module 400, configured to generate a plurality of node elements based on a plurality of sets of node element parameters, wherein each set of node element parameters includes a node icon and node attributes, and the plurality of node elements include at least two of a bus element, a gateway element, and a controller element; The storage module 500 is used to store multiple node elements in a CAN network node element library.
[0094] like Figure 5 As shown, the device for generating a CAN network topology diagram further includes: The node element editing module 600 is used to copy or delete a node element in at least one node element.
[0095] Figure 6 FIG. 3 is a structural block diagram of a topology map generation module 300 in some embodiments of the present disclosure. Figure 6 As shown, the topology map generating module 300 includes: A node moving unit 310, configured to move the position of the first target node in the rendering interface based on a node moving instruction for the first target node in at least one node element; A parameter adjustment unit 320, configured to adjust the element parameter of the second target node in the rendering interface based on the element parameter adjustment instruction for the second target node in the at least one node element; The node connection unit 330 is used to connect the nodes based on the node connection instruction for each node in at least one node element to obtain a CAN network topology diagram.
[0096] like Figure 5 As shown, the device for generating a CAN network topology diagram further includes: The simulation test module 700 is used to perform simulation test based on the CAN network topology diagram to obtain simulation test results.
[0097] It should be noted that the specific implementation of the device for generating the CAN network topology map of the embodiment of the present disclosure is similar to the specific implementation of the method for generating the CAN network topology map of the embodiment of the present disclosure, and the technical effect of the device for generating the CAN network topology map of the embodiment of the present disclosure is similar to the technical effect of the method for generating the CAN network topology map of the embodiment of the present disclosure. Please refer to the description of the method for generating the CAN network topology map for details. In order to reduce redundancy, it will not be repeated here.
[0098] In addition, an embodiment of the present disclosure further provides an electronic device, including: Memory for storing computer programs; The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the similar image acquisition method described in any of the above embodiments of the present disclosure is implemented.
[0099] Below, reference Figure 7 To describe the electronic device according to the embodiment of the present disclosure. Figure 7 As shown, the electronic device includes one or more processors and memory.
[0100] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0101] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor may run the computer program product to implement the method for generating a CAN network topology diagram of each embodiment of the present disclosure described above and / or other desired functions.
[0102] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0103] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0104] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0105] Of course, to simplify, Figure 7 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0106] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the method for generating a CAN network topology map according to various embodiments of the present disclosure described in the above part of this specification.
[0107] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0108] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the method for generating a CAN network topology diagram according to various embodiments of the present disclosure described in the above part of this specification.
[0109] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0110] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0111] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0112] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0113] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0114] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0115] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0116] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for generating a CAN network topology diagram, characterized in that: include: Based on multiple groups of node element parameters, generating multiple node elements, wherein each group of node element parameters includes a node icon and node attributes, and the multiple node elements include at least two of a bus element, a gateway element, and a controller element; Storing the plurality of node elements in a CAN network node element library; Acquire at least one node element from the CAN network node element library; Adding the at least one node element to the rendering interface; Based on the operation instruction for the at least one node element, the operation corresponding to the operation instruction is performed on the at least one node element in the rendering interface to generate a CAN network topology diagram, wherein the operation instruction at least includes a node movement instruction and a node connection instruction.
2. The method according to claim 1, characterized in that After adding the at least one node element to the rendering interface and before performing, based on the operation instruction for the at least one node element, the operation corresponding to the operation instruction on the at least one node element in the rendering interface to generate the CAN network topology diagram, the method further includes: A node element in the at least one node element is copied or deleted.
3. The method according to claim 1 or 2, characterized in that: The step of performing an operation corresponding to the operation instruction on the at least one node element in the rendering interface to generate a CAN network topology diagram includes: Based on a node movement instruction for a first target node in the at least one node element, moving the position of the first target node in the rendering interface; Based on the element parameter adjustment instruction for the second target node in the at least one node element, adjusting the element parameter of the second target node in the rendering interface; Based on the node connection instruction for each node in the at least one node element, the nodes are connected to obtain the CAN network topology diagram.
4. The method according to claim 1 or 2, characterized in that: After performing an operation corresponding to the operation instruction on the at least one node element in the rendering interface based on the operation instruction for the at least one node element to generate a CAN network topology diagram, the method further includes: A simulation test is performed based on the CAN network topology diagram to obtain a simulation test result.
5. A device for generating a CAN network topology diagram, characterized in that: include: A node element generation module, configured to generate a plurality of node elements based on a plurality of sets of node element parameters, wherein each set of the node element parameters comprises a node icon and node attributes, and the plurality of node elements comprises at least two of a bus element, a gateway element, and a controller element; A storage module, used for storing the plurality of node elements in a CAN network node element library; A node element acquisition module, used to acquire at least one node element from the CAN network node element library; A node element adding module, used to add the at least one node element to the rendering interface; A topology map generation module is used to generate a CAN network topology map by performing an operation corresponding to the operation instruction on the at least one node element in the rendering interface based on the operation instruction for the at least one node element, wherein the operation instruction includes at least a node movement instruction and a node connection instruction.
6. The device according to claim 5, characterized in that Also includes: The node element editing module is used to copy or delete the node element in the at least one node element.
7. The device according to claim 5 or 6, characterized in that The topology map generating module comprises: A node moving unit, configured to move the position of the first target node in the at least one node element in the rendering interface based on a node moving instruction for the first target node; A parameter adjustment unit, configured to adjust the element parameter of the second target node in the rendering interface based on the element parameter adjustment instruction for the second target node in the at least one node element; The node connection unit is used to connect the nodes based on the node connection instructions for each node in the at least one node element to obtain the CAN network topology diagram.
8. The device according to claim 5 or 6, characterized in that Also includes: The simulation test module is used to perform simulation test based on the CAN network topology diagram to obtain simulation test results.
9. An electronic device, characterized in that: include: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 4 above.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 4 is implemented.
11. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method for constructing network topological graph of industrial system
CN110618815A
Network simulation method and device, equipment and storage medium
CN113037545A
Implementation method of self-defined visual topological graph based on Antv
CN114048110A
SVG-based distributed cloud platform network topology drawing method and system
CN115658064A
Page generation method and device, nonvolatile storage medium and computer equipment
CN118484183A