Data conversion method and device, electronic equipment and computer readable storage medium

CN116309027BActive Publication Date: 2026-11-03MASHANG CONSUMER FINANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310272574.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2026-11-03
Estimated Expiration
2043-03-20

AI Technical Summary

Technical Problem

Because the business platform and the diagramming software are cross-platform, the business platform cannot use professional diagramming software to draw flowcharts, creating a bottleneck for business needs.

Method used

By parsing the graphic to be converted to obtain the attribute information of the graphic elements, using format conversion rules to map it to the second display system, determining the location of connection points, configuring connection information, and generating graphic data that matches the second display system, so as to display the same graphic in the business platform.

Benefits of technology

It enables the display of graphics drawn by the drawing software in the business platform, improves the compatibility between the drawing software and the business platform, and breaks through the bottleneck of business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309027B_ABST
    Figure CN116309027B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data conversion method and device, electronic equipment and computer readable medium, the method comprising: analyzing the size and first reference position of at least one graphical element contained in the to-be-converted graph; obtaining the second reference position of each graphical element in the second display system according to the format conversion rule of the first display system and the second display system, and determining the position of the connection point of each graphical element according to the second reference position and size of each graphical element; configuring the connection information of at least one connection point with a connection relationship; generating the graph data matched with the second display system according to the second reference position and size of each graphical element and the connection information of the at least one connection point, so as to display the same graph as the to-be-converted graph in the second display system. According to the embodiment of the present disclosure, the compatibility of the graphing software and the business platform can be improved, and the bottleneck of business demand can be broken through.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a data conversion method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Flowcharts, as intuitive and clear views that display processing procedures and content, are widely used in various business scenarios such as data analysis and process monitoring. Some business platforms that require flowcharts typically deploy diagramming tools with functions such as data analysis based on the flowcharts. However, given that professional diagramming software (such as Microsoft Visio) offers more comprehensive diagramming capabilities, using professional diagramming software remains the mainstream approach in practical implementations.

[0003] Because the business platform and the diagramming software are cross-platform, the business platform cannot use professional diagramming software to create flowcharts, which creates a bottleneck for business needs. Summary of the Invention

[0004] This disclosure provides a data conversion method, apparatus, electronic device, and computer-readable storage medium.

[0005] Firstly, this disclosure provides a data transformation method, which includes:

[0006] The graphic to be converted is parsed to obtain the attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. The first reference position refers to the reference position of the graphic element in the first display system. The first display system refers to the system that generates the graphic to be converted.

[0007] Based on the format conversion rules between the first display system and the second display system, the second reference position of each graphic element in the second display system is obtained as the first reference position of each graphic element.

[0008] The position of the connection point of the graphic element is determined based on the second reference position and size of each graphic element;

[0009] Based on the position of the connection point of each graphic element, configure the connection information of at least one connection point with a connection relationship. The at least one connection point with a connection relationship refers to the connection point in the graphic to be converted that is connected to the connected graphic element.

[0010] Based on the second reference position and size of each graphic element, and the connection information of the at least one connection point, graphic data matching the second display system is generated so as to display the same graphic as the graphic to be converted in the second display system.

[0011] Secondly, this disclosure provides a data conversion apparatus, which includes:

[0012] The parsing module is used to parse the graphic to be converted and obtain the attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. The first reference position refers to the reference position of the graphic element in the first display system. The first display system refers to the system that generates the graphic to be converted.

[0013] The obtaining module is used to obtain the second reference position in the second display system corresponding to the first reference position of each graphic element according to the format conversion rules between the first display system and the second display system;

[0014] A determination module is used to determine the position of the connection point of the graphic element based on the second reference position and size of each graphic element;

[0015] The configuration module is used to configure the connection information of at least one connection point with a connection relationship according to the position of the connection point of each graphic element. The at least one connection point with a connection relationship refers to the connection point in the graphic to be converted that is connected to the connected graphic element.

[0016] The drawing module is used to generate graphic data that matches the second display system based on the second reference position and size of each graphic element and the connection information of the at least one connection point, so as to display the same graphic as the graphic to be converted in the second display system.

[0017] Thirdly, this disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the data conversion method described above.

[0018] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described data conversion method.

[0019] Fifthly, this disclosure provides a computer program or computer program product, the computer program product including a computer program stored in a computer-readable storage medium, the computer program implementing the above-described data conversion method when executed by a processor.

[0020] The embodiments provided in this disclosure parse the graphic to be converted to obtain attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. Further, according to the format conversion rules between the first display system and the second display system, the second reference position of each graphic element corresponding to the first reference position in the second display system is obtained, and the position of the connection point of the graphic element is determined according to the second reference position and size of each graphic element. After configuring the connection information of at least one connection point with a connection relationship according to the position of the connection point of each graphic element, graphic data matching the second display system is generated according to the second reference position and size of each graphic element and the connection information of the at least one connection point, so as to display the same graphic as the graphic to be converted in the second display system. Here, the first display system and the second display system belong to two platforms, and the graphic to be converted is generated in the first display system. The first reference position refers to the reference position of the graphic element in the first display system. Based on this, after determining the format conversion rules between the first display system and the second display system, for any graphic element, the second reference position corresponding to the first reference position of the graphic element after mapping to the second display system can be obtained. Furthermore, in the second display system, after determining the connection points of each graphic element based on its second reference position and size, dynamic connections between the graphic elements are configured. Based on the second reference positions of each graphic element, the connection point positions of each graphic element, and the dynamic connections obtained above, graphic data matching the second display system can be obtained. Therefore, based on the graphic data matching the second display system, a graphic identical to the graphic to be converted can be drawn in the second display system. Compared to the problem of traditional business platforms being unable to use drawing software to create graphics, the data conversion method of this disclosure can determine format conversion rules based on the format mapping relationship between the first and second display systems. Then, based on the format conversion rules and the reference position of each graphic element in the first display system, the position information and connection information of each graphic element in the second display system are obtained. This allows a graphic identical to the graphic to be converted to be drawn in the second display system using the data format supported by the second display system, thus enabling the second display system to use the graphic. As can be seen, the embodiments of this disclosure provide a method for converting a diagram in the format of a drawing software into a diagram in the format of a business platform. This method not only makes full use of the functions of professional drawing software, but also allows the diagrams drawn by the drawing software to be used on the business platform, thereby improving the compatibility between the drawing software and the business platform and breaking through the bottleneck of business needs.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0022] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:

[0023] Figure 1 A flowchart of a data conversion method provided in this embodiment of the disclosure;

[0024] Figure 2 A flowchart illustrating an exemplary data conversion method provided in this disclosure embodiment;

[0025] Figure 3 A structural diagram of a data conversion device provided in an embodiment of this disclosure;

[0026] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0027] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0028] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.

[0029] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.

[0030] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.

[0031] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.

[0032] This disclosure relates to the field of data processing technology, specifically to a technique for format conversion of graphic data. The reason why a business platform cannot use drawing software to create flowcharts is generally that the format of the graphic data in the drawing software differs from the format of the graphic data in the business platform, and the two are incompatible. However, whether it's drawing software or a business platform, when displaying graphics on the interface, it can be understood that the graphics are displayed in a two-dimensional display area. In view of this, a data conversion method becomes possible that maps the formats of the graphic data from both platforms to the same coordinate system, then obtains the correspondence between the two formats of graphic data under this same coordinate system, and thus converts the graphic data in the format matched by the drawing software to the format matched by the business platform.

[0033] The present invention aims to convert graphics drawn by drawing software from a format matching the drawing software to a format matching the business platform, so that the graphics drawn by the drawing software can be displayed in the business platform and the business platform can parse the graphics to use the data and content presented in the graphics.

[0034] The drawing software involved in the embodiments of this disclosure includes, for example, Microsoft Visio (hereinafter referred to as Visio), and the drawing tools supported by the business platform involved in the embodiments of this disclosure include, for example, AntV X6.

[0035] The data conversion method illustrated in this embodiment can be executed by an electronic device, which may be an in-vehicle device, user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, wearable device, etc. In some implementations, the data conversion method can be implemented by a processor in the electronic device calling computer-readable program instructions stored in memory.

[0036] The data conversion method of this disclosure embodiment will be described below with reference to exemplary implementation methods.

[0037] Figure 1 A flowchart of a data conversion method provided in this disclosure embodiment, the method comprising:

[0038] In step S11, the graphic to be converted is parsed to obtain the attribute information of at least one graphic element contained in the graphic to be converted.

[0039] The graphic to be converted can be a graphic drawn using drawing software, such as a diagram drawn using Visio, hereinafter referred to as a "Visio diagram". The graphic to be converted can be, for example, a flowchart, such as at least one of a basic flowchart and a cross-functional flowchart. In this embodiment of the disclosure, the drawing software is referred to as a "first display system".

[0040] It should be noted that the diagram to be converted can be obtained by combining at least one graphic element. Taking a Visio diagram as an example, each graphic element can be one of the following: any graphic shape contained in the basic flowchart, connecting lines contained in the basic flowchart, swimlanes, vertical swimlanes, separators, vertical separators, etc. in a cross-functional flowchart.

[0041] In some implementations, the attribute information of each graphic element includes the size of the graphic element and its first reference position. In other implementations, the attribute information of each graphic element may also include at least one of the following: the description information of the graphic element, the separator information contained in the graphic element, etc.

[0042] Here, the first reference position of a graphic element refers to the reference position of the graphic element in the first display system. The reference position can be used to locate the position of the graphic element in the display system. For example, the reference position of the graphic element can be the center position of the graphic element.

[0043] For example, the dimensions of a graphic element may include its height and width. The descriptive information of a graphic element may include its name and notes. For instance, the notes for a graphic element may be content entered within the graphic element itself.

[0044] Taking the conversion of a graphic to a Visio diagram as an example, the electronic device can use the `org.apacHe.poi.Xdgf.eXtractor.XDGFVisioEXtractor` method to parse and obtain the name of each graphic element in the Visio diagram, and can use the `org.apacHe.poi.Xdgf.usermodel.XmlVisioDocument` method to parse and obtain other attribute information such as the size and first reference position of each graphic element in the Visio diagram.

[0045] In step S12, according to the format conversion rules between the first display system and the second display system, the first reference position of each graphic element is obtained, corresponding to the second reference position in the second display system.

[0046] The second display system can be the display system of the business platform, such as the AntV X6 system. The second display system supports different formats of graphic data than the first display system.

[0047] In one implementation of this disclosure, the electronic device can map the display space of the first display system and the display space of the second display system to a two-dimensional coordinate system. Then, it can determine the format conversion rules between the first display system and the second display system in the same two-dimensional coordinate system. After that, the electronic device can obtain the second reference position of the graphic element when it is displayed in the second display system based on the first reference position of each graphic element.

[0048] In some implementations, if the first reference position and the second reference position of each graphic element are both represented by the horizontal axis (e.g., the X-axis) coordinate and the vertical axis (e.g., the Y-axis) coordinate of a two-dimensional coordinate system, for a graphic element, the electronic device can use the first axial coordinate in the first reference position of the graphic element as the first axial coordinate in the second reference position of the graphic element, and obtain the second axial coordinate in the second reference position corresponding to the second axial coordinate in the first reference position of the graphic element according to the format conversion rules.

[0049] It should be noted that the attributes of graphic elements differ in different implementation scenarios, so the implementation methods of the first and second axial coordinates can also differ. For example, in one optional implementation, the first axial coordinate is the vertical axis (i.e., the Y-axis), and the second axial coordinate is the horizontal axis (i.e., the X-axis); as another example, in another optional implementation, the first axial coordinate is the horizontal axis (i.e., the X-axis), and the second axial coordinate is the vertical axis (i.e., the Y-axis).

[0050] In some implementations, when the graphic element is a graphic element of a basic flowchart, the first axial coordinate is the horizontal axis (i.e., X-axis) coordinate in the first reference position, and the second axial coordinate is the vertical axis (i.e., Y-axis) coordinate in the first reference position. Obtaining the second axial coordinate of the graphic element in the first reference position corresponding to the second axial coordinate in the second reference position can include: summing the difference between the largest first vertical axis coordinate Ymax and the vertical axis coordinate Y1 in the first reference position with the smallest first vertical axis coordinate Ymin, and using the result as the vertical axis coordinate Y in the second reference position of the graphic element, i.e., Y = Ymax - Y1 + Ymin. Here, both the largest and smallest first vertical axis coordinates Ymax and Ymin are values ​​within the range of all first vertical axis coordinates corresponding to the graphic to be converted. For example, the largest first vertical axis coordinate Ymax refers to the largest first vertical axis coordinate among all first vertical axis coordinates corresponding to the graphic to be converted, and the smallest first vertical axis coordinate Ymin refers to the smallest first vertical axis coordinate among all first vertical axis coordinates corresponding to the graphic to be converted. The first ordinate coordinates corresponding to the graphic to be converted refer to the ordinate coordinates of all the first reference positions corresponding to the graphic to be converted, and the first reference positions corresponding to the graphic to be converted refer to the first reference positions of the at least one graphic element.

[0051] In other implementations, when the graphic element is a vertical swimlane graph, the first axial coordinate is the horizontal coordinate of the first reference position, and the second axial coordinate is the vertical coordinate of the first reference position. In this example, the electronic device can use the difference between the vertical coordinate of the first reference position and half the height of the graphic element as the vertical coordinate of the second reference position of the graphic element. That is, in this example, Y = Y1 - H / 2 in the second reference position of the graphic element, where H refers to the height of the vertical swimlane graph.

[0052] The height of the vertical swimlane plot can be determined based on the vertical separators contained within it. For example, the electronic device can sort the swimlanes by Y-axis coordinates from smallest to largest and calculate the height of the vertical separators: H = H0 + H1. Here, H0 represents the height of the previous separator, and H1 represents the height of the current separator.

[0053] In some implementations, when the graphic element is a horizontal swimlane plot, the first axial coordinate is the vertical coordinate of the first reference position, and the second axial coordinate is the horizontal coordinate. In this example, the electronic device can use the difference between the horizontal coordinate of the first reference position and half the width of the graphic element as the horizontal coordinate of the second reference position of the graphic element. That is, in this example, X = X1 - W / 2 in the second reference position of the graphic element, where X1 refers to the X-axis coordinate of the first reference position of the graphic element, and W refers to the width of the horizontal swimlane plot.

[0054] The width of the horizontal lane diagram can be determined based on the horizontal separators contained in the horizontal lane diagram. For example, the electronic device can sort the horizontal separators from smallest to largest according to the X-axis coordinates and calculate the height of the horizontal separators: W = W0 + W1, where W0 represents the width of the previous horizontal separator and W1 represents the width of the current horizontal separator.

[0055] Furthermore, for each of the above-mentioned graphic elements, after obtaining the second axial coordinate of the graphic element in the second reference position based on the second axial coordinate in the first reference position, the position identified by the first axial coordinate and the second axial coordinate in the second reference position can be determined as the second reference position of the graphic element in the second display system. For example, when the graphic element is a graphic element of a basic flowchart, the coordinates of the first reference position of the graphic element are (X1, Y1). After obtaining Y based on the value of Y1, the coordinates of the first reference position of the graphic element are obtained as (X1, Y). When the graphic element is another type of graphic element, the coordinates of the second reference position of the graphic element are obtained as in the above embodiment, and will not be repeated here.

[0056] As can be seen, by mapping the display space of the first display system and the display space of the second display system to the same reference system, the format conversion rules between the first display system and the second display system can be obtained. Furthermore, based on the first reference position of the graphic element, the second reference position of the graphic element when it is displayed in the second display system can be obtained, thereby providing data support for displaying each graphic element in the second display system.

[0057] In step S13, the position of the connection point of the graphic element is determined according to the second reference position and size of each graphic element.

[0058] In this context, a connection point of a graphic element refers to the point where a graphic element establishes a connection with other graphic elements. A graphic element can include a top connection point, a bottom connection point, a left connection point, and a right connection point. Each connection point can be located on the border of the graphic element.

[0059] As described above regarding the second reference position of a graphic element, the second reference position can be used as a reference position for determining the drawing area of ​​the graphic element in the second display system. Since the size of each graphic element is fixed, the position of the connection point of each graphic element can be obtained based on the second reference position and the size of the graphic element.

[0060] In some implementations, taking the second reference position of each graphic element indicating the center of the graphic element as an example, for any graphic element, the horizontal coordinate of the second reference position of the graphic element is determined as the horizontal coordinate of the upper and lower connection points of the graphic element; the difference between the vertical coordinate of the second reference position of the graphic element and half the height of the graphic element is used as the vertical coordinate of the upper connection point of the graphic element, and the sum of the vertical coordinate of the second reference position of the graphic element and half the height of the graphic element is used as the vertical coordinate of the lower connection point of the graphic element; the vertical coordinate of the second reference position of the graphic element is determined as the vertical coordinate of the left and right connection points of the graphic element; the difference between the horizontal coordinate of the second reference position of the graphic element and half the width of the graphic element is used as the horizontal coordinate of the left connection point of the graphic element, and the sum of the horizontal coordinate of the second reference position of the graphic element and half the width of the graphic element is used as the horizontal coordinate of the right connection point of the graphic element.

[0061] For example, the position of the upper connection point of the graphic element can be represented as coordinates (X, YH / 2), the position of the lower connection point can be represented as coordinates (X, Y+H / 2), the position of the left connection point can be represented as coordinates (XW / 2, Y), and the position of the right connection point can be represented as coordinates (X+W / 2, Y). Here, X refers to the X-axis coordinate of the graphic element in the second reference position, and Y refers to the Y-axis coordinate of the graphic element in the second reference position.

[0062] By adopting this implementation method, the precise location of the connection point of each graphic element in the second display system can be determined, thereby providing a data basis for establishing the connection relationship of each graphic element in the second display system.

[0063] In step S14, connection information of at least one connection point with a connection relationship is configured according to the position of the connection point of each graphic element.

[0064] Wherein, the at least one connection point with a connection relationship refers to a connection point in the graphic to be converted that is connected to the line graphic element. The electronic device can determine at least one connection point with a connection relationship based on the graphic to be converted, as well as the attributes of each connection point and the pixel value of the point graphic of each connection point. The attributes of each connection point are, for example, a start connection point or an end connection point, and each point graphic is located above the frame line of the graphic element.

[0065] In some implementations, configuring connection information for at least one connection point with a connection relationship can involve calculating the pixel values ​​of the point graphics of at least one connection point with a connection relationship. In a two-dimensional coordinate system, for any one of the at least one connection point, the electronic device can add a preset pixel difference to the pixel value of the point graphics of that connection point in the axial direction perpendicular to the target frame line, where the target frame line refers to the frame line of the graphic element where the connection point is located.

[0066] For example, if the point graphic of the connection point is located within the frame line of the graphic element along the horizontal axis, then a preset pixel difference is added to the pixel value of the point graphic of the connection point along the vertical axis. If the point graphic of the connection point is located within the frame line of the graphic element along the vertical axis, then a preset pixel difference is added to the pixel value of the point graphic of the connection point along the horizontal axis.

[0067] The preset pixel difference can be, for example, 3 pixels (px).

[0068] For example, regardless of whether the connection point is the starting or ending node in the connection relationship, if the connection point is the top or bottom connection point of a graphic element, the number of pixels in the X-axis direction of the graphic at that connection point remains unchanged, while the number of pixels in the Y-axis direction increases by 3px. If the connection point is the left or right connection point of a graphic element, the number of pixels in the Y-axis direction of the graphic at that connection point remains unchanged, while the number of pixels in the X-axis direction increases by 3px.

[0069] In step S15, graphic data matching the second display system is generated based on the second reference position and size of each graphic element and the connection information of at least one connection point.

[0070] The electronic device can display a graphic in the second display system that is identical to the graphic to be converted, based on graphic data that matches the second display system.

[0071] The information obtained from steps S11 to S14 above is the position of the graphic elements when displayed in the second display system. Based on this, the electronic device can deploy graphic elements that match the format of the second display system. During the deployment of each graphic element, the reference position, width and height, and various connection points of the graphic element are made to meet the requirements obtained in steps S11 to S13. Then, based on the result of step S14 above, dynamic connections can be matched for the graphic elements with connection relationships in the second display system, thereby obtaining graphic data that matches the second display system.

[0072] After each combination of graphic elements is drawn in the second display system, it can present a graphic that is the same as the graphic to be converted. For example, the second display system displays an AntV X6 graphic that has the same content as the Visio graphic.

[0073] The data conversion method of this disclosure embodiment will be described below with reference to examples.

[0074] Taking the conversion of a Visio diagram to AntV X6 format as an example, Figure 2 A flowchart illustrating a method for converting a Visio diagram to AntV X6 format is shown, which may include the following steps:

[0075] Step S21: Obtain the Visio diagram.

[0076] The Visio diagram is the graphic to be converted.

[0077] For example, the Visio diagram may be a graph that includes a basic flowchart and a cross-functional flowchart. Therefore, the Visio diagram includes graphical elements of the basic flowchart and graphical elements of the cross-functional flowchart, as well as the connections between the various graphical elements. Graphical elements of the cross-functional flowchart may include, for example, horizontal swimlanes, vertical swimlanes, horizontal separators, and vertical separators.

[0078] Step S22: Parse the Visio diagram to obtain the attribute information of each graphic element in the Visio diagram.

[0079] For example, the attribute information of each graphic element includes, for instance, the name of the graphic element, remarks, width, height, and center position coordinates. Here, the center position coordinates refer to the coordinates of the graphic element in the Visio system, i.e., the aforementioned first reference position.

[0080] It should be noted that this example uses a two-dimensional coordinate system as a reference, and each position is represented by the X-axis and Y-axis coordinates in the two-dimensional coordinate system.

[0081] For example, the attribute information of a connection includes: "Name: Connection, Center position coordinates: x-axis: 1046, y-axis: 2509, Start connection point (start) x-axis: 1046, start y-axis: 2533, End connection point (end) x-axis: 1046, end y-axis: 2484, width: 20, height: -49".

[0082] For example, the attribute information of a basic flowchart graphic element includes: "Name: Flowchart, Center position coordinates: x-axis: 1769, y-axis: 791, startX-axis: 0, startY-axis: 0, endX-axis: 0, endY-axis: 0, width: 98, height: 59".

[0083] For example, the attribute information of a vertical swim lane includes: "Name: Vertical swim lane, Center position coordinates: x-axis: 292, y-axis: 2838, startX-axis: 0, startY-axis: 0, endX-axis: 0, endY-axis: 0, width: 584, height: 39".

[0084] For example, the attribute information of a horizontal swim lane includes: "Name: swim lane, center position coordinates: x-axis: 10, y-axis: 345, startX-axis: 0, startY-axis: 0, endX-axis: 0, endY-axis: 0, width: 729, height: 20".

[0085] In practice, for example, the name and notes of each graphic element can be obtained by parsing using the org.apacHe.poi.Xdgf.eXtractor.XDGFVisioEXtractor method, and then the width, height, center position coordinates and other information of each graphic element can be obtained by parsing using the org.apacHe.poi.Xdgf.usermodel.XmlVisioDocument method.

[0086] Step S23: Determine the center position of the corresponding graphic element in AntVX6 based on the center position of each graphic element in the Visio diagram.

[0087] The center position of each graphic element in AntV X6 is the aforementioned second reference position.

[0088] For example, if the graphic element is a graphic element or connection in the basic flowchart, the center position of the graphic element in AntV X6 is: the X-axis coordinate is the same as in the Visio diagram, for example, X1; the Y-axis coordinate is: Y = Ymax - Y1 + Ymin, where Ymax is the Y-axis coordinate with the largest value among the center positions of all graphic elements in the Visio diagram, Ymin is the Y-axis coordinate with the smallest value among the center positions of all graphic elements in the Visio diagram, and Y1 is the Y-axis coordinate of the center position of the graphic element in the Visio diagram.

[0089] For example, if the graphic element is a vertical swimlane plot, its width in AntV X6 is: W = W0 + W1. Here, following the positive increasing direction of the X-axis in the Visio plot, W0 refers to the width of the previous vertical swimlane in the Visio plot, and W1 refers to the width of the current vertical swimlane plot in the Visio plot. The center position of this graphic element in AntV X6 is: the X-axis coordinate is the same as in the Visio plot, for example, X1; the Y-axis coordinate is: Y = Y1 - H / 2. Here, Y1 refers to the Y-axis coordinate of the center position of the vertical swimlane plot in the Visio plot, and H refers to the height of the vertical swimlane plot in the Visio plot.

[0090] For example, if the graphic element is a horizontal swimlane plot, its height in AntV X6 is: H = H0 + H1, where H0 refers to the height of the previous horizontal swimlane plot in the Visio plot, and H1 refers to the height of the current horizontal swimlane plot in the Visio plot. The center position of this horizontal swimlane plot in AntV X6 is: the Y-axis coordinate is the same as in the Visio plot, for example, Y1; the X-axis coordinate is: X = X1 - W / 2, where X1 refers to the X-axis coordinate of the center position of the horizontal swimlane plot in the Visio plot, and W refers to the width of the horizontal swimlane plot in the Visio plot.

[0091] Step S24: Obtain the coordinates of each connection point of each graphic element in AntV X6.

[0092] For example, for any graphic element:

[0093] The coordinates of the upper connection point are: the X-axis coordinate of the upper connection point is the X-axis coordinate of the center position of the graphic element in AntV X6, and the Y-axis coordinate is: Y = Y0 - H / 2. Here, Y0 refers to the Y-axis coordinate of the center position of the graphic element in AntV X6, and H refers to the height of the graphic element.

[0094] The coordinates of the lower connection point are: the X-axis coordinate of the lower connection point is the X-axis coordinate of the center position of the graphic element in AntV X6, and the Y-axis coordinate is: Y = Y0 + H / 2.

[0095] The coordinates of the left connection point are: the Y-axis coordinate of the left connection point is the Y-axis coordinate of the center position of the graphic element in AntV X6, and the X-axis coordinate is: X = X0 - W / 2. Here, X0 refers to the X-axis coordinate of the center position of the graphic element in AntV X6, and W refers to the width of the graphic element.

[0096] The coordinates of the right connection point are: the Y-axis coordinates of the right connection point are the Y-axis coordinates of the center position of the graphic element in AntV X6, and the X-axis coordinates are: X = X0 + W / 2.

[0097] Step S25: Match the dynamic connections in AntV X6.

[0098] That is, the connection information is configured based on the coordinates of the connection points of each graphic element in AntV X6.

[0099] For example, based on the attribute information of the lines in the Visio diagram, the coordinates of the start and end points of each line can be determined. Then, the coordinates of each start point can be matched with the coordinates of the connection point in step S24, and the coordinates of each end point can be matched with the coordinates of the connection point in step S24. Afterward, the pixel value at the coordinates of each matched connection point (i.e., the point position graph of the connection point described above) is obtained.

[0100] For any matching connection point, if the connection point is the top or bottom connection point of a graphic element, the pixel value in the X-direction of the display graphic of that connection point remains unchanged, while the pixel value in the Y-direction is increased by 3px. When the connection point is the left or right connection point of a graphic element, the pixel value in the Y-direction of the display graphic of that connection point remains unchanged, while the pixel value in the X-direction is increased by 3px.

[0101] Step S26: Generate AntV X6 graphics.

[0102] The relevant data, connection point data, and dynamic connection data of each graphic element obtained in steps S21 to S25 are converted into graphic data in AntV X6 format. Then, each graphic element is drawn according to the converted graphic data to obtain an AntV X6 diagram that is the same as the Visio diagram in step S21.

[0103] As can be seen, by using the embodiments provided in this disclosure, the graphic to be converted is parsed to obtain attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. Further, according to the format conversion rules between the first display system and the second display system, the second reference position of each graphic element corresponding to the first reference position in the second display system is obtained, and the position of the connection point of the graphic element is determined according to the second reference position and size of each graphic element. After configuring the connection information of at least one connection point with a connection relationship according to the position of the connection point of each graphic element, graphic data matching the second display system is generated according to the second reference position and size of each graphic element and the connection information of the at least one connection point, so as to display the same graphic as the graphic to be converted in the second display system. Here, the first display system and the second display system belong to two platforms, and the graphic to be converted is generated in the first display system. The first reference position refers to the reference position of the graphic element in the first display system. Based on this, after determining the format conversion rules between the first display system and the second display system, for any graphic element, the second reference position corresponding to the first reference position of the graphic element after mapping to the second display system can be obtained. Furthermore, in the second display system, after determining the connection points of each graphic element based on its second reference position and size, dynamic connections between the graphic elements are configured. Based on the second reference positions of each graphic element, the connection point positions of each graphic element, and the dynamic connections obtained above, graphic data matching the second display system can be obtained. Therefore, based on the graphic data matching the second display system, a graphic identical to the graphic to be converted can be drawn in the second display system. Compared to the problem of traditional business platforms being unable to use drawing software to create graphics, the data conversion method of this disclosure can determine format conversion rules based on the format mapping relationship between the first and second display systems. Then, based on the format conversion rules and the reference position of each graphic element in the first display system, the position information and connection information of each graphic element in the second display system are obtained. This allows a graphic identical to the graphic to be converted to be drawn in the second display system using the data format supported by the second display system, thus enabling the second display system to use the graphic. As can be seen, the embodiments of this disclosure provide a method for converting a diagram in the format of a drawing software into a diagram in the format of a business platform. This method not only makes full use of the functions of professional drawing software, but also allows the diagrams drawn by the drawing software to be used on the business platform, thereby improving the compatibility between the drawing software and the business platform and breaking through the bottleneck of business needs.

[0104] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.

[0105] In addition, this disclosure also provides data conversion apparatus, electronic equipment, and computer-readable storage medium, all of which can be used to implement any of the data conversion methods provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding descriptions in the method section, and will not be repeated here.

[0106] Reference Figure 3 This disclosure provides a data conversion apparatus, which includes: a parsing module 31, an obtaining module 32, a determining module 33, a configuring module 34, and a drawing module 35. Each module, when running, can implement some or all of the functions described in the above method implementation.

[0107] For example, the parsing module 31 is used to parse the graphic to be converted and obtain the attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. The first reference position refers to the reference position of the graphic element in the first display system, which is the system that generates the graphic to be converted. The obtaining module 32 is used to obtain the second reference position of each graphic element in the second display system according to the format conversion rules between the first display system and the second display system. The determining module 33 is used to determine the position of the connection point of the graphic element according to the second reference position and size of each graphic element. The configuring module 34 is used to configure the connection information of at least one connection point with a connection relationship according to the position of the connection point of each graphic element. The at least one connection point with a connection relationship refers to the connection point in the graphic to be converted that is connected to the connecting graphic element. The drawing module 35 is used to generate graphic data that matches the second display system according to the second reference position and size of each graphic element and the connection information of the at least one connection point, so as to display the same graphic as the graphic to be converted in the second display system.

[0108] For details on the specific implementation method, please refer to the above. Figure 1 and Figure 2 The illustrated method embodiments are described herein and will not be repeated here.

[0109] It is understandable that the above division of modules / units is merely a logical functional division; in actual implementation, each of these modules / units can be integrated into the hardware implementation. For example... Figure 4As shown, Figure 4 This is a block diagram of an electronic device provided according to an embodiment of the present disclosure. (Refer to...) Figure 4 This disclosure provides an electronic device, which includes: at least one processor 401; at least one memory 402; and one or more I / O interfaces 403 connected between the processor 401 and the memory 402; wherein the memory 402 stores one or more computer programs that can be executed by the at least one processor 401, and the one or more computer programs are executed by the at least one processor 401 to enable the at least one processor 401 to perform the above-described data conversion method.

[0110] This disclosure also provides a computer-readable storage medium, which may be volatile or non-volatile, storing a computer program thereon, wherein the computer program, when executed by processor 401:

[0111] The process involves parsing the graphic to be converted to obtain attribute information for at least one graphic element contained in the graphic. The attribute information for each graphic element includes its size and a first reference position, where the first reference position refers to the reference position of the graphic element in a first display system, which is the system that generated the graphic to be converted. Based on the format conversion rules between the first and second display systems, a second reference position in the second display system corresponding to the first reference position of each graphic element is obtained. The positions of the connection points of each graphic element are determined based on its second reference position and size. Connection information for at least one connection point with a connection relationship is configured based on the position of the connection point of each graphic element. This connection point refers to the connection point in the graphic to be converted that is connected to a line graphic element. Finally, graphic data matching the second display system is generated based on the second reference position and size of each graphic element, and the connection information of the at least one connection point, so that the same graphic as the graphic to be converted can be displayed in the second display system.

[0112] In some embodiments, the first reference position and the second reference position of each graphic element are represented by the horizontal axis coordinate and the vertical axis coordinate of a two-dimensional coordinate system. The processor 401 is further configured to: for a graphic element, use the first axial coordinate in the first reference position of the graphic element as the first axial coordinate in the second reference position of the graphic element; and obtain the second axial coordinate in the second reference position corresponding to the second axial coordinate in the first reference position of the graphic element according to the format conversion rule.

[0113] In some embodiments, if the graphic element is a graphic element of a basic flowchart, then the first axial coordinate is the horizontal axis coordinate in the first reference position, and the second axial coordinate is the vertical axis coordinate in the first reference position. The processor 401 is further configured to: take the sum of the difference between the largest first vertical axis coordinate and the vertical axis coordinate in the first reference position and the smallest first vertical axis coordinate as the vertical axis coordinate in the second reference position of the graphic element, wherein the largest first vertical axis coordinate is the first vertical axis coordinate with the largest value among all the first vertical axis coordinates corresponding to the graphic to be converted, the smallest first vertical axis coordinate is the first vertical axis coordinate with the smallest value among all the first vertical axis coordinates corresponding to the graphic to be converted, all the first vertical axis coordinates corresponding to the graphic to be converted are the vertical axis coordinates in all the first reference positions corresponding to the graphic to be converted, and all the first reference positions corresponding to the graphic to be converted are the first reference positions of the at least one graphic element.

[0114] In some embodiments, if the graphic element is a vertical swimlane diagram, the first axial coordinate is the horizontal coordinate in the first reference position, and the second axial coordinate is the vertical coordinate in the first reference position. The processor 401 is further configured to: obtain the difference between the vertical coordinate in the first reference position and half the height of the graphic element, and use the difference as the vertical coordinate in the second reference position of the graphic element.

[0115] In some embodiments, if the graphic element is a horizontal swimlane diagram, the first axial coordinate is the vertical coordinate in the first reference position, and the second axial coordinate is the horizontal coordinate in the first reference position. The processor 401 is further configured to: take the difference between the horizontal coordinate in the first reference position and half the width of the graphic element as the horizontal coordinate in the second reference position of the graphic element.

[0116] In some embodiments, the processor 401 is further configured to: determine the position identified by the first axial coordinate of the graphic element in the second reference position and the second axial coordinate in the second reference position as the second reference position of the graphic element in the second display system.

[0117] In some embodiments, the size of each graphic element includes the height and width of the corresponding graphic element. If the second reference position of each graphic element indicates the center of the corresponding graphic element, the processor 401 is further configured to: for any graphic element, determine the horizontal axis coordinate in the second reference position of the graphic element as the horizontal axis coordinate of the upper connection point and the lower connection point of the graphic element; subtract half the height of the graphic element from the vertical axis coordinate in the second reference position of the graphic element as the vertical axis coordinate of the upper connection point of the graphic element, and add half the height of the graphic element to the vertical axis coordinate in the second reference position of the graphic element as the vertical axis coordinate of the lower connection point of the graphic element; determine the vertical axis coordinate in the second reference position of the graphic element as the vertical axis coordinate of the left connection point and the right connection point of the graphic element; subtract half the width of the graphic element from the horizontal axis coordinate in the second reference position of the graphic element as the horizontal axis coordinate of the left connection point of the graphic element, and add half the width of the graphic element to the horizontal axis coordinate in the second reference position of the graphic element as the horizontal axis coordinate of the right connection point of the graphic element.

[0118] In some embodiments, the point graphics of the connection points of each graphic element are located above the frame line of the graphic element. The processor 401 is further configured to: in a two-dimensional coordinate system, for any connection point among the at least one connection point, add a preset pixel difference to the pixel value of the point graphics of the connection point in the axial direction perpendicular to the target frame line, wherein the target frame line refers to the frame line of the graphic element where the connection point is located.

[0119] In some embodiments, the processor 401 is further configured to: if the point graphic of the connection point is located on the frame line of the horizontal axis of the graphic element, then increase the pixel value of the point graphic of the connection point on the vertical axis by a preset pixel difference; or, if the point graphic of the connection point is located on the frame line of the vertical axis of the graphic element, then increase the pixel value of the point graphic of the connection point on the horizontal axis by a preset pixel difference.

[0120] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described data conversion method.

[0121] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).

[0122] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0123] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0124] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0125] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0126] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0127] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0128] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0130] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.

Claims

1. A data conversion method, characterized in that, The method includes: The graphic to be converted is parsed to obtain the attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. The first reference position refers to the reference position of the graphic element in the first display system. The first display system refers to the system that generates the graphic to be converted. Based on the format conversion rules between the first display system and the second display system, the second reference position of each graphic element in the second display system is obtained, corresponding to the first reference position of the graphic element. The position of the connection point of the graphic element is determined based on the second reference position and size of each graphic element; Based on the position of the connection point of each graphic element, configure the connection information of at least one connection point with a connection relationship. The at least one connection point with a connection relationship refers to the connection point in the graphic to be converted that is connected to the connected graphic element. Based on the second reference position and size of each graphic element, and the connection information of the at least one connection point, graphic data matching the second display system is generated so as to display the same graphic as the graphic to be converted in the second display system.

2. The data conversion method according to claim 1, characterized in that, The first reference position and the second reference position of each graphic element are represented by the horizontal and vertical coordinates of a two-dimensional coordinate system. Obtaining the second reference position in the second display system corresponding to the first reference position of each graphic element includes: For a given graphic element, the first axial coordinate in the first reference position of the graphic element is used as the first axial coordinate in the second reference position of the graphic element; According to the format conversion rules, the second axial coordinate in the first reference position of the graphic element is obtained, which corresponds to the second axial coordinate in the second reference position.

