CN114911462A - Gantt chart generation method and device, equipment and storage medium - Google Patents

Gantt chart generation method and device, equipment and storage medium Download PDF

Info

Publication number
CN114911462A
CN114911462A CN202210667455.3A CN202210667455A CN114911462A CN 114911462 A CN114911462 A CN 114911462A CN 202210667455 A CN202210667455 A CN 202210667455A CN 114911462 A CN114911462 A CN 114911462A
Authority
CN
China
Prior art keywords
rendered
video source
item
gantt chart
time period
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202210667455.3A
Other languages
Chinese (zh)
Inventor
罗敏敏
刘晖
朱斌
陈高岭
方琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN202210667455.3A priority Critical patent/CN114911462A/en
Publication of CN114911462A publication Critical patent/CN114911462A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The embodiment of the application discloses a Gantt chart generation method, a Gantt chart generation device, Gantt chart generation equipment and a storage medium, wherein the method comprises the following steps: acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods; for each activity, matching a horizontal axis of rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period; rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain a Gantt chart of the at least one item to be processed.

Description

Gantt chart generation method and device, equipment and storage medium
Technical Field
The embodiment of the application relates to a data processing technology, and relates to but is not limited to a Gantt chart generation method, a Gantt chart generation device, Gantt chart generation equipment and a Gantt chart generation storage medium.
Background
The gantt chart component is a data presentation and interaction component commonly used for a World Wide Web (World Wide Web) interface, and is mainly used for expressing the progress of some transactions in certain time periods, such as project progress, resource occupation and the like.
However, in the related art, a gantt chart component reconstructed based on an open source library such as Echarts (a JavaScript-based data visualization chart) has the problems of difficult style modification, unfavorable intuitive and friendly display of data, slow data rendering, poor code maintainability and readability and the like.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for generating a gantt chart, a device, and a storage medium.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for generating a gantt chart, where the method includes: acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods; for each activity, matching a horizontal axis of rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period; rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain a Gantt chart of the at least one item to be processed.
Through the mode, the Gantt chart component capable of displaying the resource occupation conditions of multiple projects, multiple activities and multiple time periods of a single activity can be provided, and further according to an actual application scene, the Gantt chart component can be used for expressing the service of the occupation conditions at any time.
In some embodiments, the method further comprises: acquiring a parameter file; wherein the parameter file comprises at least one of the following: the style parameter of the Gantt chart, the style parameter of the icon to be rendered, the style parameter of the item and the time starting point of the horizontal axis; rendering the transverse axis of the Gantt chart by using the style parameters of the Gantt chart in the parameter file to obtain the transverse axis of the rendered time scale; and rendering the vertical axis of the Gantt chart by using the style parameters of the items in the parameter file and the at least one to-be-processed item.
Through the method, the Gantt chart component capable of freely customizing the presentation style can be provided, and further the presentation style can be freely customized according to the actual application scene.
In some embodiments, the rendering the horizontal axis of the gantt chart by using the style parameter of the gantt chart in the parameter file to obtain the horizontal axis of the rendered time scale includes: acquiring a time starting point of a horizontal axis and a style parameter of a Gantt chart from the parameter file; and rendering the transverse axis of the Gantt chart by using the style parameters of the Gantt chart, the time starting point and the preset time length of the transverse axis to obtain the transverse axis of the rendered time scale.
By the method, the horizontal axis of the Gantt chart can be rendered by using the freely customized style.
In some embodiments, the rendering the vertical axis of the gantt chart using the style parameter of the item in the parameter file and the at least one item to be processed includes: determining an item type of each item to be processed; determining style parameters of the items matched with the item types from the parameter file; rendering each item to be processed in the longitudinal axis by using the style parameters of the matched items; wherein different item types correspond to different style parameters.
By the method, any item to be processed of the longitudinal axis of the Gantt chart can be rendered by using the freely customized style.
In some embodiments, said rendering said icon to be rendered based on a position of each said activity on a vertical axis, a start end time of each said execution time period, and a time scale of said horizontal axis, comprises: acquiring a style parameter of the icon to be rendered; obtaining the position of each execution time period on the horizontal axis according to the starting and ending time of each execution time period and the time scale of the horizontal axis; determining the position of each execution time period on the vertical axis according to the position of each video source on the vertical axis; and rendering the icon to be rendered by utilizing a cascading style sheet based on the positions of the execution time periods on the horizontal axis and the vertical axis respectively and the style parameters of the icon to be rendered.
By the mode, the icon corresponding to any execution time period of any activity can be rendered by using the freely customized style.
In some embodiments, in the case that the activity includes a video source, the obtaining at least one to-be-processed item includes: acquiring a database comprising various types of video sources; calling a target video source matched with the at least one item to be processed from the database based on the data requirement corresponding to the at least one item to be processed; taking the target video source as the at least one item to be processed; wherein different items to be processed include the same video source, and/or different items to be processed include different video sources.
By the method, the target video sources matched with the target video sources can be called from the database comprising the multiple types of video sources according to the data requirements corresponding to the items to be processed, and the same video source can be called by different items.
In some embodiments, in a case that different items to be processed include the same video source, the regarding the target class video source as the at least one item to be processed includes: taking a first video source in the target video sources as a first item to be processed in a first time period, and taking the first video source as a second item to be processed in a second time period; wherein the first time period is the same as the second time period, or the first time period is different from the second time period.
By the mode, a certain video source can be called by different projects at the same time, and can also be called by different projects at different times.
In some embodiments, after the taking the target class video source as the at least one item to be processed, the method further comprises: determining the corresponding position of the target video source in the longitudinal axis based on the type of the target video source; and loading the identification information of the target video source into a corresponding position in the longitudinal axis.
Through the method, the video source can be loaded into the corresponding position in the longitudinal axis according to the type of the video source.
In some embodiments, the obtaining a database comprising multiple categories of video sources comprises: determining at least one video source of the same type in the acquired multiple video sources; determining a plurality of execution time periods for each of the at least one video source; establishing a hierarchical relationship between the same type, the at least one video source, and a plurality of execution time periods for each video source; storing the same type of at least one video source and a plurality of execution time periods for each video source in the database based on the hierarchical relationship.
In the manner, the acquired video source can be structurally stored in the database based on the hierarchical relationship among the type, the video source and the execution time period.
In some embodiments, where the activity comprises a video source, the method further comprises: analyzing the video content of each execution time slot in the video source to obtain a corresponding analysis result; determining the style parameter of the icon to be rendered corresponding to each execution time period according to the analysis result; wherein, different analysis results correspond to different style parameters.
By the method, the icon corresponding to each execution time period can be rendered according to the video content of each execution time period of the video source.
In some embodiments, where the activity comprises a video source and the generation of the gantt chart is complete, the method further comprises: in response to the cursor being suspended on the rendered icon of the Gantt chart, displaying the description information of the video content corresponding to the rendered icon; wherein the description information includes at least one of: a brief introduction of the video content, an alert of the video content; and responding to the selected operation of the rendered icon, and displaying the video content corresponding to the rendered icon.
By the method, different contents of the rendered icon can be displayed under the condition that the cursor is suspended on the rendered icon or the rendered icon is selected.
In a second aspect, an embodiment of the present application provides an apparatus for generating a gantt chart, where the apparatus includes: an acquisition unit for acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods; the matching unit is used for matching a horizontal axis with rendered time scales with each execution time period aiming at each activity to obtain an icon to be rendered corresponding to each execution time period; and the rendering unit is used for rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain the Gantt chart of the at least one item to be processed.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program that is executable on the processor, and the processor implements the steps in the method for generating a gantt chart when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the generation method of the gantt chart.
The embodiment of the application provides a Gantt chart generation method, a Gantt chart generation device, Gantt chart generation equipment and a storage medium, wherein at least one to-be-processed item is obtained; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods; for each activity, matching a horizontal axis of rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period; rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain the Gantt chart of the at least one item to be processed, so that a Gantt chart component capable of showing resource occupation conditions of a plurality of items, a plurality of activities and a plurality of time periods of a single activity can be provided, and further the Gantt chart component can be used for expressing services of any time occupation condition according to an actual application scene.
Drawings
Fig. 1A is a schematic diagram of a system architecture corresponding to a generation method of a gantt chart in an embodiment of the present application;
fig. 1B is a schematic implementation flow diagram i of a generation method of a gantt chart in the embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation process of a generation method of a gantt chart in the embodiment of the present application;
fig. 3 is a schematic flow chart diagram of an implementation of a generation method of a gantt chart in the embodiment of the present application;
FIG. 4 is a schematic diagram of a Gantt chart generated by an embodiment of the present application;
FIG. 5 is a schematic diagram of a schematic structural diagram of a Gantt chart generation apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware entity of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solution of the present application is further elaborated below with reference to the drawings and the embodiments. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning by themselves. Thus, "module", "component" or "unit" may be used mixedly.
It should be noted that the terms "first \ second \ third" referred to in the embodiments of the present application are only used for distinguishing similar objects and do not represent a specific ordering for the objects, and it should be understood that "first \ second \ third" may be interchanged under specific ordering or sequence if allowed, so that the embodiments of the present application described herein can be implemented in other orders than illustrated or described herein.
Fig. 1A is a schematic diagram of a system architecture corresponding to a generation method of a gantt chart in an embodiment of the present application, and as shown in fig. 1A, the system architecture may include: acquisition device 101, database 102, and electronic device 103.
The acquisition device 101 can acquire data according to different scenes, different times, different places and the like, the database 102 stores the data acquired by the acquisition device 101, and the electronic device 103 communicates with the database 102 through a network to acquire the acquired data stored in the database and generate a corresponding Gantt chart.
The electronic device 102 may be various types of devices with information processing capabilities, such as a navigator, a smart phone, a tablet computer, a wearable device, a laptop portable computer, a kiosk and a desktop computer, a server cluster, and the like.
Based on this, the embodiments of the present application provide a method for generating a gantt chart, where the method is applied to an electronic device, and functions implemented by the method may be implemented by a processor in the electronic device calling a program code, and of course, the program code may be stored in a storage medium of the electronic device. Fig. 1B is a first schematic flow chart of an implementation process of a generation method of a gantt chart in an embodiment of the present application, as shown in fig. 1B, the method includes:
s101, acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods;
here, the gantt chart is also called as a crosswalk chart or a bar chart. It shows through bar graphs how items, progress and other time-dependent internal relationships of system progress over time. The items to be processed comprise at least one activity, and each activity comprises a plurality of execution time periods. For example, in the "vehicle management" project, the capturing device at the entrance/exit of a parking lot is turned on from 6 to 8, turned off from 8 to 12, and turned on from 12 to 1, and the execution time period of the video source captured by the capturing device includes the time period from 6 to 8 and the time period from 12 to 1.
In the embodiment of the present application, a plurality of items to be processed may be rendered in one gantt chart, and when the items to be processed include a plurality of activities, an association relationship may exist between the plurality of activities, or each of the activities may be an independent activity.
Step S102, aiming at each activity, matching a horizontal axis with rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
for example, the current time and the time 24 hours ago may be determined, cut into 24 segments, and rendered on the X-axis. And then circulating a plurality of activities under the project to be processed, acquiring a certain execution time period of a certain activity, matching the time scale of the rendered X axis according to the starting and ending time of the execution time period, dynamically rendering a horizontal bar for identifying resource occupation after the matching is finished, and rendering the horizontal bar for representing all activities and resource occupation conditions of all execution time periods under each activity after multiple circulation.
That is to say, after the matching is completed, the icon to be rendered corresponding to each execution time period is obtained, and then the bar representing the resource occupation situation is obtained after the icon to be rendered is rendered.
Step S103, rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain the Gantt chart of the at least one item to be processed.
Here, according to the position of each activity on the vertical axis, the position of the icon to be rendered corresponding to each execution time period in the activity on the vertical axis can be obtained. According to the starting and ending time of each execution time period and the time scale of the horizontal axis, the position of the icon to be rendered corresponding to each execution time period in the activity on the horizontal axis can be obtained. Furthermore, the icon to be rendered corresponding to each execution time period in the activity can be rendered at the position corresponding to the Gantt chart. Therefore, the Gantt chart component can show resource occupation conditions of multiple projects, multiple activities and multiple time periods of a single activity, and can be used for expressing services of any time occupation condition according to an actual application scene.
In some embodiments, where the activity comprises a video source, the method further comprises:
step S11a, analyzing the video content of each execution time slot in the video source to obtain a corresponding analysis result;
step S12a, determining the style parameter of the icon to be rendered corresponding to each execution time period according to the analysis result; wherein, different analysis results correspond to different style parameters.
In some embodiments, where the activity comprises a video source and the generation of the gantt chart is complete, the method further comprises:
step S11b, responding to the cursor floating on the rendered icon of the Gantt chart, and displaying the description information of the video content corresponding to the rendered icon; wherein the description information includes at least one of: a brief introduction of the video content, an alert of the video content;
and step S12b, responding to the selected operation of the rendered icon, and displaying the video content corresponding to the rendered icon.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, and the method includes:
s111, acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods;
step S112, aiming at each activity, matching a horizontal axis with rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
s113, acquiring a style parameter of the icon to be rendered;
here, the style parameter may be customized by a user or an operation and maintenance person, that is, the user or the operation and maintenance person may customize various style parameters according to an actual use situation. For example, the style of the gantt chart, such as the length of the gantt chart, the width and the transparency of the gantt chart, the style of the bar corresponding to each execution time period, such as the color and the transparency of the bar, and the style of each item or each activity in the vertical axis, such as different colors of different types of activities, may be customized.
Step S114, obtaining the position of each execution time period on the horizontal axis according to the starting and ending time of each execution time period and the time scale of the horizontal axis;
in the embodiment of the present application, the starting time and the ending time of each execution time period are the starting time and the ending time of each execution time period. For example, an activity is in the executive state at 8 to 10, in the halt state at 10 to 18, in the executive state at 18 to 24, and in the halt state at 0 to 8. Then one execution period in the campaign has a start time of 8 and an end time of 10, and another execution period has a start time of 18 and an end time of 24. Further, the position of each execution time period on the horizontal axis can be obtained according to the start time and the end time of each execution time period and the time scale of the horizontal axis. For example, when the current time and the time before 24 hours are divided into 24 segments, the rendering X-axis shows that the starting time of a certain execution time segment is 10 points, the ending time is 11 points, the starting point of the horizontal bar corresponding to the execution time segment is 10/24 points, the ending point is 11/24 points, and the width is (11-10)/24 points.
Step S115, determining the position of each execution time period on the vertical axis according to the position of each video source on the vertical axis;
here, the position of each video source on the vertical axis, i.e., the position of each of the execution periods in the video source on the vertical axis.
And step S116, rendering the icon to be rendered by utilizing a cascading style sheet based on the positions of the execution time periods on the horizontal axis and the vertical axis respectively and the style parameters of the icon to be rendered to obtain the Gantt chart of the at least one item to be processed.
Here, the cascading style sheet is a computer language used for expressing a file style such as HTML (an application of standard universal markup language) or XML (a subset of standard universal markup language), and the cascading style sheet can precisely control the layout of element positions in a web page at a pixel level, support almost all font and font styles, and have the capability of editing web page objects and model styles. Therefore, in the embodiment of the application, based on the customized style parameter, the position (coordinates where the horizontal axis and the vertical axis are located) of each execution time period is rendered by using the cascading style sheet, so that a rendered icon corresponding to each execution time period of each activity is obtained, and further, a gantt chart of the to-be-processed item is obtained. For example, an inline style (inline style) may be set, changing the style, according to the incoming parameters.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, fig. 2 is a schematic view of an implementation flow of the method for generating a gantt chart according to the embodiment of the present application, and as shown in fig. 2, the method includes:
step S201, acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods;
step S202, acquiring a parameter file; wherein the parameter file comprises at least one of the following: the style parameter of the Gantt chart, the style parameter of the icon to be rendered, the style parameter of the item and the time starting point of the horizontal axis;
in the embodiment of the application, the style parameters related to the Gantt chart can be defined at the entry file of the code, and the style parameters related to the Gantt chart can also be placed in a parameter file which can be called, so that a user or operation and maintenance personnel can freely customize and display the style according to the actual application scene.
Here, the parameter file includes, but is not limited to: a time starting point of the horizontal axis, a time ending point of the horizontal axis, a width of the gantt chart (the style parameter belonging to the gantt chart), a height of each line in the gantt chart, a height of each horizontal bar (the style parameter belonging to the icon to be rendered), a horizontal bar conversion background color, and a vertical axis conversion background color (the style parameter belonging to the item).
In the embodiment of the present application, the time starting point of the horizontal axis may be any time point set by the user, or may be the current time point.
Step S203, rendering the horizontal axis of the Gantt chart by using the style parameters of the Gantt chart in the parameter file to obtain the horizontal axis with rendered time scales;
here, the style parameter of the gantt chart refers to a style parameter of a chart display region, which refers to the entire gantt chart, and the style parameter of the gantt chart may be a length, a width, a transparency, and the like of the gantt chart in the entire page. For example, the region in which the entire gantt chart in fig. 4 is located is a chart display region. The style parameter of the icon to be rendered refers to the style parameter of the rendered icon corresponding to each execution time period of each activity, for example, the style parameters of the bar 43 and other bars in fig. 4. The style parameter of the item refers to a style parameter corresponding to each item in the vertical axis, such as the style parameter of the item "vehicle management" in the Y axis 42 in fig. 4, and the style parameter of each activity (including video source) under the item "vehicle management". For example, the horizontal axis in fig. 4 is the time starting point, i.e., the zero point.
Step S204, rendering a longitudinal axis of the Gantt chart by using the style parameters of the items in the parameter file and the at least one to-be-processed item;
here, the identification information of the at least one to-be-processed item may be rendered in a vertical axis of the gantt chart by a style parameter of the item in the parameter file.
Step S205, aiming at each activity, matching the horizontal axis of the rendered time scale with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
here, the horizontal axis of the rendered time scale is matched with each execution time period, the obtained icon to be rendered may be a web page tag, the web page tag is a tag language of a web page program, and the tag creates a horizontal line in an HTML page.
And S206, rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain the Gantt chart of the at least one item to be processed.
Here, the precise position of the icon to be rendered in the gantt chart can be determined by the position of each activity on the vertical axis, the starting and ending time of each execution time period, and the time scale of the horizontal axis, and the icon to be rendered is rendered by using the cascading style sheet.
In some embodiments, the step S204 of rendering the vertical axis of the gantt chart by using the style parameter of the item in the parameter file and the at least one to-be-processed item may be implemented by:
step S2041, determining the item type of each item to be processed;
in the embodiment of the application, a gantt chart may include a plurality of items to be processed, each item to be processed may include a plurality of activities, and each item to be processed corresponds to a different item type.
Step S2042, determining style parameters of the items matched with the item types from the parameter files;
here, different style parameters may be allocated to different items to be processed, and different styles may be rendered for the different items to be processed in the vertical axis according to the style parameters of the items.
Step S2043, rendering each item to be processed in the longitudinal axis by using the style parameters of the matched items; wherein different item types correspond to different style parameters.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, and the method includes:
step S211, acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprising a plurality of execution time periods;
step S212, acquiring a parameter file; wherein the parameter file comprises at least one of the following: the style parameter of the Gantt chart, the style parameter of the icon to be rendered, the style parameter of the item and the time starting point of the horizontal axis;
step S213, acquiring a time starting point of a horizontal axis and a style parameter of the Gantt chart from the parameter file;
in the embodiment of the application, a user can customize the time starting point of the transverse shaft according to the actual application condition. A time starting point with the current time as the horizontal axis may also be selected.
Step S214, rendering the cross shaft of the Gantt chart by using the style parameters of the Gantt chart, the time starting point and the preset time length of the cross shaft to obtain the cross shaft with rendered time scales;
here, the preset time period may be set according to an actual application, and if the preset time period may be set to be 24 hours, the horizontal axis of the gantt chart may be rendered by cutting 24 hours after the time start point of the horizontal axis into 24 segments.
Step S215, rendering the vertical axis of the Gantt chart by using the style parameters of the items in the parameter file and the at least one to-be-processed item;
step S216, aiming at each activity, matching the horizontal axis of the rendered time scale with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
step S217, rendering the icon to be rendered based on the position of each activity on the vertical axis, the start/end time of each execution time period, and the time scale of the horizontal axis, to obtain a gantt chart of the at least one item to be processed.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, fig. 3 is a schematic view of an implementation flow of the method for generating a gantt chart according to the embodiment of the present application, and as shown in fig. 3, the method includes:
s301, acquiring a database comprising various types of video sources;
in this embodiment of the application, the activity in the to-be-processed item may be a video source. The video sources under each project can be regarded as a type of video source, and the types of video sources are stored in the database according to a certain structure.
Step S302, calling a target video source matched with at least one project to be processed from the database based on a data requirement corresponding to the at least one project to be processed;
for example, when a user wants to show a vehicle management item in a recent time period, a target video source matched with the vehicle management item is called from a database, and then a gantt chart corresponding to the target video source is drawn by using a gantt chart component provided in the embodiment of the present application.
Step S303, using the target video source as the at least one item to be processed; wherein each target type video source comprises a plurality of execution time periods; different items to be processed comprise the same video source, and/or different items to be processed comprise different video sources;
here, each of the object-type video sources includes a plurality of execution time periods, for example, if the capturing device at the first entrance of a certain location in the vehicle management project is turned on at 6 o 'clock to 10 o' clock, turned off at 10 o 'clock to 17 o' clock, and turned on at 17 o 'clock to 21 o' clock, the video source captured by the capturing device includes a plurality of execution time periods, respectively, 6 o 'clock to 10 o' clock, and 17 o 'clock to 21 o' clock.
In the embodiment of the present application, the same video source may be called by different items, for example, the video source a may be called by the item a, and may also be called by the item B, and the comparison in the embodiment of the present application is not limited.
Step S304, aiming at each target video source, matching a horizontal axis with rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
step S305, rendering the icon to be rendered based on the position of each target video source on the vertical axis, the start/end time of each execution time period, and the time scale of the horizontal axis, to obtain a gantt chart of the at least one item to be processed.
In some embodiments, in a case that different items to be processed include the same video source, the regarding the target class video source as the at least one item to be processed includes: taking a first video source in the target video sources as a first item to be processed in a first time period, and taking the first video source as a second item to be processed in a second time period; wherein the first time period is the same as the second time period, or the first time period is different from the second time period.
For example, in the time period from 3 to 4, video source a can be called by item a and item B at the same time; for another example, video source a may be called by item a and not called by item B in a period of 3 to 4, and video source a may be called by item B and not called by item a in a period of 4 to 5.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, and the method includes:
step S311, acquiring a database comprising various types of video sources;
step S312, based on the data requirement corresponding to at least one to-be-processed item, calling a target video source matched with the at least one to-be-processed item from the database;
step 313, using the target video source as the at least one item to be processed; wherein each target type video source comprises a plurality of execution time periods; different items to be processed comprise the same video source, and/or different items to be processed comprise different video sources;
step S314, aiming at each target video source, matching a horizontal axis with rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
step S315, determining the corresponding position of the target video source in the longitudinal axis based on the type of the target video source;
in the embodiment of the application, because a plurality of different types of items may exist in one gantt chart, that is, identification information of a plurality of items may be rendered in a longitudinal axis of the gantt chart, when a target type video source matched with a requirement is called from the database, which type of item the video source belongs to may be determined according to the type of the target type video source, and then a position of the target type video source in the longitudinal axis may be determined.
Step S316, loading the identification information of the target video source into a corresponding position in the longitudinal axis;
in the embodiment of the present application, the identification information of the target type video source includes, but is not limited to, a name of the video source, and an Identity Document (ID number) of the video source.
Step S317, rendering the icon to be rendered based on the position of each target video source on the vertical axis, the start and end time of each execution time period, and the time scale of the horizontal axis, to obtain a gantt chart of the at least one item to be processed.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, and the method includes:
step S321, determining at least one video source of the same type in the acquired multiple video sources;
here, each item includes at least one video source collected by the collecting device, the plurality of video sources may be different video sources under different items, and thus video sources of the same item may be regarded as the same type of video source.
Step S322, determining a plurality of execution time periods of each video source in the at least one video source;
step S323, establishing a hierarchical relationship among the same type, the at least one video source and a plurality of execution time periods of each video source;
in the embodiment of the present application, a specific data structure may be used to store the acquired multiple video sources. The data structure is divided into three levels, the first level being which types exist, the second level being which video sources exist under each type, and the third level being how many execution periods exist under each video source.
That is to say, in the embodiment of the present application, fields such as types of video sources, a plurality of video sources of each type, a plurality of time periods of each video source, start end time of each time period, and the like are structurally stored in the database. Furthermore, when a Gantt chart needs to be drawn subsequently, a video source matched with the requirement can be called from the database stored in the structured mode according to the requirement.
Step S324, storing the at least one video source of the same type and a plurality of execution time periods of each video source in the database based on the hierarchical relationship;
step 325, based on the data requirement corresponding to the project to be processed, calling a target video source matched with the project to be processed from the database;
step S326, using the target video source as the item to be processed; each target type video source comprises a plurality of execution time periods;
step S327, aiming at each target video source, matching a horizontal axis with rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
step 328, rendering the icon to be rendered based on the position of each target video source on the vertical axis, the starting and ending time of each execution time period, and the time scale of the horizontal axis, so as to obtain a gantt chart of the item to be processed.
Based on the foregoing embodiment, an embodiment of the present application further provides a method for generating a gantt chart, where the method is applied to an electronic device, and the method includes:
step S331, acquiring a database comprising multiple types of video sources;
step S332, calling a target video source matched with at least one project to be processed from the database based on a data requirement corresponding to the at least one project to be processed;
step S333, using the target video source as the at least one item to be processed; wherein each target type video source comprises a plurality of execution time periods; different items to be processed comprise the same video source, and/or different items to be processed comprise different video sources;
step 334, for each target video source, matching a horizontal axis with a rendered time scale with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
step S335, analyzing the video content of each execution time slot in the target video source to obtain a corresponding analysis result;
for example, the video content of each execution time period of a video source under a certain project is analyzed, and the obtained analysis result is a statistical result of event detection in each execution time period.
Step S336, determining the style parameter of the icon to be rendered corresponding to each execution time period according to the analysis result; wherein, different analysis results correspond to different style parameters;
for example, if the called target video source is a video source under a vehicle management project, and the video source is used for managing the vehicle access situation, the video content of each execution time period of the video source may be analyzed, and the obtained analysis result is statistics of the vehicle access situation in each execution time period. If the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is larger than a first preset threshold value, rendering the icon to be rendered corresponding to the time period to be red; if the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is smaller than a second preset threshold value, rendering the icon to be rendered corresponding to the time period to be green; and if the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is between a second preset threshold value and the first threshold value, rendering the icon to be rendered corresponding to the time period to be yellow.
Step S337, rendering the icon to be rendered based on the position of each target video source on the longitudinal axis, the starting and ending time of each execution time period, the time scale of the horizontal axis and the style parameter to obtain a Gantt chart of the at least one item to be processed;
step S338, responding to the cursor to be suspended on the rendered icon of the Gantt chart, and displaying the description information of the video content corresponding to the rendered icon; wherein the description information includes at least one of: a brief introduction of the video content, an alert of the video content;
here, the cursor is hovering over the rendered icons of the gantt chart, which may be detecting that the user moves the mouse over a certain rendered icon and keeps staying for a short time.
For example, if the called target video source is a video source under a vehicle management project, and the video source is used for managing the vehicle access situation, the video content of each execution time period of the video source may be analyzed, and the obtained analysis result is statistics of the vehicle access situation in each execution time period. If the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is larger than a first preset threshold value, rendering the icon to be rendered corresponding to the time period to be red; if the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is smaller than a second preset threshold value, rendering the icon to be rendered corresponding to the time period to be green; and if the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is between a second preset threshold value and the first threshold value, rendering the icon to be rendered corresponding to the time period to be yellow. When the mouse is moved to a yellow rendered icon (horizontal bar), the system pops up alarm information, and the content of the alarm information is as follows: "the vehicle of entering is more than the vehicle of leaving in this time quantum, and the vacant parking stall remains inadequately".
And step S339, responding to the selection operation of the rendered icon, and displaying the video content corresponding to the rendered icon.
Here, the operation of selecting the rendered icon may be detecting that a user clicks a certain rendered icon.
For example, if the called target video source is a video source under a vehicle management project, and the video source is used for managing the vehicle access situation, the video content of each execution time period of the video source may be analyzed, and the obtained analysis result is statistics of the vehicle access situation in each execution time period. If the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is larger than a first preset threshold value, rendering the icon to be rendered corresponding to the time period to be red; if the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is smaller than a second preset threshold value, rendering the icon to be rendered corresponding to the time period to be green; and if the difference value of the number of the vehicles entering the parking lot and the number of the vehicles leaving the parking lot is between a second preset threshold value and the first threshold value, rendering the icon to be rendered corresponding to the time period to be yellow. Clicking on the rendered icon for yellow, the system pops up the vehicle access video clip for that time period.
Based on the foregoing embodiment, in order to intuitively and beautifully show the occupation situation of video resources and quickly understand the problem of which video resources are occupied in any time period, the embodiment of the present application further provides a method for generating a gantt chart, that is, a gantt chart component in the embodiment of the present application is developed by using technologies such as HTML5 (a language description mode), CSS (Cascading Style Sheets), JS (JavaScript, a programming language), and the like.
Compared with the related art, the gantt chart component in the embodiment of the application can solve the following technical problems:
1) by extracting the custom parameters, the latest 24 hours can be automatically rendered as X-axis coordinates, and the X-axis can intelligently render a dividing line, so that data can be displayed more intuitively and friendly.
Here, a parameter may be defined at the entry file of the code, for example, the parameter may be a width value (width of the entire gantt chart), which may be one-half, one-third of the screen; the parameter can also be the starting point of time, and the later Gantt chart can be set to be in the unit of days or hours; the parameter may also be color. The Gantt chart component provided by the embodiment of the application can intelligently render a vertical time partition line.
2) Any region such as an X axis (horizontal axis), a Y axis (vertical axis), each video source display region and a chart display region supports customization of any style by dynamically changing the CSS, and the problem that the style of an open source library is difficult to freely modify is solved.
In the embodiment of the application, the CSS can be dynamically changed through the java script language, so that the customization of any style is realized. Here, the area where the whole gantt chart is located is a chart display area, and the area where the icon (i.e., the bar) corresponding to each execution time period of the video source is located is a video source display area.
3) The data interface is optimized, multi-video source display is supported, multi-time-period display of a single video source is supported, and the occupation condition of video resources is expressed more intuitively and easily.
Here, the back-end provides a data interface that functions to inform the front-end which video sources occupy which time periods. The interface can provide various services, a plurality of videos under each service, a plurality of occupied time periods of each video and the like.
In detail, the generation method of the gantt chart can be realized by the following steps:
step S401, acquiring video content, starting time or ending time of video services such as area management, night patrol management, vehicle management and the like in the using process;
s402, according to the video types, a plurality of time periods of each type, starting ending time of each time period and other fields, storing the fields in a database in a structured manner;
and S403, acquiring data in the background database, receiving the data by the front-end Gantt chart component, rendering the Gantt chart in real time according to the data, and visually displaying the resource occupation condition of various video sources in any time period.
For example, the front end receives data of the back end through HTTP (Hyper Text Transfer Protocol), and then inputs the data into the component.
Wherein the step S403 can be implemented by:
step S4031, obtaining the current time and the time before 24 hours, cutting the current time and the time before 24 hours into 24 sections, and rendering an X axis;
s4032, circulating a plurality of video sources, acquiring a certain occupied time period of a certain video source, matching a time scale of an X axis rendered before according to the starting and ending time, dynamically rendering a horizontal bar for identifying resource occupation after data calculation, and rendering a horizontal bar for representing all the video sources and resource occupation conditions of all the time periods of each video source after multiple circulation;
here, the loop refers to sequential rendering of a plurality of video sources and a plurality of time periods for each video source.
Step S4033, according to the types of the video sources, the occupied horizontal bars of each video source alternately adopt different colors to improve the discrimination, and the Y axis renders different styles according to different types of the video sources;
and step S4034, parameters such as length, width, height, color and transparency are extracted, so that the free customization of the style of the Gantt chart is supported.
Fig. 4 is a schematic diagram of a gantt chart generated in an embodiment of the present application, as shown in fig. 4, a starting time point of an X axis 41 of the gantt chart is a zero point, services (i.e., items) included in the gantt chart include "vehicle management" and "traffic management", and the like, wherein the "vehicle management" service includes two video sources (i.e., activities) and the two video sources are independent video sources, and the "traffic management" service includes one video source. It can be seen that the names of the different services, and the names of the different video sources under each service, are rendered in the Y-axis 42. Correspondingly, the video source display area under the X-axis 41 renders a plurality of video sources and a plurality of time periods of each video source, wherein the bar 43 is a rendering result of an occupied time period of the video source "first major" under "traffic management".
Compared with the problems that the Gantt chart component in the related art is difficult to modify in style and is not intuitive and unfriendly to display, the Gantt chart component in the embodiment of the application can freely customize the display style; compared with the prior art that the resource occupation situation of multiple time periods is difficult to show by the Gantt chart component, the Gantt chart component in the embodiment of the application can show the resource occupation situation of multiple video sources and multiple time periods of a single video source. Thus, the generation method of the gantt chart in the embodiment of the application can achieve the following technical effects:
1) according to the actual application scene, the display style can be freely customized.
2) According to the actual application scene, the method can be used for expressing the service of any time occupation condition.
Therefore, the generation method of the gantt chart in the embodiment of the present application can be applied to the following scenarios:
1) hope to express the project progress situation intuitively;
2) the occupation situation of resources is hoped to be expressed visually;
3) any service that expresses the time occupancy.
Based on the foregoing embodiments, the present application provides a apparatus for generating a gantt chart, where the apparatus includes units, sub-units and modules included in the units, and sub-modules and components included in the modules, and may be implemented by a processor in an electronic device; of course, the implementation can also be realized through a specific logic circuit; in the implementation process, the processor may be a CPU (Central Processing Unit), an MPU (Microprocessor Unit), a DSP (Digital Signal Processing), an FPGA (Field Programmable Gate Array), or the like.
Fig. 5 is a schematic structural diagram of a generating apparatus of a gantt chart in an embodiment of the present application, and as shown in fig. 5, the generating apparatus 500 includes:
an obtaining unit 501, configured to obtain at least one to-be-processed item; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods;
a matching unit 502, configured to match, for each activity, a horizontal axis of a rendered time scale with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
a rendering unit 503, configured to render the icon to be rendered based on a position of each activity on the vertical axis, a start/end time of each execution time period, and a time scale of the horizontal axis, so as to obtain a gantt chart of the at least one item to be processed.
In some embodiments, the apparatus further comprises:
a file acquisition unit for acquiring a parameter file; wherein the parameter file comprises at least one of the following: the style parameter of the Gantt chart, the style parameter of the icon to be rendered, the style parameter of the item and the time starting point of the horizontal axis;
the transverse axis rendering unit is used for rendering the transverse axis of the Gantt chart by using the style parameters of the Gantt chart in the parameter file to obtain the transverse axis of the rendered time scale;
and the vertical axis rendering unit is used for rendering the vertical axis of the Gantt chart by using the style parameters of the items in the parameter file and the at least one to-be-processed item.
In some embodiments, the horizontal axis rendering unit includes:
the style acquisition module is used for acquiring a time starting point of a transverse axis and a style parameter of the Gantt chart from the parameter file;
and the transverse axis rendering module is used for rendering the transverse axis of the Gantt chart by using the style parameters of the Gantt chart, the time starting point and the preset time length of the transverse axis to obtain the transverse axis with the rendered time scale.
In some embodiments, the vertical axis rendering unit includes:
the type determining module is used for determining the item type of each item to be processed;
the style determining module is used for determining the style parameters of the items matched with the item types from the parameter files;
the longitudinal axis rendering module is used for rendering each item to be processed in the longitudinal axis by using the style parameters of the matched items; wherein different item types correspond to different style parameters.
In some embodiments, the rendering unit 503 includes:
the icon style acquisition module is used for acquiring the style parameters of the icon to be rendered;
the horizontal axis position determining module is used for obtaining the position of each execution time period on the horizontal axis according to the starting and ending time of each execution time period and the time scale of the horizontal axis;
the vertical axis position determining module is used for determining the position of each execution time period on the vertical axis according to the position of each video source on the vertical axis;
and the rendering module is used for rendering the icon to be rendered based on the positions of the execution time periods on the horizontal axis and the vertical axis respectively and the style parameters of the icon to be rendered by utilizing a cascading style sheet.
In some embodiments, in the case that the activity includes a video source, the obtaining unit 501 includes:
the database acquisition module is used for acquiring a database comprising various types of video sources;
the video source calling module is used for calling a target video source matched with the at least one item to be processed from the database based on the data requirement corresponding to the at least one item to be processed;
the project determining module is used for taking the target video source as the at least one project to be processed; wherein different items to be processed include the same video source, and/or different items to be processed include different video sources.
In some embodiments, in a case where different items to be processed include the same video source, the item determination module includes:
an item determining component, configured to take a first video source in the target type video sources as a first item to be processed in a first time period, and take the first video source as a second item to be processed in a second time period;
wherein the first time period is the same as the second time period, or the first time period is different from the second time period.
In some embodiments, the apparatus further comprises:
the position determining unit is used for determining the corresponding position of the target video source in the longitudinal axis based on the type of the target video source;
and the loading unit is used for loading the identification information of the target video source into a corresponding position in the longitudinal axis.
In some embodiments, the database acquisition module comprises:
the similar video source determining component is used for determining at least one video source of the same type in the acquired multiple video sources;
an execution time period determination unit for determining a plurality of execution time periods for each of the at least one video source;
a hierarchical relationship establishing component for establishing a hierarchical relationship between the same type, the at least one video source, and a plurality of execution time periods of each video source;
a storage component for storing the at least one video source of the same type and a plurality of execution time periods for each video source in the database based on the hierarchical relationship.
In some embodiments, the apparatus further comprises:
the video content analysis unit is used for analyzing the video content of each execution time slot in the video source to obtain a corresponding analysis result;
the icon style determining unit is used for determining a style parameter of the icon to be rendered corresponding to each execution time period according to the analysis result; wherein, different analysis results correspond to different style parameters.
In some embodiments, the apparatus further comprises:
the first response unit is used for responding to the cursor to float on the rendered icon of the Gantt chart and displaying the description information of the video content corresponding to the rendered icon; wherein the description information includes at least one of: a brief introduction of the video content, an alert of the video content;
and the second response unit is used for responding to the selection operation of the rendered icon and displaying the video content corresponding to the rendered icon.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
In the embodiment of the present application, if the generation method of the gantt chart is implemented in the form of a software functional module and sold or used as a standalone product, the method may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including several instructions for causing an electronic device (which may be a personal computer, a server, etc.) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a ROM (Read Only Memory), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor executes the program to implement the steps in the method for generating the gantt chart provided in the above embodiment.
Correspondingly, the embodiment of the present application provides a readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the generation method of the gantt chart.
Accordingly, embodiments of the present application provide a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the method for generating the gantt chart in the embodiment of the present application.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be noted that fig. 6 is a schematic diagram of a hardware entity of an electronic device according to an embodiment of the present application, and as shown in fig. 6, the hardware entity of the electronic device 600 includes: a processor 601, a communication interface 602, and a memory 603, wherein
The processor 601 generally controls the overall operation of the electronic device 600.
The communication interface 602 may enable the electronic device 600 to communicate with other electronic devices or servers or platforms via a network.
The Memory 603 is configured to store instructions and applications executable by the processor 601, and may also buffer data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or already processed by the processor 601 and modules in the electronic device 600, and may be implemented by FLASH Memory or RAM (Random Access Memory);
wherein the various hardware entities within the electronic device 600 are coupled together by a bus 604. It is understood that bus 604 is used to enable communications among these hardware entities.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing module, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit. 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: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments. The features disclosed in the several product embodiments presented in this application can be combined arbitrarily, without conflict, to arrive at new product embodiments. The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A Gantt chart generation method is characterized by comprising the following steps:
acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprises a plurality of execution time periods;
for each activity, matching a horizontal axis of rendered time scales with each execution time period to obtain an icon to be rendered corresponding to each execution time period;
rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain a Gantt chart of the at least one item to be processed.
2. The method of claim 1, further comprising:
acquiring a parameter file; wherein the parameter file comprises at least one of the following: the style parameter of the Gantt chart, the style parameter of the icon to be rendered, the style parameter of the item and the time starting point of the horizontal axis;
rendering the transverse axis of the Gantt chart by using the style parameters of the Gantt chart in the parameter file to obtain the transverse axis of the rendered time scale;
and rendering the vertical axis of the Gantt chart by using the style parameters of the items in the parameter file and the at least one to-be-processed item.
3. The method of claim 2, wherein the rendering the horizontal axis of the gantt chart using the style parameter of the gantt chart in the parameter file to obtain the horizontal axis of the rendered time scale comprises:
acquiring a time starting point of a horizontal axis and a style parameter of a Gantt chart from the parameter file;
and rendering the transverse axis of the Gantt chart by using the style parameters of the Gantt chart, the time starting point and the preset time length of the transverse axis to obtain the transverse axis of the rendered time scale.
4. The method according to claim 2, wherein the rendering the vertical axis of the gantt chart using the style parameter of the item in the parameter file and the at least one to-be-processed item comprises:
determining an item type of each item to be processed;
determining style parameters of the items matched with the item types from the parameter file;
rendering each item to be processed in the longitudinal axis by using the style parameters of the matched items; wherein different item types correspond to different style parameters.
5. The method according to any one of claims 1 to 4, wherein the rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period, and the time scale of the horizontal axis comprises:
acquiring a style parameter of the icon to be rendered;
obtaining the position of each execution time period on the horizontal axis according to the starting and ending time of each execution time period and the time scale of the horizontal axis;
determining the position of each execution time period on the vertical axis according to the position of each video source on the vertical axis;
and rendering the icon to be rendered by utilizing a cascading style sheet based on the position of each execution time period on the horizontal axis and the vertical axis respectively and the style parameter of the icon to be rendered.
6. The method according to any one of claims 1 to 5, wherein in case the activity comprises a video source, the obtaining at least one item to be processed comprises:
acquiring a database comprising various types of video sources;
calling a target video source matched with the at least one item to be processed from the database based on the data requirement corresponding to the at least one item to be processed;
taking the target video source as the at least one item to be processed; wherein different items to be processed include the same video source, and/or different items to be processed include different video sources.
7. The method according to claim 6, wherein in a case that different items to be processed include the same video source, the regarding the target class video source as the at least one item to be processed comprises:
taking a first video source in the target video sources as a first item to be processed in a first time period, and taking the first video source as a second item to be processed in a second time period;
wherein the first time period is the same as the second time period, or the first time period is different from the second time period.
8. The method of claim 6, wherein after said treating said target class video source as said at least one pending item, said method further comprises:
determining the corresponding position of the target video source in the longitudinal axis based on the type of the target video source;
and loading the identification information of the target video source into the corresponding position in the longitudinal axis.
9. The method of any of claims 6 to 8, wherein obtaining a database comprising a plurality of categories of video sources comprises:
determining at least one video source of the same type in the acquired multiple video sources;
determining a plurality of execution time periods for each of the at least one video source;
establishing a hierarchical relationship between the same type, the at least one video source, and a plurality of execution time periods for each video source;
storing the same type of at least one video source and a plurality of execution time periods for each video source in the database based on the hierarchical relationship.
10. The method of any of claims 1 to 9, wherein in the event that the activity comprises a video source, the method further comprises:
analyzing the video content of each execution time slot in the video source to obtain a corresponding analysis result;
determining the style parameter of the icon to be rendered corresponding to each execution time period according to the analysis result; wherein, different analysis results correspond to different style parameters.
11. The method of any one of claims 1 to 10, wherein in the event that the activity comprises a video source and the generation of the gantt chart is complete, the method further comprises:
in response to the cursor being suspended on the rendered icon of the Gantt chart, displaying the description information of the video content corresponding to the rendered icon; wherein the description information includes at least one of: a brief introduction of the video content, an alert of the video content;
and responding to the selected operation of the rendered icon, and displaying the video content corresponding to the rendered icon.
12. An apparatus for generating a gantt chart, the apparatus comprising:
an acquisition unit for acquiring at least one item to be processed; each of the pending items comprises at least one activity, each of the activities comprising a plurality of execution time periods;
the matching unit is used for matching a horizontal axis with rendered time scales with each execution time period aiming at each activity to obtain an icon to be rendered corresponding to each execution time period;
and the rendering unit is used for rendering the icon to be rendered based on the position of each activity on the vertical axis, the starting and ending time of each execution time period and the time scale of the horizontal axis to obtain the Gantt chart of the at least one item to be processed.
13. An electronic device comprising a memory and a processor, the memory storing a computer program operable on the processor, the processor implementing the steps of the method of any one of claims 1 to 11 when executing the program.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 11.
CN202210667455.3A 2022-06-13 2022-06-13 Gantt chart generation method and device, equipment and storage medium Withdrawn CN114911462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210667455.3A CN114911462A (en) 2022-06-13 2022-06-13 Gantt chart generation method and device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210667455.3A CN114911462A (en) 2022-06-13 2022-06-13 Gantt chart generation method and device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114911462A true CN114911462A (en) 2022-08-16

Family

ID=82770771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210667455.3A Withdrawn CN114911462A (en) 2022-06-13 2022-06-13 Gantt chart generation method and device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114911462A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115643428A (en) * 2022-12-23 2023-01-24 中央广播电视总台 Method, equipment and storage medium for making package pictures and texts

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115643428A (en) * 2022-12-23 2023-01-24 中央广播电视总台 Method, equipment and storage medium for making package pictures and texts
CN115643428B (en) * 2022-12-23 2023-03-28 中央广播电视总台 Method, equipment and storage medium for making package pictures and texts

Similar Documents

Publication Publication Date Title
US9576246B2 (en) Predictive modeling and data analysis in a secure shared system
CN103678468B (en) The system and method for improved consumption model for profiling
CN107193920B (en) Data processing method and device for client
CN113238741A (en) Form configuration method and device, electronic equipment and storage medium
CN113094674A (en) Page display method and device, electronic equipment and storage medium
CN109634579B (en) Code generation method, device, computer device and storage medium
CN113095995A (en) Webpage watermark adding method and device, electronic equipment and storage medium
CN112948226A (en) User portrait drawing method and device
CN114911462A (en) Gantt chart generation method and device, equipment and storage medium
CN110795180A (en) Two-dimensional code management method and system, electronic device and storage medium
CN113283216A (en) Webpage content display method, device, equipment and storage medium
CN112528207A (en) Activity page generation method and device and electronic equipment
CN114185750A (en) Process monitoring method, device, equipment and storage medium
CN114169303A (en) Method, device, equipment and medium for editing table based on vue.js
US20200327181A1 (en) Device for providing visitor behavior analysis data of dynamic webpage, and method for providing visitor behavior analysis data of website using same
CN113254016A (en) Interface generation method, interface information processing method, equipment and storage medium
CN111538645B (en) Data visualization method and related equipment
CN114968032A (en) Service processing method, device, equipment and computer readable storage medium
CN113704288A (en) Data display method and device, computer readable medium and electronic equipment
CN113934481A (en) Notification information pushing method, intelligent terminal and storage medium
EP3051468A1 (en) A graphical user interface for temporal representation of structured information in an object model
CN116401828A (en) Key event visual display method based on data characteristics
CN109766236A (en) KAFKA message queue number monitoring method, device, electronic equipment and storage medium
CN113515715B (en) Buried point event code generation method, buried point event code processing method and related equipment
CN115018473A (en) Service processing method, device, storage medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20220816

WW01 Invention patent application withdrawn after publication