Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of an annotation method according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101, calling a plan and a safety element mark set from a database according to a received calling instruction, and respectively displaying the plan and the safety element mark set in respective corresponding preset areas;
102, moving the safety element marks in the safety element mark set into a plan view along a dragging track according to the obtained dragging operation so as to cover corresponding areas in the plan view;
and 103, storing all the safety element marks in the plan view according to the received storage instruction so as to realize the marking of the plan view.
It should be noted that the plan view mentioned in the embodiment of the present invention may be a map or an internal area schematic view of public places such as schools, units, and shopping malls. Due to the large number of people in the public places, once a safety accident occurs, situations such as execution confusion or misoperation can happen inevitably in the process of personnel evacuation or accident handling of emergency personnel. For better personnel evacuation or accident handling, it is important to label the map or the interior area schematic diagram of the public place in advance, for example, if the staff in the public place learns the label diagram in advance, or even compares the label diagram with the scene to perform personnel evacuation or accident handling work when an accident occurs, the whole scene work will be performed in a non-turbulent manner, and the consequences caused by the accident are greatly reduced. The embodiment of the invention provides a labeling method and a labeling system aiming at the labeling process, and the detailed description is carried out.
Specifically, the method can be executed by intelligent devices such as a mobile terminal, a tablet computer and a computer. The method will be described with the intelligent device, preferably a computer, performing the method. The computer receives a calling instruction of a user, calls a plan and a security element mark set from the database, and respectively displays the plan and the security element mark set in a first area and a second area, so that the user can select any security element mark from the security element mark set in the second area through a mouse and drag the security element mark set to the plan of the first area, wherein the first area and the second area are two areas without intersection in a webpage. It will be appreciated that dragging a security element tag into the plan view will overlay the corresponding area of the plan view. If the computer receives a storage instruction of a user, all the safety element marks in the plan view are stored in the plan view so as to realize the marking of the plan view.
The method provided by the embodiment of the invention abandons the traditional method for marking on the drawing, simplifies the operation of marking the safety elements, enables a user to quickly mark the plane graph on the webpage, and enables the marking operation to be more flexible by dragging the mouse, thereby improving the user experience.
Based on the above embodiment, according to the received call instruction, the plan view and the security element mark set are called from the database and are respectively displayed in the corresponding preset areas, and the method further includes:
recording basic information of each security element mark;
binding each safety element mark with the basic information of the safety element mark to enable each safety element mark to carry the basic information of the safety element mark;
and storing a plurality of security element marks carrying basic information into a database as a security element mark set.
Specifically, before labeling the plan view, basic information of the security element label may be set on a computer through online input, a CSS file, or a Config file, wherein the basic information includes a type, a paraphrase, and a constraint. It should be noted that the types are the types to which the safety element marks belong, such as safety risk types (e.g. a substation, a distribution room), safety hazard types (e.g. an elevator is not patrolled and maintained on time) and emergency material types (e.g. a fire extinguisher), etc.; paraphrasing is the specific meaning represented by the security element indicia; the constraint conditions are dependence and mutual exclusion relations of the safety element marks, for example, the position distances between the mutually exclusive safety element marks cannot be adjacent, and the safety risk safety element marks need to be provided with corresponding emergency material safety element marks.
And binding each safety element mark with the basic information of the safety element mark, so that each safety element mark carries the basic information of the safety element mark. And storing a plurality of security element marks carrying basic information into a database as a security element mark set. So that the user can retrieve the security element mark set from the database when labeling the plan graph subsequently. It can be understood that, since each secure element tag in the secure element tag set carries its own basic information, the user can view the basic information carried by the secure element tag during the tagging process, so as to reduce the error rate of tagging.
According to the method provided by the embodiment of the invention, basic information such as the type, explanation and restriction conditions of the safety element mark is set on a computer through online input, a CSS (cascading style sheets) file or a Config file, and the basic information and the safety element mark are bound and then stored in a database, so that a user can check the basic information carried by the safety element mark in the subsequent process of marking a plan view, and the error rate of marking is reduced.
Based on the above embodiment, according to the received saving instruction, saving all the secure element marks located in the plan view to implement labeling of the plan view, and then further including:
the floor plan, all the secure element marks, and the location coordinates of each secure element mark relative to the floor plan are saved to a database.
Specifically, if the computer receives a save instruction from the user, the plan view, all the secure element marks, and the position coordinates of each secure element mark relative to the plan view are saved in the database, so that the plan view is opened again next time to directly display the secure element marks in the plan view.
According to the method provided by the embodiment of the invention, if the computer receives the storage instruction of the user, the plan, all the safety element marks and the position coordinates of each safety element mark relative to the plan are stored in the database, so that the plan is opened next time and the safety element marks are directly displayed in the plan, and the user experience is improved.
Based on the foregoing embodiment, the method provided in the embodiment of the present invention further includes:
and clearing at least one safety element mark positioned in the plan view according to the received reset instruction.
Specifically, the annotator can select one, a plurality of or all of the security element marks and perform a reset operation, for example, when the computer determines that a certain security element mark needs to be reset, the reset security element mark is cleared.
Based on the foregoing embodiment, the method provided in the embodiment of the present invention further includes:
and if the cursor is judged and known to be in the preset area where the safety element mark is located, displaying the basic information of the safety element mark.
Specifically, the preset area may be set in advance, and only when the computer determines that the cursor of the mouse is located in the preset area where the security element mark is located, the type, definition, constraint condition, and the like of the security element mark may be displayed in the web page.
Based on the foregoing embodiment, the method provided in the embodiment of the present invention moves the secure element tag in the secure element tag set into the plan view along the dragging track according to the obtained dragging operation, and further includes:
acquiring a first position coordinate of the plan;
calculating a second position coordinate of the safety element mark in real time in the process of moving the safety element mark to the plane graph along the dragging track;
and when the dragging is judged and known to be completed, if the position relation between the second position coordinate of the safety element mark and the first position coordinate of the plan does not meet the preset condition, adaptively adjusting the second position coordinate of the safety element mark so as to enable the safety element mark to be positioned in the plan.
It should be noted that the first position coordinate includes a first horizontal coordinate of the left side edge, a second horizontal coordinate of the right side edge, a first vertical coordinate of the top edge, and a second vertical coordinate of the bottom edge, and the second position coordinate includes a horizontal coordinate and a vertical coordinate.
During the labeling process, the position coordinates of the plan view and the position coordinates of the dragged safety element mark need to be calculated and compared in real time to ensure that the safety element mark is moved into the plan view.
The preset condition means that the horizontal coordinate is between the first horizontal coordinate and the second horizontal coordinate, and the vertical coordinate is between the first vertical coordinate and the second vertical coordinate.
According to the method provided by the embodiment of the invention, the position coordinate of the plan view and the position coordinate of the dragged safety element mark are compared in real time in the dragging process, so that the safety element mark is prevented from being placed in an area outside the plan view due to errors in the operation process of a marking person on the plan view.
Based on the foregoing embodiment, the method provided in the embodiment of the present invention is a method for adaptively adjusting a second position coordinate of a security element mark if a position relationship between the second position coordinate of the security element mark and a first position coordinate of a plan view does not satisfy a preset condition, and the method further includes:
if the horizontal coordinate is smaller than the first horizontal coordinate, taking the first horizontal coordinate as the horizontal coordinate of the safety element mark;
if the horizontal coordinate is larger than the second horizontal coordinate, taking the second horizontal coordinate as the horizontal coordinate of the safety element mark;
if the vertical coordinate is smaller than the first vertical coordinate, taking the first vertical coordinate as the vertical coordinate of the safety element mark;
and if the vertical coordinate is larger than the second vertical coordinate, taking the second vertical coordinate as the vertical coordinate of the safety element mark.
Specifically, in the process of dragging the safety element mark, a horizontal coordinate (lmin) of the left side of the parent element (plan view) from the current window and a horizontal coordinate (lmax) of the right side of the parent element from the current window are calculated, and a vertical coordinate (tmin) of the top side of the parent element from the current window and a vertical coordinate (tmax) of the bottom side of the parent element from the current window are also calculated. Then respectively and continuously calculating the horizontal coordinate (l) and the vertical coordinate (t) of the dragged safety element mark relative to the distance between the left side edge and the top edge and the current window, and finally continuously comparing whether the value of the dragged element l is between lmin and lmax, if l is smaller than lmin, assigning the value of lmin to l, and if l is larger than lmax, assigning the value of lmax to l to ensure that the horizontal distance of the dragged safety element mark does not separate from the left side and the right side of the parent element; and continuously comparing whether the value of t is between tmin and tmax, if t is smaller than tmin, assigning tmin to t, and if t is larger than tmax, assigning tmax to t, so as to ensure that the dragged safety element mark does not depart from the parent element in the vertical distance. The two calculation methods are carried out simultaneously, and the dragged safety element mark is prevented from being separated from the plan view.
Based on the above embodiments, the method provided by the embodiments of the present invention is further described below by specific examples, and fig. 2 is a flowchart of a labeling method provided according to another embodiment of the present invention, as shown in fig. 2, the whole flow of the method is described by taking a user to mark a plan view through a computer as an example:
1) basic information of the security element mark is preset, wherein the basic information comprises types, paraphrases and constraint conditions.
2) And opening the security element mark-up labeling page by using the browser.
3) A plan view and a security element label are obtained.
4) Clicking on the secure element tag looks at the detailed information represented by the tag.
5) And dragging the various safety element marks to the corresponding positions of the plane graph by using a mouse.
6) And clicking to store the safety element marks on the plan to form a labeled graph, and storing the plan, all the safety element marks and the position coordinates of each safety element mark relative to the plan into a database.
7) Clicking to reset, emptying all the safety element marks on the plan and simultaneously restoring the marks to the positions to be used.
8) The marked plan can control the size of the plan by using a mouse wheel, and the basic information marked by the safety elements can be checked;
a) the security elements include risk elements of various risk types;
b) the safety element marks in the steps 3) and 4) correspond to a type and basic information thereof;
c) the step 5) comprises the following specific processes:
i. clicking the safety element mark through a mouse and dragging the safety element mark into a plane graph range;
calculating the distance of the safety element mark relative to the boundary of the plan view while dragging the safety element mark in the plan view, and ensuring that the safety element is always within the range of the plan view;
dragging the safe element mark to the position to be represented, releasing the mouse to place the mark on the plan view, simultaneously calculating the distance of the safe element relative to the upper boundary and the left boundary of the plan view, and storing the data.
After the safety element mark is put down, the position can be changed by continuously clicking and dragging;
d) the saving process in step 6) saves the position of the various security element markers stored in step 5) relative to the boundaries of the plan view and the unique markers of the security elements themselves by sending them to the database for the next time the plan view is opened to directly display the security element markers on the plan view.
e) And 7) sending a request to the database in the resetting process in the step 7), clearing all information stored on the plan, and simultaneously displaying all the safety element marks on the plan at the positions to be marked on the side edge.
f) And 8) realizing the magnification and the reduction of the label graph, and controlling the planar graph and the safety element mark to simultaneously magnify and reduce in proportion by controlling the magnification and the reduction to check the label graph.
Fig. 3 is a flowchart of a method for determining a boundary according to an embodiment of the present invention, as shown in fig. 3:
in the dragging process, the horizontal coordinate (lmin) of the left side of the parent element (base map) from the current window and the horizontal coordinate (lmax) of the right side of the parent element from the current window are calculated, and the vertical coordinate (tmax) of the top (tmin) and the bottom of the parent element from the current window are also calculated. Continuously calculating a horizontal coordinate (l) and a vertical coordinate (t) of the current window of the distance between the dragging element and the left side edge and the top edge, and finally continuously comparing whether the value of the dragging element l is between lmin and lmax, if l is smaller than lmin, assigning the value of lmin to l, and if l is larger than lmax, assigning the value of lmax to l, so as to ensure that the horizontal distance of the dragging element is not separated from the left side and the right side of the parent element; and continuously comparing whether the value of t is between tmin and tmax, if t is smaller than tmin, assigning tmin to t, and if t is larger than tmax, assigning tmax to t, so as to ensure that the drag element does not depart from the parent element in the vertical distance. The two calculation methods are carried out simultaneously, and the four corners are prevented from being separated.
The method for setting the labeling characteristics and the constraints of the safety elements comprises the following steps:
the element type and the representation form are set by the online input and CSS file, the element type and the constraint condition can also be configured in a centralized way by the Config file, and the set content comprises element dependence and mutual exclusion relations, such as: the mutual exclusion elements cannot be closely adjacent in position, and the safety risk elements need to be equipped with corresponding emergency resource elements. A rationality constraint is provided for the overall presentation of the plan view.
In conclusion, the technical scheme provided by the invention simplifies the operation of the safety element labeling diagram, directly shows the safety information through the safety element, and abandons the traditional method for labeling on the drawing. All information is conveniently and quickly stored through the database. The setting of the element characteristics and the display constraint further standardizes the display method. The method has the advantages that the display constraints among the features of the safety elements and the elements and among different labels of the same element can be set, the labeling of the safety elements can be directly realized through mouse dragging operation, the safety elements can directly check basic information carried by the elements, and data are stored on the network and can be checked and edited at any time; the method can support the enlargement and reduction of the view of the annotation graph; compared with the prior art, the method provided by the embodiment of the invention simplifies the operation of labeling the drawing, directly displays the safety information through the safety element mark, and abandons the traditional method of labeling on the drawing. All information is conveniently and quickly stored through the database. The setting of the element characteristics and the display constraint further standardizes the display method.
An embodiment of the present invention provides a labeling system, including: the calling module is used for calling the plan and the safety element mark set from the database according to the received calling instruction and respectively displaying the plan and the safety element mark set in the corresponding preset areas;
the dragging module is used for moving the secure element marks in the secure element mark set into the plan view along a dragging track so as to cover corresponding areas in the plan view;
and the storage module is used for storing all the security element marks in the plan view so as to realize the marking of the plan view.
It should be noted that the system according to the embodiment of the present invention may be used to implement the technical solution of the embodiment of the labeling method shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Based on the foregoing embodiment, the system provided in the embodiment of the present invention further includes:
the calling module is used for calling the plan and the safety element mark set from the database according to the received calling instruction and respectively displaying the plan and the safety element mark set in the corresponding preset areas;
the dragging module is used for moving the secure element marks in the secure element mark set into the plan view along a dragging track so as to cover corresponding areas in the plan view;
and the storage module is used for storing all the security element marks in the plan view so as to realize the marking of the plan view.
Fig. 4 is a block diagram of a structure of an annotating device according to an embodiment of the present invention, as shown in fig. 4, the device includes: a processor (processor)401, a memory (memory)402, and a bus 403; wherein, the processor 401 and the memory 402 complete communication with each other through the bus 403; the processor 401 is configured to call the program instructions in the memory 402 to execute the methods provided by the above-mentioned method embodiments, for example, including: calling a plan and a safety element mark set from a database according to a received calling instruction, and respectively displaying the plan and the safety element mark set in respective corresponding preset areas; according to the obtained dragging operation, moving the safety element marks in the safety element mark set into the plan along a dragging track so as to cover corresponding areas in the plan; and according to the received saving instruction, saving all the secure element marks in the plan view in order to realize the marking of the plan view.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: calling a plan and a safety element mark set from a database according to a received calling instruction, and respectively displaying the plan and the safety element mark set in respective corresponding preset areas; according to the obtained dragging operation, moving the safety element marks in the safety element mark set into the plan along a dragging track so as to cover corresponding areas in the plan; and according to the received saving instruction, saving all the secure element marks in the plan view in order to realize the marking of the plan view.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, the methods include: calling a plan and a safety element mark set from a database according to a received calling instruction, and respectively displaying the plan and the safety element mark set in respective corresponding preset areas; according to the obtained dragging operation, moving the safety element marks in the safety element mark set into the plan along a dragging track so as to cover corresponding areas in the plan; and according to the received saving instruction, saving all the secure element marks in the plan view in order to realize the marking of the plan view.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.