An AI model-based chart generation method, chart generation system, and computer storage medium
Patent Information
- Application Number
- CN202610704832.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-08-21
AI Technical Summary
[0004]本发明的目的在于:针对现有技术中的AI辅助图表工具进行图表生成,由于图表识别与解析的单一模态输入而缺乏跨模态语义相对齐功能,复杂多样性图表的容易局部生成错误,而存在复杂图表生成质量不高的问题,提供一种基于AI模型的图表生成方法、图表生成系统及计算机存储介质
[0036] This system generates and optimizes original image elements across multiple modes of design drafts, then combines them to form a chart code set C. This adapts to the generation and deployment of complex and diverse design drafts on web pages, reducing the local error rate and thus improving the quality of complex chart generation. It also saves development time and meets the high-quality generation requirements of diverse and complex charts. In particular, when combining design requirements and UI graphics, it can obtain highly similar code in a short time, quickly generate the corresponding chart code, and then reasonably combine each individual chart to form complex composite charts. This improves the development efficiency of complex composite charts and simplifies the operations that require a lot of coding and analysis in front-end development into an end-to-end image-to-code model.
Smart Images

Figure CN122618005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer network web front-end display technology, and in particular to a chart generation method, chart generation system and computer storage medium based on an AI model. Background Technology
[0002] Web front-end display technology is primarily responsible for transforming design drafts into web pages that users can see in a browser, implementing page layout, colors, animations, and responding to user clicks, inputs, and other interactive operations. The vast amounts of data on the internet require efficient display on web pages. Utilizing information visualization charts and complex graphs such as multi-dimensional line charts, heatmaps, and relationship network diagrams to provide users with clear, comprehensive, and intuitive graphical representations is a crucial technology for web front-end display.
[0003] Current chart generation primarily relies on manual selection and parameter fine-tuning, which is not only cumbersome but also easily limited by experience. This is especially true for low-code platforms, which require specialized training and struggle to handle dynamically changing and complex chart needs, such as complex charts for multidimensional data cube visualization, making it difficult to meet the requirements of real-time large-screen monitoring. While AI-assisted charting tools have emerged, they often focus on single-modal input for chart recognition and parsing, lacking cross-modal semantic capabilities and failing to balance the diversity and quality requirements of complex charts. Furthermore, existing AI-assisted charting tools do not utilize multi-model collaboration capabilities, limiting the quality of generated charts and the scalability of the system, resulting in poor versatility. Summary of the Invention
[0004] The purpose of this invention is to address the problem that existing AI-assisted chart generation tools lack cross-modal semantic capabilities due to their single-modal input for chart recognition and parsing, which easily leads to local generation errors in complex and diverse charts, resulting in low quality of complex chart generation. This invention provides a chart generation method, chart generation system, and computer storage medium based on an AI model.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A chart generation method based on an AI model, comprising the following steps:
[0007] Step 1: Extract the chart feature data of the design drawing: Upload the design drawing corresponding to the front end to the image management system, identify the multiple charts contained in the design drawing through the multimodal parsing algorithm, and extract the type data and structural feature data of the charts to generate a chart feature set S={S1, S2, ..., Sn}, where Sn represents the nth chart feature;
[0008] St2, Visualizing the chart feature data: Visualizing each chart feature in the chart feature set S, and then outputting an image set P = {P1, P2, ..., Pn}, where Pn represents the nth image corresponding to the nth chart feature;
[0009] Step 3: Generate a code template set corresponding to an image Pn: Input an image Pn from the image set P into the model management subsystem, call the AI model set M = {M1, M2, ..., Mk} to perform inference generation, and output a code template set H = {H1, H2, ..., Hk} corresponding to an image Pn, where Mk represents the k-th AI model and Hk represents the code template output by the k-th AI model;
[0010] St4, Obtain the effect set J: Render the code template set H into an effect set J = {J1, J2, ..., Jk}, where Jk represents the k-th effect;
[0011] Step 5: Select alternative code templates for an image Pn: Evaluate the similarity between each of the rendered images and the corresponding image Pn, and then generate a similarity set F = {F1, F2, ..., Fk}, where Fk represents the k-th similarity; Select the similarity F-max with the largest similarity value in the similarity set F, and select the code template H-max corresponding to F-max as an alternative code template for an image Pn;
[0012] St6, Combining and Deploying the Chart Code Set: Combine multiple spare code templates corresponding to the 1st to nth images of the image set P to form a chart code set C = {C1, C2, ..., Cn}; automatically deploy the chart code set C to the front end.
[0013] The AI-based chart generation method described in this invention extracts and generates chart feature sets and graphics from design drawings through an image management system. It analyzes and obtains chart features and rendered original image elements from the design drawings. Then, multiple AI models are used to infer and generate multiple code templates corresponding to each original image element. Steps St4 and St5 filter out the code template with the highest similarity to an original image element as a backup template. For each original image element in the chart feature set, Steps St3-St5 are executed and combined to obtain a chart code set C, which represents the chart code with the highest similarity to the design drawing. This allows for the differentiation of original image elements in diverse and complex icon design drawings across different modes. Instead of using AI models to generate code templates with the highest similarity, this approach generates and selects the original image elements from various modes of the design drawing across different modalities, then combines them to form a chart code set C. This adapts to the generation and deployment of complex and diverse design drawings on web pages, reducing the local error rate and thus improving the quality of complex chart generation. It also saves development time and meets the high-quality generation requirements of diverse and complex charts. Especially when combining design requirements and UI graphics, it can obtain highly similar code in a short time, quickly generate the code corresponding to the chart, and then reasonably combine each individual chart to form complex composite charts, improving the development efficiency of complex composite charts. It simplifies the operations that require a lot of coding and analysis in front-end development into an end-to-end image-to-code model.
[0014] Preferably, in the AI model-based chart generation method of the present invention, the similarity threshold is set to 0.80~0.85; if F-max≥0.80, then the code template H-max corresponding to F-max is selected as a backup code template for image Pn, otherwise the St5 is executed repeatedly to filter the backup code template.
[0015] As a preferred embodiment of the present invention, by setting a specific threshold range for similarity, the matching degree between the code template and the original design drawing can be controlled more precisely, thereby further improving the generation quality and accuracy of diverse and complex charts.
[0016] Preferably, in the AI model-based chart generation method of the present invention, the evaluation of the similarity between each of the rendered images and a corresponding image Pn is based on mean squared error, structural similarity index, or peak signal-to-noise ratio.
[0017] As a preferred embodiment of the present invention, by adopting the above-described evaluation algorithm, the accuracy and matching degree of the evaluation can be improved, and the selection accuracy of the backup code template can be further improved.
[0018] Preferably, the chart generation method based on the AI model of the present invention, wherein Step 1, extracting chart feature data of the design drawing, further includes the steps of: uploading the design drawing to a RESTful interface using Axios; and the image management system starting the ResNet-50 and YOLO detection modules for parallel processing to extract the boundaries and text labels of the chart.
[0019] As a preferred embodiment of the present invention, the accuracy of extracting chart feature data of the design drawing is improved by the above-described specific chart feature data extraction, thereby further improving the generation quality of complex charts.
[0020] Preferably, the chart generation method based on the AI model of the present invention further includes the steps of St2 and image processing of the chart feature data: performing Gaussian filtering on each image in the image set P, unifying the size and format, and storing it in a Redis cache.
[0021] As a preferred embodiment of the present invention, by processing the image set P and unifying its format and size, the error in similarity assessment can be reduced, the accuracy and efficiency of similarity assessment can be improved, and the reliability of screening backup code templates can be further improved.
[0022] Preferably, the chart generation method based on the AI model of the present invention evaluates the similarity between each of the rendered images and a corresponding image Pn by the following steps: manually previewing the structural and visual similarity between each rendered image and a corresponding image Pn.
[0023] As a preferred embodiment of the present invention, the reliability of similarity assessment is further improved by the above-described specific similarity assessment method.
[0024] Preferably, the chart generation method based on the AI model of the present invention, wherein St6, combining and deploying the chart code set, further includes the steps of: triggering unit tests through the Jenkins pipeline, wherein the coverage of the unit tests is ≥85%; generating a Docker image of the chart code set C, pushing it to a private Registry, and then deploying it to a Kubernetes cluster.
[0025] As a preferred embodiment of the present invention, the above-described specific chart generation method reduces data inconsistency errors, enables more automated and efficient chart deployment, and improves the stability of chart code set deployment.
[0026] To achieve the objectives of this invention, another technical solution is provided:
[0027] A chart generation system includes: an image management subsystem, a model management subsystem, and a code management subsystem;
[0028] The image management subsystem is used to extract the graphic feature data of the design drawings and evaluate the similarity between each of the renderings and a corresponding image Pn;
[0029] The model management subsystem is used to call AI model Mk in the AI model set M and output code templates;
[0030] The code management subsystem is used to obtain the effect image set J and the combination and deployment chart code set.
[0031] The chart generation system described in this invention is used to implement the chart generation method based on the AI model. It can quickly generate the code corresponding to the complex combined chart in a short time, saving development time. The generated code can then be fine-tuned by comparing it with the design drawing to meet the complex and diverse chart design needs.
[0032] To achieve the objectives of this invention, another technical solution is provided:
[0033] A computer storage medium storing a computer program that, when executed by a processor, implements the AI model-based chart generation method described in this invention.
[0034] The computer present in this invention, when executed, implements the chart generation method based on the AI model described in this invention. It can obtain code with high similarity in a short time, quickly generate the code corresponding to the chart, and then reasonably combine each individual chart to form a complex composite chart, thereby improving the development efficiency of complex composite charts. It simplifies the operations that require a lot of coding and analysis in front-end development into an end-to-end mode from image to code.
[0035] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0036] This system generates and optimizes original image elements across multiple modes of design drafts, then combines them to form a chart code set C. This adapts to the generation and deployment of complex and diverse design drafts on web pages, reducing the local error rate and thus improving the quality of complex chart generation. It also saves development time and meets the high-quality generation requirements of diverse and complex charts. In particular, when combining design requirements and UI graphics, it can obtain highly similar code in a short time, quickly generate the corresponding chart code, and then reasonably combine each individual chart to form complex composite charts. This improves the development efficiency of complex composite charts and simplifies the operations that require a lot of coding and analysis in front-end development into an end-to-end image-to-code model. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating the chart generation method based on an AI model according to the present invention;
[0038] Figure 2 This is a diagram illustrating the module connection structure of the chart generation system or computer storage medium of the present invention. Detailed Implementation
[0039] The present invention will now be described in detail with reference to the accompanying drawings.
[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0041] Example 1:
[0042] refer to Figure 1 As shown, this embodiment discloses a chart generation method based on an AI model, including the following steps:
[0043] Step 1: Extract the chart feature data of the design drawing: Upload the design drawing corresponding to the front end to the image management system, identify the multiple charts contained in the design drawing through the multimodal parsing algorithm, and extract the type data and structural feature data of the charts to generate a chart feature set S={S1, S2, ..., Sn}, where Sn represents the nth chart feature;
[0044] St2, Visualizing the chart feature data: Visualizing each chart feature in the chart feature set S, and then outputting an image set P = {P1, P2, ..., Pn}, where Pn represents the nth image corresponding to the nth chart feature;
[0045] Step 3: Generate a code template set corresponding to an image Pn: Input an image Pn from the image set P into the model management subsystem, call the AI model set M = {M1, M2, ..., Mk} to perform inference generation, and output a code template set H = {H1, H2, ..., Hk} corresponding to an image Pn, where Mk represents the k-th AI model and Hk represents the code template output by the k-th AI model;
[0046] St4, Obtain the effect image set J: Render the code template set H into an effect image set J = {J1, J2, ..., Jk}, where Jk represents the k-th effect image; for example, the code management system uses Vue3 to mount templates and renders the J set images in the HeadlessChrome environment, and calculates the similarity score through SSIM and SIFT matching.
[0047] Step 5: Select alternative code templates for an image Pn: Evaluate the similarity between each of the rendered images and the corresponding image Pn, and then generate a similarity set F = {F1, F2, ..., Fk}, where Fk represents the k-th similarity; Select the similarity F-max with the largest similarity value in the similarity set F, and select the code template H-max corresponding to F-max as an alternative code template for an image Pn;
[0048] Step 6: Combining and Deploying the Chart Code Set: Combine multiple spare code templates corresponding to the 1st to nth images of the image set P to form a chart code set C = {C1, C2, ..., Cn}; automatically deploy the chart code set C to the front end. For example, repeat Steps 3 to 5 to finally merge all the chart code snippets into a single Vue component to generate a composite chart.
[0049] It should be noted that, in Sn and Pn of this invention, "n" represents the identifier of an element within the set, and n can be any natural number other than 0; an image Pn is understood as an image in the image set, when n is 1, an image Pn is P1, when n is 2, an image Pn is P2; the values of n in Sn and Pn correspond, for example, if S1 is selected in Sn, then Pn in St is P1 accordingly; in Mk, Jk and Fk of this invention, "k" represents the identifier of an element within the set, and k can be any natural number other than 0, for example, when k is 1, Mk represents element M1; n and k represent sets whose values are not related, for example, k code template sets H = {H1, H2, ..., Hk} are generated from k AI sets, each corresponding to P1; St1, St2, St3, St4, St5 and St6 of this invention represent steps 1 to 6 of the method of this invention, respectively.
[0050] The first and second in this invention are not interpreted in terms of specific numerical values or order, but are only used to distinguish meanings. The design drawing is understood as the front-end design drawing required by the user, and the effect drawing is understood as the effect image obtained by rendering each of the code templates.
[0051] The alternative code template for filtering an image Pn described in this invention specifically involves submitting the images in the P set to a large model in batches, using OpenAICLIPViT-B / 32 weights, with 4 images per batch, performing parallel inference, and generating code parameters in JSON format.
[0052] The complex and diverse charts described in this invention are understood as effect charts that include multiple patterns or diverse combinations of image elements.
[0053] The similarity described in this invention can be achieved through manual image preview. Preferably, in this embodiment, the structural and visual similarity between each rendered image and its corresponding image Pn is manually previewed. More specifically, the similarity threshold is set to 0.80~0.85; if F-max ≥ 0.80, then the code template H-max corresponding to F-max is selected as a backup code template for image Pn; otherwise, St5 is repeatedly executed to filter the backup code templates.
[0054] Evaluation can also be achieved through computational algorithms. In this preferred embodiment, the similarity between each effect image and its corresponding image Pn is evaluated using a method based on mean squared error, structural similarity index, or peak signal-to-noise ratio.
[0055] In this preferred embodiment, Step 1, extracting the chart feature data of the design drawing, further includes the steps of: uploading the design drawing to a RESTful interface using Axios; and the image management system starting the ResNet-50 and YOLO detection modules for parallel processing to extract the boundaries and text labels of the chart.
[0056] The Axios library described in this invention is a Promise-based JavaScript network request library, primarily used in browsers and Node.js environments. In front-end development, it helps front-end code initiate HTTP requests to back-end servers. RESTful is a design principle; in AI applications, application programming interfaces are designed based on the RESTful style. Front-end web pages or external systems can call back-end YOLO or ResNet models through standard HTTP requests. ResNet-50 can be understood as a deep convolutional neural network architecture with 50 layers, responsible for extracting deep, high-dimensional abstract features from images. YOLO can perform a forward computation on the entire image, simultaneously predicting object categories and bounding boxes, and quickly identifying and locating specific graphical elements such as candlestick charts, trend lines, and support levels in chart analysis.
[0057] In this preferred embodiment, the St2 step of image processing of the chart feature data further includes the step of performing Gaussian filtering on each image in the image set P, unifying the size and format, and storing it in a Redis cache. Specifically, for example, Gaussian filtering with σ=1.0, uniformly scaling the size to 512×512 and storing it in PNG format in a Redis cache, with a maximum cache capacity of 1000 images.
[0058] In this preferred embodiment, the St6, combination and deployment of the chart code set further includes the steps of: triggering unit tests through the Jenkins pipeline, wherein the coverage of the unit tests is ≥85%; generating a Docker image of the chart code set C, pushing it to a private Registry, and then deploying it to a Kubernetes cluster.
[0059] The front-end described in this invention is understood as the front-end for web development or server deployment design. The charts described in this invention can be built using the Echarts chart library, which is imported through the npm package management system. Web development uses the Vue3 framework.
[0060] In this invention, the Jenkins pipeline is understood as a control unit for code testing; Docker is understood as an open-source containerization platform that can package the chart code set, runtime environment, system libraries, and configuration files together to form a standardized, lightweight containerized data set; Registry is a repository used to centrally store and manage Docker images; Kubernetes is an open-source container orchestration system responsible for managing and scheduling Docker containers. When an application needs to be deployed, Kubernetes pulls the latest Docker image from the private Registry and automatically runs it on the servers or browsers in the cluster.
[0061] This invention solves the problems of low efficiency in processing data from traditional tools, inability to meet the needs of generating complex and dynamically changing charts, and lack of cross-modal semantic alignment capabilities due to the single modality input of AI charting solutions. It realizes an automated closed loop from design drawings to executable code, significantly improving development efficiency, reducing maintenance costs, and improving the consistency between generated results and design expectations. It is widely applicable to complex scenarios such as large-screen visualization, business intelligence, and operation monitoring.
[0062] Example 2:
[0063] Reference image Figure 1 and Figure 2 As shown, this embodiment discloses a chart generation system for implementing the AI model-based chart generation method as described in Embodiment 1, including: an image management subsystem, a model management subsystem, and a code management subsystem; the image management subsystem is used to extract chart feature data of the design drawing and evaluate the similarity between each of the effect drawings and a corresponding image Pn; the model management subsystem is used to call the AI model Mk in the AI model set M and output the code template; the code management subsystem is used to obtain the effect drawing set J and combine and deploy the chart code set.
[0064] Specifically, the image management subsystem includes the following steps: Chart recognition: A pre-trained ResNet-50 model is used to extract image features, combined with a YOLOv5-based detector to locate chart boundaries; OCR recognition: Tesseract OCR is used to recognize scales and label text in the chart, and the results are mapped to the chart structure; Image preprocessing: Detected sub-images are cropped, Gaussian filtering is performed for noise reduction, and the size is normalized (to 512×512 pixels), and stored in an LRU cache to accelerate subsequent access; Similarity calculation: Similarity assessment is performed based on algorithms such as mean squared error (MSE), structural similarity index (SSIM), and peak signal-to-noise ratio (PSNR) to evaluate the similarity between images in set J and set P; The results are then used for image analysis and processing, and input into the AI model management subsystem.
[0065] The AI model management subsystem described in this invention includes: model scheduling: managing large multimodal models such as CLIP and ViLT, and achieving dynamic scaling through a Kubernetes cluster; version control: using GitLFS to store model weights, supporting canary upgrades and rollbacks; performance evaluation: periodically running benchmark tests to monitor inference latency (within 100ms) and accuracy metrics. Execution flow: after receiving an image set P, it calls each instance of the model set M in parallel, using batchsize=4 for inference; utilizing a large model tool, each large model analyzes its parameters and automatically generates code to respond to the images, and then combines the code of each model together for execution of the next process.
[0066] The code management subsystem described in this invention connects to the large model management system and receives the code generated by the large model management system. It includes template library management: maintaining the ECharts template repository and dynamically populating parameters using the Handlebars engine; code merging and optimization: performing formatting and syntax checks based on Prettier and ESLint; and automatic deployment: executing unit tests, packaging, and Docker container deployment through the Jenkins pipeline.
[0067] The image management system described in this invention is used to process and analyze the transmitted raw data, and then transmit the processed data to the large model management system for analysis. The data processed by the large model management system is then transmitted to the code system for final management.
[0068] Example 3:
[0069] Reference image Figure 1 and Figure 2 As shown, this embodiment discloses a computer storage medium storing a computer program, which, when executed by a processor, implements the chart generation method based on an AI model as described in Embodiment 1.
[0070] Furthermore, this specification uses specific terms to describe embodiments thereof. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that references to "an embodiment," "one embodiment," or "an alternative embodiment" in different locations throughout this specification do not necessarily refer to the same embodiment. Moreover, certain features, structures, or characteristics in one or more embodiments of this specification can be appropriately combined.
[0071] Furthermore, those skilled in the art will understand that various aspects of this specification can be described and illustrated in several patentable ways or situations, including any new and useful combination of processes, machines, products, or substances, or any new and useful improvements thereof. Accordingly, various aspects of this specification can be implemented entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. All of the above hardware or software may be referred to as a “data block,” “module,” “engine,” “unit,” “component,” or “system.” Furthermore, various aspects of this specification may be represented as a computer product located on one or more computer-readable media, including computer-readable program code.
[0072] Computer storage media may contain a propagated data signal containing computer program code, for example, on baseband or as part of a carrier wave. This propagated signal may take various forms, including electromagnetic, optical, and other suitable combinations thereof. Computer storage media can be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, apparatus, or device to enable communication, propagation, or transmission of a program for use. The program code located on the computer storage medium can be propagated through any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of the above media.
[0073] The computer program code required for the operation of each part of this manual can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, Python, etc.; conventional procedural programming languages such as C, Visual Basic, Fortran2003, Perl, COBOL2002, PHP, ABAP; dynamic programming languages such as Python, Ruby, and Groovy; or other programming languages. This program code can run entirely on the user's computer, or as a standalone software package on the user's computer, or partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any network, such as a local area network (LAN) or wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as Software as a Service (SaaS).
[0074] Furthermore, unless expressly stated in the claims, the order of processing elements and sequences, the use of numbers and letters, or other names described in this specification are not intended to limit the order of the processes and methods described herein. Although various examples have been discussed in the foregoing disclosure of some embodiments of the invention that are currently considered useful, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments; rather, the claims are intended to cover all modifications and equivalent combinations that conform to the spirit and scope of the embodiments described herein. For example, while the system components described above can be implemented using hardware devices, they can also be implemented solely using software solutions, such as installing the described system on existing servers or mobile devices.
[0075] Similarly, it should be noted that, in order to simplify the description disclosed herein and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of embodiments in this specification may sometimes combine multiple features into a single embodiment, drawing, or description thereof. However, this method of disclosure does not imply that the subject matter of this specification requires more features than those mentioned in the claims. In fact, the embodiments contain fewer features than all the features of a single embodiment disclosed above.
[0076] For each patent, patent application, patent application publication, and other material, such as articles, books, specifications, publications, and documents, referenced in this specification, the entire contents of which are incorporated herein by reference. This excludes historical application documents that are inconsistent with or conflict with the content of this specification, as well as documents that limit the broadest scope of the claims in this specification (currently or subsequently appended to this specification). It should be noted that in the event of any inconsistency or conflict between the descriptions, definitions, and / or terminology used in the supplementary materials to this specification and the content of this specification, the descriptions, definitions, and / or terminology used in this specification shall prevail.
[0077] Finally, it should be understood that the embodiments described in this specification are merely illustrative of the principles of the embodiments described herein. Other variations may also fall within the scope of this specification. Therefore, alternative configurations of the embodiments described herein are intended to be illustrative rather than limiting, and should be considered consistent with the teachings of this specification. Accordingly, the embodiments described herein are not limited to those explicitly introduced and described herein.
[0078] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A chart generation method based on an AI model, characterized in that, Including the following steps: Step 1: Extract the chart feature data of the design drawing: Upload the design drawing corresponding to the front end to the image management system, identify the multiple charts contained in the design drawing through the multimodal parsing algorithm, and extract the type data and structural feature data of the charts to generate a chart feature set S={S1, S2, ..., Sn}, where Sn represents the nth chart feature; St2, Visualizing the chart feature data: Visualizing each chart feature in the chart feature set S, and then outputting an image set P = {P1, P2, ..., Pn}, where Pn represents the nth image corresponding to the nth chart feature; Step 3: Generate a code template set corresponding to an image Pn: Input an image Pn from the image set P into the model management subsystem, call the AI model set M = {M1, M2, ..., Mk} to perform inference generation, and output a code template set H = {H1, H2, ..., Hk} corresponding to an image Pn, where Mk represents the k-th AI model and Hk represents the code template output by the k-th AI model; St4, Obtain the effect set J: Render the code template set H into an effect set J = {J1, J2, ..., Jk}, where Jk represents the k-th effect; Step 5: Select alternative code templates for an image Pn: Evaluate the similarity between each of the rendered images and the corresponding image Pn, and then generate a similarity set F = {F1, F2, ..., Fk}, where Fk represents the k-th similarity; Select the similarity F-max with the largest similarity value in the similarity set F, and select the code template H-max corresponding to F-max as an alternative code template for an image Pn; St6, Combining and Deploying the Chart Code Set: Combine multiple spare code templates corresponding to the 1st to nth images of the image set P to form a chart code set C = {C1, C2, ..., Cn}; automatically deploy the chart code set C to the front end.
2. The chart generation method based on an AI model according to claim 1, characterized in that, The similarity threshold is set to 0.80~0.85; if F-max≥0.80, then the code template H-max corresponding to F-max is selected as a backup code template for image Pn, otherwise St5 is executed repeatedly to filter the backup code template.
3. The chart generation method based on an AI model according to claim 1, characterized in that, The similarity between each of the rendered images and its corresponding image Pn is evaluated using a method based on mean squared error, structural similarity index, or peak signal-to-noise ratio.
4. The chart generation method based on an AI model according to claim 1, characterized in that, The St1 step of extracting the chart feature data of the design drawing also includes the following steps: uploading the design drawing to the RESTful interface using Axios; and the image management system starting the ResNet-50 and YOLO detection modules for parallel processing to extract the boundaries and text labels of the chart.
5. The chart generation method based on an AI model according to claim 1, characterized in that, The St2 process, which visualizes the chart feature data, further includes the steps of performing Gaussian filtering on each image in the image set P, unifying the size and format, and storing it in a Redis cache.
6. The chart generation method based on an AI model according to claim 1, characterized in that, The evaluation of the similarity between each of the rendered images and the corresponding image Pn includes the steps of: manually previewing the structural and visual similarity between each rendered image and the corresponding image Pn.
7. The chart generation method based on an AI model according to claim 1, characterized in that, The St6, combination and deployment of the chart code set also includes the following steps: triggering unit tests through the Jenkins pipeline, with the unit test coverage ≥85%; generating a Docker image of the chart code set C, pushing it to a private Registry, and then deploying it to a Kubernetes cluster.
8. A chart generation system, characterized in that, The method for generating charts based on AI models as described in any one of claims 1-7 includes: an image management subsystem, a model management subsystem, and a code management subsystem; The image management subsystem is used to extract the chart feature data of the design drawings and evaluate the similarity between each of the renderings and a corresponding image Pn; the model management subsystem is used to call the AI model Mk in the AI model set M and output the code template; the code management subsystem is used to obtain the rendering set J and combine and deploy the chart code set.
9. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the chart generation method based on an AI model as described in any one of claims 1-7.