CN111275619B - Method for converting process graphics into SVG vector graphics - Google Patents

Method for converting process graphics into SVG vector graphics Download PDF

Info

Publication number
CN111275619B
CN111275619B CN202010043234.XA CN202010043234A CN111275619B CN 111275619 B CN111275619 B CN 111275619B CN 202010043234 A CN202010043234 A CN 202010043234A CN 111275619 B CN111275619 B CN 111275619B
Authority
CN
China
Prior art keywords
graphic
svg vector
file
converted
graphics
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010043234.XA
Other languages
Chinese (zh)
Other versions
CN111275619A (en
Inventor
刘胜
游之晋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Qixiang Intelligent Technology Co ltd
Original Assignee
Shanghai Qixiang Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Qixiang Intelligent Technology Co ltd filed Critical Shanghai Qixiang Intelligent Technology Co ltd
Priority to CN202010043234.XA priority Critical patent/CN111275619B/en
Publication of CN111275619A publication Critical patent/CN111275619A/en
Application granted granted Critical
Publication of CN111275619B publication Critical patent/CN111275619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for converting a process graphic into an SVG vector graphic, which comprises the following steps: step S10, circularly traversing all the process graphic pictures in the page, and determining the process graphic pictures to be converted; step S20, processing the technological graphic picture to be converted and generating a basic SVG vector diagram file; step S30, performing traversal optimization processing on the content of the basic SVG vector image file; and step S40, performing label configuration processing and picture conversion processing on the process graphic pictures to be converted in the page according to the basic SVG vector image file subjected to traversal optimization processing. According to the invention, one or more existing process graphic pictures in the page are directly converted into the SVG vector graphics file, and the pictures are not required to be drawn again and the animation is not required to be configured, so that the working efficiency is greatly improved. Meanwhile, the converted SVG vector image file has the advantages of being capable of being scaled in an electrodeless manner and free of distortion.

Description

Method for converting process graphics into SVG vector graphics
Technical Field
The invention relates to the technical field of graphic conversion methods, in particular to a method for converting a process graphic into an SVG (Scalable Vector Graphics, scalable vector graphic) vector graphic.
Background
The process graphic screen shots such as HMI/SCADA/DCS are changed into bitmaps, graphic files are usually redrawn by adopting a drawing tool, and then corresponding labels are filled in to generate new graphic files. However, this method has drawbacks in that: the graph needs to be manually drawn and configured with the data labels and the animations every time, the labor cost is obviously greatly increased, the working efficiency is reduced, and meanwhile, the newly generated graph file is in a non-vector graph format, so that the graph is distorted after being scaled.
To this end, the applicant has advantageously explored and studied to find a solution to the above-mentioned problems, against which the technical solutions described below are generated.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: aiming at the defects of the prior art, the method for converting the process graphics into the SVG vector graphics reduces the labor cost, improves the working efficiency and avoids the graphics distortion.
The technical problems to be solved by the invention can be realized by adopting the following technical scheme:
a method for converting a process graphic into an SVG vector graphic, comprising the steps of:
step S10, circularly traversing all the process graphic pictures in the page, and determining the process graphic pictures to be converted;
step S20, processing the technological graphic picture to be converted and generating a basic SVG vector diagram file;
step S30, performing traversal optimization processing on the content of the basic SVG vector image file;
and step S40, performing label configuration processing and picture conversion processing on the process graphic pictures to be converted in the page according to the basic SVG vector image file subjected to traversal optimization processing.
In a preferred embodiment of the present invention, in the step S20, the processing the process graphics frame to be converted and generating a basic SVG vector graphics file includes the following steps:
step S21, reading the label prefix, the label suffix and the graphic object attribute of the process graphic picture to be converted;
step S22, obtaining the label prefix, label suffix and SVG vector diagram object attribute of the converted SVG vector diagram file;
and S23, modifying the label prefix, label suffix and graphic object attribute of the process graphic picture to be converted into the label prefix, label suffix and SVG vector graphic object attribute of the converted SVG vector graphic file, and generating a basic SVG vector graphic file.
In a preferred embodiment of the present invention, in the step S30, the performing a traversal optimization process on the content of the basic SVG vector graphics file includes the following steps:
step S31, performing cyclic traversal processing on the basic SVG vector graphics file to acquire all codes of the basic SVG vector graphics file;
step S32, screening all codes of the obtained basic SVG vector graphic file to screen out useless codes in the basic SVG vector graphic file;
and step S33, optimizing the useless codes in the basic SVG vector graphic file.
In a preferred embodiment of the present invention, in the step S40, the label configuration process and the picture conversion process are performed on the process graphics picture to be converted in the page according to the basic SVG vector image file after the traversal optimization process, including the following steps:
step S41, obtaining label information of the basic SVG vector image file subjected to traversal optimization;
step S42, modifying the label information of the technological graphic picture to be converted in the page by using the obtained label information;
and step S43, modifying the process graphic picture to be converted in the page by using the basic SVG vector graphic file subjected to traversal optimization.
In a preferred embodiment of the present invention, in the step S40, a CSV result file is also generated, where the CSV result file includes a control ID, a data source ID, a label name, and a success flag, so as to help the user identify whether the graphics and animation are converted.
In a preferred embodiment of the present invention, the process graphic screen is one or a combination of HMI process graphic screen, SCADA process graphic screen or DCS process graphic screen.
Due to the adoption of the technical scheme, the invention has the beneficial effects that: according to the invention, one or more existing process graphic pictures in the page are directly converted into the SVG vector graphics file, and the pictures are not required to be drawn again and the animation is not required to be configured, so that the working efficiency is greatly improved. Meanwhile, the converted SVG vector image file has the advantages of being capable of being scaled in an electrodeless manner and free of distortion.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of the present invention.
Detailed Description
The invention is further described with reference to the following detailed drawings in order to make the technical means, the creation characteristics, the achievement of the purpose and the effect of the implementation of the invention easy to understand.
Referring to fig. 1, a method for converting a process graphic into an SVG vector graphic is shown, comprising the steps of:
step S10, cycling through all the process graphic pictures in the page, and determining the process graphic pictures to be converted. In this embodiment, the process graphic frame is one or a combination of several of HMI process graphic frame, SCADA process graphic frame or DCS process graphic frame.
And step S20, processing the technological graphic picture to be converted and generating a basic SVG vector diagram file.
And step S30, performing traversal optimization processing on the content of the basic SVG vector image file.
And step S40, performing label configuration processing and picture conversion processing on the process graphic pictures to be converted in the page according to the basic SVG vector image file subjected to traversal optimization processing.
In step S20, the process graphics picture to be converted is processed and a basic SVG vector graphics file is generated, including the following steps:
step S21, reading the label prefix, the label suffix and the graphic object attribute of the process graphic picture to be converted;
step S22, obtaining the label prefix, label suffix and SVG vector diagram object attribute of the converted SVG vector diagram file;
and S23, modifying the label prefix, label suffix and graphic object attribute of the process graphic picture to be converted into the label prefix, label suffix and SVG vector graphic object attribute of the converted SVG vector graphic file, and generating a basic SVG vector graphic file.
In step S30, the traversal optimization process is performed on the content of the basic SVG vector graphics file, including the following steps:
and S31, performing cyclic traversal processing on the basic SVG vector graphics file to acquire all codes of the basic SVG vector graphics file. Specifically, traversing the basic SVG vector image file from the first row of codes to the last row of codes in a cyclic traversing mode, wherein the traversing aims at optimizing useless codes, the type of a replacement control is InSmart Portal identifiable control type, and the content of a replacement tag is identifiable tag content;
step S32, screening all codes of the obtained basic SVG vector graphic file to screen out useless codes in the basic SVG vector graphic file;
and step S33, optimizing the useless codes in the basic SVG vector graphic file.
In step S40, label configuration processing and picture conversion processing are performed on the process graphics picture to be converted in the page according to the basic SVG vector image file after the traversal optimization processing, including the following steps:
step S41, obtaining label information of the basic SVG vector image file subjected to traversal optimization;
step S42, modifying the label information of the process graphic picture to be converted in the page by using the acquired label information, so that the new label information can be normally identified in the InSmart Portal, the new label information and the label information in the InSmart Portal keep consistent, and SVG vector diagram and animation association are realized in the Portal;
and step S43, modifying the process graphic picture to be converted in the page by using the basic SVG vector graphic file subjected to traversal optimization.
In order to make the user more clearly know the conversion state of each label in the conversion process, in step S40, a CSV result file is also generated, and each process graphic image correspondingly generates a CSV result file to record the state of each key point in the conversion process, where the CSV result file includes a control ID, a data source ID, a label and a success flag, so as to help the user identify whether the graphics and animation are converted. Meanwhile, during failure processing, a CSV result file is checked, failed operation is processed, failed labels are found out, and manual modification is carried out by using a drawing tool.
The foregoing has shown and described the basic principles and main features of the present invention and the advantages of the present invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, and that the above embodiments and descriptions are merely illustrative of the principles of the present invention, and various changes and modifications may be made without departing from the spirit and scope of the invention, which is defined in the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (5)

1. A method for converting a process graphic into an SVG vector graphic, comprising the steps of:
step S10, circularly traversing all the process graphic pictures in the page, and determining the process graphic pictures to be converted;
step S20, processing the technological graphic picture to be converted and generating a basic SVG vector diagram file;
step S30, performing traversal optimization processing on the content of the basic SVG vector image file;
step S40, performing label configuration processing and picture conversion processing on the process graphic pictures to be converted in the page according to the basic SVG vector image file subjected to traversal optimization processing;
in the step S20, the processing the process graphics picture to be converted and generating a basic SVG vector graphics file includes the following steps:
step S21, reading the label prefix, the label suffix and the graphic object attribute of the process graphic picture to be converted;
step S22, obtaining the label prefix, label suffix and SVG vector diagram object attribute of the converted SVG vector diagram file;
and S23, modifying the label prefix, label suffix and graphic object attribute of the process graphic picture to be converted into the label prefix, label suffix and SVG vector graphic object attribute of the converted SVG vector graphic file, and generating a basic SVG vector graphic file.
2. The method for converting process graphics into SVG vector graphics according to claim 1, wherein in step S30, the performing traversal optimization on the content of the basic SVG vector graphics file includes the steps of:
step S31, performing cyclic traversal processing on the basic SVG vector graphics file to acquire all codes of the basic SVG vector graphics file;
step S32, screening all codes of the obtained basic SVG vector graphic file to screen out useless codes in the basic SVG vector graphic file;
and step S33, optimizing the useless codes in the basic SVG vector graphic file.
3. The method for converting process graphics into SVG vector graphics according to claim 1, wherein in step S40, the label configuration process and the picture conversion process are performed on the process graphics pictures to be converted in the page according to the basic SVG vector graphics file after the traversal optimization process, and the method comprises the following steps:
step S41, obtaining label information of the basic SVG vector image file subjected to traversal optimization;
step S42, modifying the label information of the technological graphic picture to be converted in the page by using the obtained label information;
and step S43, modifying the process graphic picture to be converted in the page by using the basic SVG vector graphic file subjected to traversal optimization.
4. A method according to any one of claims 1 to 3, wherein in step S40, a CSV result file is also generated, and the CSV result file includes a control ID, a data source ID, a label name, and a success flag, so as to help the user identify whether the graphics and animation are converted.
5. The method of converting process graphics to SVG vector graphics according to claim 1, wherein the process graphics frames are one or more combinations of HMI process graphics frames, SCADA process graphics frames, or DCS process graphics frames.
CN202010043234.XA 2020-01-15 2020-01-15 Method for converting process graphics into SVG vector graphics Active CN111275619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010043234.XA CN111275619B (en) 2020-01-15 2020-01-15 Method for converting process graphics into SVG vector graphics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010043234.XA CN111275619B (en) 2020-01-15 2020-01-15 Method for converting process graphics into SVG vector graphics

Publications (2)

Publication Number Publication Date
CN111275619A CN111275619A (en) 2020-06-12
CN111275619B true CN111275619B (en) 2023-07-28

Family

ID=71001061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010043234.XA Active CN111275619B (en) 2020-01-15 2020-01-15 Method for converting process graphics into SVG vector graphics

Country Status (1)

Country Link
CN (1) CN111275619B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835597B (en) * 2020-06-24 2024-11-08 腾讯科技(深圳)有限公司 Image generation method, image processing method, related device and medium
CN116185427A (en) * 2023-04-20 2023-05-30 北京尽微致广信息技术有限公司 Webpage conversion method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN206433086U (en) * 2016-12-31 2017-08-22 上海慧鼎信息系统工程有限公司 A kind of video monitoring system
CN107729007A (en) * 2017-11-21 2018-02-23 华北电力大学 A kind of transformer station uniformly monitors the implementation method of graphic editor on-line
CN108447108A (en) * 2018-03-21 2018-08-24 上海振华重工(集团)股份有限公司 Pier facilities monitored picture analysis system and method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PL2403280T3 (en) * 2010-06-30 2021-04-06 Hughes Systique India Private Limited A method and system for compressing and efficiently transporting scalable vector graphics based images and animation over low bandwidth networks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN206433086U (en) * 2016-12-31 2017-08-22 上海慧鼎信息系统工程有限公司 A kind of video monitoring system
CN107729007A (en) * 2017-11-21 2018-02-23 华北电力大学 A kind of transformer station uniformly monitors the implementation method of graphic editor on-line
CN108447108A (en) * 2018-03-21 2018-08-24 上海振华重工(集团)股份有限公司 Pier facilities monitored picture analysis system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
金丰 ; 王瀛洲 ; 焦嵩鸣 ; .DCS监控画面的Web发布实现.计算机仿真.2013,(第06期),全文. *

Also Published As

Publication number Publication date
CN111275619A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
CN111275619B (en) Method for converting process graphics into SVG vector graphics
CN106651992B (en) Method and system for optimizing Android resource picture
CN106791937B (en) Video image annotation method and system
JP5303865B2 (en) Information processing apparatus and information processing method
CN113296774B (en) Processing method and system of OFD file based on browser
US20220067998A1 (en) Method for displaying electronic price tag, server and storage medium
CN115496749B (en) Product defect detection method and system based on target detection training preprocessing
CN116486759B (en) Intelligent adjustment method, device, equipment and storage medium for identification display
CN116954450A (en) Screenshot method and device for front-end webpage, storage medium and terminal
CN111881648A (en) Method for generating electronic book font file
CN108495174B (en) Method and system for generating video file by H5 page effect
CN110162301B (en) Form rendering method, form rendering device and storage medium
CN113157275B (en) Frame animation rendering method and device, electronic equipment and storage medium
US20150036154A1 (en) Methods and apparatuses for displaying text block and processing text block
JP5200786B2 (en) Difference extraction apparatus and difference extraction program
CN112417087B (en) Text-based tracing method and system
CN102867322A (en) Method and device for realizing Chinese marking in three-dimensional scene
CN109657671A (en) Nameplate character recognition method and device, computer equipment and storage medium
CN109086481B (en) Method for improving DRC examination efficiency of integrated circuit design layout
CN111091608A (en) Picture generation method based on mobile operating system picture editing
CN111508041A (en) HMI character compression and rendering method and device and electronic equipment
JP2007241772A (en) Image output device, image output method, and program
CN116170520A (en) Electronic protocol generation method and device, storage medium and electronic equipment
CN111144071B (en) Cross-platform MathType formula conversion method and device
CN111554277B (en) Voice data recognition method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Liu Sheng

Inventor after: You Zhijin

Inventor before: Liu Sheng

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant