Disclosure of Invention
The invention aims to provide a method, a system, electronic equipment and a medium for generating a flow chart with a suspension prompt aiming at the problems of the conventional method for supplementing information in the flow chart drawing process, so that the suspension prompt information can be conveniently presented in a flow chart file in a webpage format after being edited on a Microsoft Office Visio software interface.
To achieve the object of the present invention, an embodiment of a first aspect of the present invention provides a method for generating a flowchart with a hover prompt, including the following steps:
s1, selecting a flow picture frame body object needing to display suspension prompt information in an editing interface of Microsoft Office Visio software, and setting the name number of the flow picture frame body object needing to display the suspension prompt information according to a preset number rule;
s2, editing the shape data of the flow chart frame object, and writing the suspension prompt information expected to be displayed into the shape data of the flow chart frame object needing to display the suspension prompt information;
s3, storing the Microsoft Office Visio flow chart file edited in the S2 as a webpage, and generating a webpage file for opening a link and an engineering file directory for storing webpage information;
s4, acquiring a data.xml file under the engineering file directory, and acquiring the suspension prompt information of the corresponding flow drawing frame object in the data.xml file according to the name number of the flow drawing frame object needing to display the suspension prompt information;
s5, acquiring a gif _. htm file corresponding to the flow frame body object under the project file directory, replacing the suspension prompt information of the corresponding flow frame body object in the corresponding gif _. htm file with the suspension prompt information of the corresponding flow frame body object acquired in the S4, and generating a new gif _. htm file; wherein, is a natural number greater than 0;
s6, replacing gif _ htm files in the project file directory generated in the S3 with the new gif _ htm files generated in the S5.
Wherein the setting of the name number of the flow drawing frame body object in S1 specifically includes:
setting the name content of the special part in the flow chart box body object format, and setting the name content as a name number according to a preset numbering rule.
Wherein, the step S4 specifically includes:
s4.1, acquiring a data.xml file under the engineering file directory;
s4.2, identifying all flow chart webpage file page number information, name number information of a flow chart frame object and suspension prompt information in shape data of the flow chart frame object in the data.xml file;
wherein, a page of flow chart in the Microsoft Office Visio flow chart file correspondingly generates a webpage, and each webpage has a page number;
and S4.3, acquiring the suspension prompt information of the corresponding flow chart frame body object in the data.xml file according to the name number of the flow chart frame body object needing to display the suspension prompt information.
In S4.2, a preset first regular expression is specifically used to retrieve and identify page number information of a flow chart file in a data.xml file under the project file directory, name number information of a flow chart frame object, and suspension prompt information in shape data of the flow chart frame object.
Wherein, the step S5 specifically includes:
s5.1, acquiring page number information of a flow chart file of a corresponding flow chart frame object in the data.xml file;
s5.2, acquiring a gif _ htm file corresponding to the page number information of the flow chart file under the project file directory according to the page number information of the flow chart frame body corresponding to the data.xml file; wherein, corresponds to the webpage number;
s5.3, identifying page number information, name number information in frame content and suspension prompt information of all flow frame objects in the corresponding gif _ htm file;
s5.4, determining the corresponding flow picture frame body object in the corresponding gif _. htm file according to the page number information of the flow picture frame body object and the name number information in the frame body content;
and S5.5, replacing the suspension prompt information of the corresponding flow picture frame object in the corresponding gif _ htm file with the suspension prompt information of the corresponding flow picture frame object in the data.xml file acquired in the S4.3, and generating a new gif _ htm file.
In S5.3, a preset second regular expression is specifically used to retrieve and identify page number information, name number information, and suspension prompt information of the flow frame body object in the corresponding gif _ htm file.
An embodiment of a second aspect of the present invention provides a system for generating a flowchart with a floating prompt, including:
the system comprises a first editing module, a second editing module and a display module, wherein the first editing module is used for selecting a flow picture frame body object needing to display suspension prompt information in an editing interface of Microsoft Office Visio software, and setting the name number of the flow picture frame body object needing to display the suspension prompt information according to a preset number rule;
the second editing module is used for editing the shape data of the flow chart frame object, and writing the suspension prompt information to be displayed into the shape data of the flow chart frame object needing to display the suspension prompt information to obtain a Microsoft Office Visio flow chart file;
the first information processing module is used for storing the Microsoft Office Visio flow chart file as a webpage, and generating a webpage file for opening a link and an engineering file directory for storing webpage information;
the second information processing module is used for acquiring a data.xml file under the engineering file directory and acquiring the suspension prompt information of a corresponding flow picture frame body object in the data.xml file according to the name number of the flow picture frame body object needing to display the suspension prompt information;
a third information processing module, configured to obtain a gif _. htm file corresponding to the flow frame object under the project file directory, replace the suspension prompt information of the corresponding flow frame object in the gif _. htm file with the suspension prompt information of the corresponding flow frame object obtained by the second information processing module, and generate a new gif _. htm file; wherein, is a natural number greater than 0;
and the fourth information processing module is used for replacing gif _ htm in the project file directory generated by the first information processing module with a new gif _ htm file generated by the third information processing module. The second information processing module adopts a preset first regular expression to obtain suspension prompt information of a flow picture frame object corresponding to a name code in the data.xml file; and the third information processing module acquires suspension prompt information of the corresponding flow picture frame body object in the corresponding gif _.
An embodiment of the third aspect of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the method for generating a flowchart with a hover prompt according to the embodiment of the first aspect of the present invention.
In a fourth aspect, the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, where the computer program is executable by a processor to perform a method for generating a flowchart with a hover hint according to the first aspect of the present invention.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
1) in the prior art, the 'comment' information occupies an editing layout; the embodiment of the invention automatically generates the effect of 'floating prompt', and only when the mouse is hovered on the flow picture frame body object, the 'floating prompt' information can be displayed on the flow picture web interface;
2) in the prior art, redundant information is added to 'note', so that the appearance of a layout is influenced; the supplementary information of the embodiment of the invention can be embodied in the 'floating prompt' information, so that the content of the frame body can be simplified as much as possible;
3) in the prior art, "comment" information can not automatically move along with a frame body, and is difficult to maintain and edit; the embodiment of the invention utilizes the shape data of the flow chart to edit the floating information, thereby greatly facilitating the modification and maintenance of drawing personnel and freely defining the information format;
4) in the prior art, the shape screen prompt cannot be presented in a webpage file, and the issue of a flow file is influenced; the embodiment of the invention realizes the 'suspension prompt' function of the flow chart webpage file.
5) The embodiment of the invention can make the drawing form of the flow chart clearer and more hierarchical, provide the user with concise and brief sequence relation and logical relation, and simultaneously display more detailed and specific description information to the user through 'suspension prompt', greatly improve the convenience and consistency of the user for reading the flow chart, and contribute to the cognition and the propagation of the connotation of the flow chart.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
In addition, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present invention. It will be understood by those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the invention.
As shown in fig. 5, an embodiment of the present invention provides a method for generating a flowchart with a floating prompt, including the following steps:
s1, selecting a flow picture frame object needing to display suspension prompt information in an editing interface of Microsoft Office Visio software, and setting the name number of the flow picture frame object needing to display the suspension prompt information according to a preset number rule.
Specifically, the preset numbering rule in step S1 should satisfy the basic requirement that program language identification can be realized in the following steps S5 and S6. For example, the "name" numbering rule may be defined as "alphanumeric: number-number ", the regular expression for the corresponding program language is: w \ d \\ \ d- \ d- \\.
And S2, editing the shape data of the flow chart frame object, and writing the suspension prompt information expected to be displayed into the shape data of the flow chart frame object needing to display the suspension prompt information.
Specifically, editing the shape data of the flow diagram box object in S2 specifically includes, on the Microsoft Office Visio flow diagram box object, right-clicking a pull-down menu, selecting "data-shape data", and editing "shape data"; wherein, the shape data firstly needs to click the definition option to define the attribute of the shape data, so as to ensure that S5 can correctly identify the content which can be replaced. For example, an item of "shape data" is defined, a "tag (L)" of the "shape data" is a "job description", a "name (N)" of the "name (N)" is "Practice", a "type (T)" of the "type (T)" is a "character string", and the like, a "value (V)" of the "shape data" can be set after setting a basic attribute, that is, information required to implement a "floating alert" function, where the "name (N)" is a unique identifier in a data. xml file and is an associated attribute of a Visio and a web page file, as shown in fig. 6, and fig. 6 is an operation interface of a version of Microsoft Office Visio 2007 software.
And S3, storing the Microsoft Office Visio flow chart file edited in the S2 as a webpage, and generating a webpage file for opening a link and an engineering file directory for storing webpage information.
Specifically, the "file" is clicked in the menu bar of Microsoft Office Visio software, and the "file" is saved as the web page (G) …, and the flowchart file is saved in the specified path in the form of the web page. After the saving is completed, a webpage file (htm is a file suffix) for opening a link and an engineering file directory (files is a file suffix) for saving webpage information are included.
And S4, acquiring the data.xml file under the engineering file directory, and acquiring the suspension prompt information of the corresponding flow drawing frame object in the data.xml file according to the name number of the flow drawing frame object needing to display the suspension prompt information.
And S5, acquiring a gif _ htm file corresponding to the flow picture frame object under the project file directory, replacing the suspension prompt information of the corresponding flow picture frame object in the corresponding gif _ htm file with the suspension prompt information of the corresponding flow picture frame object acquired in the S4, and generating a new gif _ htm.
Wherein, a natural number is greater than 0, and if the flow chart has 3 pages, a plurality of gif _1.htm, gif _2.htm and gif _3.htm are correspondingly generated.
S6, replacing gif _. htm in the project file directory generated in the S3 with the new gif _. htm file generated in the S5.
In an example, the effect of displaying the floating prompt information in the flowchart file in the web page format achieved by using the method of the embodiment of the present invention is as shown in fig. 7, where C1 and C2 are numbers of frame objects of the flowchart respectively, and the floating prompt information is "adopting the method of the present invention, it can be supported that differentiated information different from frame contents is embodied in the flowchart file in the web page format".
In a preferred embodiment, the steps S4-S6 in the first embodiment may be implemented by using an automation M script, which means that an automation program script is developed in M language in MATLAB software to implement the file processing function of step S6, including reading and saving a file, parsing and modifying a character string, and the like. It should be noted that, in the first embodiment, the steps S4-S6 may also be implemented by other script programs supporting text processing, such as C/C + +, python, and the like.
Therefore, in the method of the first embodiment of the present invention, steps S1-S3 need to be manually edited in Microsoft Office Visio software, and after the corresponding program script is manually developed, steps S4-S6 can be automatically completed by executing the program script. The method of the embodiment of the invention comprehensively utilizes the flow chart editing function of Microsoft Office Visio software and the automatic program script such as the M language script of MATLAB software and the like by searching the name number and the shape data of the flow chart frame object, realizes the flow chart webpage file with the suspension prompt and improves the expression form of the flow chart.
Wherein the setting of the name number of the flow drawing frame body object in S1 specifically includes:
setting the name content of the special part in the frame object format of the flow chart, and setting the name content as a corresponding name number according to a preset numbering rule. Referring specifically to fig. 8-9, fig. 8-9 are schematic diagrams of a set name numbering process using Microsoft Office Visio 2007 version software. The special portion is "special (E)" shown in fig. 8, the name content is "name (N)" shown in fig. 9, and the name number is specifically set to "flow.5" in fig. 9. In this embodiment, the purpose of the step S1 is to facilitate the following step S4 to correctly search the floating prompt information for identifying the flow frame object according to the name number.
As shown in fig. 10, the step S4 specifically includes:
s4.1, acquiring data.xml files under the engineering file directories (files);
s4.2, identifying all flow chart webpage file page number information, name number information of a flow chart frame object and suspension prompt information in shape data of the flow chart frame object in the data.xml file;
when the Microsoft Office Visio flow chart file is saved as a webpage, a webpage (gif _ html file) is generated correspondingly by a flow chart in the Microsoft Office Visio flow chart file, and each webpage has a page number;
and S4.3, acquiring the suspension prompt information of the corresponding flow picture frame body object in the data.xml file according to the name number (namely the name number set in the S1) of the flow picture frame body object needing to display the suspension prompt information.
In S4.2, a preset first regular expression is specifically used to retrieve and identify page number information of a flow chart file, name number information of a flow chart frame object, and floating prompt information in shape data of the flow chart frame object in the data.
Specifically, the first regular expression includes the following:
1) the page number expression:
'<Page\sID="([^"]+)"\sName="([^"]+)"\sNameU="([^"]+)".*>'
example (c): the procedure of developing finished vehicles is as follows: c0"NameU ═ vehicle development process >
The following examples are given: the page number is 3, and the name of the flow chart is that: c0", the label automatically created by visio when the flowchart is created for the first time is" whole vehicle development flow ".
2) The name number expression of the flow picture frame body object:
<Shape\sID="([^"]+)"\sUniqueID="[^"]+"\sName="([^"]+)"\sNameU="([^"]+)".*>'
example (c): < Shape ID ═ 25 ═ UniqueID ═ { B4a327B0-A6E6-44E4-BB39-C19F62CF073D } "Name ═ a1:1-2-3" Name ═ a1:1-2-3"Master ═ 0" >)
The following examples are given: the name number of the flow diagram box object is "A1: 1-2-3".
3) Shape data expression:
'<Prop\sID="([^"]+)"\sName="([^"]+)"\sNameU="([^"]+)".*>'
example (c): < Prop ID ═ 1 ═ Name ═ Practice >
The examples illustrate that: here, the "name" of the "shape data" is "Practice".
4) Expression of "value (V)" in shape data:
'<Value\sUnit="STR">'
example (c): the invention provides a flow chart method (Value) < STR >
The examples illustrate that: the content of "value (V)" here is "the present invention provides a flowchart method".
As shown in fig. 11, the step S5 specifically includes:
s5.1, acquiring page number information of a flow chart file of a corresponding flow chart frame object in the data.xml file;
s5.2, acquiring a gif _ htm file corresponding to the page number information of the flow chart file under the project file directory according to the page number information of the flow chart frame body corresponding to the data.xml file; wherein, corresponds to the webpage number;
s5.3, identifying page number information, name number information in frame content and suspension prompt information of all flow frame objects in the corresponding gif _ htm file;
s5.4, determining the corresponding flow picture frame body object in the corresponding gif _. htm file according to the page number information of the flow picture frame body object and the name number information in the frame body content;
and S5.5, replacing the suspension prompt information of the corresponding flow frame body object in the corresponding gif _.
In S5.3, a preset second regular expression is specifically used to retrieve and identify page number information, name number information, and suspension prompt information of the flow frame body object in the corresponding gif _ htm file.
The preset second regular expression comprises the following contents:
page number expression:
'var\spageID\s=\s(\d+);'
example (c): var pageID is 3;
the examples illustrate that: page number is "3"
2) Frame content and "floating cue" expression:
'ALT="[^"]+".*origTitle="([^"]+)".*TITLE="([^"]+)".*target="[^"]+"'
the frame content refers to a part followed by the attribute tag origTitle, and the floating prompt refers to a part followed by the attribute tag TITLE.
The frame content of the flow chart frame object comprises a corresponding name number.
Example (a): the present invention provides a flowchart method of "HREF ═ gif ═ poly" binddex ═ "1" ALT ═ "a1:1-2-3 frame content" origtile ═ "a1:1-2-3 frame content" tlle ═ "htm ═ target ═" frmDrawing "COORDS ═"95,360,170, 322,95,360 "onmouseOver:" UpdateTooltip (this,4,60) "onfocus ═" UpdateTooltip (this,4,60) "return sharp ═ 4, 60)"; "onkeyup ═ onsharekey (4, 60); ">", in the specification of a sample
The examples illustrate that: the above is the actual content of the gif _. htm file.
3) The box object "name" numbering expression (depending on the numbering rule of step S1):
'(\w\d+(:\d+)?(-\d+)?)'
the above expression is "alphanumeric: number-number ".
It should be noted that the regular expression is a general method for text processing, and is preferably implemented by M-script in the embodiment.
As shown in fig. 12, a second embodiment of the present invention provides a system for generating a flowchart with a floating prompt, including:
the first editing module 1 is used for selecting a flow picture frame body object needing to display suspension prompt information in an editing interface of Microsoft Office Visio software, and setting the name number of the flow picture frame body object needing to display the suspension prompt information according to a preset numbering rule;
the second editing module 2 is configured to edit the shape data of the flow chart box object, and write the floating prompt information desired to be displayed into the shape data of the flow chart box object needing to display the floating prompt information, so as to obtain a Microsoft Office Visio flow chart file;
the first information processing module 3 is used for storing the Microsoft Office Visio flow chart file as a webpage, and generating a webpage file for opening a link and an engineering file directory for storing webpage information;
the second information processing module 4 is configured to obtain a data.xml file under the engineering file directory, and obtain the suspension prompt information of the corresponding flow drawing frame object in the data.xml file according to the name number of the flow drawing frame object needing to display the suspension prompt information;
a third information processing module 5, configured to obtain a gif _ htm file corresponding to the flow frame object under the project file directory, replace the suspension prompt information of the corresponding flow frame object in the gif _ htm file with the suspension prompt information of the corresponding flow frame object obtained by the second information processing module, and generate a new gif _ htm file; wherein, is a natural number greater than 0;
and the fourth information processing module 6 is configured to replace the gif _.
The second information processing module 4 acquires suspension prompt information of a flow picture frame object corresponding to a name code in the data.xml file by adopting a preset first regular expression; the third information processing module 5 obtains the suspension prompt information of the corresponding flow frame body object in the gif _ htm file by using a preset second regular expression.
For the system disclosed in the second embodiment, since it corresponds to the method disclosed in the first embodiment, reference may be made to the description of the method for the relevant points, and details are not repeated here.
As shown in fig. 13, a third embodiment of the present invention provides an electronic device 200, which includes a memory 201, a processor 202, and a computer program 203 stored in the memory 201 and executable on the processor 202, where when the processor 202 executes the program 203, the method for generating a flowchart with a floating alert according to the first embodiment is implemented.
It should be noted that the foregoing explanation on the method of the embodiment is also applicable to the electronic device of the third embodiment, and the implementation principle is similar, which is not described herein again.
The fourth embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is executable by a processor to perform a method for generating a flowchart with a floating alert according to the first embodiment of the present invention.
It should be noted that the foregoing explanation of the method of the embodiment is also applicable to the computer readable storage medium of the fourth embodiment, and the implementation principle thereof is similar and will not be described herein again.
As can be seen from the above description of the embodiments:
1) in the prior art, the 'comment' information occupies an editing layout; the embodiment of the invention automatically generates the effect of 'suspension prompt', and only when the mouse is hovered on the flow picture frame body object, the 'suspension prompt' information is displayed on the webpage interface of the flow picture;
2) in the prior art, redundant information is added to 'note', so that the attractiveness of the layout is influenced; the supplementary information of the embodiment of the invention can be embodied in the 'floating prompt' information, so that the content of the frame body can be simplified as much as possible;
3) in the prior art, "comment" information cannot automatically move along with a frame body, and is difficult to maintain and edit; the embodiment of the invention utilizes the shape data of the flow chart to edit the floating information, thereby greatly facilitating the modification and maintenance of drawing personnel and freely defining the information format;
4) in the prior art, the shape screen prompt cannot be presented in a webpage file, and the issue of a flow file is influenced; the embodiment of the invention realizes the suspension prompting function of the flow chart webpage file.
5) The embodiment of the invention can make the drawing form of the flow chart clearer and more hierarchical, provides the user with concise and brief sequence relation and logical relation, and simultaneously can show the user more detailed and specific description information through the suspension prompt, thereby greatly improving the convenience and consistency of reading the flow chart by the user and being beneficial to the cognition and the propagation of the connotation of the flow chart.
In the description of the present specification, different embodiments or examples and features of different embodiments or examples described in the specification may be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of embodiments of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.