A method, device and storage medium for simultaneously displaying status information of multiple devices
By converting the device status change data into time period data and displaying it in stacked column charts, the problem that multi-device status information in the prior art is difficult to visually display, and monitoring efficiency is improved.
Patent Information
- Application Number
- CN202080002733.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-11-12
AI Technical Summary
The prior art is difficult to quickly and intuitively display the status information of multiple devices through graphical methods, which makes it difficult for monitoring personnel to discover problems in the devices in a timely manner.
By obtaining the original state change data from each device, converting it into time period data, and displaying it in the form of stacked column charts in the graphical screen, it is ensured that the information of the state information of each device can change over time in the same graphical screen. Clear display.
It realizes intuitive display of multi-device status information, simplifies the process of monitoring personnel understanding the status of equipment, and improves the efficiency of discovering potential problems.
Smart Images

Figure CN114766018B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of drawing, and in particular to a method, an apparatus and a storage medium for simultaneously displaying status information of multiple devices. Background Art
[0002] With the development of technology, more and more devices can be monitored online.
[0003] Usually, a device will record a state change data after its state changes, recording the time when the state change occurs, the state after the change, and the device ID. For example, if the state of device 1 (assuming its device ID is 1) changes at 9 o'clock, from online to offline, a record will be generated: time is 9 o'clock, state is offline, and device ID is 1. The background obtains this data from each device in real time and provides it to the monitoring personnel, so that the monitoring personnel can understand the status of each device.
[0004] However, as time goes by, more and more monitoring data is generated. Since these data are in a discrete state, they cannot be displayed to users in a graphical way. As a result, it is difficult for users to quickly and intuitively understand the status of all devices through these numerous data, and it is impossible to discover possible problems in the equipment in time. Summary of the invention
[0005] The present disclosure provides a method, an apparatus and a storage medium for simultaneously displaying status information of multiple devices, so as to solve the above-mentioned technical problems existing in the prior art.
[0006] In the first aspect, in order to solve the above technical problems, the technical solution of a method for simultaneously displaying status information of multiple devices provided by the embodiment of the present disclosure is as follows:
[0007] Acquire, from at least one device, original data of changes in the device state of each device in the same time period; wherein each piece of the original data includes the time point data of the device state change and the changed state data, and the device state includes two states;
[0008] Convert the time point data of each device into time period data, and construct a first sequence in chronological order, and insert time period data with a value of 0 into the first sequence, so that the second sequence corresponding to each device includes the same second number of time period data, and the state data corresponding to the time period data at the same sequence position in all the second sequences are the same;
[0009] A corresponding graphic identifier is set for each status data, and each time period data in the second sequence is plotted in the graphic area of the corresponding device as the duration of the corresponding status data, so that the information on the device status of at least one device changing over time is displayed in the same graphic screen.
[0010] A possible implementation method is to convert the time point data of each device into time period data and construct a first sequence in chronological order, including:
[0011] For the original data of the same device, according to the time sequence, the first difference value corresponding to the data of two adjacent time points is determined as one of the time period data, and the state data corresponding to the smaller one of the two adjacent time point data is determined as the state data corresponding to the time period data;
[0012] All the time period data belonging to the same device are constructed into a first sequence in the time order.
[0013] In a possible implementation, determining the first difference value corresponding to the data of two adjacent time points as the time period data includes:
[0014] Determine the first time period data of the corresponding device according to whether the first time point data of each device is the minimum value of the time points in the same time period;
[0015] The third difference between the current time point data and the last time point data of each device is determined as the last time period data of the corresponding device; wherein, except for the first time period data and the last time period time, other time period data are determined by the difference between two adjacent time point data.
[0016] A possible implementation method is to determine the first time period data of the corresponding device according to whether the first time point data of each device is the minimum value of the time points in the same time period, including:
[0017] Determine whether the first time point data of each device is the minimum value;
[0018] If the first time point data is not the minimum value, 0 is used as an adjacent time point data of the first time point data, and the second difference between the first time point data and the minimum value is used as the first time period data, and the corresponding state data is different from the state data corresponding to the first time point data;
[0019] If the first time point data is the minimum value, the third difference between the second time point data and the first time point data is used as the first time period data.
[0020] A possible implementation manner, by inserting time period data with a value of 0 into the first sequence, so that the second sequence corresponding to each device includes the same second number of time period data, and the time period data located at the same sequence position in all the second sequences corresponds to the same state data, includes:
[0021] For the first sequence in which the status data corresponding to the first time period data is not the preset status data, insert time period data with a value of 0 before the first time period data and correspond to the preset status data to obtain a third sequence;
[0022] The state data corresponding to the first time period data is the first sequence of the preset state data as the third sequence;
[0023] Determine a first total quantity of time period data included in each third sequence, and determine the first total quantity with the largest value as the second quantity;
[0024] At the end of the third sequence in which the first total quantity is less than the second quantity, insert time period data with a value of 0 and a third quantity, and make the corresponding status data different from the status data corresponding to the adjacent time period data, to obtain the second sequence; wherein the third quantity is the difference between the second quantity and the corresponding first total quantity.
[0025] In a possible implementation, the data of each time period in the second sequence is plotted as the retention time of the corresponding state data in a graphic area of the corresponding device, including:
[0026] Starting from the first time period data in all the first series, the time period data at the same sequence position are taken out in sequence to form a series array until the last time period data is taken out to obtain the series data;
[0027] Echarts is used to draw a stacked column chart based on the multiple devices and the seriers data.
[0028] A possible implementation method is to obtain original data of device status changes in the same time period from multiple devices respectively, including:
[0029] Periodically or when a preset condition occurs, obtain all the raw data of the day before the current time from multiple devices;
[0030] The time period from 0 o'clock to the current time is regarded as the same time period.
[0031] In a second aspect, an embodiment of the present disclosure provides an apparatus for simultaneously displaying status information of multiple devices, including:
[0032] An acquisition unit, used to acquire, from at least one device, original data of changes in the device state of each device in the same time period; wherein each piece of the original data includes the time point data of the device state change and the changed state data, and the device state includes two states;
[0033] a data construction unit, configured to convert the time point data of each device into time period data, and construct a first sequence in chronological order, and insert time period data with a value of 0 into the first sequence, so that a second sequence corresponding to each device includes the same second number of time period data, and the state data corresponding to the time period data at the same sequence position in all the second sequences are the same;
[0034] A display unit is used to set a corresponding graphic identifier for each status data, and draw the data of each time period in the second sequence as the duration of the corresponding status data in the graphic area of the corresponding device, so that the information of the device status of at least one device changing over time is displayed in the same graphic screen.
[0035] In a possible implementation manner, the data construction unit is used to:
[0036] For the original data of the same device, according to the time sequence, the first difference value corresponding to the data of two adjacent time points is determined as one of the time period data, and the state data corresponding to the smaller one of the two adjacent time point data is determined as the state data corresponding to the time period data;
[0037] All the time period data belonging to the same device are constructed into a first sequence in the time order.
[0038] In a possible implementation manner, the data construction unit is further used for:
[0039] Determine the first time period data of the corresponding device according to whether the first time point data of each device is the minimum value of the time points in the same time period;
[0040] The third difference between the current time point data and the last time point data of each device is determined as the last time period data of the corresponding device; wherein, except for the first time period data and the last time period time, other time period data are determined by the difference between two adjacent time point data.
[0041] In a possible implementation manner, the data construction unit is further used for:
[0042] Determine whether the first time point data of each device is the minimum value;
[0043] If the first time point data is not the minimum value, 0 is used as an adjacent time point data of the first time point data, and the second difference between the first time point data and the minimum value is used as the first time period data, and the corresponding state data is different from the state data corresponding to the first time point data;
[0044] If the first time point data is the minimum value, the third difference between the second time point data and the first time point data is used as the first time period data.
[0045] In a possible implementation manner, the data construction unit is further used for:
[0046] For the first sequence in which the status data corresponding to the first time period data is not the preset status data, insert time period data with a value of 0 before the first time period data and correspond to the preset status data to obtain a third sequence;
[0047] The state data corresponding to the first time period data is the first sequence of the preset state data as the third sequence;
[0048] Determine a first total quantity of time period data included in each third sequence, and determine the first total quantity with the largest value as the second quantity;
[0049] At the end of the third sequence in which the first total quantity is less than the second quantity, insert time period data with a value of 0 and a third quantity, and make the corresponding status data different from the status data corresponding to the adjacent time period data, to obtain the second sequence; wherein the third quantity is the difference between the second quantity and the corresponding first total quantity.
[0050] In a possible implementation manner, the display unit is used for:
[0051] Starting from the first time period data in all the first series, the time period data at the same sequence position are taken out in sequence to form a series array until the last time period data is taken out to obtain the series data;
[0052] Echarts is used to draw a stacked column chart based on the multiple devices and the seriers data.
[0053] In a possible implementation manner, the acquisition unit is further configured to:
[0054] Periodically or when a preset condition occurs, obtain all the raw data of the day before the current time from multiple devices;
[0055] The time period from 0 o'clock to the current time is regarded as the same time period.
[0056] In a third aspect, an embodiment of the present disclosure further provides an apparatus for simultaneously displaying status information of multiple devices, including:
[0057] at least one processor, and
[0058] a memory coupled to the at least one processor;
[0059] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method as described in the first aspect above by executing the instructions stored in the memory.
[0060] In a fourth aspect, an embodiment of the present disclosure further provides a readable storage medium, including:
[0061] Memory,
[0062] The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A flowchart of simultaneously displaying multiple device status information provided by an embodiment of the present disclosure;
[0064] Figure 2 A schematic diagram of setting the first time period data in multiple sequences to have the same state data provided by an embodiment of the present disclosure;
[0065] Figure 3 A schematic diagram of obtaining a second sequence of each device provided in an embodiment of the present disclosure;
[0066] Figure 4 A stacked column chart of multiple devices provided by an embodiment of the present disclosure;
[0067] Figure 5 A schematic diagram of the structure of an apparatus for simultaneously displaying status information of multiple devices provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0068] The embodiments of the present disclosure provide a method, an apparatus and a storage medium for simultaneously displaying status information of multiple devices to solve the above-mentioned technical problems existing in the prior art.
[0069] In order to better understand the above technical scheme, the technical scheme of the present disclosure is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present disclosure and the specific features in the embodiments are detailed descriptions of the technical scheme of the present disclosure, rather than limitations on the technical scheme of the present disclosure. In the absence of conflict, the embodiments of the present disclosure and the technical features in the embodiments can be combined with each other.
[0070] Please refer to Figure 1 , an embodiment of the present disclosure provides a method for simultaneously displaying status information of multiple devices, and the processing process of the method is as follows.
[0071] Step 101: Obtain original data of device status changes of each device in the same time period from at least one device; wherein each piece of original data includes time point data of device status change and status data after the change, and the device status includes two states.
[0072] For example, multiple devices include device 1 to device 3, and the status of these three devices needs to be monitored at the same time. Assume that the device status of these devices includes online status and offline status, and the same time period is from 0:00 of the day to the current time (22:00) when the original data is obtained on the same day, then the current time period is 0 to 22. These records generated due to status changes can be used as {changed status data, occurrence time, device identification}. The status data includes online (indicated by 1) and offline (indicated by 0). The occurrence time is the time point data in the present disclosure. The device identifications of devices 1 to 3 are 1, 2, and 3 respectively, and the data format of the occurrence time is hour: minute: second.
[0073] During this time period, the records generated by device 1 due to state changes are {1, 00:00:00, 1}, {0, 12:10:50, 1}, {1, 20:05:02, 1}, which constitute all the original data of device 1 during the period from 0 to 22 o'clock; the records generated by device 2 due to state changes are {0, 03:50:30, 2}, {1, 14:15:00, 2}, {0, 18:55:20, 2}, which constitute all the original data of device 2 during the period from 0 to 22 o'clock; the records generated by device 3 due to state changes are {0, 00:00:00, 3}, {1, 22:00:00, 3}, which constitute all the original data of device 3 during the period from 0 to 22 o'clock.
[0074] At 22:00, all the original data generated on the day are read from devices 1 to 3 respectively, so that all the original data of all devices in the same time period can be obtained.
[0075] After the original data generated by multiple devices in the same time period are acquired, step 102 may be executed.
[0076] Step 102: Convert the time point data of each device into time period data, and construct a first sequence in chronological order, by inserting time period data with a value of 0 into the first sequence, so that the second sequence corresponding to each device includes the same second number of time period data, and the status data corresponding to the time period data at the same sequence position in all second sequences are the same.
[0077] The time point data of each device is converted into time period data and constructed into a first sequence in chronological order. The following methods can be used:
[0078] For the original data of the same device in chronological order, the first difference between the data of two adjacent time points is determined as a time period data, and the state data corresponding to the smaller of the two adjacent time point data is determined as the state data corresponding to the time period data; all time period data belonging to the same device are constructed into a first sequence in chronological order.
[0079] Taking the above example of device 1 to device 3, since the data format of the time point data is hour: minute: second, it can be converted into decimal data with 3 decimal points for the convenience of calculation. Assuming that it is converted into hours, the following formula can be used: (h×3600+m×60+s) / 3600, where h represents hours, m represents minutes, and s represents seconds. After using this formula for data conversion, the data of device 1 to device 3 can be obtained as follows: {1, 0, 1}, {0, 12.18, 1}, {1, 20.08, 1}, {0, 3.84, 2}, {1, 14.25, 2}, {0, 18.92, 2}, {0, 0, 3}, {1, 22, 3}.
[0080] For each device, a time period data can be obtained by calculating the first difference between two adjacent time point data. For example, the first difference between time point data 0 and time point data 12.18 (12:10:50) in device 1 is 12.18-0=12.18, and the first difference between time point data 12.18 (12:10:50) and time point data 20.08 (20:05:02) is 20.08-12.18=7.9; the first difference between time point data 3.84 (03:50:30) and time point 14.25 (14:15:00) in device 2 is 14.25-3.84=10.41, and the first difference between time point data 14.25 (14:15:00) and time point 18.92 (18:55:20) is 18.92-14.25=4.67. Similarly, the first difference between the two time points of device 3 can be calculated to be 22.
[0081] It should be noted that if the time point data recorded in the device is recorded in the same unit, such as hours, minutes, and seconds, there is no need to use the above formula for conversion. Or if the time point data is recorded in a format including hours, minutes, and seconds as described in the above example, the corresponding hours, minutes, and seconds can be directly calculated separately, or the calculation can be completed and then converted into data of a time unit.
[0082] However, for the same time period, the time point data at both ends of the same time period are actually implied. Therefore, to calculate all the time period data of the same device in the same time period, it is also necessary to calculate the time point data at both ends with the first time point data and the last time point data of each device respectively. This can be achieved in the following way:
[0083] The first time period data of the corresponding device is determined according to whether the first time point data of each device is the minimum value of the time points in the same time period.
[0084] For example, in the above example of device 1 to device 3, their first time point data are 0, 3.84, and 0 respectively, and the same time period is 0 to 22. Therefore, by judging whether the first time point data is the minimum value of the time point in the same time period, it can be determined whether there is a time period between the first time point data and the minimum time point of the same time period to determine the first time period data.
[0085] The first time period data can be determined in the following ways:
[0086] Determine whether the first time point data of each device is the minimum value; if the first time point data is not the minimum value, use 0 as an adjacent time point data of the first time point data, and use the second difference between the first time point data and the minimum value as the first time period data, and the corresponding status data is different from the status data corresponding to the first time point data; if the first time point data is the minimum value, use the third difference between the second time point data and the first time point data as the first time period data.
[0087] Continuing with device 1 to device 3 as an example, their first time point data are 0, 3.84, and 0 respectively, and the same time period is 0 to 22. Therefore, it can be determined that only the first time point data of device 2 is not 0, and then it is necessary to determine that the first time period data of device 2 is 3.84-0=3.84, and the first time period data of devices 1 and 3 is the second difference between the second time point data and the first time point data, that is, 12.18 and 22.
[0088] It should be noted that the difference between the second time point data and the first time point data of device 1 and device 3 only needs to be calculated once, and should not be understood as repeated calculation twice. Judging whether the first time point data is the minimum value of the time points in the same time period can effectively prevent the omission of time period data.
[0089] In addition to determining the first time period data for each device, you also need to determine the last time period data for each device:
[0090] The third difference between the current time point data and the last time point data of each device is determined as the last time period data of the corresponding device; wherein, except for the first time period data and the last time period time, other time period data are determined by the difference between two adjacent time point data.
[0091] For example, still taking the aforementioned device 1 to device 3 as an example, their last time point data are 20.08, 18.92, and 22 respectively. Assuming that the current time point is 23:00, the current time point data is 23. Through judgment, it can be determined that the last time point data of device 1 to device 3 are not equal to the current time point data (23). Therefore, it is necessary to determine the last time period data of device 1 and device 2, which are 23-20.08=2.92, 23-18.92=4.08, and 23-22=1 respectively.
[0092] Through the above method, the time period data of all devices can be determined, and then all the time period data of each device can be combined into a first sequence in time order. The time order here refers to the order in which time passes, that is, the time period corresponding to the time period data passes first, and its sequence position in the first sequence is higher. For example, the first sequences of the above devices 1 to 3 are {12.18, 7.9, 2.92}, {3.84, 10.41, 4.67, 4.08}, and {22, 1} respectively.
[0093] The status data corresponding to these time period data are usually determined based on the status data of the minimum time point data corresponding to the time period. In order to facilitate understanding, the status data and the time period data are recorded together. The status data are marked with 0 and 1, 0 represents offline and 1 represents online. Therefore, the time period data of device 1 to device 3 and their corresponding status data can be expressed as: {(12.18, 1), (7.9, 0), (1.92, 1)}, {(3.84, 1), (10.41, 0), (4.67, 1), (3.08, 0)}, {(22, 0), (1, 1)}.
[0094] When determining the last time period data for each device, the third difference between the current time point data and the last time point data is used as the last time period data, which can display the current device status of the device in real time and facilitate real-time monitoring of device status changes.
[0095] In order to draw graphics using relevant drawing software, the first sequence corresponding to each device needs to be adjusted to have the same number of time period data and the same state data corresponding to the visual segment data at the same sequence position. This can be achieved in the following ways:
[0096] For the first sequence in which the status data corresponding to the first time period data is not the preset status data, insert the time period data with a value of 0 before the first time period data and correspond to the preset status data to obtain the third sequence; the first sequence in which the status data corresponding to the first time period data is the preset status data is taken as the third sequence. The preset status data may be the status data specified by the user, or the status data corresponding to the first time period data in the first sequence containing the largest number of time period data.
[0097] See also Figure 2 A schematic diagram of setting the first time period data in multiple sequences to have the same state data is provided in an embodiment of the present disclosure. The first sequences of devices 1 to 3 are {(12.18, 1), (7.9, 0), (1.92, 1)}, {(3.84, 1), (10.41, 0), (4.67, 1), (3.08, 0)}, {(22, 0), (1, 1)}, respectively. The preset state data is 0 (offline). Then, it can be determined that the device 1 to the device 3 have the same state data. The state data corresponding to the first time period data of device 1 and device 2 is not 0, so it is necessary to insert a time period data with a value of 0 before it and set the corresponding state data to 0, and the third sequences of device 1 and device 2 are {(0, 0), (12.18, 1), (7.9, 0), (1.92, 1)}, {(0, 0), (3.84, 1), (10.41, 0), (4.67, 1), (3.08, 0)} respectively. The state data corresponding to the first time period data in the first sequence of device 3 is 0, so the first sequence of device 3 is used as the third sequence {(22, 0), (1, 1)}.
[0098] Since the time when the device status of each device occurs is different, the number of time period data included in each device is usually different. Therefore, it is necessary to fill the insufficient number by inserting a short time with a value of 0. The following method can be used:
[0099] Determine a first total number of time period data included in each third sequence, and determine the first total number with the largest value as the second number; at the end of the third sequence whose first total number is less than the second number, insert time period data with a value of 0 and a third number, and make the corresponding status data different from the status data corresponding to the adjacent time period data, to obtain a second sequence; wherein the third number is the difference between the second number and the corresponding first total number.
[0100] See also Figure 3A schematic diagram of obtaining the second sequence of each device provided in the embodiment of the present disclosure, assuming that the third sequences of devices 1 to 3 are respectively: {(0, 0), (12.18, 1), (7.9, 0), (1.92, 1)}, {(0, 0), (3.84, 1), (10.41, 0), (4.67, 1), (3.08, 0)}, {(22, 0), (1, 1)}, it can be determined that the first total number of time period data included in the third sequence corresponding to devices 1 to 3 is respectively: 4, 5, 2, so it can be determined that the first total number corresponding to device 2 is the largest, and it is determined as the second number (5). The difference between the second number and the first total number corresponding to each device is calculated as the third number of the corresponding device, and the third numbers corresponding to devices 1 to 3 are 1, 0, and 3 respectively.
[0101] Therefore, it is necessary to insert a time period data with a value of 0 at the end of the third sequence corresponding to device 1, and set the corresponding state data to be the same as the state data corresponding to the last time period data in device 2; insert three time period data with a value of 0 at the end of device 3, and set their corresponding state data to be the same as the state data corresponding to the last three time period data in device 2. In this way, the second sequences of devices 1 to 3 can be obtained, which are: {(0, 0), (12.18, 1), (7.9, 0), (1.92, 1), (0, 0)}, {(0, 0), (3.84, 1), (10.41, 0), (4.67, 1), (3.08, 0)}, {(22, 0), (1, 1), (0, 0), (0, 0), (0, 0)}.
[0102] It should be noted that the first, second and third sequences mentioned above do not need to record the status data corresponding to each time period data in actual use, because the status data corresponding to these actual segment data are either 0 or 1. From the above example 2, it can be seen that the status data corresponding to two adjacent time period data in the second sequence are different, while the status data corresponding to the time period data at the same sequence position are the same. Therefore, after determining the status data corresponding to the first time period data in the second sequence, the status data of other time period data are also determined. In actual use, for the convenience of calculation, the status data corresponding to each time period data may not be recorded in the sequence. For example, the second sequences of devices 1 to 3 can be recorded as {0, 12.18, 7.9, 1.92, 0}, {0, 3.84, 10.41, 4.67, 3.08}, and {22, 1, 0, 0, 0}, respectively.
[0103] After the second sequence of each device is obtained, the device status change of each device can be displayed in the same graphic picture, and step 103 is executed.
[0104] Step 103: Set a corresponding graphic identifier for each state data, and draw each time period data in the second sequence as the duration of the corresponding state data in the graphic area of the corresponding device, so that the information of the device state changing over time of at least one device is displayed in the same graphic screen.
[0105] Displaying the device status changes of each device on the same graphic screen can be achieved in the following ways:
[0106] Starting from the first time period data in all the first series, take out the time period data at the same sequence position in turn and form an array of series until the last time period data is taken to obtain the series data; use Echarts to draw a stacked column chart based on multiple devices and series data.
[0107] For example, you need to use Echarts to draw a stacked column chart based on device 1 to device 3. Set the status data to 0 with a twill graphic and set the status data to 1 with a black graphic. The second series of device 1 to device 3 are {0, 12.18, 7.9, 1.92, 0}, {0, 3.84, 10.41, 4.67, 3.08}, {22, 1, 0, 0, 0} respectively. Remove the time period data at the same position from the first time period of the second series of each device to construct a series of arrays:
[0108] The first array is {0, 0, 22}, the second array is {12.18, 3.84, 1}, the third array is {7.9, 10.41, 0}, the fourth array is {1.92, 4.67, 0}, and the fifth array is {0, 3.08, 0}. These five arrays together constitute the seriers data of device 1 to device 3. Then, Echarts can be used to draw a stacked column chart with device 1 to device 3 as the vertical axis and time as the horizontal axis (the data on the horizontal axis is provided by the seriers data). Please refer to Figure 4 A stacked column chart of multiple devices provided for an embodiment of the present disclosure.
[0109] By setting conditions for the time when the raw data of each device is obtained, the status change information in the graphic screen can be updated in real time.
[0110] The raw data can be obtained from multiple devices periodically or when a preset condition occurs, and all the raw data of the day before the current time can be obtained from multiple devices; the time period from 0 o'clock to the current time is regarded as the same time period.
[0111] For example, when the user enters the graphic screen of device 1 to device 3 (the user entering the graphic interface can be set as a preset condition), all historical data from 0 o'clock to the current time can be obtained from device 1 to device 3, and the information on the device status changes over time of each device can be displayed through the method introduced in the present invention; or, when the user currently stays in the graphic screen, all historical data from 0 o'clock to the current time can be periodically obtained to redraw the information on the device status changes over time in the graphic screen.
[0112] Based on the same inventive concept, an embodiment of the present disclosure provides a device for simultaneously displaying the status information of multiple devices. The specific implementation of the method for simultaneously displaying the status information of multiple devices of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 5 , the device comprises:
[0113] The acquisition unit 501 is used to respectively acquire, from at least one device, original data of the device state change of each device in the same time period; wherein each piece of the original data includes the time point data of the device state change and the changed state data, and the device state includes two states;
[0114] The data construction unit 502 is used to convert the time point data of each device into time period data, and construct a first sequence in chronological order, and insert the time period data with a value of 0 into the first sequence, so that the second sequence corresponding to each device includes the same second number of time period data, and the state data corresponding to the time period data at the same sequence position in all the second sequences are the same;
[0115] The display unit 503 is used to set a corresponding graphic identifier for each status data, and draw the data of each time period in the second sequence as the duration of the corresponding status data in the graphic area of the corresponding device, so that the information of the device status of at least one device changing over time is displayed in the same graphic screen.
[0116] In a possible implementation manner, the data construction unit 502 is used to:
[0117] For the original data of the same device, according to the time sequence, the first difference value corresponding to the data of two adjacent time points is determined as one of the time period data, and the state data corresponding to the smaller one of the two adjacent time point data is determined as the state data corresponding to the time period data;
[0118] All the time period data belonging to the same device are constructed into a first sequence in the time order.
[0119] In a possible implementation manner, the data construction unit 502 is further configured to:
[0120] Determine the first time period data of the corresponding device according to whether the first time point data of each device is the minimum value of the time points in the same time period;
[0121] The third difference between the current time point data and the last time point data of each device is determined as the last time period data of the corresponding device; wherein, except for the first time period data and the last time period time, other time period data are determined by the difference between two adjacent time point data.
[0122] In a possible implementation manner, the data construction unit 502 is further configured to:
[0123] Determine whether the first time point data of each device is the minimum value;
[0124] If the first time point data is not the minimum value, 0 is used as an adjacent time point data of the first time point data, and the second difference between the first time point data and the minimum value is used as the first time period data, and the corresponding state data is different from the state data corresponding to the first time point data;
[0125] If the first time point data is the minimum value, the third difference between the second time point data and the first time point data is used as the first time period data.
[0126] In a possible implementation manner, the data construction unit 502 is further configured to:
[0127] For the first sequence in which the status data corresponding to the first time period data is not the preset status data, insert time period data with a value of 0 before the first time period data and correspond to the preset status data to obtain a third sequence;
[0128] The state data corresponding to the first time period data is the first sequence of the preset state data as the third sequence;
[0129] Determine a first total quantity of time period data included in each third sequence, and determine the first total quantity with the largest value as the second quantity;
[0130] At the end of the third sequence in which the first total quantity is less than the second quantity, insert time period data with a value of 0 and a third quantity, and make the corresponding status data different from the status data corresponding to the adjacent time period data, to obtain the second sequence; wherein the third quantity is the difference between the second quantity and the corresponding first total quantity.
[0131] In a possible implementation manner, the display unit 503 is used to:
[0132] Starting from the first time period data in all the first series, the time period data at the same sequence position are taken out in sequence to form a series array until the last time period data is taken out to obtain the series data;
[0133] Echarts is used to draw a stacked column chart based on the multiple devices and the seriers data.
[0134] In a possible implementation manner, the acquiring unit 501 is further configured to:
[0135] Periodically or when a preset condition occurs, obtain all the raw data of the day before the current time from multiple devices;
[0136] The time period from 0 o'clock to the current time is regarded as the same time period.
[0137] Based on the same inventive concept, an embodiment of the present disclosure provides a device for simultaneously displaying status information of multiple devices, including: at least one processor, and
[0138] a memory coupled to the at least one processor;
[0139] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method for simultaneously displaying status information of multiple devices as described above by executing the instructions stored in the memory.
[0140] Based on the same inventive concept, the embodiment of the present disclosure further provides a readable storage medium, including:
[0141] Memory,
[0142] The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium completes the method for simultaneously displaying status information of multiple devices as described above.
[0143] Those skilled in the art will appreciate that the disclosed embodiments may be provided as methods, systems, or computer program products. Therefore, the disclosed embodiments may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the disclosed embodiments may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0147] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A method for simultaneously displaying status information of multiple devices, wherein: include: Acquire, from at least one device, original data of changes in the device state of each device in the same time period; wherein each piece of the original data includes the time point data of the device state change and the changed state data, and the device state includes two states; Convert the time point data of each device into time period data, and construct a first sequence in chronological order, and insert time period data with a value of 0 into the first sequence, so that the second sequence corresponding to each device includes the same second number of time period data, and the state data corresponding to the time period data at the same sequence position in all the second sequences are the same; A corresponding graphic identifier is set for each status data, and each time period data in the second sequence is plotted in the graphic area of the corresponding device as the duration of the corresponding status data, so that the information on the device status of at least one device changing over time is displayed in the same graphic screen.
2. The method of claim 1, wherein: The time point data of each device is converted into time period data and constructed into a first sequence in chronological order, including: For the original data of the same device, according to the time sequence, the first difference value corresponding to the data of two adjacent time points is determined as one of the time period data, and the state data corresponding to the smaller one of the two adjacent time point data is determined as the state data corresponding to the time period data; All the time period data belonging to the same device are constructed into a first sequence in the time order.
3. The method of claim 2, wherein: Determining a first difference value corresponding to two adjacent time point data as a time period data includes: Determine the first time period data of the corresponding device according to whether the first time point data of each device is the minimum value of the time points in the same time period; The third difference between the current time point data and the last time point data of each device is determined as the last time period data of the corresponding device; wherein, except for the first time period data and the last time period time, other time period data are determined by the difference between two adjacent time point data.
4. The method of claim 3, wherein: According to whether the first time point data of each device is the minimum value of the time points in the same time period, the first time period data of the corresponding device is determined, including: Determine whether the first time point data of each device is the minimum value; If the first time point data is not the minimum value, 0 is used as an adjacent time point data of the first time point data, and the second difference between the first time point data and the minimum value is used as the first time period data, and the corresponding state data is different from the state data corresponding to the first time point data; If the first time point data is the minimum value, the third difference between the second time point data and the first time point data is used as the first time period data.
5. The method of claim 2, wherein: By inserting time period data with a value of 0 into the first sequence, the second sequence corresponding to each device includes the same second number of time period data, and the time period data located at the same sequence position in all the second sequences correspond to the same state data, including: For the first sequence in which the status data corresponding to the first time period data is not the preset status data, insert time period data with a value of 0 before the first time period data and correspond to the preset status data to obtain a third sequence; The state data corresponding to the first time period data is the first sequence of the preset state data as the third sequence; Determine a first total quantity of time period data included in each third sequence, and determine the first total quantity with the largest value as the second quantity; At the end of the third sequence in which the first total quantity is less than the second quantity, insert time period data with a value of 0 and a third quantity, and make the corresponding status data different from the status data corresponding to the adjacent time period data, to obtain the second sequence; wherein the third quantity is the difference between the second quantity and the corresponding first total quantity.
6. The method according to any one of claims 1 to 5, wherein: Drawing the duration of each time period data in the second sequence as corresponding state data in a graphic area of the corresponding device includes: Starting from the first time period data in all the first series, the time period data at the same sequence position are taken out in sequence to form a series array until the last time period data is taken out to obtain the series data; Echarts is used to draw a stacked column chart based on the multiple devices and the series data.
7. The method of claim 6, wherein: Acquiring original data of changes in the device state of each device in the same time period from at least one device respectively, including: Periodically or when a preset condition occurs, all raw data of the day before the current time are obtained from each of the devices; The time period from 0 o'clock to the current time is regarded as the same time period.
8. A device for simultaneously displaying status information of multiple devices, wherein: include: An acquisition unit, which acquires original data of device status changes of each device in the same time period from at least one device, wherein each piece of the original data includes time point data of the device status change and status data after the change, and the device status includes two states; A data construction unit, used to convert the time point data of each device into time period data, and construct a first sequence in chronological order, and insert time period data with a value of 0 into the first sequence, so that the second sequence corresponding to each device includes the same second number of time period data, and the state data corresponding to the time period data located at the same sequence position in all the second sequences are the same; wherein, if the first number of time period data included in the first sequence is less than the second number, the first sequence after the insertion of 0 is used as the second sequence, and if the first number is equal to the second number, the first sequence is used as the second sequence; A display unit is used to set a corresponding graphic identifier for each status data, and draw the data of each time period in the second sequence as the duration of the corresponding status data in the graphic area of the corresponding device, so that the information of the device status of at least one device changing over time is displayed in the same graphic screen.
9. A device for simultaneously displaying status information of multiple devices, wherein: include: at least one processor, and a memory coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the at least one processor executes the method according to any one of claims 1 to 7 by executing the instructions stored in the memory.
10. A readable storage medium, wherein: Including memory, The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the method as described in any one of claims 1 to 7.
