Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus for counting equipment state, can utilize seldom
System resource accurately counts the state of all devices in a certain amount of time, then based on the status information of preservation, accurately divides
The utilization rate etc. of equipment is precipitated.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of side for counting equipment state is provided
Method.
The method of the statistics equipment state of the embodiment of the present invention includes: to obtain status information and the guarantor of equipment original state
It deposits;The status command of monitoring device, the status command are used to indicate the state of equipment operation;According to the equipment monitored
Status command judge whether to save the status information of the equipment current state.
Optionally, the step of obtaining status information and the preservation of equipment original state includes: to obtain equipment original state
Status information;Determine the device identification of the equipment;The state of the device identification of the equipment and equipment original state is believed
Breath is accordingly saved into status list.
Optionally, judge whether to save the shape of the equipment current state according to the status command of the equipment monitored
The step of state information, comprises determining that current state indicated by the status command of the equipment monitored;Judge the current state
Whether the state recorded recently with equipment described in the status list is consistent;If it is inconsistent, by the current state
Status information is saved to the status list.
Optionally, the status information includes but is not limited to: status indicator, state initial time and state end time.
To achieve the above object, other side according to an embodiment of the present invention provides a kind of statistics equipment state
Device.
The device of the statistics equipment state of the embodiment of the present invention includes: initialization module, for obtaining equipment original state
Status information and preservation;Monitoring module, for the status command of monitoring device, the status command is used to indicate equipment operation
State;Judgment module, for judging whether to save the current shape of the equipment according to the status command of the equipment monitored
The status information of state.
Optionally, the initialization module is also used to, and the initialization module is also used to, and obtains the shape of equipment original state
State information;Determine the device identification of the equipment;By the device identification of the equipment and the status information of equipment original state
Accordingly save into status list.
Optionally, the judgment module is also used to, and is determined current indicated by the status command of the equipment monitored
State;Whether the state for judging that the current state and equipment described in the status list record recently is consistent;If different
It causes, then saves the status information of the current state to the status list.
Optionally, the status information includes but is not limited to: status indicator, state initial time and state end time.
To achieve the above object, another aspect according to an embodiment of the present invention provides a kind of statistics equipment state
Electronic equipment.
The electronic equipment of the statistics equipment state of the embodiment of the present invention includes: one or more processors;Storage device is used
In storing one or more programs, when one or more of programs are executed by one or more of processors, so that described
The method that one or more processors realize the statistics equipment state of any of the above-described.
To achieve the above object, another aspect according to an embodiment of the present invention provides a kind of computer-readable medium,
It is stored thereon with computer program, which is characterized in that realize that the statistics of any of the above-described is set when described program is executed by processor
The method of standby state.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that real-time by instructing to equipment state
Monitoring can record in time the status information of the equipment when equipment state changes, avoid the omission to equipment state.And only
Have and judge whether to save status information when equipment receives status command, solves and continually scan for equipment state in the prior art
The problem of occupying a large amount of system resources.All devices can be obtained through the embodiment of the present invention, and accurately state is believed within the period
Breath, based on this, accurately status information, Data Analyst can precisely determine the parameters such as equipment hour utilization rate, and then be analysis
The increase and decrease of the state distribution and equipment of equipment, provides accurately decision support.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment
With explanation.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 2 is the schematic diagram of the main flow of the method for statistics equipment state according to an embodiment of the present invention, such as Fig. 2 institute
Show, the method for the statistics equipment state of the embodiment of the present invention specifically includes that
Step S201: the status information of equipment original state and preservation are obtained.Specifically, for all of state to be counted
Equipment obtains the status information of all devices original state, and determines the device identification of all devices, by setting for all devices
The status information of standby mark and equipment original state is accordingly saved into status list, so that being learnt by the status list
The status information of each equipment original state.The process is alternatively referred to as the process of init state list.
Wherein, status information includes but is not limited to: status indicator, state initial time and state end time.In the step
Before rapid, stateful to the institute involved by equipment it can also be identified, then it can be directly by status indicator when saving status information
It saves into status list.In embodiments of the present invention, there is one-to-one relationship, equipment mark between status indicator and state
Know has one-to-one relationship between equipment.For sorting trolley, the state being likely to be at includes but is not limited to: carrying on the back
Packet is advanced, load carried by animals waits, empty wagons is advanced, empty wagons waits and idle.Such as table 1 after above-mentioned status indicator:
Status indicator |
State |
1 |
Load carried by animals is advanced |
2 |
Load carried by animals waits |
3 |
Empty wagons is advanced |
4 |
Empty wagons waits |
5 |
It is idle |
Table 1
In above-mentioned steps, status information can be saved into the state into the table with generating device by establishing table
List.The table can be four column, respectively device identification, state initial time, state end time and status indicator.Such as to
All equipment of statistic behavior include three sorting trolleies in total, and device identification is respectively a1, a2 and a3, equipment a1, a2
Original state with a3 is respectively that load carried by animals is advanced, load carried by animals waits and empty wagons is advanced.Pass through the initial shape generated after step S201
State list is table 2:
Table 2
In addition, in above-mentioned table 2, t0 is represented at the time of obtain equipment original state, due to obtain original state when
It carves, the original state is also in the operation phase, so representing without the time that state terminates, -1 in the table also in the shape of operation
The end time of state.Certainly, can also be by other fixed numbers or symbology in the end time of the state of operation, it can also not
Fill in the end time also in the state of operation.
Step S202: the status command of monitoring device, status command are used to indicate the state of equipment operation.In control system
When generating status command, parameter can be added at the place end to end of the status command, so that equipment is receiving control system sending
When status command, which is saved, and step S203 is carried out based on the status command.Equipment is receiving control
After the status command that system issues, the state of operation can be changed based on the status command.For example, equipment a3 original state is empty wagons
It advances, according to the performance of task, the status command that control system is issued to equipment a3 is empty wagons waiting, then equipment a3 is based on
The status command runs the state that empty wagons waits, i.e. the operating status of equipment a3 is changed to empty wagons waiting by empty wagons traveling.
Step S203: judge whether that the state for saving the equipment current state is believed according to the status command of the equipment monitored
Breath.For each equipment of state to be counted, current state indicated by the status command of the equipment monitored is determined;Sentence
Whether disconnected current state and the state that the equipment records recently in status list are consistent.The state that the equipment records recently refers to phase
For current state, i.e., the state before equipment runs current state is the state recorded recently.If current state
If the equipment records recently in status list state consistency, then do not have to that processing can not be had to;If it is inconsistent, by current
The status information of state is saved to status list.Newly-increased status information is saved into status list, and then passes through the state
List is it can be learnt that from init state list to the status information of current time all devices.Pass through prior art timing scan
The status information of the state recording state of all devices not only cannot accurately confirm the equipment state in certain time period, but also
The information scanned every time is recorded in different tables.Information due to scanning acquisition every time may be different, by Multiple-Scan
Status information table also inconvenient operation when integrating.Through the embodiment of the present invention, it can be directly obtained including a certain specific period
Interior all devices accurately status information.Wherein, if saving the state end time in status list, also pass through status list
The state initial time of middle state and state end time can accurately get the period that equipment is run in each state,
The prior art is unable to reach the effect.
After the status information for judging preservation current state by status command, the initial time of the current state is recorded
The time of status command, i.e. current time are received for equipment.Since equipment is after receiving status command, this can be immediately performed
State indicated by status command, receive the time of status command and execute indicated state time between time difference
It is very little, so state initial time can receive the time of status command in the status information of preservation for equipment.If
The state end time is saved in status list, it, will after the status information for judging to save current state by status command
The end time for the state that the equipment records recently is updated to current time.
In step S203, if it is judged that current state indicated by the status command of equipment and the state recorded recently
It is inconsistent, it, can also be by the status information of the current state of the equipment when needing to save current state indicated by the status command
It is not preserved in the status list for saving the state recorded recently, for the state that convenient for post analysis, will can be recorded recently at this time
The state end time be updated to current time.It is consistent in view of the status information of preservation, if to analyze in a period of time
Equipment state distribution, by all status list and can be one, or go in all status lists to obtain status information.
For the embodiment of the present invention by the real time monitoring instructed to equipment state, can record in time when equipment state changes should
The status information of equipment avoids the omission to equipment state.And only judge whether when equipment receives status command
Status information is saved, solves the problems, such as that continually scanning for equipment state in the prior art occupies a large amount of system resources.By this hair
All devices accurately status information within the period can be obtained in bright embodiment, based on the accurately status information, data analysis
Teacher can precisely determine the parameters such as equipment hour utilization rate, and then be the increase and decrease of the state of analytical equipment distribution and equipment, provide
Accurately decision support.
For example, the original state list of equipment a1, a2 and a3 are as shown in table 2, referred to by the state to equipment a1, a2 and a3
Enable monitor today, confirmation equipment a1 advances from camel packet at the t1 moment and is changed to the state that empty wagons advances, at the t2 moment from empty wagons row
Into the state for being changed to the free time;Equipment a3 advances from empty wagons at the t3 moment and is changed to the state of empty wagons waiting.In turn, a period of time
Afterwards, the status categories of equipment a1, a2 and a3 such as table 3:
Table 3
The status list of equipment is got through the foregoing embodiment, and the state that every a line can represent some equipment is cut
Piece, i.e. equipment are constantly in some state in the initial time to the isochronous surface terminated of this line.Remember by this way
The status information of recording apparatus not will cause the loss of state, and then according to the status list counted, can be to the state of the equipment
Distribution or the holding time of each state etc., which are made, accurately to be judged and analyzes.It is to calculate the hour utilization rate of equipment ai
Example, i.e., in one hour, the utilization rate of equipment belongs to the conventional index of utilization rate of equipment and installations, illustrates through foregoing invention embodiment
The application of obtained status list.Wherein, ai in embodiments of the present invention, only represents device identification.
It, can based on the status list got by foregoing invention embodiment after determining that analysis time section is tA to tB
Speed gets the status information within tA to the tB period of equipment ai quickly.Specifically, under meeting simultaneously in status list
The entry information of two conditions of column filters out:
1) device identification is ai, and initial time is more than or equal to tA and is less than the entry information of tB;
2) device identification is ai, and the end time is more than or equal to tA and is less than the entry information of tB.
If not filtering out entry information through the above way, illustrate equipment ai within this period of tA to tB
It is continuously the same state.At this point, screen status list again, state initial time is less than tA, and state initial time away from
The entry information nearest from the tA moment filters out.
The equipment ai filtered out can carry out the entry information filtered out whole after the entry information in tA to tB period
Reason is in a table.Since the period of analysis is tA to tB, thus to the state initial time of the entry information filtered out and
The state end time is updated, and the duration of each state is calculated based on the updated time.The rule of update is as follows:
1) the state initial time of the entry information by state initial time less than tA is updated to tA;
2) the state end time of the entry information by the state end time greater than tB is updated to tB;
If 3) the state end time of entry information be -1, i.e., this equipment is from the initial time of the entry until when tB
The state for being in this entry is carved, the state end time of this entry is revised as tB.
After above-mentioned update, the time difference of each entry information is calculated, i.e., is terminated with the state of the entry information
Time subtracts the state initial time of the entry information, obtains the duration for the state that equipment ai is recorded in the entry information.
In turn, determine equipment ai in tA to tB period stateful and each state duration, then further may be used
Calculate the form utilization rate of equipment.
Fig. 3 is the schematic diagram of the main modular of the device of statistics equipment state according to an embodiment of the present invention, such as Fig. 3 institute
Show, the device 300 that the embodiment of the present invention counts equipment state includes initialization module 301, monitoring module 302 and judgment module
303。
Initialization module 301 is used for, and obtains the status information of equipment original state and preservation.
Monitoring module 302 is used for, the status command of monitoring device, and status command is used to indicate the state of equipment operation.
Judgment module 303 is used for, and is judged whether to save equipment current state according to the status command of the equipment monitored
Status information.
For all devices of state to be counted, initialization module 301 is also used to, and obtains the shape of all devices original state
State information, and determine the device identification of all devices, by the device identification of all devices and the state of equipment original state
Information is accordingly saved into status list, so that learning the status information of each equipment original state by the status list.
Wherein, status information includes but is not limited to: status indicator, state initial time and state end time.Initialization module 301 is also
It stateful to the institute involved by equipment can be identified, then can directly be saved status indicator to state when saving status information
In list.In embodiments of the present invention, there is one-to-one relationship between status indicator and state, device identification and equipment it
Between have one-to-one relationship.
Judgment module 302 is also used to, and determines current state indicated by the status command of the equipment monitored;Judgement is current
Whether state and the state that equipment in status list records recently are consistent;If it is inconsistent, by the status information of current state
It saves to status list.The state that the equipment records recently refers to for current state, i.e., runs current shape in equipment
State before state is the state recorded recently.If the state consistency that the equipment records recently in current state and status list
If, then do not have to that processing can not be had to;If it is inconsistent, saving the status information of current state to status list.It will increase newly
Status information save into status list, and then pass through the status list it can be learnt that from init state list to it is current when
Carve the status information of all devices.By the status information of the state recording state of prior art timing scan all devices, no
It only cannot accurately confirm the equipment state in certain time period, and the information scanned every time is recorded in different tables.By
May be different in the information that each scanning obtains, the also inconvenient operation when integrating the status information table of Multiple-Scan.Pass through this
Inventive embodiments can be directly obtained including the accurately status information of all devices in a certain specific period.Wherein, if shape
State end time, also the state initial time by state in status list and state end time are saved in state list,
The period that equipment is run in each state can be accurately got, the prior art is unable to reach the effect.
The embodiment of the present invention passes through the real time monitoring that instruct to equipment state of monitoring module, can in equipment state change and
The status information of the Shi Jilu equipment avoids the omission to equipment state.And judgment module is only monitored in monitoring module
When having received status command to equipment, judges whether to save status information, solve the prior art and need to continually scan for equipment
State occupies the problem of a large amount of system resources.All devices accurately state within the period can be obtained through the embodiment of the present invention
Information, based on this, accurately status information, Data Analyst can precisely determine the parameters such as equipment hour utilization rate, and then to divide
The increase and decrease of the state distribution and equipment of desorption device, provides accurately decision support.
Fig. 4 is shown can be using the method for the statistics equipment state of the embodiment of the present invention or the device of statistics equipment state
Exemplary system architecture 400.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405.
Network 404 between terminal device 401,402,403 and server 405 to provide the medium of communication link.Network 404 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 401,402,403 and be interacted by network 404 with server 405, to receive or send out
Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403
(merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet
Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user
The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception
To the data such as information query request carry out the processing such as analyzing, and processing result is fed back into terminal device.
It should be noted that the method for statistics equipment state provided by the embodiment of the present invention is generally held by server 405
Row, correspondingly, the device for counting equipment state is generally positioned in server 405.
It should be understood that the number of terminal device, network and server in Fig. 4 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the terminal device for being suitable for being used to realize the embodiment of the present invention
Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, function to the embodiment of the present invention and should not use model
Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and
Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data.
CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always
Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.;
And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon
Computer program be mounted into storage section 508 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention
Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer
Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.?
In such embodiment, which can be downloaded and installed from network by communications portion 509, and/or from can
Medium 511 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 501, system of the invention is executed
The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet
Include initialization module, monitoring module and judgment module.Wherein, the title of these modules is not constituted under certain conditions to the mould
The restriction of block itself, for example, initialization module is also described as " obtaining the status information of all devices original state and guarantor
The module deposited ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be
Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating
Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes
Obtaining the equipment includes: to obtain status information and the preservation of all devices original state;Monitor the status command of all devices, state
Instruction is used to indicate the state of equipment operation;For each equipment, it is according to the judgement of the status command of the equipment monitored
The no status information for saving the equipment current state.
For the embodiment of the present invention by the real time monitoring instructed to equipment state, can record in time when equipment state changes should
The status information of equipment avoids the omission to equipment state.And only judge whether when equipment receives status command
Status information is saved, solves the problems, such as that continually scanning for equipment state in the prior art occupies a large amount of system resources.By this hair
All devices accurately status information within the period can be obtained in bright embodiment, based on the accurately status information, data analysis
Teacher can precisely determine the parameters such as equipment hour utilization rate, and then be the increase and decrease of the state of analytical equipment distribution and equipment, provide
Accurately decision support.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright
It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any
Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention
Within.