3. The data conversion method according to claim 2, characterized in that, If the graphic element is a graphic element of a basic flowchart, then the first axial coordinate is the horizontal axis coordinate in the first reference position, and the second axial coordinate is the vertical axis coordinate in the first reference position. Obtaining the second axial coordinate of the graphic element in the first reference position corresponding to the second axial coordinate in the second reference position includes: The sum of the difference between the largest first ordinate and the ordinate at the first reference position, and the smallest first ordinate, is used as the ordinate at the second reference position of the graphic element. Wherein, the largest first ordinate refers to the first ordinate with the largest value among all the first ordinates corresponding to the graphic to be converted, the smallest first ordinate refers to the first ordinate with the smallest value among all the first ordinates corresponding to the graphic to be converted, all the first ordinates corresponding to the graphic to be converted refer to the ordinates among all the first reference positions corresponding to the graphic to be converted, and all the first reference positions corresponding to the graphic to be converted refer to the first reference positions of the at least one graphic element.

4. The data conversion method according to claim 2, characterized in that, If the graphic element is a vertical swimlane diagram, then the first axial coordinate is the horizontal coordinate in the first reference position, and the second axial coordinate is the vertical coordinate in the first reference position. Obtaining the second axial coordinate in the first reference position corresponding to the second axial coordinate in the second reference position includes: The difference between the vertical coordinate of the graphic element in the first reference position and half the height of the graphic element is used as the vertical coordinate of the graphic element in the second reference position.

5. The data conversion method according to claim 2, characterized in that, If the graphic element is a horizontal swimlane diagram, then the first axial coordinate is the vertical coordinate in the first reference position, and the second axial coordinate is the horizontal coordinate in the first reference position. Obtaining the second axial coordinate of the graphic element in the first reference position corresponding to the second axial coordinate in the second reference position includes: The difference between the horizontal axis coordinate in the first reference position and half the width of the graphic element is used as the horizontal axis coordinate of the graphic element in the second reference position.

6. The data conversion method according to any one of claims 3-5, characterized in that, After obtaining the second axial coordinate of the second reference position of the graphic element based on the second axial coordinate of the first reference position of the graphic element, the method further includes: The position identified by the first axial coordinate and the second axial coordinate of the graphic element in the second reference position is determined as the second reference position of the graphic element in the second display system.

7. The data conversion method according to claim 6, characterized in that, The dimensions of each graphic element include its height and width. If the second reference position of each graphic element indicates its center, for any graphic element, determining the position of the connection point of the graphic element based on its second reference position and dimensions includes: The horizontal coordinates in the second reference position of the graphic element are determined as the horizontal coordinates of the upper and lower connection points of the graphic element; The difference between the vertical coordinate of the second reference position of the graphic element and half the height of the graphic element is used as the vertical coordinate of the upper connection point of the graphic element, and the sum of the vertical coordinate of the second reference position of the graphic element and half the height of the graphic element is used as the vertical coordinate of the lower connection point of the graphic element. The vertical coordinates of the second reference position of the graphic element are determined as the vertical coordinates of the left and right connection points of the graphic element; The difference between the horizontal coordinate of the second reference position of the graphic element and half the width of the graphic element is used as the horizontal coordinate of the left connection point of the graphic element, and the sum of the horizontal coordinate of the second reference position of the graphic element and half the width of the graphic element is used as the horizontal coordinate of the right connection point of the graphic element.

8. The data conversion method according to claim 7, characterized in that, The point locations of the connection points of each graphic element are located above the frame of the graphic element. The step of configuring connection information for at least one connection point with a connection relationship based on the position of the connection points of each graphic element includes: In a two-dimensional coordinate system, for any of the at least one connection points, a preset pixel difference is added to the pixel value of the point graphic of the connection point in the axial direction perpendicular to the target frame line, where the target frame line refers to the frame line of the graphic element where the connection point is located.

9. The data conversion method according to claim 8, characterized in that, Adding a preset pixel difference to the pixel values ​​of the connection point's point graph in the axial direction perpendicular to the target frame line, including: If the point graphic of the connection point is located within the frame line of the graphic element along the horizontal axis, then the pixel value of the point graphic of the connection point along the vertical axis is increased by a preset pixel difference; or, If the point graphic of the connection point is located on the frame line of the vertical axis of the graphic element, then the pixel value of the point graphic of the connection point on the horizontal axis is increased by a preset pixel difference.

10. A data conversion device, characterized in that, The device includes: The parsing module is used to parse the graphic to be converted and obtain the attribute information of at least one graphic element contained in the graphic to be converted. The attribute information of each graphic element includes the size of the graphic element and the first reference position of the graphic element. The first reference position refers to the reference position of the graphic element in the first display system. The first display system refers to the system that generates the graphic to be converted. The obtaining module is used to obtain the second reference position in the second display system corresponding to the first reference position of each graphic element according to the format conversion rules between the first display system and the second display system; A determination module is used to determine the position of the connection point of the graphic element based on the second reference position and size of each graphic element; The configuration module is used to configure the connection information of at least one connection point with a connection relationship according to the position of the connection point of each graphic element. The at least one connection point with a connection relationship refers to the connection point in the graphic to be converted that is connected to the connected graphic element. The drawing module is used to generate graphic data that matches the second display system based on the second reference position and size of each graphic element and the connection information of the at least one connection point, so as to display the same graphic as the graphic to be converted in the second display system.

11. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the data conversion method as described in any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the data conversion method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Display method and device, electronic equipment and storage medium

    CN112269620A