CN115048915B - Data processing method and system of electric power file based on operation platform - Google Patents
Data processing method and system of electric power file based on operation platform Download PDFInfo
- Publication number
- CN115048915B CN115048915B CN202210985917.6A CN202210985917A CN115048915B CN 115048915 B CN115048915 B CN 115048915B CN 202210985917 A CN202210985917 A CN 202210985917A CN 115048915 B CN115048915 B CN 115048915B
- Authority
- CN
- China
- Prior art keywords
- area
- image
- new image
- pixel value
- file
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/40—Document-oriented image-based pattern recognition
- G06V30/41—Analysis of document content
- G06V30/418—Document matching, e.g. of document images
-
- Y—GENERAL 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
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S10/00—Systems supporting electrical power generation, transmission or distribution
- Y04S10/50—Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Editing Of Facsimile Originals (AREA)
- Supply And Distribution Of Alternating Current (AREA)
Abstract
本发明公开了一种基于操作平台的电力文件的数据处理方法及系统,包括:对在线电力报告进行解析处理,得到在线电力报告的至少一个文件子区域;提取文件子区域内的可编辑内容;通过编辑装置基于富文本编辑软件对可编辑内容进行编辑修改,得到修改后内容,根据文件子区域的板式规格和/或相邻文件子区域的内容格式对修改后内容进行调整,得到调整后内容;基于预设比例对显示区域进行分区处理得到第一显示区域和第二显示区域,将调整后内容在电力报告中同步修改后通过第一显示区域显示,通过第二显示区域对所编辑的文件子区域进行显示;在接收到用户输入的第一确认信息后,将修改后的在线电力报告作为最终在线电力报告。
The invention discloses a data processing method and system for power files based on an operation platform, comprising: analyzing and processing an online power report to obtain at least one file sub-region of the online power report; and extracting editable content in the file sub-region; Editing and modifying the editable content based on the rich text editing software by the editing device to obtain the modified content, and adjusting the modified content according to the board format specification of the file sub-region and/or the content format of the adjacent file sub-region to obtain the adjusted content ; Perform partition processing on the display area based on the preset ratio to obtain the first display area and the second display area, and synchronously modify the adjusted content in the power report and display it through the first display area, and use the second display area to display the edited file. The sub-area is displayed; after receiving the first confirmation information input by the user, the revised online power report is used as the final online power report.
Description
技术领域technical field
本发明涉及数据处理技术领域,特别是涉及一种基于操作平台的电力文件的数据处理方法及系统。The invention relates to the technical field of data processing, in particular to a data processing method and system for power files based on an operating platform.
背景技术Background technique
随着现代化电力企业的快速发展,需要制作大量的电力报告来展示发展状况,一般来说,电力报告中会有文字展示区域和图片展示区域,直观的像用户展示电力发展数据。With the rapid development of modern power enterprises, it is necessary to produce a large number of power reports to show the development status. Generally speaking, there will be a text display area and a picture display area in the power report to intuitively display power development data to users.
现有技术中,制作好的电力报告会上传到服务器,用户可以以网页的形式查看电力报告,用户需要对电力调研报告进行修改时,会按照个人习惯插入内容,导致新插入的数据会与原始数据格式不一,使得被修改后的电力报告较为混乱。In the existing technology, the prepared power report will be uploaded to the server, and the user can view the power report in the form of a web page. When the user needs to modify the power research report, the content will be inserted according to personal habits, resulting in the newly inserted data. Data formats vary, making the revised power report confusing.
因此,如何在用户对电力报告进行编辑后对格式和内容进行相适应调整,使得插入的数据符合电力报告的板式要求成为了急需解决的问题。Therefore, how to adapt and adjust the format and content after the user edits the power report, so that the inserted data meets the format requirements of the power report has become an urgent problem to be solved.
发明内容Contents of the invention
本发明克服现有技术的缺点,提供一种基于操作平台的电力文件的数据处理方法及系统,可以在用户对在线电力报告进行编辑后对格式和内容进行相适应调整,使得插入的数据符合电力报告的板式要求。The present invention overcomes the shortcomings of the prior art, and provides a data processing method and system for power files based on an operating platform, which can adapt and adjust the format and content after the user edits the online power report, so that the inserted data conforms to the power Reported plate requirements.
为了解决以上技术问题,本发明的技术方案如下:In order to solve the above technical problems, the technical solution of the present invention is as follows:
本发明实施例提供一种基于操作平台的电力文件的数据处理方法,所述管理驾驶舱包括显示设备和编辑装置,所述显示设备包括显示区域和可编辑区域,通过以下步骤进行电力报告可视化编辑,包括:An embodiment of the present invention provides a data processing method for power files based on an operating platform, the management cockpit includes a display device and an editing device, the display device includes a display area and an editable area, and the visual editing of the power report is performed through the following steps ,include:
S1、根据用户的选择将相应的在线电力报告在显示设备中进行显示,对在线电力报告进行解析处理,得到在线电力报告的至少一个文件子区域;S1. Display the corresponding online power report on the display device according to the user's selection, analyze and process the online power report, and obtain at least one file sub-area of the online power report;
S2、确定用户选择的文件子区域,提取所述文件子区域内的可编辑内容,在所述可编辑区域内建立富文本编辑区域;S2. Determine the file sub-area selected by the user, extract the editable content in the file sub-area, and create a rich text editing area in the editable area;
S3、通过编辑装置基于富文本编辑软件对所述可编辑内容进行编辑修改,得到修改后内容,根据所述文件子区域的板式规格和/或相邻文件子区域的内容格式对修改后内容进行调整,得到调整后内容;S3. Use the editing device to edit and modify the editable content based on the rich text editing software to obtain the modified content, and modify the modified content according to the format specification of the file sub-area and/or the content format of the adjacent file sub-area Adjust to get the adjusted content;
S4、基于预设比例对所述显示区域进行分区处理得到第一显示区域和第二显示区域,将所述调整后内容在在线电力报告中同步修改后通过第一显示区域显示,通过第二显示区域对所编辑的文件子区域进行显示;S4. Partitioning the display area based on a preset ratio to obtain a first display area and a second display area, synchronously modifying the adjusted content in the online power report, displaying it in the first display area, and displaying it in the second display area The area displays the edited file sub-area;
S5、在接收到用户输入的第一确认信息后,将修改后的在线电力报告作为最终在线电力报告,结束对电力报告可视化编辑。S5. After receiving the first confirmation information input by the user, use the modified online power report as the final online power report, and end the visual editing of the power report.
进一步的,所述S1包括:Further, the S1 includes:
获取所述在线电力报告所对应的初始模板,所述初始模板包括至少一个初始区域,所述初始区域包括文字编辑区域或图片编辑区域中的任意一种或多种;Acquire an initial template corresponding to the online power report, the initial template includes at least one initial area, and the initial area includes any one or more of a text editing area or an image editing area;
基于所述初始模板与初始区域的对应关系对在线电力报告进行解析处理,得到与所述初始区域对应的文件子区域;Analyzing and processing the online power report based on the correspondence between the initial template and the initial area to obtain a document sub-area corresponding to the initial area;
确定每个文件子区域的轮廓像素点,根据轮廓像素点的第一像素值、轮廓像素点相邻像素点的第二像素值进行计算,得到用于显示的第三像素值;Determining the contour pixels of each file sub-region, performing calculations based on the first pixel value of the contour pixel and the second pixel value of adjacent pixels of the contour pixel, to obtain a third pixel value for display;
控制每个文件子区域的轮廓像素点按照所述第三像素值进行显示。Controlling the display of the contour pixel points of each file sub-region according to the third pixel value.
进一步的,所述确定每个文件子区域的轮廓像素点,根据轮廓像素点的第一像素值、轮廓像素点相邻像素点的第二像素值进行计算,得到用于显示的第三像素值,包括:Further, the determination of the contour pixel of each file sub-region is calculated according to the first pixel value of the contour pixel and the second pixel value of the adjacent pixel of the contour pixel to obtain the third pixel value for display ,include:
若判断所述第一像素值与所述第二像素值的差值的绝对值大于等于预设像素值,则将所述第一像素值作为用于显示的第三像素值;If it is determined that the absolute value of the difference between the first pixel value and the second pixel value is greater than or equal to a preset pixel value, the first pixel value is used as a third pixel value for display;
若判断所述第一像素值与所述第二像素值的差值的绝对值小于预设像素值,则根据所述第二像素值确定轮廓像素点的像素值的变化趋势;If it is determined that the absolute value of the difference between the first pixel value and the second pixel value is smaller than a preset pixel value, then determine the change trend of the pixel value of the contour pixel point according to the second pixel value;
若所述变化趋势为增大趋势,则将所述第一像素值加预设像素值得到第三像素值;If the change trend is an increasing trend, adding a preset pixel value to the first pixel value to obtain a third pixel value;
若所述变化趋势为减小趋势,则将所述第一像素值减预设像素值得到第三像素值;If the change trend is a decreasing trend, then subtracting the preset pixel value from the first pixel value to obtain a third pixel value;
将所计算得到的第三像素值作为替换先前第一像素值、用于进行显示的第三像素值。The calculated third pixel value is used as a third pixel value to replace the previous first pixel value for display.
进一步的,所述若判断所述第一像素值与所述第二像素值的差值的绝对值小于预设像素值,则根据所述第二像素值确定轮廓像素点的像素值的变化趋势,包括:Further, if it is judged that the absolute value of the difference between the first pixel value and the second pixel value is smaller than the preset pixel value, then determine the change trend of the pixel value of the contour pixel point according to the second pixel value ,include:
若所述第二像素值小于等于预设像素值,则确定轮廓像素点的像素值的变化趋势为增大趋势;If the second pixel value is less than or equal to the preset pixel value, it is determined that the change trend of the pixel value of the contour pixel point is an increasing trend;
若所述第二像素值大于预设像素值,则确定轮廓像素点的像素值的变化趋势为减小趋势。If the second pixel value is greater than the preset pixel value, it is determined that the change trend of the pixel value of the contour pixel point is a decreasing trend.
进一步的,还包括:Further, it also includes:
统计与第一像素值相同的第三像素值的像素点数量得到第一数量,统计与第一像素值不相同的第三像素值的像素点数量得到第二数量;counting the number of pixels of the third pixel value identical to the first pixel value to obtain the first number, and counting the number of pixels of the third pixel value different from the first pixel value to obtain the second number;
根据所述第一数量、第二数量得到像素值变化比例,若所述像素值变化比例大于预设比例,则选取第一预设像素值和第二预设像素值;Obtaining a pixel value change ratio according to the first quantity and the second quantity, if the pixel value change ratio is greater than a preset ratio, then selecting a first preset pixel value and a second preset pixel value;
控制所述轮廓像素点分别按照所述第一预设像素值和第二预设像素值,交替显示预设时间段。Controlling the contour pixel points to alternately display preset time periods according to the first preset pixel value and the second preset pixel value respectively.
进一步的,所述S3包括:Further, the S3 includes:
若所述初始区域为图片编辑区域,则根据用户操作删除可编辑内容中的历史图像,并添加新图像;If the initial area is an image editing area, delete historical images in the editable content according to user operations, and add new images;
获取文件子区域的板式规格,所述板式规格包括形状规格和/或尺寸规格;Acquiring the plate specification of the sub-area of the document, the plate specification includes shape specification and/or size specification;
若判断新图像的图像形状与文件子区域的形状规格不相同,则对文件子区域相邻的其他文件子区域的内容格式进行获取,得到参考形状规格,所述参考形状规格为调整形状或不调整形状中的一个;If it is judged that the image shape of the new image is not the same as the shape specification of the file sub-area, the content format of other file sub-areas adjacent to the file sub-area is obtained to obtain a reference shape specification, and the reference shape specification is to adjust the shape or not adjust one of the shapes;
若所述参考形状规格为调整形状,则以文件子区域的形状规格对新图像显示,将新图像与文件子区域融合,使得所展示的新图像与文件子区域融合为相同形状,得到为图像的调整后内容;If the reference shape specification is an adjusted shape, display the new image with the shape specification of the file sub-area, and fuse the new image and the file sub-area, so that the displayed new image and the file sub-area are fused into the same shape, and an image is obtained adjusted content of
若所述参考形状规格为不调整形状,则根据所述文件子区域的尺寸规格对所述新图像的图像尺寸进行调整,将新图像与文件子区域融合,此时新图像和文件子区域为不同的形状,得到为图像的调整后内容。If the reference shape specification is an unadjusted shape, then adjust the image size of the new image according to the size specification of the document sub-area, and fuse the new image with the document sub-area. At this time, the new image and the document sub-area are A different shape is obtained for the resized content of the image.
进一步的,所述若所述参考形状规格为调整形状,则以文件子区域的形状规格对新图像显示,将新图像与文件子区域融合,使得所展示的新图像与文件子区域融合为相同形状,包括:Further, if the reference shape specification is an adjusted shape, display the new image with the shape specification of the file sub-area, and fuse the new image with the file sub-area, so that the displayed new image and the file sub-area are fused into the same shape, including:
选中新图像的图像中心点,以及选中文件子区域的区域中心点;Select the image center point of the new image, and the area center point of the selected file sub-area;
基于所述图像中心点和区域中心点,将所述新图像与文件子区域进行叠加设置得到融合中心点,根据所述融合中心点建立坐标系;Based on the center point of the image and the center point of the region, superimpose the new image and the file sub-region to obtain a fusion center point, and establish a coordinate system according to the fusion center point;
获取新图像中每个图像像素点的图像坐标值,以及文件子区域中每个区域像素点的区域坐标值;Obtain the image coordinate value of each image pixel point in the new image, and the area coordinate value of each area pixel point in the file sub-area;
将图像坐标值与区域坐标值进行比对,对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状。Compare the image coordinate value with the area coordinate value, adjust the image size of the new image to obtain the first target size, and fuse the new image of the first target size with the file sub-region according to the fusion center point, so that the displayed new The image and file subregions are blended into the same shape.
进一步的,所述将图像坐标值与区域坐标值进行比对,对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状,包括:Further, the image coordinate value is compared with the area coordinate value, the image size of the new image is adjusted to obtain the first target size, and the new image of the first target size is fused with the file sub-region according to the fusion center point, Causes the displayed new image to blend into the same shape as the subregion of the document, including:
若判断图像坐标值的坐标未完全包括区域坐标值的坐标,则获取未完全包括区域坐标值的所有坐标得到第一坐标数量,根据所述第一坐标数量确定所述新图像的第一放大倍数;If it is judged that the coordinates of the image coordinate value do not completely include the coordinates of the area coordinate value, then obtain all the coordinates that do not completely include the area coordinate value to obtain the first coordinate quantity, and determine the first magnification factor of the new image according to the first coordinate quantity ;
根据所述第一放大倍数对新图像放大处理,提取放大处理后新图像中每个图像像素点的图像坐标值;Enlarging the new image according to the first magnification, extracting the image coordinate value of each image pixel in the new image after the enlarging process;
将放大处理后的图像坐标值再次与区域坐标值进行比对,若判断新图像放大后的图像坐标值的坐标完全包括区域坐标值的坐标,则不再对新图像进行放大处理,将此时新图像的尺寸作为第一目标尺寸。Compare the enlarged image coordinate value with the area coordinate value again. If it is judged that the coordinates of the enlarged image coordinate value of the new image completely include the coordinates of the area coordinate value, the new image will not be enlarged. The size of the new image is used as the first target size.
进一步的,所述若判断图像坐标值的坐标未完全包括区域坐标值的坐标,则获取未完全包括区域坐标值的所有坐标得到第一坐标数量,根据所述第一坐标数量确定所述新图像的第一放大倍数,包括:Further, if it is judged that the coordinates of the image coordinate value do not completely include the coordinates of the area coordinate value, then obtain all the coordinates that do not completely include the area coordinate value to obtain the first coordinate number, and determine the new image according to the first coordinate number The first magnification, including:
获取文件子区域内像素点的第一总数量;Obtain the first total number of pixels in the file sub-area;
根据所述第一坐标数量、第一总数量、放大权重值进行计算得到所述新图像的第一放大倍数,通过以下公式计算第一放大倍数,Calculate according to the first coordinate quantity, the first total quantity, and the magnification weight value to obtain the first magnification factor of the new image, and calculate the first magnification factor by the following formula,
其中,为第一放大倍数,为第一坐标数量,为第一总数量,为放大权重值。in, is the first magnification, is the number of first coordinates, is the first total quantity, is the magnification weight value.
进一步的,所述将图像坐标值与区域坐标值进行比对,对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状,包括:Further, the image coordinate value is compared with the area coordinate value, the image size of the new image is adjusted to obtain the first target size, and the new image of the first target size is fused with the file sub-region according to the fusion center point, Causes the displayed new image to blend into the same shape as the subregion of the document, including:
若判断图像坐标值的坐标完全包括区域坐标值的坐标,则获取图像坐标值中未完全包括区域坐标值的所有图像坐标值,得到第二坐标数量,根据所述第二坐标数量确定所述新图像的第一缩小倍数;If it is judged that the coordinates of the image coordinate value completely include the coordinates of the area coordinate value, then obtain all the image coordinate values that do not completely include the area coordinate value in the image coordinate value, obtain the second coordinate quantity, and determine the new coordinate value according to the second coordinate quantity. The first zoom factor of the image;
根据所述第一缩小倍数对新图像缩小处理,提取缩小处理后新图像中每个图像像素点的图像坐标值;The new image is reduced according to the first reduction factor, and the image coordinate value of each image pixel in the new image after the reduction processing is extracted;
将缩小处理后的图像坐标值再次与区域坐标值进行比对,若判断新图像缩小后的图像坐标值的坐标完全包括区域坐标值的坐标,则再次获取图像坐标值中未与坐标完全包括区域坐标值对应的所有图像坐标值,得到第三坐标数量,根据所述第三坐标数量确定所述新图像的第二缩小倍数;Compare the reduced image coordinate value with the area coordinate value again, if it is judged that the coordinates of the reduced image coordinate value of the new image completely include the coordinates of the area coordinate value, then obtain the area not completely included in the image coordinate value again All image coordinate values corresponding to the coordinate values are obtained to obtain a third coordinate quantity, and a second reduction factor of the new image is determined according to the third coordinate quantity;
持续将缩小处理后的图像坐标值与区域坐标值进行比对,直至缩小处理后新图像的图像坐标值的坐标不完全包括区域坐标值的坐标,将本次缩小前的新图像的图像尺寸作为第一目标尺寸。Continue to compare the reduced image coordinates with the region coordinates until the coordinates of the image coordinates of the new image after reduction do not completely include the coordinates of the region coordinates, and take the image size of the new image before this reduction as The first target size.
进一步的,所述若判断图像坐标值的坐标完全包括区域坐标值的坐标,则获取图像坐标值中未与坐标完全包括区域坐标值对应的所有图像坐标值,得到第二坐标数量,根据所述第二坐标数量确定所述新图像的第一缩小倍数,包括:Further, if it is judged that the coordinates of the image coordinate values completely include the coordinates of the area coordinate values, all image coordinate values in the image coordinate values that do not correspond to the coordinates completely including the area coordinate values are obtained to obtain the second coordinate number, according to the A second coordinate quantity determines a first reduction factor of the new image, comprising:
获取新图像内图像像素点的第二总数量;Obtain the second total number of image pixels in the new image;
根据所述第二坐标数量、第二总数量、缩小权重值进行计算得到所述新图像的第一缩小倍数,通过以下公式计算第一缩小倍数,Calculate according to the second coordinate quantity, the second total quantity, and the reduction weight value to obtain the first reduction factor of the new image, and calculate the first reduction factor by the following formula,
其中,为第一缩小倍数,为第二坐标数量,为第二总数量,为缩小权重值。in, is the first reduction factor, is the second coordinate quantity, is the second total quantity, To shrink the weight value.
进一步的,所述若所述参考形状规格为不调整形状,则根据所述文件子区域的尺寸规格对所述新图像的图像尺寸进行调整,将新图像与文件子区域融合,此时新图像和文件子区域为不同的形状,得到为图像的调整后内容,包括:Further, if the reference shape specification is a non-adjusted shape, then adjust the image size of the new image according to the size specification of the document sub-area, and fuse the new image with the document sub-area. At this time, the new image and file subregions of different shapes, resulting in the resized content of the image, including:
选中新图像的图像中心点,以及选中文件子区域的区域中心点;Select the image center point of the new image, and the area center point of the selected file sub-area;
基于所述图像中心点和区域中心点,将所述新图像与文件子区域进行叠加设置得到融合中心点;Based on the center point of the image and the center point of the region, the new image and the sub-region of the file are superimposed and set to obtain the fusion center point;
若所述新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则将所述新图像和文件子区域融合;If the size of the new image is smaller than the size of the document sub-region in all dimensions, then merging the new image and the document sub-region;
若所述新图像的尺寸在任意一个维度上大于文件子区域的尺寸,则根据新图像的尺寸与文件子区域的尺寸的差值得到第二缩小倍数,通过以下公式计算第三缩小倍数,If the size of the new image is greater than the size of the file sub-area in any dimension, the second reduction factor is obtained according to the difference between the size of the new image and the size of the file sub-area, and the third reduction factor is calculated by the following formula,
其中,为第三缩小倍数,为新图像的尺寸,为文件子区域的尺寸,为缩小系数值;in, is the third reduction factor, is the size of the new image, is the size of the subregion of the document, is the reduction factor value;
基于所述缩小倍数对新图像进行缩小处后,将缩小处理后的新图像与文件子区域融合。After the new image is reduced based on the reduction factor, the reduced new image is fused with the file sub-region.
进一步的,所述若所述新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则将所述新图像和文件子区域融合,包括:Further, if the size of the new image is smaller than the size of the file sub-area in all dimensions, then merging the new image and the file sub-area includes:
若所述新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则输出第一反馈信息;If the size of the new image is smaller than the size of the document sub-region in all dimensions, then output the first feedback information;
若接收到用户的第二确认信息,则将所述新图像和文件子区域融合;If the second confirmation information from the user is received, the new image is fused with the file sub-region;
若接收到用户的第二放大倍数,则根据所述第二放大倍数对所述新图像放大处理,在判断放大处理后的新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则将所述新图像和文件子区域融合。If the user’s second magnification is received, the new image is enlarged according to the second magnification, and after judging that the size of the enlarged new image is smaller than the size of the document sub-region in all dimensions, then the The new image is fused with the subregion of the document.
进一步的,所述S3包括:Further, the S3 includes:
若所述初始区域为文字编辑区域,则根据用户操作删除可编辑内容中的历史文字,并添加新文字得到修改后内容;If the initial area is a text editing area, delete the historical text in the editable content according to the user operation, and add new text to obtain the modified content;
获取相邻文件子区域的内容格式,将所述内容格式中对应的文字大小和文字样式作为参考文字大小和参考文字样式;Acquiring the content format of the sub-region of the adjacent file, using the corresponding text size and text style in the content format as the reference text size and reference text style;
将所述修改后内容中的新文字,按照所述参考文字大小和参考文字样式进行调整,得到为文字的调整后内容。The new text in the modified content is adjusted according to the reference text size and reference text style to obtain the text adjusted content.
本发明实施例提供一种基于操作平台的电力文件的数据处理系统,包括显示设备和编辑装置,所述显示设备包括显示区域和可编辑区域,通过以下模块进行电力报告可视化编辑,包括:An embodiment of the present invention provides a data processing system for power files based on an operating platform, including a display device and an editing device. The display device includes a display area and an editable area, and the power report can be visually edited through the following modules, including:
解析模块,用于根据用户的选择将相应的在线电力报告在显示设备中进行显示,对在线电力报告进行解析处理,得到在线电力报告的至少一个文件子区域;The analysis module is used to display the corresponding online power report on the display device according to the user's selection, analyze the online power report, and obtain at least one file sub-area of the online power report;
提取模块,用于确定用户选择的文件子区域,提取所述文件子区域内的可编辑内容,在所述可编辑区域内建立富文本编辑区域;An extracting module, configured to determine the file sub-area selected by the user, extract the editable content in the file sub-area, and establish a rich text editing area in the editable area;
修改模块,用于通过编辑装置基于富文本编辑软件对所述可编辑内容进行编辑修改,得到修改后内容,根据所述文件子区域的板式规格和/或相邻文件子区域的内容格式对修改后内容进行调整,得到调整后内容;The modification module is used to edit and modify the editable content based on the rich text editing software through the editing device to obtain the modified content, and modify the content according to the format specification of the file sub-area and/or the content format of the adjacent file sub-area The adjusted content is adjusted to obtain the adjusted content;
处理模块,用于基于预设比例对所述显示区域进行分区处理得到第一显示区域和第二显示区域,将所述调整后内容在在线电力报告中同步修改后通过第一显示区域显示,通过第二显示区域对所编辑的文件子区域进行显示;A processing module, configured to partition the display area based on a preset ratio to obtain a first display area and a second display area, synchronously modify the adjusted content in the online power report and then display it in the first display area, through The second display area displays the edited file sub-area;
确认模块,用于在接收到用户输入的第一确认信息后,将修改后的在线电力报告作为最终在线电力报告,结束对电力报告可视化编辑。The confirmation module is configured to use the revised online power report as the final online power report after receiving the first confirmation information input by the user, and end the visual editing of the power report.
本发明的有益效果是:The beneficial effects of the present invention are:
(1)本发明在对在线电力报告进行编辑的过程中,会对在线电力报告解析得到多个可供用户编辑的文件子区域,然后通过编辑装置对文件子区域内的内容进行编辑,得到编辑的内容;其中,为了使得内容符合在线电力报告的文件子区域的板式规格和/或相邻文件子区域的内容格式,本方案会按照不同的情况对插入的内容进行不同的调整,使得调整后的内容文件子区域的板式规格和/或相邻文件子区域的内容格式相对应,保证在线电力报告的查看时的一致性;(1) In the process of editing the online power report, the present invention analyzes the online power report to obtain multiple file sub-areas that can be edited by users, and then uses the editing device to edit the content in the file sub-area to obtain the edited among them, in order to make the content conform to the board specification of the file sub-area of the online power report and/or the content format of the adjacent file sub-area, this solution will make different adjustments to the inserted content according to different situations, so that after adjustment The format specifications of the content file sub-area and/or the content format of the adjacent file sub-area correspond to ensure the consistency when viewing the online power report;
(2)本发明在对在线电力报告解析后,为了提高轮廓的对比度,会基于轮廓像素点的第一像素值、轮廓像素点相邻像素点的第二像素值进行计算,得到用于显示的第三像素值,以第三像素值来让轮廓变的清晰,本发明对轮廓的显示颜色进行了调整,增加了轮廓显示的对比度,更直观的供用户在编辑过程中参考,提高用户在编辑过程中的准确性。此外,本方案考虑到对轮廓的显示颜色进行调整后,可能会导致轮廓显示为灰度值种类较多的,可能会影响用户编辑,会在一定条件下,按照第一预设像素值和第二预设像素值控制轮廓像素点交替显示,来更为直观的向用户展示轮廓的线条;(2) After analyzing the online power report, in order to improve the contrast of the outline, the present invention will calculate based on the first pixel value of the outline pixel point and the second pixel value of the adjacent pixel point of the outline pixel point, and obtain the The third pixel value, the third pixel value is used to make the outline clear. The present invention adjusts the display color of the outline, increases the contrast of the outline display, and is more intuitive for the user to refer to during the editing process, and improves the user's ability to edit. accuracy in the process. In addition, this solution considers that after adjusting the display color of the outline, it may cause the outline to display more types of gray values, which may affect user editing. Under certain conditions, the first preset pixel value and the second Two preset pixel values control the alternate display of contour pixels to more intuitively show the contour lines to the user;
(3)本发明为了使得添加的新图像匹配文件子区域,分为了两种情况,一种是需要对新图像的形状进行调整,另一种是不需要对新图像的形状进行调整;针对需要对新图像的形状进行调整的情况,本方案又提供的新图像的放大和缩小方案,其中会计算放大倍数和缩小倍数,来供服务器多次自动放大或缩小处理,在使得新图像的尺寸是最为合适的情况下,使新图像的失真率最小;另外,本方案针对不调整形状的实施例与需要调整形状的实施例不同,调整形状是对新图像的形状进行了改变,因此需要利用服务器来一点点调整,以达到所需的准确的新图像;而针对于不调整形状实施例,人为介入调整即可以实现所需要的新图像,无需服务器一点点调整,减少服务器的数据处理量。(3) In order to make the added new image match the sub-region of the file, the present invention is divided into two situations, one is that the shape of the new image needs to be adjusted, and the other is that the shape of the new image does not need to be adjusted; In the case of adjusting the shape of the new image, this solution also provides a new image zoom-in and zoom-out solution, which will calculate the zoom factor and zoom factor for the server to automatically zoom in or zoom out multiple times, so that the size of the new image is In the most suitable case, the distortion rate of the new image is minimized; in addition, this solution is different from the embodiment that does not adjust the shape and the embodiment that needs to adjust the shape. Adjusting the shape changes the shape of the new image, so it is necessary to use the server A little bit of adjustment is required to achieve the required accurate new image; and for the embodiment of not adjusting the shape, the required new image can be realized through human intervention and adjustment, without a little bit of adjustment by the server, reducing the data processing amount of the server.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.
图1为本发明提供的一种场景示意图;FIG. 1 is a schematic diagram of a scene provided by the present invention;
图2为基于操作平台的电力文件的数据处理方法的示意图;Fig. 2 is the schematic diagram of the data processing method based on the power file of operating platform;
图3为本发明提供的第一种新图像与文件子区域的示意图;Fig. 3 is a schematic diagram of the first new image and file sub-area provided by the present invention;
图4为本发明提供的第二种新图像与文件子区域的示意图;4 is a schematic diagram of the second new image and file sub-area provided by the present invention;
图5为本发明提供的第三种新图像与文件子区域的示意图;Fig. 5 is a schematic diagram of the third new image and file sub-area provided by the present invention;
图6为本发明提供的第四种新图像与文件子区域的示意图;Fig. 6 is a schematic diagram of the fourth new image and file sub-area provided by the present invention;
图7为本发明提供的第五种新图像与文件子区域的示意图;Fig. 7 is a schematic diagram of the fifth new image and file sub-area provided by the present invention;
图8为基于操作平台的电力文件的数据处理系统的示意图。FIG. 8 is a schematic diagram of a data processing system based on an operating platform's power file.
具体实施方式Detailed ways
为使本发明的内容更容易被清楚地理解,下面根据具体实施方式并结合附图,对本发明作出进一步详细的说明。In order to make the content of the present invention more clearly understood, the present invention will be further described in detail below based on the specific embodiments and in conjunction with the accompanying drawings.
参见图1,是本发明实施例提供的一种场景示意图,显示设备1可以是液晶显示器,具体可以是大型的液晶显示器,显示设备1包括显示区域和可编辑区域,可以理解的是,显示区域用于显示在线电力报告,可编辑区域供用户基于编辑装置来编辑在线电力报告;编辑装置2例如可以是键盘、鼠标等输入数据的设备。Referring to FIG. 1 , it is a schematic diagram of a scene provided by an embodiment of the present invention. The
本发明实施例提供一种基于操作平台的电力文件的数据处理方法,通过以下步骤进行电力报告可视化编辑,包括步骤S1-S5,参见图2,具体如下:An embodiment of the present invention provides a data processing method for power files based on an operating platform. Visual editing of power reports is performed through the following steps, including steps S1-S5, see FIG. 2, and the details are as follows:
S1、将用户在网页中任意选择的一个在线电力报告显示在所述显示设备中,对在线电力报告进行解析处理,得到在线电力报告的至少一个文件子区域。S1. Display an online power report arbitrarily selected by the user in the webpage on the display device, analyze and process the online power report, and obtain at least one file sub-area of the online power report.
用户可以在网页中任意选择的一个需要编辑的在线电力报告,在需要对电力报告进行编辑时,本方案会先对在线电力报告进行解析,得到在线电力报告的至少一个文件子区域,然后对文件子区域内的内容进行编辑操作。Users can arbitrarily select an online power report that needs to be edited on the web page. When editing the power report, this solution will first analyze the online power report to obtain at least one file sub-area of the online power report, and then edit the file The content in the sub-area can be edited.
在一些实施例中,所述S1包括S11- S14:In some embodiments, the S1 includes S11-S14:
S11,获取所述在线电力报告所对应的初始模板,所述初始模板包括至少一个初始区域,所述初始区域包括文字编辑区域或图片编辑区域中的任意一种或多种。S11. Acquire an initial template corresponding to the online power report, where the initial template includes at least one initial area, and the initial area includes any one or more of a text editing area or an image editing area.
需要说明的是,本方案中的在线电力报告都是基于一个初始模板建立的,同一类型的在线电力报告所对应的初始模板可以是相同的。It should be noted that the online power reports in this solution are all established based on an initial template, and the initial templates corresponding to the same type of online power reports may be the same.
本方案需要对在线电力报告进行编辑时,会首先确定在线电力报告所对应的初始模板,然后利用初始模板来对在线电力报告进行解析处理,得到所需要的内容。When this solution needs to edit the online power report, it will first determine the initial template corresponding to the online power report, and then use the initial template to analyze and process the online power report to obtain the required content.
S12,基于所述初始模板与初始区域的对应关系对在线电力报告进行解析处理,得到与所述初始区域对应的文件子区域。S12. Analyzing the online power report based on the correspondence between the initial template and the initial area to obtain a file sub-area corresponding to the initial area.
本方案中的初始模板包括至少一个初始区域,每个初始区域对应文字编辑区域或图片编辑区域中的任意一种或多种。可以理解的是,在线电力报告一般包括文字区域和图片区域,本方案会利用初始区域来对在线电力报告进行解析,得到与初始区域对应的文件子区域。The initial template in this solution includes at least one initial area, and each initial area corresponds to any one or more of a text editing area or an image editing area. It can be understood that an online power report generally includes a text area and a picture area, and this solution uses the initial area to analyze the online power report to obtain the file sub-area corresponding to the initial area.
S13,确定每个文件子区域的轮廓像素点,根据轮廓像素点的第一像素值、轮廓像素点相邻像素点的第二像素值进行计算,得到用于显示的第三像素值,其中第一像素值、第二像素值以及第三像素值可以指的是像素点的灰度值。S13, determine the contour pixel points of each file sub-region, calculate according to the first pixel value of the contour pixel point, the second pixel value of the adjacent pixel point of the contour pixel point, and obtain the third pixel value for display, wherein The first pixel value, the second pixel value and the third pixel value may refer to grayscale values of pixels.
本方案在得到文件子区域后,每个文件子区域都有对应的轮廓,可以理解的是,在线电力报告所展示的内容较多,背景颜色可能也是灰度值种类较多的,当文件子区域的底板颜色或者区域颜色与轮廓的颜色一致或者接近时,就会导致轮廓清晰度不够,或者轮廓会以断断续续的形式展现,无法给用户提供一个明晰的轮廓参考,后续用户在编辑文件子区域内的内容时,可能会出现编辑不准确的现象,本方案为了解决上述问题,会基于轮廓像素点的第一像素值、轮廓像素点相邻像素点的第二像素值进行计算,得到用于显示的第三像素值,以第三像素值来让轮廓变的清晰。After the file sub-areas are obtained in this solution, each file sub-area has a corresponding outline. It is understandable that the online power report displays more content, and the background color may also have more types of gray values. When the file sub-area When the base color of the area or the color of the area is the same as or close to the color of the outline, the outline will not be clear enough, or the outline will be displayed intermittently, which cannot provide users with a clear outline reference. Subsequent users will edit the file sub-area Inaccurate editing may occur. In order to solve the above problems, this solution will calculate based on the first pixel value of the contour pixel point and the second pixel value of the adjacent pixel point of the contour pixel point. The third pixel value displayed, the outline becomes clearer with the third pixel value.
在一些实施例中,所述S13包括S131- S135:In some embodiments, the S13 includes S131-S135:
S131,若判断所述第一像素值与所述第二像素值的差值的绝对值大于等于预设像素值,则将所述第一像素值作为用于显示的第三像素值。S131. If it is determined that the absolute value of the difference between the first pixel value and the second pixel value is greater than or equal to a preset pixel value, use the first pixel value as a third pixel value for display.
可以理解的是,本方案会先得到第一像素值与第二像素值的差值,如果差值大于等于预设像素值,说明轮廓的颜色与轮廓相邻区域的颜色差别较大,此时,本方案直接将第一像素值作为用于显示的第三像素值即可,例如预设像素值为127,此时第一像素值可以是1、第二像素值可以是130,此时的第一像素值与第二像素值之间的颜色明暗对比较大,即第一像素值和第二像素值之间的灰度相差较大,方便用户对图像轮廓的区分。It can be understood that this solution will first obtain the difference between the first pixel value and the second pixel value. If the difference is greater than or equal to the preset pixel value, it means that the color of the outline is quite different from the color of the adjacent area of the outline. At this time In this solution, the first pixel value can be directly used as the third pixel value for display. For example, the preset pixel value is 127. At this time, the first pixel value can be 1, and the second pixel value can be 130. At this time, The color light-dark contrast between the first pixel value and the second pixel value is relatively large, that is, the grayscale difference between the first pixel value and the second pixel value is relatively large, which is convenient for the user to distinguish the outline of the image.
又例如,第一像素值对应的颜色为黑色,第二像素值对应的颜色为白色,黑色和白色的区别度较大,本方案直接将黑色的像素值作为显示的第三像素值即可。For another example, the color corresponding to the first pixel value is black, and the color corresponding to the second pixel value is white. The difference between black and white is relatively large. In this solution, the black pixel value can be directly used as the third pixel value displayed.
S132,若判断所述第一像素值与所述第二像素值的差值的绝对值小于预设像素值,则根据所述第二像素值确定轮廓像素点的像素值的变化趋势。S132. If it is judged that the absolute value of the difference between the first pixel value and the second pixel value is smaller than a preset pixel value, then determine the change trend of the pixel value of the contour pixel point according to the second pixel value.
可以理解的是,如果差值小等于预设像素值,说明轮廓的颜色与文件子区域和轮廓相邻区域的颜色差别较小,此时,本方案会基于第二像素值确定轮廓像素点的像素值的变化趋势。例如预设像素值为127,此时第一像素值可以是120、第二像素值可以是130,此时的第一像素值与第二像素值之间的颜色明暗对比较小,即第一像素值和第二像素值之间的灰度相差较小,不方便用户对图像轮廓的区分。It can be understood that if the difference is less than or equal to the preset pixel value, it means that the color of the outline is less different from the color of the sub-area of the file and the adjacent area of the outline. Trends in pixel values. For example, the preset pixel value is 127. At this time, the first pixel value can be 120, and the second pixel value can be 130. At this time, the color contrast between the first pixel value and the second pixel value is small, that is, the first The grayscale difference between the pixel value and the second pixel value is small, which is inconvenient for the user to distinguish the outline of the image.
例如,第一像素值对应的颜色为深灰色,第二像素值对应的为黑色,为深灰色和黑色的区别度较小,本方案会基于第一像素值(对应深灰色)确定轮廓像素点的像素值的变化趋势,此时第一像素值和第二像素值的灰度较为接近。For example, the color corresponding to the first pixel value is dark gray, and the second pixel value corresponds to black. The difference between dark gray and black is small. This solution will determine the contour pixel points based on the first pixel value (corresponding to dark gray). The variation trend of the pixel value of , at this time, the gray levels of the first pixel value and the second pixel value are relatively close.
在一些实施例中,S132(若判断所述第一像素值与所述第二像素值的差值的绝对值小于预设像素值,则根据所述第二像素值确定轮廓像素点的像素值的变化趋势)包括:In some embodiments, S132 (if it is judged that the absolute value of the difference between the first pixel value and the second pixel value is smaller than the preset pixel value, determine the pixel value of the contour pixel point according to the second pixel value trends) including:
若所述第二像素值小于等于预设像素值,则确定轮廓像素点的像素值的变化趋势为增大趋势。其中,预设像素值例如是255的一半左右,具体例如是127。示例性的,第二像素值的灰度值为80(可以是通过像素点的R值加G值加B值除以3得到),预设像素值的灰度值为127,则此时轮廓像素点的像素值的变化趋势为增大趋势,即需要增大第一像素值的灰度值,来增加第一像素值与第二像素值之间的差异。If the second pixel value is less than or equal to the preset pixel value, it is determined that the change trend of the pixel value of the contour pixel point is an increasing trend. Wherein, the preset pixel value is about half of 255, for example, 127 specifically. Exemplarily, the grayscale value of the second pixel value is 80 (it can be obtained by dividing the R value plus G value plus B value of the pixel point by 3), and the grayscale value of the preset pixel value is 127, then the contour at this time The change trend of the pixel value of the pixel point is an increasing trend, that is, the gray value of the first pixel value needs to be increased to increase the difference between the first pixel value and the second pixel value.
若所述第二像素值大于预设像素值,则确定轮廓像素点的像素值的变化趋势为减小趋势。例如,第二像素值例如是灰度值为180,预设像素值例如是127,则此时轮廓像素点的像素值的变化趋势为减小趋势,即需要降低第一像素值的灰度值,来增加第一像素值与第二像素值之间的差异。If the second pixel value is greater than the preset pixel value, it is determined that the change trend of the pixel value of the contour pixel point is a decreasing trend. For example, the second pixel value is, for example, a grayscale value of 180, and the preset pixel value is, for example, 127. At this time, the change trend of the pixel value of the contour pixel point is a decreasing trend, that is, the grayscale value of the first pixel value needs to be reduced. , to increase the difference between the first pixel value and the second pixel value.
S133,若所述变化趋势为增大趋势,则将所述第一像素值加预设像素值得到第三像素值。S133. If the change trend is an increasing trend, add a preset pixel value to the first pixel value to obtain a third pixel value.
可以理解的是,本方案会将第一像素值加预设像素值(灰度值)得到第三像素值,例如增大前的第一像素值为80、第二像素值为55,第一像素值增大后、即可以是207(灰度值80加灰度值127),然后以第三像素值来显示对应的轮廓,增大轮廓的区分度。该种方式即可以实现,在相邻的两个像素点的灰度值较为接近,都是暗色(小于127),此时本发明会对其中的第一像素值进行调整,将其调亮,进而使得轮廓像素点与其相邻的像素点之间的对比增大,对相应的像素点由暗变亮。It can be understood that this solution will add the first pixel value to the preset pixel value (gray value) to obtain the third pixel value, for example, the first pixel value before the increase is 80, the second pixel value is 55, and the first After the pixel value is increased, it can be 207 (gray value 80 plus gray value 127), and then the corresponding outline is displayed with the third pixel value, increasing the distinction of the outline. This method can be realized. The gray values of two adjacent pixels are relatively close, both of which are dark (less than 127). At this time, the present invention will adjust the first pixel value and brighten it. In turn, the contrast between the contour pixel and its adjacent pixels is increased, and the corresponding pixel is changed from dark to bright.
S134,若所述变化趋势为减小趋势,则将所述第一像素值减预设像素值得到第三像素值。例如减小前的第一像素值为197、第二像素值为180,第一像素值减小后即可以是70(灰度值197减灰度值127),然后以第三像素值来显示对应的轮廓,增大轮廓的区分度。该种方式即可以实现,在相邻的两个像素点的灰度值较为接近,都是亮色(大于127),此时本发明会对其中的第一像素值进行调整,将其调暗,进而使得轮廓像素点与其相邻的像素点之间的对比增大,对相应的像素点由亮变暗。S134. If the change trend is a decreasing trend, subtract a preset pixel value from the first pixel value to obtain a third pixel value. For example, the first pixel value before reduction is 197, and the second pixel value is 180. After the first pixel value is reduced, it can be 70 (gray value 197 minus gray value 127), and then displayed with the third pixel value Corresponding to the contour, increasing the discrimination of the contour. This method can be realized. The gray values of two adjacent pixels are relatively close, both of which are bright colors (greater than 127). At this time, the present invention will adjust the value of the first pixel to darken it. In turn, the contrast between the contour pixel and its adjacent pixels is increased, and the corresponding pixel is changed from bright to dark.
S135,将所计算得到的第三像素值作为替换先前第一像素值、用于进行显示的第三像素值。S135. Use the calculated third pixel value as a third pixel value for displaying instead of the previous first pixel value.
S14,控制每个文件子区域的轮廓像素点按照所述第三像素值进行显示。S14. Control the outline pixel points of each file sub-region to be displayed according to the third pixel value.
可以理解的是,在得到第三像素值后,控制每个文件子区域的轮廓像素点按照第三像素值进行显示即可,可以给用户提供清晰的轮廓界限的参考。本方案通过上述实施例来对轮廓的显示颜色进行了调整,增加了轮廓显示的对比度,更直观地供用户在编辑过程中参考,提高用户在编辑过程中的准确性。It can be understood that, after obtaining the third pixel value, it is only necessary to control the outline pixel points of each document sub-region to be displayed according to the third pixel value, which can provide a clear reference for the outline boundary to the user. This solution adjusts the display color of the outline through the above-mentioned embodiment, increases the contrast of the outline display, provides a more intuitive reference for the user in the editing process, and improves the accuracy of the user in the editing process.
本方案考虑到对轮廓的显示颜色进行调整后,可能会导致轮廓显示为灰度值种类较多的,可能会影响用户编辑、查看,因此在上述实施例的基础上,本方案还包括:This solution considers that after adjusting the display color of the outline, it may cause the outline to display more types of gray values, which may affect the user's editing and viewing. Therefore, on the basis of the above embodiments, this solution also includes:
统计与第一像素值相同的第三像素值的像素点数量得到第一数量,统计与第一像素值不相同的第三像素值的像素点数量得到第二数量。本方案会统计得到与第一像素值相同的第三像素值的像素点数量,以及与第一像素值不相同的第三像素值的像素点数量。The first number is obtained by counting the number of pixels with a third pixel value identical to the first pixel value, and the second number is obtained by counting the number of pixels with a third pixel value different from the first pixel value. In this solution, the number of pixels with a third pixel value identical to the first pixel value and the number of pixels with a third pixel value different from the first pixel value are counted.
根据所述第一数量、第二数量得到像素值变化比例,若所述像素值变化比例大于预设比例,则选取第一预设像素值和第二预设像素值。本方案会计算出第一数量和第二数量的像素值变化比例,如果像素值变化比例大于预设比例,说明轮廓的显示颜色被调整的较多,可能是以灰度值种类较多的形式展现的,此时,本方案会选取第一预设像素值和第二预设像素值,其中,第一预设像素值可以是白色所对应的像素值,第二预设像素值可以是黑色所对应的像素值。A pixel value change ratio is obtained according to the first quantity and the second quantity, and if the pixel value change ratio is greater than a preset ratio, a first preset pixel value and a second preset pixel value are selected. This solution will calculate the pixel value change ratio of the first quantity and the second quantity. If the pixel value change ratio is greater than the preset ratio, it means that the display color of the outline has been adjusted more, and it may be displayed in the form of more types of gray values. Yes, at this time, this solution will select the first preset pixel value and the second preset pixel value, wherein the first preset pixel value can be the pixel value corresponding to white, and the second preset pixel value can be the pixel value corresponding to black corresponding pixel value.
控制所述轮廓像素点分别按照所述第一预设像素值和第二预设像素值,交替显示预设时间段。本方案会按照第一预设像素值和第二预设像素值控制轮廓像素点进行频闪,例如可以是1S显示白色,1S显示黑色,交替显示,来直观的向用户展示轮廓的线条。Controlling the contour pixel points to alternately display preset time periods according to the first preset pixel value and the second preset pixel value respectively. This solution will control the outline pixels to flash according to the first preset pixel value and the second preset pixel value. For example, 1S can display white, 1S can display black alternately, so as to intuitively show the outline lines to the user.
S2、确定用户选择的文件子区域,提取所述文件子区域内的可编辑内容,在所述可编辑区域内建立富文本编辑区域。S2. Determine the file sub-area selected by the user, extract the editable content in the file sub-area, and create a rich text editing area in the editable area.
用户想要对其中一个文件子区域内的内容进行编辑时,可以基于编辑装置选择对应的文件子区域,服务器会提取文件子区域内的可编辑内容,在可编辑区域内建立富文本编辑区域。When the user wants to edit the content in one of the file sub-areas, he can select the corresponding file sub-area based on the editing device, and the server will extract the editable content in the file sub-area, and create a rich text editing area in the editable area.
其中,富文本编辑区域是供用户编辑数据的区域,用户可以基于富文本编辑软件对富文本编辑区域内的内容进行编辑,富文本编辑软件是一种可内嵌于浏览器,所见即所得的文本编辑器,此处为现有技术,不再赘述。Among them, the rich text editing area is an area for users to edit data. Users can edit the content in the rich text editing area based on rich text editing software. Rich text editing software is a browser that can be embedded. The text editor of , here is prior art, no longer go into details.
S3、通过编辑装置基于富文本编辑软件对所述可编辑内容进行编辑修改,得到修改后内容,根据所述文件子区域的板式规格和/或相邻文件子区域的内容格式对修改后内容进行调整,得到调整后内容。S3. Use the editing device to edit and modify the editable content based on the rich text editing software to obtain the modified content, and modify the modified content according to the format specification of the file sub-area and/or the content format of the adjacent file sub-area Adjust to obtain the adjusted content.
可以理解的是,本方案可以利用编辑装置基于富文本编辑软件对所述可编辑内容进行编辑修改,其中,富文本编辑软件为现有技术,在此不再赘述。It can be understood that, in this solution, the editing device can be used to edit and modify the editable content based on rich text editing software, wherein the rich text editing software is a prior art, and will not be repeated here.
由于用户输入的数据与文件子区域的原始内容可能不匹配,例如文字的字体、大小不一,图片的形状和尺寸也与文件子区域不匹配,因此本方案在得到修改后内容后,会根据文件子区域的板式规格和/或相邻文件子区域的内容格式对修改后内容进行调整,得到调整后内容。Since the data entered by the user may not match the original content of the sub-area of the file, for example, the font and size of the text, and the shape and size of the picture do not match the sub-area of the file. The format specification of the file sub-area and/or the content format of the adjacent file sub-area are adjusted to obtain the adjusted content.
本方案针对初始区域是图片编辑区域和初始区域是文字编辑区域的不同,各布局了不同的实施方式,具体如下:This solution aims at the difference between the initial area is a picture editing area and the initial area is a text editing area, and each layout has different implementation methods, as follows:
针对初始区域为图片编辑区域的情况:For the case where the initial area is the image editing area:
在一些实施例中,所述S3包括S31- S35:In some embodiments, the S3 includes S31-S35:
S31,若所述初始区域为图片编辑区域,则根据用户操作删除可编辑内容中的历史图像,并添加新图像。S31. If the initial area is an image editing area, delete historical images in the editable content according to user operations, and add new images.
可以理解的是,用户想要向在线电力报告内插入新图像时,本方案会先将可编辑内容中的历史图像删除,然后把新图像添加进去。It can be understood that when the user wants to insert a new image into the online power report, this solution will first delete the historical image in the editable content, and then add the new image.
S32,获取文件子区域的板式规格,所述板式规格包括形状规格和/或尺寸规格。S32. Obtain the plate specification of the file sub-area, where the plate specification includes a shape specification and/or a size specification.
本方案为了使得添加的新图像匹配文件子区域,会得到文件子区域的形状规格和/或尺寸规格,从而较为准确的对新图像进行自动调整,使新图像的形状规格和/或尺寸规格与文件子区域相适应。In order to make the added new image match the file sub-area, the program will obtain the shape specification and/or size specification of the file sub-area, so as to automatically adjust the new image more accurately, so that the shape specification and/or size specification of the new image are consistent with File subregions are adapted.
S33,若判断新图像的图像形状与文件子区域的形状规格不相同,则对文件子区域相邻的其他文件子区域的内容格式进行获取,得到参考形状规格,所述参考形状规格为调整形状或不调整形状中的一个。S33, if it is judged that the image shape of the new image is different from the shape specification of the document sub-area, then acquire the content format of other document sub-areas adjacent to the document sub-area to obtain a reference shape specification, the reference shape specification is the adjusted shape Or not adjust one of the shapes.
示例性的,新图像的图像形状为圆形,文件子区域的形状为方形,那么新图像的图像形状与文件子区域的形状规格不相同,此时本方案会得到文件子区域相邻的其他文件子区域的内容格式,进而得到参考形状规格,来判断新图像的形状是否需要进行调整,如果需要进行调整,那么参考形状规格为调整形状,如果不需要进行形状的调整,那么参考形状规格为不调整形状。Exemplarily, the image shape of the new image is a circle, and the shape of the file sub-area is square, then the image shape of the new image is different from the shape specification of the file sub-area. At this time, this solution will get other adjacent file sub-areas The content format of the sub-area of the file, and then obtain the reference shape specification to determine whether the shape of the new image needs to be adjusted. If adjustment is required, then the reference shape specification is the adjusted shape. If no shape adjustment is required, the reference shape specification is Does not reshape.
S34,若所述参考形状规格为调整形状,则以文件子区域的形状规格对新图像显示,将新图像与文件子区域融合,使得所展示的新图像与文件子区域融合为相同形状,得到为图像的调整后内容。S34. If the reference shape specification is an adjusted shape, display the new image with the shape specification of the file sub-area, and fuse the new image with the file sub-area, so that the displayed new image and the file sub-area are fused into the same shape, to obtain is the resized content of the image.
可以理解的是,在参考形状规格为调整形状时,本方案会以文件子区域的形状规格对新图像显示,然后将新图像与文件子区域融合,使得所展示的新图像与文件子区域融合为相同形状,得到为图像的调整后内容。It can be understood that when the reference shape specification is to adjust the shape, this solution will display the new image with the shape specification of the file sub-area, and then fuse the new image with the file sub-area, so that the displayed new image and the file sub-area are fused For the same shape, get the resized content of the image.
在一些实施例中,S34(所述若所述参考形状规格为调整形状,则以文件子区域的形状规格对新图像显示,将新图像与文件子区域融合,使得所展示的新图像与文件子区域融合为相同形状)包括S341- S344:In some embodiments, S34 (if the reference shape specification is an adjusted shape, then display the new image with the shape specification of the file sub-area, and fuse the new image with the file sub-area, so that the displayed new image is consistent with the file sub-regions fused into the same shape) including S341-S344:
S341,选中新图像的图像中心点,以及选中文件子区域的区域中心点。S341. Select the image center point of the new image and the area center point of the selected file sub-area.
S342,基于所述图像中心点和区域中心点,将所述新图像与文件子区域进行叠加设置得到融合中心点,根据所述融合中心点建立坐标系。S342. Based on the image center point and the region center point, superimpose the new image and the file sub-region to obtain a fusion center point, and establish a coordinate system according to the fusion center point.
首先,本方案会确定新图像的图像中心点以及文件子区域的区域中心点,然后利用图像中心点和图像中心点进行融合得到融合中心点,并在融合中心点建立坐标系。First, this program will determine the image center point of the new image and the area center point of the file sub-area, then use the image center point and the image center point to fuse to obtain the fusion center point, and establish a coordinate system at the fusion center point.
S343,获取新图像中每个图像像素点的图像坐标值,以及文件子区域中每个区域像素点的区域坐标值。S343. Obtain the image coordinate value of each image pixel point in the new image, and the area coordinate value of each area pixel point in the file sub-area.
本方案以新图像为圆形,以文件子区域为方形进行阐述,图像坐标值即为新图像中像素点所对于的图像坐标值,区域坐标值即为文件子区域中每个像素点的坐标值。In this scheme, the new image is a circle, and the file sub-area is a square. The image coordinate value is the image coordinate value corresponding to the pixel in the new image, and the area coordinate value is the coordinate of each pixel in the file sub-area. value.
S344,将图像坐标值与区域坐标值进行比对,对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状。S344, compare the image coordinate value with the area coordinate value, adjust the image size of the new image to obtain the first target size, and fuse the new image of the first target size with the file sub-region according to the fusion center point, so that the displayed The new image of is blended with the file subregion into the same shape.
本方案会将图像坐标值与区域坐标值进行比对,然后对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状。This solution will compare the image coordinate value with the area coordinate value, then adjust the image size of the new image to obtain the first target size, and fuse the new image of the first target size with the file sub-region according to the fusion center point, so that The new image shown is fused to the same shape as the document subregion.
第一种情况,需要对新图像进行放大处理:In the first case, the new image needs to be enlarged:
在一些实施例中,S344(所述将图像坐标值与区域坐标值进行比对,对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状)包括A1-A3:In some embodiments, S344 (comparing the image coordinate value with the area coordinate value, adjusting the image size of the new image to obtain the first target size, and merging the new image with the first target size and the file sub-region according to The center point is fused so that the displayed new image is fused into the same shape as the document sub-area) including A1-A3:
A1,若判断图像坐标值的坐标未完全包括区域坐标值的坐标,则获取未完全包括区域坐标值的所有坐标得到第一坐标数量,根据所述第一坐标数量确定所述新图像的第一放大倍数。A1, if it is judged that the coordinates of the image coordinate value do not completely include the coordinates of the area coordinate value, then obtain all the coordinates that do not completely include the area coordinate value to obtain the first coordinate number, and determine the first coordinate number of the new image according to the first coordinate number gain.
可以理解的是,如果图像坐标值的坐标未完全包括区域坐标值的坐标,此时获取未完全包括区域坐标值的所有坐标得到第一坐标数量,根据所述第一坐标数量确定所述新图像的第一放大倍数。可以理解的是,第一坐标数量越大,对应的第一放大倍数就越大。It can be understood that if the coordinates of the image coordinate value do not completely include the coordinates of the area coordinate value, at this time, all coordinates that do not completely include the area coordinate value are obtained to obtain the first coordinate number, and the new image is determined according to the first coordinate number the first magnification. It can be understood that, the larger the number of first coordinates is, the larger the corresponding first magnification factor is.
示例性的,参见图3,新图像为圆形,文件子区域为方形,方形的四个角落所对应的区域坐标值的坐标是没有被图像坐标值的坐标包括的,四个角落的面积越大,则对应的第一坐标数量也就越多,说明新图像需要放大的就越大,对应的第一放大倍数就越大。For example, see Figure 3, the new image is a circle, the file sub-area is a square, and the coordinates of the area coordinate values corresponding to the four corners of the square are not included by the coordinates of the image coordinate values, and the area of the four corners is larger The larger the value, the more the number of corresponding first coordinates will be, indicating that the new image needs to be enlarged, and the corresponding first magnification factor will be larger.
A2,根据所述第一放大倍数对新图像放大处理,提取放大处理后新图像中每个图像像素点的图像坐标值。A2. Enlarge the new image according to the first magnification factor, and extract the image coordinate value of each image pixel in the enlarged new image.
本方案在得到第一放大倍数后,会利用第一放大倍数对新图像放大处理,在放大后,会再次提取放大处理后新图像中每个图像像素点的图像坐标值。In this solution, after the first magnification is obtained, the new image will be enlarged by the first magnification, and after the enlargement, the image coordinate value of each image pixel in the enlarged new image will be extracted again.
A3,将放大处理后的图像坐标值再次与区域坐标值进行比对,若判断新图像放大后的图像坐标值的坐标完全包括区域坐标值的坐标,则不再对新图像进行放大处理,将此时新图像的尺寸作为第一目标尺寸。A3, compare the enlarged image coordinate value with the area coordinate value again, if it is judged that the coordinates of the enlarged image coordinate value of the new image completely include the coordinates of the area coordinate value, the new image will no longer be enlarged, and the At this time, the size of the new image is used as the first target size.
本方案会利用第一放大倍数对新图像放大处理,在放大后,会再次提取放大处理后新图像中每个图像像素点的图像坐标值,将放大处理后的图像坐标值再次与区域坐标值进行比对,如果判断新图像放大后的图像坐标值的坐标完全包括区域坐标值的坐标,则不再对新图像进行放大处理,将此时新图像的尺寸作为第一目标尺寸。This program will use the first magnification factor to enlarge the new image. After the enlargement, the image coordinate value of each image pixel point in the enlarged new image will be extracted again, and the image coordinate value after the enlargement process will be compared with the area coordinate value again. For comparison, if it is judged that the coordinates of the enlarged image coordinate values of the new image completely include the coordinates of the area coordinate values, the new image is no longer enlarged, and the size of the new image at this time is taken as the first target size.
需要说明的是,本方案的服务器会经过多次自动放大处理,并在每次放大处理后,与上一次图像进行再次比对,直至找到新图像放大后的图像坐标值的坐标完全包括区域坐标值的坐标,则不再对新图像进行放大处理,将此时新图像的尺寸是最为合适的尺寸,同时,可以使得新图像的失真率最小。It should be noted that the server of this solution will go through multiple automatic zoom-in processes, and after each zoom-in process, it will be compared with the previous image again until the coordinates of the zoomed-in image coordinate values of the new image are found completely including the area coordinates value coordinates, the new image is no longer enlarged, and the size of the new image at this time is the most suitable size, and at the same time, the distortion rate of the new image can be minimized.
其中,所述若判断图像坐标值的坐标未完全包括区域坐标值的坐标,则获取未完全包括区域坐标值的所有坐标得到第一坐标数量,根据所述第一坐标数量确定所述新图像的第一放大倍数,包括:Wherein, if it is judged that the coordinates of the image coordinate value do not completely include the coordinates of the area coordinate value, then obtain all the coordinates that do not completely include the area coordinate value to obtain the first coordinate number, and determine the number of the new image according to the first coordinate number First magnification, including:
获取文件子区域内像素点的第一总数量;Obtain the first total number of pixels in the file sub-area;
根据所述第一坐标数量、第一总数量、放大权重值进行计算得到所述新图像的第一放大倍数,通过以下公式计算第一放大倍数,Calculate according to the first coordinate quantity, the first total quantity, and the magnification weight value to obtain the first magnification factor of the new image, and calculate the first magnification factor by the following formula,
其中,为第一放大倍数,为第一坐标数量,为第一总数量,为放大权重值。in, is the first magnification, is the number of first coordinates, is the first total quantity, is the magnification weight value.
上述公式中,第一坐标数量越大,就越大,对应的第一放大倍数也就越大,从而对新图像放大较大倍数。In the above formula, the first coordinate quantity bigger, The larger the value is, the larger the corresponding first magnification factor is, so that the new image is magnified by a larger factor.
需要说明的是,本方案会经过第一放大倍数的计算,来以较为合适的幅度快速对新图像递进放大,得到最终的新图像。It should be noted that in this solution, the first magnification factor is calculated to quickly and progressively magnify the new image with a more appropriate range to obtain the final new image.
第二种情况,需要对新图像缩小处理:In the second case, the new image needs to be scaled down:
在一些实施例中,S344(所述将图像坐标值与区域坐标值进行比对,对新图像的图像尺寸进行调整得到第一目标尺寸,将第一目标尺寸的新图像与文件子区域根据融合中心点进行融合,使得所展示的新图像与文件子区域融合为相同形状)包括B1-B4:In some embodiments, S344 (comparing the image coordinate value with the area coordinate value, adjusting the image size of the new image to obtain the first target size, and merging the new image with the first target size and the file sub-region according to The center point is fused so that the displayed new image is fused into the same shape as the file sub-region) including B1-B4:
B1,若判断图像坐标值的坐标完全包括区域坐标值的坐标,则获取图像坐标值中未完全包括区域坐标值的所有图像坐标值,得到第二坐标数量,根据所述第二坐标数量确定所述新图像的第一缩小倍数。B1, if it is judged that the coordinates of the image coordinate value completely include the coordinates of the area coordinate value, then obtain all the image coordinate values that do not completely include the area coordinate value in the image coordinate value, obtain the second coordinate number, and determine the second coordinate value according to the second coordinate number The first zoom factor for the new image.
可以理解的是,如果图像坐标值的坐标完全包括区域坐标值的坐标,此时获取未完全包括区域坐标值的所有图像坐标值,得到第二坐标数量,根据第二坐标数量确定新图像的第一缩小倍数。可以理解的是,第二坐标数量越大,对应的第一缩小倍数就越大。It can be understood that if the coordinates of the image coordinate value completely include the coordinates of the area coordinate value, all the image coordinate values that do not completely include the area coordinate value are obtained at this time, the second coordinate number is obtained, and the first coordinate value of the new image is determined according to the second coordinate number A reduction in multiples. It can be understood that, the larger the number of second coordinates is, the larger the corresponding first reduction factor is.
示例性的,参见图4,新图像为圆形,文件子区域为方形,圆形完全包括方形,图中,方形与圆形之间的面积所对应的坐标数量,即为图像坐标值中未完全包括区域坐标值的所有图像坐标值的第二坐标数量,可以理解的是,该面积越大,则对应的第二坐标数量也就越多,说明新图像需要缩小的就越小,对应的第一缩小倍数就越大。For example, see Figure 4, the new image is a circle, the file sub-area is a square, and the circle completely includes the square. In the figure, the area between the square and the circle corresponds to the number of coordinates that is not included in the image coordinate value. The second coordinate quantity of all image coordinate values that completely includes the area coordinate value. It can be understood that the larger the area, the more the corresponding second coordinate quantity, which means that the new image needs to be shrunk smaller, and the corresponding The first reduction factor is larger.
其中,所述若判断图像坐标值的坐标完全包括区域坐标值的坐标,则获取图像坐标值中未与坐标完全包括区域坐标值对应的所有图像坐标值,得到第二坐标数量,根据所述第二坐标数量确定所述新图像的第一缩小倍数,包括:Wherein, if it is judged that the coordinates of the image coordinate values completely include the coordinates of the area coordinate values, all image coordinate values in the image coordinate values that do not correspond to the coordinates completely including the area coordinate values are obtained to obtain the second number of coordinates, according to the first Two coordinate quantities determine the first reduction factor of the new image, including:
获取新图像内图像像素点的第二总数量;Obtain the second total number of image pixels in the new image;
根据所述第二坐标数量、第二总数量 、缩小权重值进行计算得到所述新图像的第一缩小倍数,通过以下公式计算第一缩小倍数,Calculate according to the second coordinate quantity, the second total quantity, and the reduction weight value to obtain the first reduction factor of the new image, and calculate the first reduction factor by the following formula,
其中,为第一缩小倍数,为第二坐标数量,为第二总数量,为缩小权重值。in, is the first reduction factor, is the second coordinate quantity, is the second total quantity, To shrink the weight value.
上述公式中,第二坐标数量越大,就越大,对应的第一缩小倍数也就越大,从而对新图像缩小较大倍数。In the above formula, the second coordinate quantity bigger, The larger the value, the corresponding first reduction factor It is also larger, thereby reducing the new image by a larger factor.
B2,根据所述第一缩小倍数对新图像缩小处理,提取缩小处理后新图像中每个图像像素点的图像坐标值。B2, reducing the new image according to the first reduction factor, and extracting the image coordinate value of each image pixel in the reduced new image.
本方案在得到第一缩小倍数后,会利用第一缩小倍数对新图像缩小处理,在缩小后,会再次提取缩小处理后新图像中每个图像像素点的图像坐标值。In this solution, after the first reduction factor is obtained, the new image will be reduced by using the first reduction factor, and after reduction, the image coordinate value of each image pixel in the reduced new image will be extracted again.
B3,将缩小处理后的图像坐标值再次与区域坐标值进行比对,若判断新图像缩小后的图像坐标值的坐标完全包括区域坐标值的坐标,则再次获取图像坐标值中未与坐标完全包括区域坐标值对应的所有图像坐标值,得到第三坐标数量,根据所述第三坐标数量确定所述新图像的第二缩小倍数。B3, compare the reduced image coordinate value with the area coordinate value again, if it is judged that the coordinates of the reduced image coordinate value of the new image completely include the coordinates of the area coordinate value, then the obtained image coordinate value is not completely consistent with the coordinate All image coordinate values corresponding to the area coordinate values are included to obtain a third coordinate quantity, and a second reduction factor of the new image is determined according to the third coordinate quantity.
本方案在缩小后,会再次提取缩小处理后新图像中每个图像像素点的图像坐标值,将缩小处理后的图像坐标值再次与区域坐标值进行比对,如果判断新图像缩小后的图像坐标值的坐标还是完全包括区域坐标值的坐标,则相同原理再次计算得到第三坐标数量,根据第三坐标数量确定新图像的第二缩小倍数。In this solution, after reduction, the image coordinate value of each image pixel point in the reduced new image will be extracted again, and the reduced image coordinate value will be compared with the area coordinate value again. If the coordinate of the coordinate value still completely includes the coordinate of the area coordinate value, the third coordinate quantity is calculated again based on the same principle, and the second reduction factor of the new image is determined according to the third coordinate quantity.
B4,持续将缩小处理后的图像坐标值与区域坐标值进行比对,直至缩小处理后新图像的图像坐标值的坐标不完全包括区域坐标值的坐标,将本次缩小前的新图像的图像尺寸作为第一目标尺寸。B4, continue to compare the reduced image coordinate value with the area coordinate value, until the coordinates of the image coordinate value of the new image after the reduction process do not completely include the coordinates of the area coordinate value, the image of the new image before this reduction size as the first target size.
本方案在得到第二缩小倍数后,将缩小处理后的图像坐标值与区域坐标值进行比对,直至缩小处理后新图像的图像坐标值的坐标不完全包括区域坐标值的坐标,将本次缩小前的新图像的图像尺寸作为第一目标尺寸。In this solution, after obtaining the second reduction factor, the image coordinate value after reduction processing is compared with the area coordinate value until the image coordinate value coordinates of the new image after reduction processing do not completely include the area coordinate value coordinates. The image size of the new image before downscaling is used as the first target size.
示例性的,参见图5,图5中缩小处理后新图像的图像坐标值的坐标不完全包括区域坐标值的坐标,那么本方案会将图5所对应图像的缩小前的新图像的图像尺寸作为第一目标尺寸。For example, see Figure 5, the coordinates of the image coordinate values of the new image after reduction processing in Figure 5 do not completely include the coordinates of the area coordinate values, then this solution will reduce the image size of the new image before reduction of the image corresponding to Figure 5 as the first target size.
可以理解的是,图5所对应的图像是指圆形恰好缩小到了与方形有交叉区域的程度,而对应其缩小前的新图像所对应的缩小程度,恰好是与方形未有交叉区域的程度,因此,前一图像是最佳图像,本方案可以在得到所需图像尺寸的情况下,将图像放大缩小过程中的失真率降到最低。It can be understood that the image corresponding to Figure 5 means that the circle is just reduced to the extent that it intersects with the square, and the degree of reduction corresponding to the new image before it is reduced is exactly the extent that there is no intersection with the square , therefore, the previous image is the best image, and this scheme can minimize the distortion rate in the process of zooming in and out of the image while obtaining the required image size.
需要说明的是,在上述实施例中对新图像的尺寸调整好之后,可以将文件子区域外的多余的部分裁剪掉,对新图像的形状进行改变,然后将裁剪后的部分作为填充到文件子区域内的内容即可。It should be noted that after the size of the new image is adjusted in the above embodiment, the redundant part outside the sub-area of the file can be cut off, the shape of the new image can be changed, and then the cut part can be filled into the file The content within the sub-area is fine.
S35,若所述参考形状规格为不调整形状,则根据所述文件子区域的尺寸规格对所述新图像的图像尺寸进行调整,将新图像与文件子区域融合,此时新图像和文件子区域为不同的形状,得到为图像的调整后内容。S35. If the reference shape specification is an unadjusted shape, adjust the image size of the new image according to the size specification of the file sub-area, and fuse the new image with the file sub-area. At this time, the new image and the file sub-area The regions are of different shapes, resulting in the resized content of the image.
可以理解的是,如果参考形状规格为不调整形状,那么不需要对新图像的形状进行调整,只需要对新图像的图像尺寸进行调整即可,本方案在对图像尺寸进行调整后,将新图像与文件子区域融合,此时新图像和文件子区域为不同的形状,得到为图像的调整后内容。It can be understood that if the reference shape specification is not to adjust the shape, then it is not necessary to adjust the shape of the new image, only the image size of the new image needs to be adjusted. After the image size is adjusted in this solution, the new The image is fused with the document sub-region. At this time, the new image and the document sub-region have different shapes, and the adjusted content of the image is obtained.
在一些实施例中,S35(所述若所述参考形状规格为不调整形状,则根据所述文件子区域的尺寸规格对所述新图像的图像尺寸进行调整,将新图像与文件子区域融合,此时新图像和文件子区域为不同的形状,得到为图像的调整后内容)包括S351- S355:In some embodiments, S35 (if the reference shape specification is no shape adjustment, adjust the image size of the new image according to the size specification of the file sub-area, and fuse the new image with the file sub-area , at this time the new image and the sub-area of the file have different shapes, and the adjusted content of the image is obtained) including S351-S355:
S351,选中新图像的图像中心点,以及选中文件子区域的区域中心点。S351. Select the image center point of the new image and the area center point of the selected file sub-area.
S352,基于所述图像中心点和区域中心点,将所述新图像与文件子区域进行叠加设置得到融合中心点。S352. Based on the image center point and the region center point, superimpose the new image and the file sub-region to obtain a fusion center point.
首先,本方案会确定新图像的图像中心点以及文件子区域的区域中心点,然后利用图像中心点和图像中心点进行融合得到融合中心点,并在融合中心点建立坐标系。First, this program will determine the image center point of the new image and the area center point of the file sub-area, then use the image center point and the image center point to fuse to obtain the fusion center point, and establish a coordinate system at the fusion center point.
S353,若所述新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则将所述新图像和文件子区域融合。S353. If the size of the new image is smaller than the size of the document sub-region in all dimensions, fuse the new image and the document sub-region.
其中,所有维度可以是指长度维度和宽度维度,可以理解的是,参见图6,图6所对应的新图像的尺寸在长度维度和宽度维度上均分别小于文件子区域的尺寸,此时可以直接将新图像和文件子区域融合。Wherein, all dimensions may refer to the length dimension and the width dimension. It can be understood that, referring to FIG. 6, the size of the new image corresponding to FIG. Directly blend new images with document subregions.
在一些实施例中,S353(所述若所述新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则将所述新图像和文件子区域融合)包括:In some embodiments, S353 (if the size of the new image is smaller than the size of the file sub-area in all dimensions, then fusing the new image with the file sub-area) includes:
若所述新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则输出第一反馈信息。可以理解的是,本方案会在新图像的尺寸在所有维度上分别小于文件子区域的尺寸时,生成第一反馈信息展示给用户。If the size of the new image is smaller than the size of the file sub-region in all dimensions, output first feedback information. It can be understood that, in this solution, when the size of the new image is smaller than the size of the file sub-region in all dimensions, the first feedback information is generated and displayed to the user.
若接收到用户的第二确认信息,则将所述新图像和文件子区域融合。可以理解的是,如果接收到用户的第二确认信息,说明用户觉得新图像的尺寸是可以的,那么服务器可以直接将新图像和文件子区域融合。If the second confirmation information from the user is received, the new image is fused with the document sub-region. It can be understood that if the second confirmation information from the user is received, indicating that the user thinks the size of the new image is acceptable, then the server can directly fuse the new image with the file sub-region.
若接收到用户的第二放大倍数,则根据所述第二放大倍数对所述新图像放大处理,在判断放大处理后的新图像的尺寸在所有维度上分别小于文件子区域的尺寸,则将所述新图像和文件子区域融合。可以理解的是,如果说用户觉得此时新图像的尺寸过小,那么可以输入第二放大倍数,服务器在接收到用户的第二放大倍数后,服务器会根据第二放大倍数对新图像进行放大处理。If the user’s second magnification is received, the new image is enlarged according to the second magnification, and after judging that the size of the enlarged new image is smaller than the size of the document sub-region in all dimensions, then the The new image is fused with the subregion of the document. It is understandable that if the user feels that the size of the new image is too small at this time, then the second magnification factor can be input. After the server receives the user's second magnification factor, the server will enlarge the new image according to the second magnification factor deal with.
S354,若所述新图像的尺寸在任意一个维度上大于文件子区域的尺寸,则根据新图像的尺寸与文件子区域的尺寸的差值得到第二缩小倍数,通过以下公式计算第三缩小倍数,S354. If the size of the new image is greater than the size of the file sub-area in any dimension, the second reduction factor is obtained according to the difference between the size of the new image and the size of the file sub-area, and the third reduction factor is calculated by the following formula ,
其中,为第三缩小倍数,为新图像的尺寸,为文件子区域的尺寸,为缩小系数值。in, is the third reduction factor, is the size of the new image, is the size of the subregion of the document, is the reduction factor value.
参见图7,图7所对应的新图像的尺寸在虽然在宽度维度上大于文件子区域的宽度,但是在长度维度上小于文件子区域的尺寸,此时新图像无法放入到文件子区域中,因此需要对新图像进行缩小处理,本方案在对新图像进行缩小处理时,会计算出第三缩小倍数。See Figure 7. Although the size of the new image corresponding to Figure 7 is larger than the width of the file sub-area in the width dimension, it is smaller than the size of the file sub-area in the length dimension. At this time, the new image cannot be placed in the file sub-area , so the new image needs to be reduced. In this solution, the third reduction factor will be calculated when the new image is reduced.
上述公式中,新图像的尺寸(例如新图像的直径)与文件子区域的尺寸(例如宽度尺寸)的差值越大,得到的第二缩小倍数就会越大,对新图像的调整幅度也会越大。In the above formula, the greater the difference between the size of the new image (such as the diameter of the new image) and the size of the sub-area of the file (such as the width), the greater the second reduction factor obtained, and the adjustment range for the new image. will be bigger.
S355,基于所述缩小倍数对新图像进行缩小处后,将缩小处理后的新图像与文件子区域融合。S355. After reducing the new image based on the reduction factor, fuse the reduced new image with the file sub-region.
可以理解的是,在以缩小倍数对新图像进行缩小处后,将缩小处理后的新图像与文件子区域融合即可。It can be understood that after the new image is reduced by the reduction factor, the reduced new image can be fused with the file sub-region.
需要说明的是,本实施例(不调整形状)与上述实施例(调整形状)不同之处在于,调整形状是对新图像的形状进行了改变,因此需要利用服务器来一点点调整,以达到所需的准确的新图像;而针对于不调整形状实施例,人为介入调整即可以实现所需要的新图像,无需服务器一点点调整,减少服务器的数据处理量。It should be noted that the difference between this embodiment (no shape adjustment) and the above embodiment (shape adjustment) is that the shape adjustment is to change the shape of the new image, so the server needs to be adjusted a little bit to achieve the desired result. Accurate new image is required; for the embodiment of not adjusting the shape, the required new image can be realized through human intervention and adjustment, without a little adjustment of the server, reducing the data processing amount of the server.
针对初始区域为文字编辑区域的情况:For the case where the initial area is a text editing area:
在另一些实施例中,所述S3包括:In other embodiments, the S3 includes:
若所述初始区域为文字编辑区域,则根据用户操作对可编辑内容中的历史文字删除,并添加新文字得到修改后内容。可以理解的是,首先,本方案会将可编辑内容中的历史文字删除,然后添加新文字得到修改后内容。If the initial area is a text editing area, delete historical text in the editable content according to user operations, and add new text to obtain the modified content. It is understandable that, first of all, this solution will delete the historical text in the editable content, and then add new text to obtain the modified content.
获取相邻文件子区域的内容格式,将所述内容格式中对应的文字大小和文字样式作为参考文字大小和参考文字样式。Obtain the content format of the sub-region of the adjacent file, and use the corresponding text size and text style in the content format as the reference text size and reference text style.
将所述修改后内容中的新文字,按照所述参考文字大小和参考文字样式进行调整,得到为文字的调整后内容。The new text in the modified content is adjusted according to the reference text size and reference text style to obtain the text adjusted content.
可以理解的是,本方案会参考相邻文件子区域的内容格式,然后将内容格式中对应的文字大小和文字样式作为参考文字大小和参考文字样式,对修改后内容中的新文字进行调整,得到文字的调整后内容。It is understandable that this solution will refer to the content format of the sub-area of the adjacent file, and then use the corresponding text size and text style in the content format as the reference text size and reference text style to adjust the new text in the modified content. Gets the adjusted content of the text.
S4、基于预设比例对所述显示区域进行分区处理得到第一显示区域和第二显示区域,将所述调整后内容在在线电力报告中同步修改后通过第一显示区域显示,通过第二显示区域对所编辑的文件子区域进行显示。S4. Partitioning the display area based on a preset ratio to obtain a first display area and a second display area, synchronously modifying the adjusted content in the online power report, displaying it in the first display area, and displaying it in the second display area The area displays the sub-area of the file being edited.
本方案会以预设比例(例如二分之一)对显示区域进行分区处理得到第一显示区域和第二显示区域,然后将调整后内容在在线电力报告中同步修改后通过第一显示区域显示,通过第二显示区域对所编辑的文件子区域进行显示。This solution partitions the display area with a preset ratio (for example, one-half) to obtain the first display area and the second display area, and then the adjusted content is synchronously modified in the online power report and displayed in the first display area to display the edited file sub-area through the second display area.
可以理解的是,用户可以通过第二显示区域对所编辑的文件子区域进行突出显示,使得编辑的内容更为突出,提高用户在编辑过程中的准确性。It can be understood that the user can highlight the edited file sub-area through the second display area, so that the edited content is more prominent, and the user's accuracy in the editing process is improved.
S5、在接收到用户输入的第一确认信息后,将修改后的在线电力报告作为最终在线电力报告,结束对电力报告可视化编辑。S5. After receiving the first confirmation information input by the user, use the modified online power report as the final online power report, and end the visual editing of the power report.
用户在编辑完成后,可以输入第一确认信息,服务器在接收到用户输入的第一确认信息后,将修改后的在线电力报告作为最终在线电力报告,结束对在线电力报告可视化编辑。After the editing is completed, the user can input the first confirmation information, and after receiving the first confirmation information input by the user, the server takes the revised online power report as the final online power report, and ends the visual editing of the online power report.
为了实现本发明提供的一种基于操作平台的电力文件的数据处理方法,本发明一种基于操作平台的电力文件的数据处理系统,参见图8,通过以下模块进行电力报告可视化编辑,包括:In order to realize the data processing method of a power file based on the operating platform provided by the present invention, a data processing system of the power file based on the operating platform of the present invention, see FIG. 8, and perform visual editing of the power report through the following modules, including:
解析模块,用于根据用户的选择将相应的在线电力报告在显示设备中进行显示,对在线电力报告进行解析处理,得到在线电力报告的至少一个文件子区域;The analysis module is used to display the corresponding online power report on the display device according to the user's selection, analyze the online power report, and obtain at least one file sub-area of the online power report;
提取模块,用于确定用户选择的文件子区域,提取所述文件子区域内的可编辑内容,在所述可编辑区域内建立富文本编辑区域;An extracting module, configured to determine the file sub-area selected by the user, extract the editable content in the file sub-area, and establish a rich text editing area in the editable area;
修改模块,用于通过编辑装置基于富文本编辑软件对所述可编辑内容进行编辑修改,得到修改后内容,根据所述文件子区域的板式规格和/或相邻文件子区域的内容格式对修改后内容进行调整,得到调整后内容;The modification module is used to edit and modify the editable content based on the rich text editing software through the editing device to obtain the modified content, and modify the content according to the format specification of the file sub-area and/or the content format of the adjacent file sub-area The adjusted content is adjusted to obtain the adjusted content;
处理模块,用于基于预设比例对所述显示区域进行分区处理得到第一显示区域和第二显示区域,将所述调整后内容在在线电力报告中同步修改后通过第一显示区域显示,通过第二显示区域对所编辑的文件子区域进行显示;A processing module, configured to partition the display area based on a preset ratio to obtain a first display area and a second display area, synchronously modify the adjusted content in the online power report and then display it in the first display area, through The second display area displays the edited file sub-area;
确认模块,用于在接收到用户输入的第一确认信息后,将修改后的在线电力报告作为最终在线电力报告,结束对电力报告可视化编辑。The confirmation module is configured to use the revised online power report as the final online power report after receiving the first confirmation information input by the user, and end the visual editing of the power report.
除上述实施例外,本发明还可以有其他实施方式;凡采用等同替换或等效变换形成的技术方案,均落在本发明要求的保护范围。In addition to the above-mentioned embodiments, the present invention can also have other implementations; all technical solutions formed by equivalent replacement or equivalent transformation all fall within the scope of protection required by the present invention.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210985917.6A CN115048915B (en) | 2022-08-17 | 2022-08-17 | Data processing method and system of electric power file based on operation platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210985917.6A CN115048915B (en) | 2022-08-17 | 2022-08-17 | Data processing method and system of electric power file based on operation platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115048915A CN115048915A (en) | 2022-09-13 |
CN115048915B true CN115048915B (en) | 2022-11-01 |
Family
ID=83168312
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210985917.6A Active CN115048915B (en) | 2022-08-17 | 2022-08-17 | Data processing method and system of electric power file based on operation platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115048915B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2578988A (en) * | 2018-09-19 | 2020-06-03 | Imagical LLC | Automated text layout, color and other stylization on an image or video, and the tracking and application of user color preferences |
CN112017195A (en) * | 2020-08-26 | 2020-12-01 | 上海三维工程建设咨询有限公司 | Intelligent integrated monitoring system applied to urban rail transit |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100501728C (en) * | 2003-01-31 | 2009-06-17 | 佳能株式会社 | Image processing method, system, program, program storage medium and information processing apparatus |
JP4251629B2 (en) * | 2003-01-31 | 2009-04-08 | キヤノン株式会社 | Image processing system, information processing apparatus, control method, computer program, and computer-readable storage medium |
CN107656941A (en) * | 2016-07-26 | 2018-02-02 | 阿里巴巴集团控股有限公司 | Document analysis method, apparatus and editor |
CN110019860A (en) * | 2017-12-04 | 2019-07-16 | 天津三星电子有限公司 | A kind of processing method and electronic equipment of multimedia file |
CN109299446B (en) * | 2018-08-03 | 2022-08-12 | 新华三大数据技术有限公司 | Report generation method and device |
CN109948510B (en) * | 2019-03-14 | 2021-06-11 | 北京易道博识科技有限公司 | Document image instance segmentation method and device |
WO2021169502A1 (en) * | 2020-02-27 | 2021-09-02 | Changsha Pixel Code Technology Co. Ltd | A pixel image as well as its processing method and application system |
CN111553137B (en) * | 2020-03-30 | 2023-03-21 | 深圳平安医疗健康科技服务有限公司 | Report generation method and device, storage medium and computer equipment |
CN111488104B (en) * | 2020-04-16 | 2021-10-12 | 维沃移动通信有限公司 | Font editing method and electronic equipment |
CN113076814B (en) * | 2021-03-15 | 2022-02-25 | 腾讯科技(深圳)有限公司 | Text area determination method, device, equipment and readable storage medium |
CN112989782B (en) * | 2021-04-22 | 2021-08-27 | 北京三维天地科技股份有限公司 | Method for automatic template configuration and report generation |
CN113744830A (en) * | 2021-08-20 | 2021-12-03 | 海南视联大健康智慧医疗科技有限公司 | Report generation method and device, electronic equipment and storage medium |
-
2022
- 2022-08-17 CN CN202210985917.6A patent/CN115048915B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2578988A (en) * | 2018-09-19 | 2020-06-03 | Imagical LLC | Automated text layout, color and other stylization on an image or video, and the tracking and application of user color preferences |
CN112017195A (en) * | 2020-08-26 | 2020-12-01 | 上海三维工程建设咨询有限公司 | Intelligent integrated monitoring system applied to urban rail transit |
Non-Patent Citations (4)
Title |
---|
Toshiki Honda ; Kohei Mukaiyama ; Takeharu Shirai ; Tetsushi Ohki ; .Ransomware Detection Considering User"s Document Editing.《2018 IEEE 32nd International Conference on Advanced Information Networking and Applications (AINA)》.2018,第907-914页. * |
Word文档中AutoCAD数据格式图形显示效果的高效编辑研究;景天虎 马小龙 刘均利 莫时旭;《图学学报》;20151015;第36卷(第5期);第811-818页 * |
文档我做主 调配由我定;小t;《电脑迷》;20101201(第23期);全文 * |
联合编辑文档 你来定规矩;Coco;《电脑迷》;20130401(第04期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115048915A (en) | 2022-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8230318B2 (en) | Selective image editing in a browser | |
US7631252B2 (en) | Distributed processing when editing an image in a browser | |
US8572512B2 (en) | Electronic document location indication and navigation method, system and program | |
US20160048483A1 (en) | Integrating image renditions and page layout | |
DE212011100021U1 (en) | Apparatus for displaying or remastering text and images for display on mobile / small screen devices | |
CN104574454A (en) | Image processing method and device | |
CN109254760A (en) | A kind of method of picture scaling | |
CN115048915B (en) | Data processing method and system of electric power file based on operation platform | |
CN112784037A (en) | VBA-based binary function visual demonstration system and method | |
US10795620B2 (en) | Image processing apparatus and layout method | |
CN112802157B (en) | Picture editing method, device, electronic equipment and storage medium | |
US5302967A (en) | Figure processing apparatus and method aided by display with ruled lines | |
JP7532110B2 (en) | Image processing device, image processing method, and program | |
CN105373519B (en) | A kind of editing device and method of Technical symbol | |
CN111782309B (en) | Method and device for displaying information and computer readable storage medium | |
JPH04222063A (en) | Data generating device and method for graphic scaling up/down by the device | |
JP6640692B2 (en) | Image layout apparatus, image layout method, and program thereof | |
JP4100842B2 (en) | Document creation apparatus and document creation method | |
CN113377262B (en) | Method and device for adjusting size proportion of pictures in electronic document | |
CN114758348A (en) | Graphics processing method, apparatus and device | |
JP2011135350A (en) | Image processing apparatus and method of controlling the same | |
JP2019103007A (en) | Program, information processing apparatus, and information processing method | |
AU2024202706B1 (en) | Image generation | |
JP2017187923A (en) | Document processing device, document processing method, terminal, and method | |
JPS6349978A (en) | Character processing method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |