Invention content
A kind of information control method of offer of the embodiment of the present invention, server and computer-readable medium, can intelligently adapt to
The watering law of user improves efficiency.
In a first aspect, an embodiment of the present invention provides a kind of information control methods, including:
Data information is received, the data information carries identity corresponding with target device, the data information
Currently to use water behavior is corresponding to use water information with user, the target device is the equipment that can carry out water process;
Detect whether there is the first predictive information corresponding with the identity according to the identity, described first
Predictive information is the use water information of prediction;
If there are first predictive information, the target device is controlled according to first predictive information.
In an optional realization method, the target device at least two, after the reception data information, with
And it is described according to the identity detect whether exist the first predictive information corresponding with the identity before, the side
Method further includes:
Search whether there are the first process or first thread, first process be it is corresponding with the identity into
Journey, the first thread are thread corresponding with the identity;
It is described detected whether according to the identity include in the presence of the first predictive information corresponding with the target device:
If there are first process or the first thread, detected by first process or the first thread
With the presence or absence of the first predictive information corresponding with the identity.
In an optional realization method, the method further includes:
If first process is not present, and the first thread is not present, then creates corresponding with the identity
Second process or the second thread, and the identity and second process are bound, alternatively, binding the identity and institute
State the second thread.
In an optional realization method, the binding identity and second process, alternatively, binding institute
Identity and second thread are stated, including:
The identity and second process, or the binding identity are bound according to modulus method or Hash method
With second thread.
It is described to detect whether exist and the target device according to the identity in an optional realization method
Before corresponding first predictive information, the method further includes:
It obtains the first history to be recorded with water, first history is input to water record in target prediction model and is carried out in advance
It surveys, obtains first predictive information;Wherein, first history carries corresponding with the target device in being recorded with water
Identity, the target prediction model are model corresponding with the identity.
In an optional realization method, the method further includes:
If first predictive information is not present, obtains the second history and recorded with water, second history is recorded with water
In carry identity corresponding with the target device;
It is recorded according to second history water after determining the second predictive information, institute is controlled according to second predictive information
State target device;Wherein, the identity is carried in second predictive information.
In an optional realization method, first history with water record or the second history water record storage in point
In cloth file system, first predictive information or second predictive information are stored in database Redis.
In an optional realization method, the data information includes:Current Temperatures, the first predictive information packet
It includes:Target temperature, it is described to include according to first predictive information control target device:
Detect whether the Current Temperatures reach the target temperature according to the data information, if not up to, controlling
The target device starts quick heating mode;
Alternatively, detect whether the Current Temperatures reach the target temperature according to the data information, if not up to,
Control instruction is generated according to the target temperature, and the control instruction is sent to the target device, the control instruction
It is used to indicate the target device and starts quick heating mode.
In an optional realization method, the target prediction model includes:Target linear neural network model, target
Recognition with Recurrent Neural Network (Recurrent neural Network, RNN) model and target shot and long term memory network (Long
At least one of Short-Term Memory, LSTM) model.
Second aspect, an embodiment of the present invention provides a kind of servers, including:
Receiving unit, for receiving data information, the data information carries identity corresponding with target device,
The data information be with user currently use water behavior it is corresponding use water information, the target device be can carry out water process
Equipment;
Detection unit, for detecting whether that having corresponding with the identity first predicts according to the identity
Information, first predictive information are the use water information of prediction;
Control unit controls the mesh for if there are first predictive information according to first predictive information
Marking device.
In an optional realization method, the target device at least two, the server further includes:
Searching unit, for searching whether that, there are the first process or first thread, first process is and the identity
Corresponding process is identified, the first thread is thread corresponding with the identity;
If the detection unit passes through described first specifically for there are first process or the first thread
Process or the first thread detect whether there is the first predictive information corresponding with the identity.
In an optional realization method, the server further includes:
Creating unit, if for first process to be not present, and the first thread is not present, then it creates and the body
Part identifies corresponding second process or the second thread;
Binding unit, for binding the identity and second process, alternatively, binding the identity and institute
State the second thread.
In an optional realization method, the binding unit is specifically used for binding institute according to modulus method or Hash method
Identity and second process are stated, or binds the identity and second thread.
In an optional realization method, the server further includes:
Acquiring unit is recorded for obtaining the first history with water;
Predicting unit is predicted for recording to be input in target prediction model first history with water, is obtained
First predictive information;Wherein, the history carries identity corresponding with the target device, institute in being recorded with water
It is model corresponding with the identity to state target prediction model.
In an optional realization method, the acquiring unit, if being additionally operable to that first predictive information is not present,
It obtains the second history to be recorded with water, second history carries identity mark corresponding with the target device in being recorded with water
Know;
The server further includes:
Determination unit determines the second predictive information, the second prediction letter for being recorded according to second history water
The identity is carried in breath;
Described control unit is additionally operable to control the target device according to second predictive information.
In an optional realization method, first history is recorded with water or the second history water record storage
In distributed file system, first predictive information or second predictive information are stored in database Redis.
In an optional realization method, the data information includes:Current Temperatures, the first predictive information packet
It includes:Target temperature;
Described control unit, specifically for detecting whether the Current Temperatures reach the target according to the data information
Temperature, if not up to, controlling the target device and starting quick heating mode;
Alternatively, described control unit, specifically for detecting whether the Current Temperatures reach institute according to the data information
Target temperature is stated, if not up to, control instruction is generated according to the target temperature, and the control instruction is sent to described
Target device, the control instruction are used to indicate the target device and start quick heating mode.
In an optional realization method, the target prediction model includes:Target linear neural network model, target
At least one of Recognition with Recurrent Neural Network RNN models and target shot and long term memory network LSTM models.
The third aspect, the embodiment of the present invention additionally provide a kind of server, including:Processor, transceiver and memory, institute
Processor, the transceiver and the memory to be stated to be connected with each other, wherein the memory is used to store application code,
The processor is configured for calling said program code, executes the method described in above-mentioned first aspect.
Specifically, the processor is configured for calling said program code, executes following operation:
Data information is received by transceiver, the data information carries identity corresponding with target device, institute
State data information be with user currently use water behavior it is corresponding use water information, the target device be can carry out setting for water process
It is standby;
Detect whether there is the first predictive information corresponding with the identity according to the identity, described first
Predictive information is the use water information of prediction;If there are first predictive information, institute is controlled according to first predictive information
State target device.
Optionally, the target device at least two, the processor, be additionally operable to search whether there are the first process or
First thread, first process are process corresponding with the identity, and the first thread is and the identity
Corresponding thread;
The processor, if specifically for there are first process or the first thread, by described first into
Journey or the first thread detect whether there is the first predictive information corresponding with the identity.
Optionally, if being additionally operable to that first process is not present, and the first thread is not present, then in the processor
The second process corresponding with the identity or the second thread are created, and binds the identity and second process,
Alternatively, binding the identity and second thread.
Optionally, the processor, is additionally operable to obtain the first history and is recorded with water, first history is recorded with water defeated
Enter into target prediction model and predicted, obtains first predictive information;Wherein, first history is taken in being recorded with water
With identity corresponding with the target device, the target prediction model is model corresponding with the identity.
Optionally, the processor obtains the second history and is remembered with water if being additionally operable to that first predictive information is not present
Record, second history carry identity corresponding with the target device in being recorded with water;
It is recorded according to second history water after determining the second predictive information, institute is controlled according to second predictive information
State target device;Wherein, the identity is carried in second predictive information.
Optionally, the data information includes:Current Temperatures, first predictive information include:Target temperature;The place
Device is managed, specifically for detecting whether the Current Temperatures reach the target temperature according to the data information, if not up to,
It controls the target device and starts quick heating mode;
Alternatively, the processor, specifically for detecting whether the Current Temperatures reach described according to the data information
Target temperature, if not up to, generating control instruction according to the target temperature, and the control instruction is sent to the mesh
Marking device, the control instruction are used to indicate the target device and start quick heating mode.
Fourth aspect, an embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage
It includes program instruction that media storage, which has computer program, the computer program, and described program instructs when being executed by a processor
The processor is set to execute the method described in above-mentioned first aspect.
Implement the embodiment of the present invention, in the case where receiving data information, by detecting the first predictive information, to root
According to first predictive information control user it is current with water behavior such as whether opening the heating of half courage, if need to close the target and set
It is standby etc. so that the target device effectively can intelligently adapt to the watering law of user, provide to the user it is more intelligent,
The service of automation improves efficiency.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into
It is described in detail to one step, it is clear that the described embodiments are only some of the embodiments of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
All other embodiment, shall fall within the protection scope of the present invention.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.It needs to illustrate
, the detailed description illustrated in conjunction with attached drawing is intended as the description to various configurations, wherein can be real without being intended to indicate that
Trample unique configuration of concepts described herein.Recorded device embodiment and embodiment of the method will be following detailed herein
It is described in thin description, and passes through various frames, module, unit, component, circuit, step, process, algorithm etc. in the accompanying drawings
(be referred to as " element ") is shown.These elements can be come using electronic hardware, computer software or its arbitrary combination
It realizes.It is implemented as hardware or software as these elements, depending on specific application and the design being applied on total system
Constraint.If the term in description and claims of this specification and Figure of description uses " first ", " second " etc.
Description, this kind description are for distinguishing different objects, rather than for describing particular order.
It should be appreciated that ought use in this specification and in the appended claims, term " comprising " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded
Body, step, operation, element, component and/or its presence or addition gathered.It is also understood that the institute in this description of the invention
The term used is not intended to limit the present invention merely for the sake of the purpose of description specific embodiment.Such as in description of the invention
With it is used in the attached claims like that, other situations unless the context is clearly specified, otherwise singulative
" one ", "one" and "the" are intended to include plural form.It will be further appreciated that being wanted in description of the invention and appended right
The term "and/or" used in book is asked to refer to any combinations of one or more of associated item listed and be possible to
Combination, and include these combinations.
It should be noted that in the case of the special instruction that do not express, every technology in various embodiments of the present invention
This kind is either combined to combine or in conjunction with nothing the reason of being not as technology as long as feature can be considered to be combined with each other
Method is implemented.In order to more adequately illustrate the present invention, some are illustrative, and optionally or preferred feature is of the invention each
It is combined together and is described with other technical characteristics in embodiment, but this combination is not essential, and should be appreciated that this and show
Example property, optionally either preferred feature and other technical characteristics are all separable or independent each other, as long as should
It plants the reason of separating or being independently not as technology and can not implement.Some functions of technical characteristic in embodiment of the method
Property description can be understood as executing the function, method or step, some functionality of the technical characteristic in device embodiment are retouched
It states and can be understood as executing the function, method or step using this kind of device.
Fig. 1 is referred to, Fig. 1 is a kind of network architecture diagram of management information system provided in an embodiment of the present invention, such as Fig. 1 institutes
Show, which includes:Server 110 and target device, wherein the target device is that can carry out setting for water process
It is standby, if the target device is water heater 120.
The server can be communicated with target device, to realize the interaction of data and/or signaling.In server
It can include first communication module, can include second communication module in target device, the first communication module and this is second logical
Letter module can be communicated by cellular network, can also be carried out by Wireless Fidelity (Wireless-Fidelity, WIFI)
Communication etc..The server can both have been communicated with target device by wired mode, can also wirelessly be carried out
Communication etc., the realization method how embodiment of the present invention communicates first communication module and second communication module is not made only
One property limits.
Wherein, target device can be not only water heater;Can also be water purifier, for another example the equipment such as kettle, of the invention
Embodiment is not construed as limiting.It is understood that the target device is also understood that as water process smart machine etc., specific real
In existing, there may be other titles for the target device, therefore should not be construed as having limiting meaning to the embodiment of the present invention.It can be with
Understand, the quantity of the target device can be one, or multiple.
Wherein, server can also be Cloud Server such as high in the clouds etc., which can interact with target device,
Such as the server can information corresponding with water heater interactive user water behavior, which can be data information, i.e. user
Currently with water behavior it is corresponding use water information, or predictive information, predicted such as server with user's water behavior pair
That answers uses water information etc..
Based on management information system described in Fig. 1, can not only handle a large number of users uses the corresponding information of water behavior,
Can also processing target equipment in real time heating operation etc., intelligently adapt to the watering law of user, improve efficiency.
It will be based on management information system described in Fig. 1 below, specifically describe the information control that the embodiment of the present invention is provided
Method processed.
Fig. 2 is referred to, Fig. 2 is a kind of flow diagram of information control method provided in an embodiment of the present invention, the information
Control method can be applied in server shown in FIG. 1, and specifically, which can be applied to high in the clouds.The information control
Method processed has been described in detail in user's water, how to provide more efficient user information to the user in time, improves expiring for user
Meaning degree.As shown in Fig. 2, the information control method at least may include but be not limited to following steps:
201, data information is received, above-mentioned data information carries identity corresponding with target device, above-mentioned data
Information is currently to use water behavior is corresponding to use water information with user;
It can include that user currently uses water behavior is corresponding to use water information in the embodiment of the present invention, in data information, such as use
At the time of family currently uses the temperature of water or user to start to use water or at the time of being begun to warm up when user's water, or
The water consumption of user currently etc. information.Optionally, in the case of in data information comprising current water consumption,
The calculation of the water consumption can be calculated with ton, can also be to be calculated with water duration etc., and the embodiment of the present invention is not made
It limits.It is understood that the data information that server receives in the embodiment of the present invention can be real-time information, that is,
It says, in the case where user exists with water behavior, server data of the real-time reception from target device can be believed incessantly
Breath.Alternatively, the data information may be to use water information in a period of time, as target device can be with every five minutes to server
A data information is sent, each minute can also send data information etc. to server, the embodiment of the present invention is not made
It limits.
Optionally, the embodiment of the present invention is not construed as limiting the specific format in the data information, such as the data information
Format can " use the water time started:XX divides XX seconds when XXX XX month XX day XX;With the water duration:XX divides XX seconds when XX "
Etc..
Wherein, refer to the behavior with water with water behavior, such as discharged water by tap, heat is for another example used by water heater
Water.
Optionally, above-mentioned data information can be the data information from a target device, or from multiple
The data information of target device.Specifically, in the case where the quantity of target device is multiple, server receives data information
When, multiple processes (python) or multiple threads (C/C++/Java) can be used to receive simultaneously.It is received to accelerate server
The speed of service of data improves the treatment effeciency of server, to improve the efficiency of control user's water behavior.Specifically, it takes
Business device can come autonomous control process or the quantity of thread according to the data volume size of data information.Included in data information
When data volume is excessive, multiple processes or multiple threads can be used to receive simultaneously, such as pre-set data-quantity threshold, if to number
It is believed that ceasing included data volume is more than (or being not less than) data-quantity threshold, then connect simultaneously using multiple threads or multiple processes
It receives.Optionally, the measurement mode for the data volume that above-mentioned measurement data information is included can be carried out according to the quantity of target device
It weighs, can also dynamically be adjusted according to the target device stand-by period, if target device waits for the effect of data processing
Rate is more than preset time (such as 5 seconds), then server can create new process or thread to receive data information.To effectively carry
The efficiency of high server data processing, phenomena such as adjusting user's water behavior in real time to realize, avoid the occurrence of water waste.It can be with
Understand, the embodiment of the present invention is not construed as limiting the measurement mode for the data volume that data information is included, can also such as lead to
Cross the occupied space size of measurement data information to weigh etc..
In the embodiment of the present invention, number when identity corresponding with target device can be target device manufacture,
Or the number etc. set by server, the embodiment of the present invention is not made for the identity of target device how is arranged
It limits.
202, detect whether there is the first predictive information corresponding with above-mentioned identity according to above-mentioned identity, it is above-mentioned
First predictive information is the use water information of prediction;
In the embodiment of the present invention, each predictive information can be preserved in server, and can in each predictive information
To carry corresponding identity, so that after receiving data information, it can be according to included in the data information
Identity obtain corresponding with identity predictive information.
Optionally, the quantity of target device be it is multiple in the case of namely data information correspond to multiple target devices
When data information, which can obtain predictive information corresponding with target device in time according to identity, can be timely
Efficiently get the predictive information of associated user (user for using the target device).Prediction such as corresponding with identity
Information is the first predictive information, then server can be detected whether effectively according to the identity there are first predictive information,
Occur to avoid there is target device (namely associated user) situation not corresponding with predictive information, to cause being stranded for user
It disturbs.
If 203, there are above-mentioned first predictive information, above-mentioned target device is controlled according to above-mentioned first predictive information.
In the embodiment of the present invention, the mode according to the first predictive information control targe equipment can be:It is first pre- according to this
Measurement information generates control instruction, and the control instruction is sent to the target device, so that the target device is according to the control
Instruction control user's uses water behavior.Or the server can also according to the first predictive information generate control instruction after,
The target device etc. is directly controlled by the control instruction, the embodiment of the present invention does not make uniqueness restriction.
Specifically, the embodiment of the present invention additionally provides a kind of method how controlling user with water behavior, as follows:
Above-mentioned data information includes:Current Temperatures, above-mentioned first predictive information include:Target temperature;It is above-mentioned according to above-mentioned
The realization method that first predictive information controls above-mentioned target device may include following two realization methods:
1, detect whether above-mentioned Current Temperatures reach above-mentioned target temperature according to above-mentioned data information, if not up to, controlling
It makes above-mentioned target device and starts quick heating mode;
2, detect whether above-mentioned Current Temperatures reach above-mentioned target temperature according to above-mentioned data information, if not up to, according to
Control instruction is generated according to above-mentioned target temperature, above-mentioned control instruction is sent to above-mentioned target device, above-mentioned control instruction is used for
Indicate that above-mentioned target device opens quick heating mode.
Be described above the mode of two kinds of quick heating modes of control targe opening of device, wherein target temperature can be
The temperature of user oneself setting, or the temperature of target device setting, or be server according to user's water row
For the temperature etc. predicted.Specifically, temperature the most comfortable can be arranged when oneself feeling to use water as target temperature in user.
Specifically, quick heating mode can not be made specifically for the heating mode of target device, such as half courage heating mode, the present embodiment
It limits.It is heated by the way that quick heating mode can be started so that user can quickly use hot water, improve target device
The efficiency of water process such as water heat treatment.
It is understood that can include not only Current Temperatures information in above-mentioned data information, can also be held comprising user
It is continuous to use water duration, or comprising the unused water of user duration (refer to once in water behavior, user due to carelessness or
Other reasons have not had to water, but target device is still under working condition) etc..Include that user persistently uses water in the data information
The duration of duration and the unused water of user, and the user's persistent subscriber duration predicted in the first predictive information is shorter than the data information
Included in user persistently use water duration, then user be likely to need not use water, therefore, according to it is above-mentioned first prediction
Information, which can control, closes above-mentioned target device, avoids that due to user water need not be used, and target device is still in working condition
When, and the case where wasting hydroelectric resources occur.
Implement the embodiment of the present invention, in the case where receiving data information, by detecting the first predictive information, to root
According to first predictive information control user it is current with water behavior such as whether opening the heating of half courage, if need to close the target and set
It is standby etc. so that the target device effectively can intelligently adapt to the watering law of user, provide to the user it is more intelligent,
The service of automation improves efficiency.
Fig. 3 is referred to, Fig. 3 is the flow diagram of another information control method provided in an embodiment of the present invention, Fig. 3 institutes
It is had been described in detail in the information control method shown, when server and multiple target devices interact, how simultaneously server
And the realization method of the data information transmitted by multiple target devices is efficiently handled, as shown in figure 3, the information control method can
Including but not limited to following steps:
301, data information is received;
Wherein, it receives data information namely receives the data information transmitted by multiple target devices.On that is,
It states data information and carries identity corresponding with each target device, above-mentioned data information is acquired in each target device
Currently use water behavior is corresponding to use water information with user, and above-mentioned target device is the equipment that can carry out water process.
The data information that server receives in the embodiment of the present invention can be real-time information, that is to say, that be deposited in user
With water behavior, server can data information of the real-time reception from target device incessantly.Alternatively, the number
It is believed that breath may be to use water information, such as target device that can send a data to server with every five minutes in a period of time
Information can also send data information etc. each minute to server.
302, search whether that there are the first process or first threads, if at least there is above-mentioned first process or above-mentioned First Line
One in journey, then 303 are executed;If above-mentioned first process is both not present, above-mentioned first thread is also not present, then executes 304;
Wherein, above-mentioned first process is process corresponding with above-mentioned identity, and above-mentioned first thread is and above-mentioned identity
Identify corresponding thread.It is understood that process described in the embodiment of the present invention or thread in the concrete realization can
To only use process, alternatively, only using thread etc..For example, however, it is determined that used in server is process, then is having
During body is realized, which can be used for executing the described in the embodiment of the present invention and relevant method of process.And if it is determined that
Used in server is thread, then the server can be used for executing described in the embodiment of the present invention related to thread
Method.
After server receives data information, before searching the first predictive information, server can first search with
The entrained corresponding process of identity or thread in data information, and if it exists, then explanation before current time with the body
Part identifies corresponding target device and has had sent primary or multiple data informations (such as in the real-time transmission data information of target device
In the case of or target device with preset frequency transmission data information in the case of), then the server is by being continuing with pair
The continuity of data information reception can be effectively ensured, to ensure that server can be received continuously in the process or thread answered
It is corresponding to the user to use water information, identify that user's uses water behavior in time.
303, detect whether there is corresponding with above-mentioned identity the by above-mentioned first process or above-mentioned first thread
One predictive information, and if it exists, then execute 305;Otherwise, 306 are executed;
304, corresponding with above-mentioned identity the second process or the second thread are created, and binds above-mentioned identity and upper
The second process is stated, alternatively, binding above-mentioned identity and above-mentioned second thread;
The above-mentioned above-mentioned identity of binding and above-mentioned second process, or bind above-mentioned identity and above-mentioned second thread
Specific implementation can be:Above-mentioned identity and above-mentioned second process, or binding are bound according to modulus method or Hash method
Above-mentioned identity and above-mentioned second thread.
Wherein, the binary value of random length is mapped as the binary value of shorter regular length by hash algorithm, this
Small binary value is known as cryptographic Hash.Cryptographic Hash is the unique and extremely compact numerical value representation of one piece of data.By will be single
(sometimes referred to as " hash algorithm ") it is applied to the result of the obtained fixed size of any number of data to mathematical function.Cause
This, server can use Hash (hash) method, can preferably target device it is more uniform be assigned to existing process or
Above thread, process or thread rational and that maximumlly utilize each establishment.Wherein, for the second process or second
The quantity embodiment of the present invention of thread is not construed as limiting, such as server can independently be set according to the quantity of target device.
For example the Hash method described in the bright embodiment of the present invention, it is assumed that Hash table a length of m, p are most less than or equal to m
Big prime, then hash function is h (k)=k%p, and wherein % is mould p complementations.
For example, as it is known that element to be hashed is (18,75,60,43,54,90,46), table long m=10, p=7 then have h (18)
=18%7=4;H (75)=75%7=5;H (60)=60%7=4;H (43)=43%7=1;H (54)=54%7=5;h
(90)=90%7=6;H (46)=46%7=4.Conflict at this time more, therefore to reduce conflict, can use larger m values and p
Value, such as m=p=13 are as a result as follows:H (18)=18%13=5;H (75)=75%13=10;H (60)=60%13=8;h
(43)=43%13=4;H (54)=54%13=2;H (90)=90%13=12;H (46)=46%13=7.
In the embodiment of the present invention, above-mentioned element to be hashed can be understood as the identity of target device, m can be process or
The number of thread, p are equal to m, then the identity by Hash method according to target device can bind a process.
By creating the second process or the second thread, it is possible to prevente effectively from right since identity and data information are not inconsistent
User's generates interference with water behavior.
In the embodiment of the present invention, it is process or thread that server, which can allow multiple processes premise that either thread is carried out at the same time,
Memory sharing.Therefore, a proceeding internal memory can be built when using process shares class, it is total to handle data between multi-process
It enjoys.And these parameters can be stored in redis databases, this database can be stored in multiple servers, when having one
Platform server is broken, and can access related data above other servers.Specifically, shared data may include target
The identity of equipment and predictive information etc. and the relevant data of the target device.And if it is multithreading, due to
Memory sharing is needed, therefore, the shared of memory can be realized by thread lock in the embodiment of the present invention.
It is understood that after server creates the second process or the second thread, which can also be by upper
It states the second process or above-mentioned second thread detects whether there is the first predictive information corresponding with above-mentioned identity.
305, above-mentioned target device is controlled according to above-mentioned first predictive information;
306, it is recorded according to the second history water after determining the second predictive information, according in the control of above-mentioned second predictive information
State target device;Wherein, above-mentioned identity is carried in above-mentioned second predictive information.
Wherein, some prediction models can be stored in server, such as linear neural network model, Recognition with Recurrent Neural Network RNN
At least one of model and shot and long term memory network LSTM models etc..Based on the prediction model stored in the server,
Server may include according to the method that the second history water record determines the second predictive information:
The history obtained in first time period is recorded with water;
The above-mentioned prediction model of training is recorded using the water of the history in above-mentioned first time period, to obtain target prediction mould
Type;
The history obtained in second time period is recorded with water;
It is recorded and is predicted with water according to the history in above-mentioned second time period, obtain above-mentioned second predictive information.
Wherein, the history water record in the history water record and second time period in first time period belongs to second and goes through
History is recorded with water, and the second history water record carries identity corresponding with target device, that is to say, that is being stored
When second history is recorded with water, the second history water record and corresponding identity can be bound.And training prediction
Model obtains target prediction model (such as target linear neural network model, target circulation neural network RNN models and target length
At least one of phase memory network LSTM model.) when, identity can also be carried in the target prediction model, in order to
Server distinguishes which model corresponds to which equipment, avoids the occurrence of chaotic situation.
Wherein, first time period can be different from second time period, to improve the accuracy of server prediction.Further
It ground can be to the history in first time period before recording training prediction model using the water of the history in first time period
It is handled with water record, is inputted with obtaining being suitable for the input form that prediction model receives.It is assumed that user is in July, 2017
The useful water behavior of Monday on the 17th, is recorded as with water 00:03 with water 1 minute, then to this encoded with water record after can be with
For [0 207171001000 ...], the front two expression of years facilitates and reduces number of encoding bits to encode,
Time coding subtracts 2015, i.e., 2017 subtract 2015, obtain 02;Third position indicates month and date, such as " 071 to the 6th
7 " indicate July 17;7th expression week, such as " 1 " indicate Monday;What subsequent position indicated each period uses regimen
Condition indicates that the first time period exists and uses water behavior, if the corresponding position of second time period if the corresponding position of first time period is 1
It is 0, it is 1 to indicate that the second time period is not present with the third position in water behavior, such as subsequent position, then it represents that 00:03, it deposits
With water behavior.Above-mentioned coding mode is only a kind of citing, and the embodiment of the present invention is not construed as limiting coding mode.
It can also use similarly, for the history water record in second time period and be used with the history in first time period
Water records same coding mode, after being encoded with water record to the history in second time period, is input to target prediction
In model, to obtain matrix corresponding with predictive information (i.e. the second predictive information), it will such as be remembered with water in second time period
It records in corresponding coding input to target prediction model, the prediction matrix of output can include at least one row vector, Mei Gehang
Water information is used in one prediction of vector expression.Each row vector can include two parts, and first part indicates the row vector pair
The time answered, the time of second part indication predicting use water information.For example, the first behavior [0 2071 of prediction matrix
820000000 ...], the front two expression of years can obtain 2017 using 02 plus 2015, i.e., the row vector corresponds to
Time be 2017;Third position indicates that month and date, such as " 0718 " indicate July 18 to the 6th;7th expression
Week, such as " 2 " indicate Tuesday;8th indicates whether it is festivals or holidays, and the 8th is festivals or holidays for 1 expression time, the 8th
Position indicates that the time is not festivals or holidays for 0;The rearmost 1440 use regimen conditions for indicating each period, this 1440 are
0, indicate that there is no use water behavior.Above-mentioned row vector [0 2071820000000 ...] is corresponding to use water information
For " on July 18th, 2017, on Tuesday, non-festivals or holidays, there is no use water behavior ".
Server can be made effectively to obtain the second predictive information according to aforesaid way, it is to be understood that above-mentioned the
The prediction mode of one predictive information can also refer to the prediction mode of the second predictive information.That is the prediction technique of the first predictive information
May include:
It obtains the first history to be recorded with water, first history is input to water record in target prediction model and is carried out in advance
It surveys, obtains first predictive information;Wherein, first history carries corresponding with the target device in being recorded with water
Identity, the target prediction model are model corresponding with the identity.
Wherein, target prediction model is trained prediction model, and the training method of the target prediction model can be with
With reference to the prediction technique of the second predictive information, no longer repeat one by one here.
Specifically, above-mentioned first history water records and above-mentioned second history water record storage is in distributed file system
In, above-mentioned first predictive information and above-mentioned second predictive information are stored in database Redis.
As the first history water record and the second history water record can be stored in next-generation distributed information system
In (Apache Kafka, Kafka), when to avoid server described in the embodiment of the present invention being single server, when into
Row Multiprocessing and when data information reaches certain scale (data volume as data information is included is huge), single server
It is difficult to occur the case where reliable and stable service is provided.Therefore it in order to support the extending transversely of server system, can will service
History accessed by device water record (including the first history water record and the second history water record etc.) storage to point
In cloth storage system.
In the embodiment of the present invention, the same target device can also be exported in synchronization by distributed lock to control
Predictive information, that is to say, that the server can predict when using water information of user, can only be predicted in synchronization same
The predictive information of target device avoids exporting multiple predictive information of the same target device due to synchronization, and causes
The timing of the server is influenced, therefore the server in the embodiment of the present invention may be implemented timing when handling data and want
It asks, the alternative and timing that same target device is predicted in real time is ensured by distributed lock.
Implement the embodiment of the present invention, not only can intelligently predict that user's uses water information, but also can efficiently be located in
The data information sent from multiple target devices is managed, treatment effeciency is improved.
It is understood that information control method described in Fig. 2 and Fig. 3 emphasizes particularly on different fields, in the embodiment of the present invention not in detail
The realization method described to the greatest extent can also correspond to the realization method with reference to information control method shown in Fig. 2, no longer repeat one by one here.
Fig. 4 is referred to, Fig. 4 is a kind of concrete scene schematic diagram of information control method provided in an embodiment of the present invention,
In concrete scene shown in Fig. 4, respectively describe server is how to be predicted with water behavior according to user, the server
Be not only how and meanwhile handle data information and the server that multiple target devices are sent but also be how efficiently control targe
Equipment.It specifically can be as shown in figure 4, the information control method may include but be not limited to following steps:
401, after asking historical data to kafka, according to the mark at one's side carried in historical data
Historical data is input in prediction model by (Identification, ID) to be predicted, prediction result (the i.e. first prediction is obtained
Information), preserve prediction result.
Wherein, for historical data (including the first historical record and the second historical record), there is going through for two major classes type
The historical data of the ID of target device has been distributed one is system or learnt to history data, and one is new target device (i.e. systems
Do not receive any information of new target device before) historical data.If the historical data of new target device, it is then
System can bind this partial history data and the ID of new target device.
Wherein, historical data can be put into historical data pond by historical data by kafka, and system can control process
Or the quantity of thread, when there is historical data to flow into historical data pond, one process of system creation or thread, optionally,
The corresponding process in historical data pond or the quantity of thread can be controlled.Due to the historical data system being stored in kafka
System is packed in advance, therefore, when by historical data input prediction model, can not based on ID by historical data and process or
The binding transmission of person's thread, i.e., historical data dynamically can be given any one process or thread by system, rational to utilize
Resource.Then the carry out model training that different processes or thread can be alone, then preserves prediction result.
402, when real time data (i.e. data information) is come in, by next-generation distributed information system (Apache Kafka)
The transmission data into system.
First, kafka wherein independently can select data transmission to data pool (namely data relay station) in transmission process
Select process (python) or the number of thread (C/C++/Java).One can be set if data volume is few, if number
Multiple processes or thread can be selected according to amount greatly.Data can be thus put into real time data pond.
403, data flow is fashionable when having in data pool, system can search process corresponding with data or thread (i.e. first into
Journey or first thread), if not finding corresponding process or thread, system can create process or thread, and by establishment
Process or thread (i.e. the second process or the second thread) and the identity of target device are bound.
Wherein, data pool is the queue of a first in first out, and is served as by a process or thread.When having detected
Data flow into, and will search the ID of corresponding target device.If the corresponding process of the target device or thread are not created
It builds, then creates process or thread first, then the ID of bound targets equipment.
If 404, finding corresponding process or thread, corresponding process or thread inspection are corresponding with target device pre-
It surveys model (i.e. target prediction model) and whether there is (i.e. whether prediction model was trained to);If being not present, sent to kafka
Historical data is asked;If intelligently judging that (i.e. comparison is received for the state of user's water in the presence of, the decision engine in system
Data and the first predictive information), command sequence is then back to kafka.
Wherein, decision engine can intelligently judge whether to need to open quick heating mode such as half courage heating mode, with
And whether need to close water heater etc..
Wherein, if be not present corresponding prediction model, to kafka send historical data request after, can intelligently according to
Prediction model is trained according to historical data and predicts that user's uses water information (i.e. the second predictive information) etc..
Wherein, return command sequence (i.e. control instruction) gives kafka, that is to say, that system is in the shape for judging user's water
After state, control instruction is generated, the control instruction is then transferred to kafka, so that system control targe equipment.
It is understood that be to illustrate information control method described in the embodiment of the present invention by taking process as an example in Fig. 4,
It should not be construed as that there is limiting meaning to the embodiment of the present invention.
Implement the embodiment of the present invention, not only can intelligently predict that user's uses water information, but also can efficiently be located in
The data information sent from multiple target devices is managed, treatment effeciency is improved.
The above-mentioned method for illustrating the embodiment of the present invention, is provided below the server of the embodiment of the present invention.
Fig. 5 is referred to, Fig. 5 is a kind of structural schematic diagram of server provided in an embodiment of the present invention, and the server is available
In executing information control method described in foregoing embodiments, as shown in figure 5, the server includes:
Receiving unit 501, for receiving data information, above-mentioned data information carries identity mark corresponding with target device
Know, above-mentioned data information be with user currently use water behavior it is corresponding use water information, above-mentioned target device be can carry out at water
The equipment of reason;
Detection unit 502, for detecting whether there is corresponding with above-mentioned identity first according to above-mentioned identity
Predictive information, above-mentioned first predictive information are the use water information of the active user of prediction;
Control unit 503 controls above-mentioned for if there are above-mentioned first predictive information according to above-mentioned first predictive information
Target device.
Implement the embodiment of the present invention, in the case where receiving data information, by detecting the first predictive information, to root
According to first predictive information control user it is current with water behavior such as whether opening the heating of half courage, if need to close the target and set
It is standby etc. so that the target device effectively can intelligently adapt to the watering law of user, provide to the user it is more intelligent,
The service of automation improves efficiency.
Optionally, as shown in fig. 6, the target device at least two, above-mentioned server further include:
Searching unit 504, for searching whether that, there are the first process or first thread, above-mentioned first process is and above-mentioned body
Part identifies corresponding process, and above-mentioned first thread is thread corresponding with above-mentioned identity;
If above-mentioned detection unit passes through above-mentioned first specifically for there are above-mentioned first process or above-mentioned first thread
Process or above-mentioned first thread detect whether there is the first predictive information corresponding with above-mentioned identity.
Optionally, as shown in fig. 6, above-mentioned server further includes:
Creating unit 505, if for be not present above-mentioned first process, and be not present above-mentioned first thread, then create with it is upper
State corresponding second process of identity or the second thread;
Binding unit 506, for binding above-mentioned identity and above-mentioned second process, alternatively, binding above-mentioned identity
With above-mentioned second thread.
Optionally, above-mentioned binding unit 506 is specifically used for binding above-mentioned identity and upper according to modulus method or Hash method
The second process is stated, or binds above-mentioned identity and above-mentioned second thread.
Optionally, as described in Figure 7, above-mentioned server further includes:
Acquiring unit 507 is recorded for obtaining the first history with water;
Predicting unit 508 is predicted for recording to be input in target prediction model above-mentioned first history with water, is obtained
To above-mentioned first predictive information;Wherein, above-mentioned history carries identity corresponding with above-mentioned target device in being recorded with water,
Above-mentioned target prediction model is model corresponding with above-mentioned identity.
Optionally, above-mentioned acquiring unit 507 obtains the second history if being additionally operable to that above-mentioned first predictive information is not present
It is recorded with water, above-mentioned second history carries identity corresponding with above-mentioned target device in being recorded with water;
As shown in fig. 7, above-mentioned server further includes:
Determination unit 509 determines the second predictive information, above-mentioned second prediction for being recorded according to above-mentioned second history water
Above-mentioned identity is carried in information;
Above-mentioned control unit 503 is additionally operable to control above-mentioned target device according to above-mentioned second predictive information.
Optionally, above-mentioned first history water records or above-mentioned second history water record storage is in distributed file system
In, above-mentioned first predictive information or above-mentioned second predictive information are stored in database Redis.
Optionally, above-mentioned data information includes:Current Temperatures, above-mentioned first predictive information include:Target temperature;
Above-mentioned control unit 503, specifically for detecting whether above-mentioned Current Temperatures reach above-mentioned according to above-mentioned data information
Target temperature, if not up to, controlling above-mentioned target device and starting quick heating mode;
Alternatively, above-mentioned control unit 503, specifically for detecting whether above-mentioned Current Temperatures reach according to above-mentioned data information
Above-mentioned target temperature, if not up to, generating control instruction according to above-mentioned target temperature, and above-mentioned control instruction is sent to
Target device is stated, above-mentioned control instruction is used to indicate above-mentioned target device and starts quick heating mode.
Specifically, above-mentioned target prediction model includes:Target linear neural network model, target circulation neural network RNN
At least one of model and target shot and long term memory network LSTM models.
It should be noted that the realization of each unit can also be implemented to should refer to Fig. 2, Fig. 3 and method shown in Fig. 4
The corresponding description of example.
Fig. 8 is referred to, Fig. 8 is the structural schematic diagram of another server provided in an embodiment of the present invention, the server packet
Processor 801, memory 802 and transceiver 803 are included, processor 801, memory 802 and transceiver 803 pass through 804 phase of bus
It connects.
Memory 802 include but not limited to be random access memory (English:Random Access Memory, referred to as:
RAM), read-only memory (English:Read-Only Memory, referred to as:ROM), Erasable Programmable Read Only Memory EPROM (English:
Erasable Programmable Read Only Memory, referred to as:EPROM) or portable read-only memory is (English:
Compact Disc Read-Only Memory, referred to as:CD-ROM), which is used for dependent instruction and data.
Transceiver 803 can include receiver and transmitter, wherein receiver for realizing receiving number in embodiment of the method
According to and/or signaling function, transmitter is for realizing transmission data in embodiment of the method and/or the function of signaling.
Processor 801 can be one or more central processing units (English:Central Processing Unit, letter
Claim:CPU), in the case where processor 801 is a CPU, which can be monokaryon CPU, can also be multi-core CPU.
Processor 801 in the server executes following behaviour for reading the program code stored in the memory 802
Make:
Data information is received, above-mentioned data information carries identity corresponding with target device, above-mentioned data information
Currently to use water behavior is corresponding to use water information with user, above-mentioned target device is the equipment that can carry out water process;
Detect whether there is the first predictive information corresponding with above-mentioned identity according to above-mentioned identity, above-mentioned first
Predictive information is the use water information of prediction;
If there are above-mentioned first predictive information, above-mentioned target device is controlled according to above-mentioned first predictive information.
It should be noted that the realization of each operation can also be implemented to should refer to Fig. 2, Fig. 3 and method shown in Fig. 4
The corresponding description of example.
A kind of computer readable storage medium, above computer readable storage medium are provided in another embodiment of the invention
Matter is stored with computer program, and above computer program is realized when being executed by processor:
Data information is received, above-mentioned data information carries identity corresponding with target device, above-mentioned data information
Currently to use water behavior is corresponding to use water information with user, above-mentioned target device is the equipment that can carry out water process;
Detect whether there is the first predictive information corresponding with above-mentioned identity according to above-mentioned identity, above-mentioned first
Predictive information is the use water information of prediction;
If there are above-mentioned first predictive information, above-mentioned target device is controlled according to above-mentioned first predictive information.
Above computer readable storage medium storing program for executing can be the internal storage unit of the above-mentioned server of aforementioned any embodiment,
Such as the hard disk or memory of server.Above computer readable storage medium storing program for executing can also be that the external storage of above-mentioned server is set
Plug-in type hard disk that is standby, such as being equipped on above-mentioned server, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) blocks, flash card (Flash Card) etc..Further, above computer readable storage medium storing program for executing is also
Can both include above-mentioned server internal storage unit and also including External memory equipment.Above computer readable storage medium storing program for executing is used
In other programs and data needed for storage above computer program and above-mentioned server.Above computer readable storage medium storing program for executing
It can be also used for temporarily storing the data that has exported or will export.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, the flow
Relevant hardware can be instructed to complete by computer program, which can be stored in computer read/write memory medium, should
Program is when being executed, it may include such as the flow of above-mentioned each method embodiment.And storage medium above-mentioned includes:ROM is deposited at random
Store up the medium of the various program storage codes such as memory body RAM, magnetic disc or CD.