Interaction method for irrigation, server and irrigation system
By using RabbitMQ message queue to process the active messages and feedback messages of the irrigation gateway separately in the intelligent irrigation system, the problem of unstable network connection in the intelligent irrigation system is solved, timely acquisition and real-time monitoring of the irrigation gateway status is realized, and the irrigation system is improved. stability and efficiency.
Patent Information
- Application Number
- CN202411163950.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-26
AI Technical Summary
In the intelligent irrigation system, when the network connection is poor, the message transmission between the irrigation gateway and the server is unstable, resulting in users being unable to obtain the status of the irrigation gateway in time, affecting the intelligent irrigation effect.
The RabbitMQ message queue is used to transmit the messages actively sent by the irrigation gateway and the feedback messages sent based on the received instructions separately, and transmit them to electronic devices through different message queues, improving the stability of message transmission between the irrigation gateway and the server.
Ensure that users can obtain and view the status of the irrigation gateway in a timely manner, and improve the effect of intelligent irrigation and message transmission speed.
Smart Images

Figure CN119030949A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of irrigation, and more particularly, to an interactive method, a server and an irrigation system for irrigation. Background Art
[0002] Smart irrigation is an important scenario in smart agriculture. In smart irrigation, users can operate in electronic devices equipped with irrigation platforms to access the server interface to control the irrigation gateway to perform operations such as upgrading the irrigation gateway, opening and closing valves, etc. Afterwards, the irrigation gateway needs to send feedback messages to the electronic devices through the server to remind users of the current status of the irrigation gateway.
[0003] However, when the irrigation gateway sends feedback, the server needs to send the feedback message to the electronic device through the WebSocket protocol. In the case of poor network connection, it is easy to cause problems such as disconnection between the server and the electronic device. This will cause the user to be unable to obtain and view the status of the irrigation gateway in real time, which may cause the user to send irrigation instructions incorrectly later, affecting the effect of smart irrigation. Summary of the invention
[0004] The present application provides an interactive method, server and irrigation system for irrigation. In the technical solution, the server uses different RabbitMQ message queues to transmit messages to electronic devices for messages actively sent by the irrigation gateway and feedback messages sent by the irrigation gateway based on received instructions, which can improve the stability of message transmission between the irrigation gateway and the irrigation platform in the electronic device through the server, so that users can obtain and view the status of the irrigation gateway in real time.
[0005] In a first aspect, an interactive method for irrigation is provided, the method being applied to an irrigation system comprising at least an electronic device, a server, an irrigation gateway, a first target RabbitMQ, and a second target RabbitMQ, the method comprising: the irrigation gateway sending a first message and a second message to the server, wherein a first type to which the first message belongs is different from a second type to which the second message belongs; the server determining the first target RabbitMQ corresponding to the first type and the second target RabbitMQ corresponding to the second type; the server sending the first message to the first target RabbitMQ and sending the second message to the second target RabbitMQ; the first target RabbitMQ sending the first message to the electronic device, and the second target RabbitMQ sending the second message to the electronic device.
[0006] For example, when the first message belongs to the first type, the corresponding first target RabbitMQ is RabbitMQ1, and when the second message belongs to the second type, the corresponding second target RabbitMQ is RabbitMQ2, and RabbitMQ1 is different from RabbitMQ2.
[0007] Based on the embodiments of the present application, the server can determine the type of message sent by the irrigation gateway, determine the corresponding different RabbitMQs for different types of messages, and send different types of messages to different RabbitMQs. Using different RabbitMQ message queues to transmit messages to electronic devices can improve the stability of message transmission between the irrigation gateway and the irrigation platform in the electronic device through the server, so that users can obtain and view the status of the irrigation gateway in real time.
[0008] In combination with the first aspect, in certain implementations of the first aspect, the first message of the first type is a message sent by the irrigation gateway in response to receiving a first instruction, and the second message of the second type is a message actively sent by the irrigation gateway.
[0009] For example, the information actively sent may be basic information of the irrigation gateway, such as valve angle, valve status, status of the pressure sensor, currently detected temperature, humidity, etc.
[0010] Based on the embodiments of the present application, the server uses different RabbitMQ message queues to feedback to the electronic device for the messages actively sent by the irrigation gateway and the feedback messages sent by the irrigation gateway based on the received instructions. This can improve the stability of message transmission between the irrigation gateway and the irrigation platform in the electronic device through the server, so that the user can instantly obtain and view the status of the irrigation gateway in real time.
[0011] In combination with the first aspect, in certain implementations of the first aspect, the first instruction includes at least one of the following instructions: a firmware upgrade instruction or a software upgrade instruction of the irrigation gateway; a configuration update instruction of the irrigation gateway; a query instruction for querying relevant information of the irrigation gateway; or a control instruction for controlling the irrigation gateway.
[0012] In combination with the first aspect, the second message of the second type is a message actively sent by the irrigation gateway when it is powered on.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the first message of the first type is a message carrying a data volume less than or equal to a first preset value, and the second message of the second type is a message carrying a data volume greater than the first preset value.
[0014] Based on the embodiment of the present application, when the irrigation gateway sends a message to the electronic device, it can determine to use different RabbitMQs according to the amount of data carried in the message, so as to better classify the message, so as to improve the transmission stability and transmission speed of the message. In this way, it is helpful for users to obtain various states of the irrigation gateway and collected data and other information in a timely manner, thereby improving the effect of intelligent irrigation.
[0015] In combination with the first aspect, in some implementations of the first aspect, the method also includes: the irrigation gateway sends a third message to the server; when the server determines that the third message is a message containing fault information, the server sends the third message to a third target RabbitMQ, wherein the third target RabbitMQ is different from the first target RabbitMQ and the second target RabbitMQ; the third target RabbitMQ sends the third message to the electronic device.
[0016] Exemplarily, the fault information may be fault information of an irrigation gateway, or fault information of a valve or sensor controlled by the irrigation gateway.
[0017] Based on the embodiments of the present application, for this special message used to indicate a fault, the server can transmit it to the irrigation platform in the electronic device through a separate RabbitMQ to increase the sending speed of the fault message, which is beneficial for users to quickly obtain fault information and perform repairs in a timely manner.
[0018] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: the server determines whether there is an abnormality in the target valve controlled by the irrigation gateway based on historical data sent by the irrigation gateway; when it is determined that there is an abnormality in the target valve, the server generates prompt information, and the prompt information is used to indicate that there is an abnormality in the target valve; the server sends the prompt information to the fourth target RabbitMQ; the fourth target RabbitMQ sends the prompt information to the electronic device.
[0019] Exemplarily, the historical data includes abnormal information such as over-current alarm, timeout, unrecognized, angle abnormality, etc. of the target valve, and may also include information such as water pressure, valve opening angle, flow, etc.
[0020] In this way, the user can promptly obtain information that the target valve is in an abnormal state, and thus can promptly inspect and repair the target valve to ensure the irrigation effect.
[0021] In a second aspect, a server is provided, comprising a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method performed by the server in the first aspect and any possible implementation thereof is executed.
[0022] In a third aspect, an irrigation system is provided, comprising an electronic device, a server, an irrigation gateway, a first target RabbitMQ, and a second target RabbitMQ, wherein the electronic device is used to execute the method executed by the electronic device in the first aspect and any possible implementation thereof, the server is used to execute the method executed by the server in the first aspect and any possible implementation thereof, the irrigation gateway is used to execute the method executed by the irrigation gateway in the first aspect and any possible implementation thereof, the first target RabbitMQ is used to execute the method executed by the first target RabbitMQ in the first aspect and any possible implementation thereof, and the second target RabbitMQ is used to execute the method executed by the second target RabbitMQ in the first aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of an irrigation system provided in an embodiment of the present application.
[0024] Figure 2 It is a schematic diagram of an irrigation system provided in an embodiment of the present application.
[0025] Figure 3 It is a schematic diagram of an irrigation system provided in an embodiment of the present application.
[0026] Figure 4 It is a schematic diagram of an irrigation system provided in an embodiment of the present application.
[0027] Figure 5 It is a schematic flow chart of an interactive method for irrigation provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0029] Smart irrigation is an important scenario in smart agriculture. In smart irrigation, users can operate in electronic devices equipped with irrigation platforms to access the server interface to control the irrigation gateway to perform operations such as upgrading the irrigation gateway, opening valves, and closing valves.
[0030] like Figure 1 As shown, Figure 1Schematic diagram of an irrigation system provided in an embodiment of the present application. Figure 1 The irrigation system 100 may include at least electronic equipment, a server and an irrigation gateway.
[0031] It should be understood that the irrigation system 100 may also include various sensors for collecting data related to irrigation, such as temperature and humidity sensors, flow sensors, etc.
[0032] The electronic device may include an irrigation platform. For example, an application for controlling irrigation is installed in the electronic device, and the application may be understood as an irrigation platform. The application may also be replaced by a web page.
[0033] The server may include a big data platform, and the server may be used to interact with electronic devices and irrigation gateways. The server may also be used to store and analyze some data transmitted by the irrigation gateway.
[0034] Generally, when an electronic device sends an instruction or message to an irrigation gateway through a server, the irrigation gateway will send a feedback message to the server after receiving the instruction or message, or after performing some operations based on the instruction or message. The server can send the feedback message to the electronic device to provide feedback to the user.
[0035] For example, the instruction may be an instruction for upgrading the irrigation gateway. After receiving the instruction for upgrading, the irrigation gateway may execute the upgrade and then feed back the upgrade result to the electronic device through the server.
[0036] However, when the irrigation gateway sends a feedback message, the server needs to send the feedback message to the electronic device through the WebSocket protocol. In the case of poor network connection, problems such as disconnection between the server and the electronic device may easily occur.
[0037] In some cases, the irrigation gateway will also actively send some messages to the irrigation platform in the electronic device. For example, after the irrigation gateway is turned on, some basic information of the irrigation gateway can be fed back to the electronic device.
[0038] For example, Figure 2 Schematic diagram of an irrigation system provided in an embodiment of the present application. Figure 2 The irrigation system 100 may include at least electronic equipment, a server and an irrigation gateway.
[0039] Exemplarily, the basic information actively sent by the irrigation gateway may include valve angle, valve status, status of the pressure sensor, currently detected temperature, humidity, etc.
[0040] The basic information may also include a reporting cycle of the irrigation gateway. The reporting cycle may be understood as a cycle for the irrigation gateway to send the basic information to the electronic device. For example, the reporting cycle may be 10 minutes, 1 hour, or 3 hours, etc. The specific value of the reporting cycle is not limited in the embodiment of the present application.
[0041] However, the messages actively reported by the irrigation gateway also need to be forwarded to the electronic device through the server. In the case of poor network connection, problems such as disconnection between the server and the electronic device may easily occur.
[0042] This will result in the user being unable to obtain and view the status of the irrigation gateway in real time, which may cause the user to erroneously issue irrigation instructions later, affecting the effect of smart irrigation.
[0043] In view of this, the embodiment of the present application provides an interactive method, server and irrigation system for user irrigation. In this technical solution, the server uses different RabbitMQ message queues to feedback to the electronic device for the messages actively sent by the irrigation gateway and the feedback messages sent by the irrigation gateway based on the received instructions, which can improve the stability of the irrigation gateway transmitting messages between the server and the irrigation platform in the electronic device, so that the user can obtain and view the status of the irrigation gateway in real time.
[0044] In addition, using different RabbitMQ message queues to transmit different types of messages can improve the speed at which the irrigation gateway transmits messages between the server and the irrigation platform of the electronic device.
[0045] The following will combine Figures 3 to 5 The technical solution in the embodiments of the present application is introduced.
[0046] For example, Figure 3 Schematic diagram of an irrigation system provided in an embodiment of the present application. Figure 3 As shown, the irrigation system 200 may include at least electronic devices, RabbitMQ1 and RabbitMQ2, a server and an irrigation gateway.
[0047] Among them, the electronic device and irrigation gateway can refer to the relevant description in the previous text.
[0048] In the embodiment of the present application, the messages transmitted by the irrigation gateway to the electronic device through the server can be divided into two types: feedback message A and actively reported message B.
[0049] It should be understood that the feedback message A can be understood as a message fed back by the irrigation gateway in response to receiving an instruction sent by the electronic device through the server.
[0050] For example, the electronic device sends a version upgrade instruction to the irrigation gateway through the server, and the irrigation gateway can perform the version upgrade operation after receiving the version upgrade instruction. After the version upgrade operation is performed, the result of the version upgrade can be fed back to the electronic device.
[0051] In a possible implementation, after the irrigation gateway successfully upgrades its version, it can send a message A indicating the successful version upgrade to the server, and the server publishes the message A to the message queue of RabbitMQ1, and RabbitMQ1 automatically pushes the message A to the electronic device.
[0052] It should be understood that the electronic device, as a consumer of messages, will subscribe to messages from RabbitMQ1. After the electronic device subscribes to the messages, if there are messages in RabbitMQ1, they will be automatically pushed to the electronic device.
[0053] In a possible implementation, after the version upgrade fails, the irrigation gateway may send a message A indicating the version upgrade failure to the server, and the server publishes the message A to the message queue of RabbitMQ1, and RabbitMQ1 automatically pushes the message A to the electronic device.
[0054] For example, the electronic device sends a firmware upgrade instruction to the irrigation gateway through the server, and the irrigation gateway can perform a firmware upgrade operation after receiving the firmware upgrade instruction. After the firmware upgrade operation is performed, the result of the firmware upgrade can be fed back to the electronic device.
[0055] Exemplarily, the electronic device sends a control instruction to the irrigation gateway through the server. For example, the control instruction can be used to control the instruction to open valve 1. After receiving the instruction to open valve 1, the irrigation gateway can control the opening of valve 1. Afterwards, the irrigation gateway sends a message 1 indicating that valve 1 is successfully opened to the server, and the server publishes the message 1 to the message queue of RabbitMQ1, and RabbitMQ1 automatically pushes the message 1 to the electronic device.
[0056] Alternatively, after valve 1 is successfully opened, the irrigation gateway can also send relevant information of valve 1 such as valve angle, water pressure, etc., and message 2 carrying relevant information of valve 1 to the server. The server publishes message 2 to the message queue of RabbitMQ1, and RabbitMQ1 automatically pushes message 2 to the electronic device.
[0057] Exemplarily, the electronic device sends a query instruction to the irrigation gateway through the server. For example, the query instruction can be used to query the current temperature, humidity, etc. After receiving the instruction to query the temperature and humidity, the irrigation gateway can obtain the temperature and humidity in real time, and send the message 3 carrying the temperature and humidity to the server. The server can publish the message 3 to the message queue of RabbitMQ1, and RabbitMQ1 automatically pushes the message 3 to the electronic device.
[0058] It should be understood that the above-mentioned feedback message A may include multiple messages. In this case, the server can publish the multiple messages received in the time sequence to the message queue of RabbitMQ1, and automatically push them to the electronic device in the queue order.
[0059] It should be understood that the actively reported message B can be understood as a message that the irrigation gateway actively reports to the electronic device when the conditions are met without receiving any message or instruction.
[0060] In an example, the message B may be a message that the irrigation gateway automatically reports to the electronic device after being powered on, and the message B may carry basic information of the irrigation gateway.
[0061] For example, the basic information may include valve angle, valve status, status of the pressure sensor, currently detected temperature, humidity, etc.
[0062] The valve angle can be used to indicate the angle at which the valve is opened. At different angles, the valve sprays water in different directions.
[0063] The valve status may include valve open, valve closed, valve abnormality, excessive water volume, etc.
[0064] The status of the pressure sensor may include normal, excessive pressure, etc., and may also include a pressure value, etc.
[0065] In this way, the irrigation gateway sends a message B1 including the above basic information to the server after startup. After receiving the message B1, the server can publish the message B1 to the message queue of RabbitMQ2, and RabbitMQ2 automatically pushes the message B1 to the electronic device.
[0066] The message B may also include the network signal information of the irrigation gateway (such as signal strength, signal-to-noise ratio), positioning information (such as longitude, latitude), unique identification number of the SIM card, version number of the irrigation gateway, kernel version number, file system version number, number and capacity of current offline messages, boot field identifier, etc.
[0067] In this way, the irrigation platform in the electronic device can comprehensively obtain the real-time status of the irrigation gateway.
[0068] In one example, when the irrigation gateway detects a fault, for example, the irrigation gateway detects a fault in itself, or the irrigation gateway detects a valve fault or a temperature and humidity sensor fault, it sends a message B2 indicating the fault to the server. After receiving the message B2, the server publishes the message B2 to the message queue of RabbitMQ2, and RabbitMQ2 automatically pushes the message B2 to the electronic device.
[0069] In this way, when the irrigation gateway detects a fault, it can automatically report the fault information to the electronic device, so that the user can obtain the fault information in time, which is conducive to the user's rapid fault location and maintenance.
[0070] It should be understood that after receiving the message from the irrigation gateway, the server can also determine whether the message belongs to the above-mentioned message A or message B, and thus publish the message to the corresponding RabbitMQ message queue.
[0071] In some implementations, when the irrigation gateway sends a message to the server, the type identifier may be carried in the message. For example, the type identifier may be carried in a field, and when the field is "1", it belongs to message A, and when the field is "0", it belongs to message B.
[0072] In this way, after receiving the message, the server can determine the type of the message according to the type identifier in the message, and then publish the message to the corresponding RabbitMQ message queue.
[0073] Alternatively, when the message does not include a type identifier, the server can also determine the type of the message based on historical messages after receiving the message. For example, the server can determine from historical messages that the message is a message based on previously sent message feedback, and thus determine that the message belongs to a type of message A, and thus publish the message to the corresponding RabbitMQ message queue.
[0074] It is understandable that the actively reported message may also include a message reported by the irrigation gateway according to the configuration of the electronic device.
[0075] For example, the configuration may be pre-stored in the irrigation gateway, or may be obtained by the irrigation gateway from a server, which is not limited in the embodiments of the present application.
[0076] Based on the embodiments of the present application, the server uses different RabbitMQ message queues to feedback to the electronic device for the messages actively sent by the irrigation gateway and the feedback messages sent by the irrigation gateway based on the received instructions. This can improve the stability of message transmission between the irrigation gateway and the irrigation platform in the electronic device through the server, so that users can obtain and view the status of the irrigation gateway in real time.
[0077] In addition, using different RabbitMQ message queues to transmit different types of messages can improve the speed at which the irrigation gateway transmits messages between the server and the irrigation platform of the electronic device.
[0078] It should be understood that the present application embodiment takes the irrigation system including RabbitMQ1 and RabbitMQ2 as an example for explanation, but this should not cause any limitation to the present application. In other examples, if the irrigation gateway also feeds back other types of messages to the electronic device, the irrigation system can also include a larger number of RabbitMQs.
[0079] For example, in some cases, the irrigation gateway may have a fault, or the valves and sensors controlled by the irrigation gateway may have a fault. For this special message used to indicate the fault, the server can transmit it to the irrigation platform in the electronic device through RabbitMQ3 to increase the speed of sending the fault message, which is conducive to users to quickly obtain fault information and conduct timely maintenance.
[0080] In some cases, the irrigation gateway may need to send a large number of messages to the electronic device. When there are too many messages, some messages may not be transmitted in time. Therefore, the server can also distinguish and use different RabbitMQ message queues according to the amount of data carried by the received message. Figure 4 Introduce the technical solution.
[0081] For example, Figure 4 Schematic diagram of another irrigation system provided in the embodiment of the present application. Figure 4 As shown, the irrigation system 300 may include at least electronic devices, RabbitMQ1 and RabbitMQ2, a server and an irrigation gateway.
[0082] Exemplarily, the electronic device and the irrigation gateway may refer to the related descriptions in the foregoing text.
[0083] In the embodiment of the present application, the messages sent by the irrigation gateway can be divided into two types: message C and message D according to the amount of data carried.
[0084] Among them, message C represents a message carrying a data volume less than or equal to a preset value, and message D represents a message carrying a data volume greater than a preset value.
[0085] For message C, it corresponds to RabbitMQ1, and for message D, it corresponds to RabbitMQ2.
[0086] It should be understood that the specific value of the preset value is not limited in the embodiment of the present application. For example, the preset size is 10 kilobytes (KB), 100 KB, or 1 megabyte (MB).
[0087] Exemplarily, the irrigation gateway can send a message to the server when it needs to send a message to the electronic device. After receiving the message, the server can determine the size of the data carried by the message, and when it is determined that the size of the data carried in the message is less than or equal to the preset value, the server publishes the message to the message queue of RabbitMQ1; thereafter, RabbitMQ1 automatically pushes the message to the electronic device.
[0088] Alternatively, when it is determined that the amount of data carried in the message is greater than a preset value, the message is published to the message queue of RabbitMQ2; thereafter, RabbitMQ1 automatically pushes the message to the electronic device.
[0089] For example, the preset value is 5KB. When the data size of message 4 sent by the irrigation gateway is 3KB, the server can determine that the data size carried by message 4 is smaller than the preset value, so that message 4 can be published to the message queue of RabbitMQ1, and RabbitMQ1 automatically pushes the message 4 to the electronic device.
[0090] For example, the preset value is 10KB. When the size of the data carried by message 5 sent by the irrigation gateway is 15KB, the server can determine that the size of the data carried by message 5 is greater than the preset value, so that the message 5 can be published to the message queue of RabbitMQ2, and RabbitMQ2 automatically pushes the message 5 to the electronic device.
[0091] Based on the embodiment of the present application, when the irrigation gateway sends a message to the electronic device, it can determine to use different RabbitMQs according to the amount of data carried in the message, so as to better classify the message, so as to improve the transmission stability and transmission speed of the message. In this way, it is helpful for users to obtain various states of the irrigation gateway and collected data and other information in a timely manner, thereby improving the effect of intelligent irrigation.
[0092] In some cases, the server can also combine various data from sensors transmitted by the irrigation gateway to conduct real-time analysis of the current irrigation situation and the status of hardware such as valves and sensors, in order to improve the intelligence of the irrigation system.
[0093] For example, the irrigation gateway may periodically send various messages to the electronic device through the server.
[0094] For example, after receiving the instruction to control the opening of valve 1, the irrigation gateway can execute the operation of opening valve 1. Afterwards, the irrigation gateway can send the relevant information of valve 1 to the electronic device in real time or at a fixed time, so that the user can obtain the irrigation situation in time.
[0095] The relevant information may include abnormal information such as overcurrent alarm, timeout, unrecognized, abnormal angle, etc., and may also include information such as water pressure, valve opening angle, flow, etc.
[0096] In some examples, if the number of abnormal information included in the valve 1 related information sent by the irrigation gateway multiple times is greater than a preset number, the server can determine that the valve 1 may be abnormal, so the server can publish a prompt message to prompt the user to repair the valve 1 to the RabbitMQ message queue, and RabbitMQ pushes it to the electronic device. After receiving the prompt message, the electronic device can display the prompt message in the application used to control irrigation, which is helpful to remind the user to repair the valve 1 in time.
[0097] For example, the preset number of times is 3 times, and the historical data indicates that the electronic device has issued a control instruction to open valve 1 6 times. In the message fed back by the irrigation gateway, 4 times include abnormal information. The server can determine that there may be an abnormality in valve 1 based on the historical data of valve 1. The server can generate a prompt message to prompt the user to inspect valve 1, and push it to the electronic device through RabbitMQ.
[0098] In this way, the user can promptly obtain information that the valve 1 is in an abnormal state, and thus can promptly inspect and repair the valve 1 to ensure the irrigation effect.
[0099] Figure 5 is a schematic flow chart of an interactive method for irrigation provided in an embodiment of the present application. Figure 5 As shown, the method 500 can be applied to an irrigation system including an irrigation gateway, a server, a first target RabbitMQ, a second target RabbitMQ, and an electronic device. The method can at least include steps 510 to 550.
[0100] 510. The irrigation gateway sends a first message and a second message to the server, wherein a first type of the first message is different from a second type of the second message.
[0101] It should be understood that the first message and the second message may be sent by the irrigation gateway simultaneously or may not be sent simultaneously.
[0102] In some cases, the first message and the second message may carry a type identifier, so that the type of the first message and the second message can be determined through the type identifier.
[0103] 520. The server determines a first target RabbitMQ corresponding to the first type and a second target RabbitMQ corresponding to the second type.
[0104] In some examples, the server may determine the types of the first message and the second message based on type identifiers carried in the first message and the second message, and further determine the corresponding target RabbitMQ.
[0105] In other examples, when the first message does not carry a type identifier, the server may also determine the type of the first message on its own.
[0106] For example, the server may determine the type of the message based on the amount of data carried in the message, or the server may determine the type of the message based on historical messages, and so on.
[0107] 530a, the server sends a first message to the first target RabbitMQ.
[0108] The server may publish the first message to a message queue of a first target RabbitMQ.
[0109] 530b, the server sends a second message to the second target RabbitMQ.
[0110] The server may publish the second message to a message queue of the second target RabbitMQ.
[0111] It should be understood that step 530a and step 530b may also be performed in one step or simultaneously, which is not limited in the embodiment of the present application.
[0112] 540. The first target RabbitMQ sends a first message to the electronic device.
[0113] 550. The second target RabbitMQ sends a second message to the electronic device.
[0114] Based on the embodiments of the present application, the server can determine the type of message sent by the irrigation gateway, determine the corresponding different RabbitMQs for different types of messages, and send different types of messages to different RabbitMQs. Using different RabbitMQ message queues to transmit messages to electronic devices can improve the stability of message transmission between the irrigation gateway and the irrigation platform in the electronic device through the server, so that users can obtain and view the status of the irrigation gateway in real time.
[0115] In some embodiments, the first message of the first type is a message sent by the irrigation gateway in response to receiving the first instruction, and the second message of the second type is a message actively sent by the irrigation gateway.
[0116] The first message may include a firmware upgrade instruction or a software upgrade instruction of the irrigation gateway; a configuration update instruction of the irrigation gateway; a query instruction for querying relevant information of the irrigation gateway; or a control instruction for controlling the irrigation gateway.
[0117] The upgrade instructions and control instructions can refer to the relevant description in the previous text.
[0118] The query instruction for querying the relevant information of the irrigation gateway may be an instruction for querying temperature and humidity, operating status, etc.
[0119] The configuration update instruction may be information for updating some configurations of the irrigation gateway, such as network configuration, data configuration, storage configuration, etc.
[0120] Exemplarily, the information actively sent may be basic information of the irrigation gateway, such as valve angle, valve status, status of the pressure sensor, currently detected temperature, humidity, etc.
[0121] Optionally, the information sent actively can be sent actively by the irrigation gateway after it is turned on. This helps the electronic device to obtain the initial data information of the irrigation gateway.
[0122] Based on the embodiments of the present application, the server uses different RabbitMQ message queues to feedback to the electronic device for the messages actively sent by the irrigation gateway and the feedback messages sent by the irrigation gateway based on the received instructions. This can improve the stability of message transmission between the irrigation gateway and the irrigation platform in the electronic device through the server, so that the user can instantly obtain and view the status of the irrigation gateway in real time.
[0123] In some embodiments, the first message of the first type is a message carrying a data volume less than or equal to a first preset value, and the second message of the second type is a message carrying a data volume greater than the first preset value.
[0124] Exemplarily, the first preset value can refer to the related description of the preset value in the previous text, and for the sake of brevity, it will not be repeated here.
[0125] Based on the embodiment of the present application, when the irrigation gateway sends a message to the electronic device, it can determine to use different RabbitMQs according to the amount of data carried in the message, so as to better classify the message, so as to improve the transmission stability and transmission speed of the message. In this way, it is helpful for users to obtain various states of the irrigation gateway and collected data and other information in a timely manner, thereby improving the effect of intelligent irrigation.
[0126] In some embodiments, the method 500 further includes:
[0127] The irrigation gateway sends a third message to the server;
[0128] When the server determines that the third message is a message including fault information, the server sends the third message to a third target RabbitMQ, wherein the third target RabbitMQ is different from the first target RabbitMQ and the second target RabbitMQ;
[0129] The third target RabbitMQ sends a third message to the electronic device.
[0130] Exemplarily, the fault information may be fault information of an irrigation gateway, or fault information of a valve or sensor controlled by the irrigation gateway.
[0131] Based on the embodiments of the present application, for this special message used to indicate a fault, the server can transmit it to the irrigation platform in the electronic device through a separate RabbitMQ to increase the sending speed of the fault message, which is beneficial for users to quickly obtain fault information and perform repairs in a timely manner.
[0132] In some embodiments, the method 500 further includes:
[0133] The server determines whether there is an abnormality in the target valve controlled by the irrigation gateway based on the historical data sent by the irrigation gateway;
[0134] When determining that the target valve has an abnormality, the server generates a prompt message, and the prompt message is used to indicate that the target valve has an abnormality;
[0135] The server sends a prompt message to the fourth target RabbitMQ;
[0136] The fourth target RabbitMQ sends a prompt message to the electronic device.
[0137] Exemplarily, the historical data includes abnormal information such as over-current alarm, timeout, unrecognized, angle abnormality, etc. of the target valve, and may also include information such as water pressure, valve opening angle, flow, etc.
[0138] For example, the server may determine whether the target valve has an abnormality based on the relationship between the number of times the abnormal information is included in the messages in the historical data and the preset number of times. For details, please refer to the relevant description in the above text.
[0139] It should be understood that the fourth target RabbitMQ may be the same as or different from the third target RabbitMQ.
[0140] In this way, the user can promptly obtain information that the target valve is in an abnormal state, and thus can promptly inspect and repair the target valve to ensure the irrigation effect.
[0141] An embodiment of the present application also provides a server, which includes a processor and a communication interface, the communication interface is used to receive a signal and transmit the signal to the processor, the processor processes the signal so that the method executed by the server in any possible implementation method described above is executed.
[0142] An embodiment of the present application also provides an irrigation system, which includes an electronic device, a server, an irrigation gateway, a first target RabbitMQ, and a second target RabbitMQ, wherein the electronic device is used to execute a method executed by the electronic device in any possible implementation as described above, the server is used to execute a method executed by the server in any possible implementation as described above, the irrigation gateway is used to execute a method executed by the irrigation gateway in any possible implementation as described above, the first target RabbitMQ is used to execute a method executed by the first target RabbitMQ in any possible implementation as described above, and the second target RabbitMQ is used to execute a method executed by the second target RabbitMQ in any possible implementation as described above.
[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0144] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0147] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An interactive method for irrigation, characterized in that The method is applied to an irrigation system including at least an electronic device, a server, an irrigation gateway, a first target RabbitMQ, and a second target RabbitMQ, and the method includes: The irrigation gateway sends a first message and a second message to the server, wherein a first type to which the first message belongs is different from a second type to which the second message belongs; The server determines the first target RabbitMQ corresponding to the first type and the second target RabbitMQ corresponding to the second type; The server sends the first message to the first target RabbitMQ, and sends the second message to the second target RabbitMQ; The first target RabbitMQ sends the first message to the electronic device, and the second target RabbitMQ sends the second message to the electronic device.
2. The method according to claim 1, characterized in that The first message of the first type is a message sent by the irrigation gateway in response to receiving a first instruction, and the second message of the second type is a message actively sent by the irrigation gateway.
3. The method according to claim 2, characterized in that The first instruction includes at least one of the following instructions: Firmware upgrade instructions or software upgrade instructions of the irrigation gateway; Configuration update instructions of the irrigation gateway; A query instruction for querying relevant information of the irrigation gateway; or Control instructions for controlling the irrigation gateway.
4. The method according to claim 2, characterized in that: The second message of the second type is a message actively sent by the irrigation gateway when it is powered on.
5. The method according to claim 1, characterized in that The first message of the first type is a message carrying a data volume less than or equal to a first preset value, and the second message of the second type is a message carrying a data volume greater than the first preset value.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The irrigation gateway sends a third message to the server; When the server determines that the third message is a message containing fault information, the server sends the third message to a third target RabbitMQ, wherein the third target RabbitMQ is different from the first target RabbitMQ and the second target RabbitMQ; The third target RabbitMQ sends the third message to the electronic device.
7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The server determines whether there is an abnormality in a target valve controlled by the irrigation gateway based on the historical data sent by the irrigation gateway; When it is determined that the target valve is abnormal, the server generates prompt information, where the prompt information is used to indicate that the target valve is abnormal; The server sends the prompt information to the fourth target RabbitMQ; The fourth target RabbitMQ sends the prompt information to the electronic device.
8. A server, characterized in that: The server includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method performed by the server as claimed in any one of claims 1 to 7 is executed.
9. An irrigation system, characterized in that: The system includes an electronic device, a server, an irrigation gateway, a first target RabbitMQ, and a second target RabbitMQ, wherein the electronic device is used to execute the method executed by the electronic device as claimed in any one of claims 1-7, the server is used to execute the method executed by the server as claimed in any one of claims 1-7, the irrigation gateway is used to execute the method executed by the irrigation gateway as claimed in any one of claims 1-7, the first target RabbitMQ is used to execute the method executed by the first target RabbitMQ as claimed in any one of claims 1-7, and the second target RabbitMQ is used to execute the method executed by the second target RabbitMQ as claimed in any one of claims 1-7.
