Method of realizing 2D simulation processing based on SVG technology
Through the combination of multi-view data acquisition and PID control algorithms, an SVG graphical model is constructed, which solves the problem of poor object synchronization in SVG technology, realizes high-precision 2D simulation and real-time control, and promotes the digital transformation in the fields of manufacturing, transportation and logistics.
Patent Information
- Application Number
- CN202410167975.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2044-02-06
AI Technical Summary
The existing SVG technology lacks binding to actual objects when building object models, resulting in poor synchronization, lack of authenticity and maintenance, and the inability to achieve high-precision key data acquisition and control.
Through multi-view and multi-directional data acquisition, a point, line and surface control generation model for SVG graphics is constructed, and combined with PID single-mode motion control algorithm, the correlation between data and graphics is established, and the full-stream system simulation processing and real-time data return is carried out to realize 2D simulation and interaction.
Real-time monitoring of object status and precise control of simulated motion, improve production efficiency and quality, promptly warning of faults, achieve full-process object-image synchronization, and support digital transformation in manufacturing, transportation and logistics fields.
Smart Images

Figure CN118012320B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of SVG technology, in particular to 2D simulation technology, and specifically refers to a method for implementing 2D simulation processing based on SVG technology. Background Art
[0002] SVG, a World Wide Web Consortium standard, defines vector-based graphics for the web. SVG images maintain quality when enlarged or resized. Traditionally, this technology only models objects and displays processes without being tied to the actual object. This lacks object-image synchronization, creates a lack of authenticity, and makes maintenance difficult. This technology offers higher precision and reliability in key data acquisition, control model generation, and motion control, achieving high synchronization while also providing more detailed monitoring and feedback mechanisms.
[0003] Therefore, it is necessary to propose a solution to better help users identify and solve the problems existing in the current existing technologies and optimize the production operation process. Summary of the Invention
[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method for realizing 2D simulation processing based on SVG technology with broad application prospects.
[0005] To achieve the above objectives, the method of the present invention for implementing 2D simulation processing based on SVG technology is as follows:
[0006] The method for implementing 2D simulation processing based on SVG technology has the following main features:
[0007] (1) Perform dynamic data acquisition and processing from multiple perspectives and directions to obtain relevant data of corresponding mechanical components;
[0008] (2) Perform data extraction and analysis on the acquired data to extract key information;
[0009] (3) Based on the currently acquired data information, a point-line-surface control generation model of the SVG graphics is constructed by controlling the position of the points, the connection of the lines, and the shape of the surfaces;
[0010] (4) Binding the data calculated according to the PID single-mode motion control conversion algorithm to the SVG graphic to establish an association between the data and the graphic;
[0011] (5) Based on the above single model implementation process, multiple single models are merged to simulate the full flow system;
[0012] (6) Using SVG technology to transmit the multi-model data acquired in real time back to SVG, and perform 2D simulation and interactive processing;
[0013] (7) When the collected data exceeds the system preset threshold, the system will issue a warning so that the user can solve the problem in time.
[0014] Preferably, the step (1) specifically includes the following steps:
[0015] (1.1) Collect multi-view and multi-directional data of corresponding mechanical components through accelerometers, gyroscopes, pressure sensors, encoders, piezoelectric sensors, current / voltage collectors, and temperature sensors;
[0016] (1.2) The collected physical quantity signals are converted into electrical signals, and then converted into digital signals through the ADC for subsequent processing.
[0017] Preferably, the step (2) specifically includes the following steps:
[0018] (2.1) Data preprocessing: First, the acquired raw data is preprocessed using filtering algorithms, outlier detection, and interpolation algorithms to remove noise, outliers, and missing data.
[0019] (2.2) Data classification: Classify the pre-processed data according to the physical structure of the collected object;
[0020] (2.3) Data extraction: Based on the idea of object-oriented programming, define objects and extract key attribute data from them.
[0021] Preferably, the step (3) specifically includes the following steps:
[0022] (3.1) Determine the position of the point: First, determine the position of the key point of the object to be constructed, specifically: by setting the SVG <x>and <y>Attributes are used to determine the coordinate position of the point, thereby accurately controlling the position of the point in the graphic;
[0023] (3.2) Connecting line segments: Use the determined point positions to connect different points to form line segments. Specifically, by setting the SVG <line>The starting point coordinates of the element ( <x1> , <y1>) and the end point coordinates ( <x2> , <y2>), and line style properties to control the length, direction, and appearance of line segments;
[0024] (3.3) Combine multiple line segments: Combine multiple line segments to create a surface structure. Specifically, by setting the SVG <polygon>or <path>Elements are used to describe closed polygons or complex paths, and the shape and size of polygons or paths can be controlled by setting the coordinates of the vertices.
[0025] (3.4) Transformation and adjustment: Transform and adjust the constructed model to make it close to the shape of the real object;
[0026] (3.5) Use SVG attributes: Combine SVG attributes, including color, transparency, and border style, to control the appearance characteristics of the generated model.
[0027] Preferably, the PID single-mode motion control conversion algorithm in step (4) is calculated as follows:
[0028]
[0029] Among them, K p is the proportional gain; K i is the integral gain; K d is the differential gain; e: error = set value (SP) - feedback value (PV); t is the current time, u(t) is the system output value at time t, and de(t) is the differential of the error value at time t.
[0030] Preferably, the step (4) is specifically as follows:
[0031] (4.1) Obtaining output data of the PID single-mode motion control conversion algorithm: obtaining real-time motion data, including position and speed, from the PID single-mode motion control conversion algorithm.
[0032] (4.2) Define SVG graphic elements: Identify the elements in the SVG graphic that need to be bound to the PID data;
[0033] (4.3) Establishing the association between data and graphics: Associating the data output by the PID single-mode motion control conversion algorithm with the SVG graphic elements.
[0034] This SVG-based 2D simulation method, employing this technical solution, combines the full-process state of an actual object with multi-dimensional hardware data acquisition, dynamically collects real-time data from multiple modules, and extracts and analyzes key data. This allows users to monitor and analyze object performance indicators in real time, enabling timely responses and adjustments. Combined with a PID single-mode motion control conversion algorithm, it enables more precise control and adjustment of the object's simulated motion trajectory and speed, improving production efficiency and quality. Full-flow system simulation and multi-mode real-time 2D simulation provide users with a more comprehensive understanding of the object's state, predicting potential future changes and failures, and improving the reliability and efficiency of the entire production process. 2D simulation system early warnings can promptly alert users when anomalies or failures occur, enabling reverse monitoring of the real object and helping users identify and resolve problems more quickly. This allows for synchronized real-time simulation of the entire process, making the entire production process simpler, clearer, and more intuitive. SVG 2D simulation technology has broad application prospects and can play an important role in multiple fields, including manufacturing, transportation, and logistics, driving digital transformation and industrial upgrading. At the same time, with the continuous improvement and upgrading of technology, this technology has greater room for development and innovation, which can inject new impetus and creativity into the development of related fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a flow chart of the method for implementing 2D simulation processing based on SVG technology of the present invention. DETAILED DESCRIPTION
[0036] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0037] Before describing in detail embodiments according to the present invention, it should be noted that, hereinafter, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, whereby a process, method, article, or apparatus comprising a list of elements includes not only those elements, but also other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0038] See also Figure 1 As shown, the method for implementing 2D simulation processing based on SVG technology, wherein the method includes the following steps:
[0039] (1) Perform dynamic data acquisition and processing from multiple perspectives and directions to obtain relevant data of corresponding mechanical components;
[0040] (2) Perform data extraction and analysis on the acquired data to extract key information;
[0041] (3) Based on the currently acquired data information, a point-line-surface control generation model of the SVG graphics is constructed by controlling the position of the points, the connection of the lines, and the shape of the surfaces;
[0042] (4) Binding the data calculated according to the PID single-mode motion control conversion algorithm to the SVG graphic to establish an association between the data and the graphic;
[0043] (5) Based on the above single model implementation process, multiple single models are merged to simulate the full flow system;
[0044] (6) Using SVG technology to transmit the multi-model data acquired in real time back to SVG, and perform 2D simulation and interactive processing;
[0045] (7) When the collected data exceeds the system preset threshold, the system will issue a warning so that the user can solve the problem in time.
[0046] As a preferred embodiment of the present invention, the step (1) specifically includes the following steps:
[0047] (1.1) Collect multi-view and multi-directional data of corresponding mechanical components through accelerometers, gyroscopes, pressure sensors, encoders, piezoelectric sensors, current / voltage collectors, and temperature sensors;
[0048] (1.2) The collected physical quantity signals are converted into electrical signals, and then converted into digital signals through the ADC for subsequent processing.
[0049] As a preferred embodiment of the present invention, the step (2) specifically includes the following steps:
[0050] (2.1) Data preprocessing: First, the acquired raw data is preprocessed using filtering algorithms, outlier detection, and interpolation algorithms to remove noise, outliers, and missing data.
[0051] (2.2) Data classification: Classify the pre-processed data according to the physical structure of the collected object;
[0052] (2.3) Data extraction: Based on the idea of object-oriented programming, define objects and extract key attribute data from them.
[0053] As a preferred embodiment of the present invention, the step (3) specifically includes the following steps:
[0054] (3.1) Determine the position of the point: First, determine the position of the key point of the object to be constructed, specifically: by setting the SVG <x>and <y>Attributes are used to determine the coordinate position of the point, thereby accurately controlling the position of the point in the graphic;
[0055] (3.2) Connecting line segments: Use the determined point positions to connect different points to form line segments. Specifically, by setting the SVG <line>The starting point coordinates of the element ( <x1> , <y1>) and the end point coordinates ( <x2> , <y2>), and line style properties to control the length, direction, and appearance of line segments;
[0056] (3.3) Combine multiple line segments: Combine multiple line segments to create a surface structure. Specifically, by setting the SVG <polygon>or <path>Elements are used to describe closed polygons or complex paths, and the shape and size of polygons or paths can be controlled by setting the coordinates of the vertices.
[0057] (3.4) Transformation and adjustment: Transform and adjust the constructed model to make it close to the shape of the real object;
[0058] (3.5) Use SVG attributes: Combine SVG attributes, including color, transparency, and border style, to control the appearance characteristics of the generated model.
[0059] As a preferred embodiment of the present invention, the PID single-mode motion control conversion algorithm in step (4) is calculated as follows:
[0060]
[0061] Among them, K p is the proportional gain; K i is the integral gain; K d is the differential gain; e: error = set value (SP) - feedback value (PV); t is the current time, u(t) is the system output value at time t, and de(t) is the differential of the error value at time t.
[0062] As a preferred embodiment of the present invention, the step (4) is specifically as follows:
[0063] (4.1) Obtaining output data of the PID single-mode motion control conversion algorithm: obtaining real-time motion data, including position and speed, from the PID single-mode motion control conversion algorithm.
[0064] (4.2) Define SVG graphic elements: Identify the elements in the SVG graphic that need to be bound to the PID data;
[0065] (4.3) Establishing the association between data and graphics: Associating the data output by the PID single-mode motion control conversion algorithm with the SVG graphic elements.
[0066] This technical solution combines 2D simulation technology to interactively render the actual situation in real time based on the collected data. Combined with the characteristics of SVG, it can be scaled losslessly, achieving one-end simulation and multi-end adaptive layout, and can realize real-time dynamic simulation of real-scene interactive information flow.
[0067] In practical applications, the technical solution in step (1) is to sense and collect relevant data information from multiple perspectives and directions by installing various suitable information collectors on mechanical equipment. Specifically:
[0068] Accelerometers, gyroscopes, pressure sensors, encoders, piezoelectric sensors, current / voltage collectors, temperature sensors, and other sensors can be used to collect data related to motion, pressure, and temperature. The sensors convert the collected physical quantities into electrical signals, which are then converted to digital signals by an ADC (digital-to-digital converter) for processing by a computer or controller. The mechanical equipment mentioned in this technical solution includes industrial robots, automated guided vehicle (AGV) transport vehicles, and various production equipment.
[0069] By installing acquisition modules on each mechanical component and connecting them to a shared data bus using CAN bus technology, data collection and centralized management of multiple components can be achieved. Specifically, the acquisition module is responsible for reading relevant data (such as temperature, pressure, speed, etc.) from the mechanical components, converting this data into digital signals, and transmitting it to other devices on the bus via the CAN bus. Other devices on the data bus (such as data collectors or control systems based on CAN communication) can receive and interpret this data and perform corresponding processing and management. This makes it possible to conveniently collect and centrally manage data from multiple mechanical components, improving the monitoring and control efficiency of the system.
[0070] In practical applications, step (2) of this technical solution mainly involves screening out key data from the collected data for data preprocessing, classifying the data collected from the same object, and extracting useful data in combination with the object-oriented thinking process; for example, attributes such as temperature, position, and color that change over time are the required information, and these key data can be used for subsequent data analysis, processing, and simulation.
[0071] In practical applications, the point-line-surface control generation model described in step (3) of this technical solution can create a model that matches an object in the real world by controlling the position of points, the connection method of lines, and the shape of surfaces. For example, a series of points can be connected into line segments, and multiple line segments can be combined into polygons, which can be transformed and adjusted to achieve an effect similar to the shape of real objects. In combination with SVG attributes such as color, transparency, border style, etc., the appearance characteristics of the generated model can be controlled.
[0072] By controlling points, lines, surfaces, and SVG attributes, this SVG-based 2D simulation technology generates realistic models. These models can be used for real-time interaction and rendering to present simulated effects that match real-world conditions. During the model generation process, further optimization and adjustments can be performed as needed to ensure that the generated models closely match the real-world scenario.
[0073] In practical applications, step (4) of this technical solution binds the data calculated by the PID motion control algorithm to the SVG graphic, allowing the graphic to reflect the motion process and status in real time. The combination of the PID single-mode motion control conversion algorithm and SVG can achieve real-time visualization and control of the object's position, facilitating the debugging and optimization of the PID control algorithm. Such visual feedback can help developers more intuitively observe the object's motion process and control effect, thereby improving the performance and stability of the PID control algorithm.
[0074] In practical applications, step (5) is to simulate the entire flow system. Based on the above-mentioned single model implementation process, the required data has been collected, the required model has been built, and the motion value calculation has been performed. At this point, the model state after the single model simulation calculation can be completed. Multiple single models can be combined to complete the layout of the entire model, and the real object can be intuitively displayed to the user through the screen. At this point, a complete information flow has been established based on SVG 2D simulation technology, from data preparation to result display, realizing the simulation process of the entire flow system simulation.
[0075] In practical applications, once the system has established a 2D model, it immediately performs multi-mode real-time 2D simulation. Due to the rapid speed of data acquisition and transmission, the object's status information, captured by the data collector, can be transmitted to the SVG 2D simulation in real time. Using SVG technology, this real-time data, such as motion properties, temperature, and pressure, is synchronously displayed on the dashboard, allowing users to intuitively observe the simulation results and interact in real time.
[0076] In practical applications, the step (7) described above is specifically as follows when performing 2D simulation system warning processing:
[0077] When the data collected by the system appears outside the threshold, the object simulated on the 2D simulation model will appear in a state different from the normal state. We can infer that the real object may have a fault, and then mark it as a special case in the simulation interface, so that users can intuitively see the location of the faulty object and quickly resolve the problem.
[0078] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0079] It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device.
[0080] Those skilled in the art will understand that all or part of the steps of the method for implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0081] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0082] Throughout this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "embodiment" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0083] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0084] This SVG-based 2D simulation method, employing this technical solution, combines the full-process state of an actual object with multi-dimensional hardware data acquisition, dynamically collects real-time data from multiple modules, and extracts and analyzes key data. This allows users to monitor and analyze object performance indicators in real time, enabling timely responses and adjustments. Combined with a PID single-mode motion control conversion algorithm, it enables more precise control and adjustment of the object's simulated motion trajectory and speed, improving production efficiency and quality. Full-flow system simulation and multi-mode real-time 2D simulation provide users with a more comprehensive understanding of the object's state, predicting potential future changes and failures, and improving the reliability and efficiency of the entire production process. 2D simulation system early warnings can promptly alert users when anomalies or failures occur, enabling reverse monitoring of the real object and helping users identify and resolve problems more quickly. This allows for synchronized real-time simulation of the entire process, making the entire production process simpler, clearer, and more intuitive. SVG 2D simulation technology has broad application prospects and can play an important role in multiple fields, including manufacturing, transportation, and logistics, driving digital transformation and industrial upgrading. At the same time, with the continuous improvement and upgrading of technology, this technology has greater room for development and innovation, which can inject new impetus and creativity into the development of related fields.
[0085] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it will be apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Accordingly, the specification and drawings are to be regarded as illustrative rather than restrictive.< / path> < / polygon> < / x2> < / x1> < / line> < / y> < / x> < / path> < / polygon> < / x2> < / x1> < / line> < / y> < / x>
Claims
1. A method for implementing 2D simulation processing based on SVG technology, characterized in that: The method comprises the following steps: (1) Perform dynamic data acquisition and processing from multiple perspectives and directions to obtain relevant data of corresponding mechanical components; (2) Perform data extraction and analysis on the acquired data to extract key information; (3) Based on the currently acquired data information, a point-line-surface control generation model of the SVG graphics is constructed by controlling the position of the points, the connection of the lines, and the shape of the surfaces; (4) Binding the data calculated according to the PID single-mode motion control conversion algorithm to the SVG graphic to establish an association between the data and the graphic; (5) Based on the above single model implementation process, multiple single models are merged to simulate the full flow system; (6) Using SVG technology to transmit the multi-model data acquired in real time back to SVG, and perform 2D simulation and interactive processing; (7) When the collected data exceeds the system preset threshold, the system will issue a warning so that the user can solve the problem in time; The step (1) specifically includes the following steps: (1.1) Collect multi-view and multi-directional data of corresponding mechanical components through accelerometers, gyroscopes, pressure sensors, encoders, piezoelectric sensors, current / voltage collectors, and temperature sensors; (1.2) Converting the collected physical quantity signals into electrical signals, and then converting the electrical signals into digital signals through the ADC for subsequent processing; The step (3) specifically includes the following steps: (3.1) Determine the position of the point: First, determine the position of the key point of the object to be constructed, specifically: by setting the SVG <x>and <y> Attributes are used to determine the coordinate position of the point, thereby accurately controlling the position of the point in the graphic;< / y> < / x> (3.2) Connecting line segments: Use the positions of the determined points to connect different points to form line segments. Specifically, by setting the <line>The starting point coordinates of the element ( <x1> , <y1>) and the end point coordinates ( <x2> , <y2> ), and line style properties to control the length, direction, and appearance of line segments; < / x2> < / x1> < / line> (3.3) Combine multiple line segments: Combine multiple line segments to create a surface structure. Specifically, by setting the SVG <polygon>or <path> Elements are used to describe closed polygons or complex paths, and the shape and size of polygons or paths can be controlled by setting the coordinates of the vertices.< / path> < / polygon> (3.4) Transformation and adjustment: Transform and adjust the constructed model to make it close to the shape of the real object; (3.5) Use SVG attributes: Combine SVG attributes, including color, transparency, and border style, to control the appearance characteristics of the generated model.
2. The method for implementing 2D simulation processing based on SVG technology according to claim 1, characterized in that: The step (2) specifically includes the following steps: (2.1) Data preprocessing: First, the acquired raw data is preprocessed using filtering algorithms, outlier detection, and interpolation algorithms to remove noise, outliers, and missing data. (2.2) Data classification: Classify the pre-processed data according to the physical structure of the collected object; (2.3) Data extraction: Based on the idea of object-oriented programming, define objects and extract key attribute data from them.
3. The method for implementing 2D simulation processing based on SVG technology according to claim 1, characterized in that: The PID single-mode motion control conversion algorithm in step (4) is calculated as follows: Among them, K p is the proportional gain; K i is the integral gain; K d is the differential gain; e: error = set value (SP) - feedback value (PV); t is the current time, u(t) is the system output value at time t, and de(t) is the differential of the error value at time t.
4. The method for implementing 2D simulation processing based on SVG technology according to claim 3, characterized in that: The step (4) is specifically as follows: (4.1) Obtaining output data of the PID single-mode motion control conversion algorithm: obtaining real-time motion data, including position and velocity, from the PID single-mode motion control conversion algorithm; (4.2) Define SVG graphic elements: Identify the elements in the SVG graphic that need to be bound to the PID data; (4.3) Establishing the association between data and graphics: Associating the data output by the PID single-mode motion control conversion algorithm with the SVG graphic elements.
Citation Information
Patent Citations
Power gird model data conversion method and device
CN105760603A
Multi-legged robot control system
CN117452860A