System for storing, retrieving and processing agricultural messages
By designing EMQX clusters, message storage clusters and message retrieval clusters in smart agriculture, the problem of low message storage and retrieval efficiency in agricultural products is solved, and messages are persisted and dual backups are realized, real-time and response speed of the system are improved. Scientific management of smart agriculture.
Patent Information
- Application Number
- CN202411217974.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-27
AI Technical Summary
In smart agriculture, the massive messages generated by agricultural equipment are inefficient in storage and retrieval, cannot meet production needs, and cannot make full use of messages.
A system was designed, including EMQX cluster, message storage cluster and message retrieval cluster. By bridging agricultural messages to kafka cluster and Elasticsearch cluster, persistent storage and dual backup are realized, providing a full-text search engine, and improving the storage and retrieval of messages. Efficiency and generate instructions based on the original message to guide agricultural production.
It realizes efficient storage and rapid retrieval of agricultural messages, ensures that messages are not lost and complete, improves the real-time and response speed of the system, and meets the scientific and refined management needs of smart agriculture.
Smart Images

Figure CN119202074A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of agriculture, and more specifically, to a system for retrieving and processing agricultural information. Background Art
[0002] Smart agriculture is an important development direction in the agricultural field. Smart agriculture is to apply the Internet of Things technology to traditional agriculture, use sensors and software to control agricultural production through the message platform, and make traditional agriculture more "intelligent". Smart agriculture integrates computer and network technology, Internet of Things technology, audio and video technology, geographic information technology, wireless communication technology, and expert wisdom and knowledge to achieve intelligent management such as agricultural visualization diagnosis, remote control, and disaster warning. Smart agriculture mainly includes monitoring function system, monitoring function system, and real-time image and video monitoring function. In the actual agricultural production process, a large number of agricultural equipment (such as sensors, irrigation machines, etc.) will be deployed to achieve the above functions. This large number of agricultural equipment will generate a large amount of messages. At present, the efficiency of storing and retrieving messages is very low, which cannot meet the actual production needs and cannot make full use of agricultural messages. Based on this, how to improve the storage and retrieval efficiency of agricultural messages and rationally use agricultural messages has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present application provides a system for storing, retrieving and processing agricultural messages, which can perform persistent storage and rapid retrieval of agricultural messages, meeting the needs of agricultural producers for quickly obtaining agricultural messages, and can also generate indication messages based on the original agricultural messages for indicating agricultural production, thereby contributing to the advancement of smart agriculture.
[0004] In a first aspect, a system for storing, retrieving and processing agricultural messages is provided, the system comprising a plurality of agricultural equipment, an EMQX cluster, a first message storage cluster, a second message storage cluster, a message retrieval cluster, a message processing module and a subscription device, the first message storage cluster is any one of the following: a kafka cluster, a RabbitMQ cluster, a Redis cluster, the second message storage cluster is any one of the following: a kafka cluster, a RabbitMQ cluster, a Redis cluster, the message retrieval cluster is any one of the following: an Elasticsearch cluster, an InfluxDB cluster, a MongoDB cluster, wherein the plurality of agricultural equipment is used to: generate N agricultural messages, N ≥ 1 and is an integer, wherein the plurality of agricultural equipment includes at least two different types of agricultural equipment, the N The agricultural messages include one or more of the following: soil information, crop information, agricultural equipment status information, and environmental information; the N agricultural messages are sent to the EMQX cluster; the EMQX cluster is used to send the N agricultural messages to the first message storage cluster; the first message storage cluster is used to send the N agricultural messages to the message retrieval cluster; the message processing module is used to: extract the N agricultural messages from the message retrieval cluster; generate M indication messages based on the N agricultural messages, M≥1 and is an integer, and the M indication messages are used to indicate production decisions; send the M indication messages to the second message storage cluster; the subscription device is used to: obtain Q agricultural information from the N agricultural messages associated with the retrieval condition from the message retrieval cluster according to the retrieval condition; obtain P indication information from the M indication messages from the second message storage cluster.
[0005] In the embodiment of the present application, by bridging the agricultural messages to the message storage cluster, persistent storage of the agricultural messages is achieved, ensuring that the agricultural messages will not be lost.
[0006] In the embodiment of the present application, agricultural messages can also be mounted to the message retrieval cluster, realizing double backup and storage of agricultural messages, and ensuring the integrity and invariance of agricultural messages, making agricultural message storage more reliable. The message retrieval cluster can provide a full-text search engine, and the subscription device can retrieve and query agricultural messages. The process of agricultural messages from publishing to storage and then to retrieval is efficient and fast, which improves the real-time and response speed of the system and meets the real-time requirements for message data.
[0007] In an embodiment of the present application, instruction information can also be generated based on the original agricultural message to guide agricultural producers in agricultural production, which will help promote the development of smart agriculture and realize the scientific and refined management of agricultural production.
[0008] In combination with the first aspect, in certain implementations of the first aspect, the message retrieval cluster also includes a first index, and the message retrieval cluster is further used to perform a rolling update on the agricultural message associated with the first index when a first preset condition is met.
[0009] In combination with the first aspect, in certain implementations of the first aspect, the first preset condition includes: the creation time of the first index is greater than or equal to a first threshold; and / or the size of the agricultural message associated with the first index is greater than or equal to a second threshold.
[0010] In combination with the first aspect, in certain implementations of the first aspect, the multiple agricultural equipment include irrigation equipment, the soil information is used to indicate soil moisture, the agricultural equipment status information is used to indicate irrigation flow of the irrigation equipment, and the M indication messages include a first indication message, the first indication message is used to indicate adjustment of the working condition of the irrigation equipment, and the first indication message is determined based on the soil information and the status information of the agricultural equipment.
[0011] In combination with the first aspect, in certain implementations of the first aspect, the crop information is used to indicate the growth stage of the crop, the environmental information is used to indicate the ambient temperature and light intensity, and the M indication messages include a second indication message, and the second indication message is used to indicate a fertilization strategy, and the second indication message is determined based on the crop information and the environmental information.
[0012] In combination with the first aspect, in certain implementations of the first aspect, the soil information is used to indicate the nitrogen, phosphorus and potassium content of the soil, and the M indication messages include a third indication message, and the third indication message is used to indicate a fertilization strategy, and the third indication message is determined based on the soil information.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the soil information is used to indicate soil moisture, the crop information is used to indicate the type and growth stage of the crop, the environmental information is used to indicate the ambient temperature and precipitation, and the M indication messages include a fourth indication message, which is used to indicate an irrigation strategy, and the fourth indication message is determined based on the soil information, the environmental information, and the crop information.
[0014] In combination with the first aspect, in certain implementations of the first aspect, the soil information is used to indicate the nitrogen, phosphorus and potassium content of the soil, the crop information is used to indicate the growth stage of the crop, the environmental information is used to indicate the ambient temperature and light intensity, and the M indication messages include a fifth indication message, which is used to indicate a fertilization strategy, and the fifth indication message is determined based on the crop information, the environmental information and the soil information.
[0015] In combination with the first aspect, in certain implementations of the first aspect, the message processing module is further used to: monitor the system parameters of the message retrieval cluster; and send a first warning message to the equipment of the operation and maintenance personnel when a second preset condition is met.
[0016] In combination with the first aspect, in certain implementations of the first aspect, the second preset condition includes: the maximum processor utilization of the message retrieval system is greater than or equal to a third threshold; and / or the storage device utilization of the message storage system is greater than or equal to a fourth threshold; and / or the number of queued tasks in the write queue of the message storage system is greater than or equal to a fifth threshold; and / or the delay of the message storage system is greater than or equal to a sixth threshold; and / or the number of queued tasks in the index queue of the message storage system is greater than or equal to a seventh threshold.
[0017] In combination with the first aspect, in certain implementations of the first aspect, the message processing module is further used to send a second warning message to the agricultural producer's equipment and / or the second message storage cluster when an abnormal production event is detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a system architecture diagram.
[0019] Figure 2 It is a system architecture diagram provided in an embodiment of the present application.
[0020] Figure 3 It is a system architecture diagram provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0022] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0023] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0024] Smart agriculture is an important development direction in the agricultural field. Smart agriculture is the application of Internet of Things technology to traditional agriculture, using sensors and software to control agricultural production through a messaging platform, making traditional agriculture more "intelligent". Smart agriculture integrates computer and network technology, Internet of Things technology, audio and video technology, geographic information technology, wireless communication technology, and expert wisdom and knowledge to achieve intelligent management such as visual agricultural diagnosis, remote control, and disaster warning. Smart agriculture mainly includes monitoring function systems, monitoring function systems, and real-time image and video monitoring functions. In the actual agricultural production process, a large number of agricultural equipment (such as sensors, irrigation machines, etc.) will be deployed to achieve the above functions. This large amount of agricultural equipment will generate massive amounts of data. The current efficiency of storing and retrieving data is very low and cannot meet actual production needs. The following will combine Figure 1 Make an introduction.
[0025] Figure 1 A schematic diagram of a system architecture is shown.
[0026] like Figure 1 As shown, the agricultural message generated by the agricultural equipment will be uploaded to the proxy server, and then the terminal device can receive the agricultural message from the proxy server by subscribing to a specific topic. In the embodiment of the present application, the agricultural message can also be referred to as agricultural data, agricultural information, etc. The terminal device includes but is not limited to a mobile phone, a laptop computer, etc.
[0027] In the embodiment of the present application, the message generated by the agricultural equipment may be referred to as an agricultural message. The agricultural equipment may be understood as the equipment used in agricultural production. In the embodiment of the present application, the agricultural equipment includes but is not limited to: agricultural machinery, drones, fertilizer spreaders, water pumps, irrigation machines, water-fertilizer integrated equipment, soil moisture sensors, soil temperature sensors, soil pH sensors, soil conductivity sensors, and gateways.
[0028] For example, a drone can take photos of crops, and the agricultural message generated by the drone can indicate the type of crops, the type of production, etc. A drone can also spray pesticides on crops, and the agricultural message generated by the drone can indicate the spraying flow, flight altitude, flight path, etc.
[0029] For example, an agricultural message generated by an irrigation machine may indicate an irrigation flow rate.
[0030] For example, an agricultural message generated by a soil moisture sensor may indicate the moisture of the soil.
[0031] Depend on Figure 1 It can be seen that in the existing system architecture, agricultural equipment sends agricultural information to the proxy server. The proxy server only provides a simple message storage function, but the proxy server only stores the current message status. The terminal device cannot obtain the historical message of a certain agricultural equipment, making it impossible for users to make real-time adjustments based on historical messages. In addition, all messages generated by agricultural equipment are stored on the proxy server, and the amount of data will be very large, resulting in a decrease in the storage and retrieval efficiency of data, and the inability to fully utilize agricultural messages. Based on this, how to improve the storage and retrieval efficiency of agricultural messages and how to reasonably utilize agricultural messages have become technical problems that need to be solved urgently.
[0032] Figure 2 A schematic diagram of the system architecture provided by an embodiment of the present application is shown.
[0033] like Figure 2 As shown, the system includes agricultural equipment 210, Erlang message queuing telemetry transport broker (EMQX) cluster 220, kafka cluster 230, Elasticsearch cluster 240 and subscription device 250. Among them, EMQX cluster 220 may include one or more EMQX proxy servers, EMQX is developed based on Erlang / OTP language platform, supports large-scale connection and distributed cluster, publishes and subscribes to the millions of open source message queuing telemetry transport (MQTT) servers, kafka cluster 230 may include one or more kafka proxy servers, and Elasticsearch cluster 240 may include one or more Elasticsearch modules (or nodes). Elasticsearch cluster 240 can provide a query interface to subscription device 250, so that subscription device 250 can obtain the required agricultural messages through the query interface.
[0034] It should be noted that the agricultural equipment 210 corresponds to a plurality of agricultural equipment, and the plurality of agricultural equipment includes at least two different types of agricultural equipment.
[0035] It can be understood that the agricultural information generated by the agricultural equipment 210 can be an MQTT message, that is, it complies with the MQTT protocol frame format.
[0036] In some embodiments, the query interface may be a hypertext transfer protocol (HTTP) interface.
[0037] When the agricultural device 210 generates an agricultural message, the agricultural message includes a topic and a payload, wherein the topic can indicate which agricultural device generates the agricultural message, and the payload is used to carry the data generated by the agricultural device.
[0038] In an embodiment of the present application, after generating N agricultural messages, the agricultural equipment 210 can send the agricultural messages to the EMQX cluster 220, where N≥1 and is an integer.
[0039] In some embodiments, when the agricultural device 210 sends N agricultural messages to the EMQX cluster 220, the EMQX cluster 220 may send the agricultural messages to the corresponding proxy server.
[0040] In some embodiments, each EMQX proxy server in the EMQX cluster 220 may carry agricultural messages of one or more topics.
[0041] For example, EMQX cluster 220 includes EMQX proxy server #1 and EMQX proxy server #2, wherein EMQX proxy server #1 is used to carry agricultural messages with themes Topic #1 and Topic #2, and EMQX proxy server #2 is used to carry agricultural messages with themes Topic #3 and Topic #4.
[0042] In some embodiments, different EMQX proxy servers may carry agricultural messages of the same topic.
[0043] For example, EMQX cluster 220 includes EMQX proxy server #1 and EMQX proxy server #2, wherein EMQX proxy server #1 is used to carry agricultural messages with themes of Topic #1 and Topic #2, and EMQX proxy server #2 is used to carry agricultural messages with themes of Topic #2 and Topic #3.
[0044] In some embodiments, different EMQX proxy servers may carry agricultural messages of different topics.
[0045] For example, EMQX cluster 220 includes EMQX proxy server #1 and EMQX proxy server #2, wherein EMQX proxy server #1 is used to carry agricultural messages with a subject of Topic #1, and EMQX proxy server #2 is used to carry agricultural messages with a subject of Topic #2.
[0046] The EMQX cluster 220 receives N agricultural messages sent by the agricultural equipment 210 , and can bridge the N agricultural messages to the Kafka cluster 230 , that is, send the N agricultural messages to the Kafka cluster 230 .
[0047] In some embodiments, when the EMQX cluster 220 bridges N agricultural messages to the Kafka cluster 230 , each Kafka proxy server can carry agricultural messages of one or more topics.
[0048] For example, the kafka cluster 230 includes a kafka proxy server #1 and a kafka proxy server #2, wherein the kafka proxy server #1 is used to carry agricultural messages with topics #1 and #2, and the kafka proxy server #2 is used to carry agricultural messages with topics #3 and #4.
[0049] In some embodiments, different Kafka proxy servers may carry agricultural messages on the same topic.
[0050] For example, the kafka cluster 230 includes a kafka proxy server #1 and a kafka proxy server #2, wherein the kafka proxy server #1 is used to carry agricultural messages with topics #1 and #2, and the kafka proxy server #2 is used to carry agricultural messages with topics #2 and #3.
[0051] In some embodiments, different Kafka proxy servers can carry agricultural messages on different topics.
[0052] For example, the kafka cluster 230 includes a kafka proxy server #1 and a kafka proxy server #2, wherein the kafka proxy server #1 is used to carry agricultural messages with a topic of topic #1, and the kafka proxy server #2 is used to carry agricultural messages with a topic of topic #2.
[0053] Table 1 shows the correspondence between agricultural equipment and Kafka topics. As can be seen from Table 1, the topic name of navigation & unmanned agricultural machinery is linktrace, the topic name of drone is drone, the topic name of the first-generation gateway & fertilizer machine & water pump is hi, and the name of the second-generation gateway is hi2g.
[0054] Table 1 Correspondence between agricultural equipment and Kafka topics
[0055] Agricultural equipment kafka topics Navigation & Unmanned Agricultural Machinery linktrace Drones drone First generation gateway & fertilizer spreader & water pump hi Second Generation Gateway hi2g
[0056] It should be noted that the agricultural equipment and the subject names corresponding to the agricultural equipment in Table 1 are only examples and should not be understood as specific limitations on the embodiments of the present application. In the embodiments of the present application, more or fewer agricultural equipment may be included, and the subject names corresponding to the agricultural equipment may also be changed.
[0057] The first-generation gateway and second-generation gateway mentioned above can be understood as gateways with different operating systems, protocol frameworks, etc.
[0058] Exemplarily, the first-generation gateway has no system, and the second-generation gateway has a Linux system.
[0059] It should be noted that in the embodiments of the present application, there is no specific limitation on the types of first-generation gateways and second-generation gateways, that is, any gateway that supports the corresponding business scenarios can be used.
[0060] The EMQX cluster 220 can bridge N agricultural messages to the Kafka cluster 230 , and the Kafka cluster 230 can mount the N agricultural messages to the Elasticsearch cluster 240 .
[0061] In some embodiments, when the kafka cluster 230 bridges agricultural messages to the Elasticsearch cluster 240, each Elasticsearch module can carry agricultural messages of one or more topics.
[0062] For example, the Elasticsearch cluster 240 includes Elasticsearch module #1 and Elasticsearch module #2, wherein Elasticsearch module #1 is used to carry agricultural messages with topics #1 and #2, and Elasticsearch module #2 is used to carry agricultural messages with topics #3 and #4.
[0063] In some embodiments, different Elasticsearch modules may carry agricultural messages on the same topic.
[0064] For example, the Elasticsearch cluster 240 includes Elasticsearch module #1 and Elasticsearch module #2, wherein Elasticsearch module #1 is used to carry agricultural messages with topics #1 and #2, and Elasticsearch module #2 is used to carry agricultural messages with topics #2 and #3.
[0065] In some embodiments, different Elasticsearch modules can carry agricultural messages on different topics.
[0066] For example, the Elasticsearch cluster 240 includes an Elasticsearch module #1 and an Elasticsearch module #2, wherein the Elasticsearch module #1 is used to carry agricultural messages with a subject of Topic #1, and the Elasticsearch module #2 is used to carry agricultural messages with a subject of Topic #2.
[0067] Table 2 shows the correspondence between Kafka topics and Elasticsearch indexes. As can be seen from Table 2, the topic name of navigation & unmanned agricultural machinery is linktrace, the topic name of drone is drone, the topic name of the first-generation gateway & fertilizer machine & water pump is hi, and the name of the second-generation gateway is hi2g.
[0068] Table 2. Correspondence between Kafka topics and Elasticsearch indexes
[0069] kafka topics Elasticsearch index linktrace linktrace-000001 drone drone-000001 hi hi-000001 hi2g hi2g-000001
[0070] It is understandable that by mounting agricultural messages to the Elasticsearch cluster 240, since the Elasticsearch cluster 240 has full-text retrieval and complex query functions, the subscription device 250 can not only retrieve historical agricultural messages, but also perform flexible message retrieval by setting different query conditions and keywords.
[0071] In some embodiments, when agricultural messages are mounted to an Elasticsearch cluster, word segmentation processing may be performed on the agricultural messages so that the subscription device 250 can perform a more efficient full-text search.
[0072] The frame format of the agricultural message includes a frame header part and a payload, wherein the frame header may include a fixed header and a variable header, wherein the word segmentation processing of the agricultural message refers to the word segmentation processing of the payload in the agricultural message.
[0073] Specifically, the payload of the agricultural message carries a string of characters. The string can be decomposed into multiple fields by performing word segmentation on the payload, wherein each field is used to carry different information.
[0074] For example, if the agricultural message is generated by navigation & unmanned agricultural machinery, the payload of the agricultural message carries one or more of the following information: device code, instruction type, instruction number, and reporting time. When the agricultural information is mounted to the Elasticsearch cluster 240, the agricultural message can be segmented and stored according to the segmentation results, so that the subscription device 250 can obtain one or more information in the agricultural message by setting different keywords and query conditions when searching.
[0075] Exemplarily, when the agricultural message is an agricultural message generated by a navigation & unmanned agricultural machine, the instruction type may include:
[0076] 1. Tracing
[0077] info information: trace=i
[0078] warning: trace=w
[0079] ecu alarm: trace = dm
[0080] Track point: trace = p
[0081] 2. Command
[0082] Read configuration parameters: comm = nreadset Response: comm = rreadset
[0083] Active reporting configuration parameters: comm=reportset
[0084] Upgrade: comm=nupdate Response: comm=rupdate
[0085] Instruction encodings may include:
[0086] 1. info information: trace = i
[0087] 1) Power-on message: mc=201
[0088] 2) Shutdown message: mc=202
[0089] 3) Start message: mc=203
[0090] 4) Wake-up message: mc=204
[0091] 5) Sleep event: mc = 206
[0092] 6) ACC event: mc = 207
[0093] 7) GPS normal status: mc = 221
[0094] 8) Network connection is normal: mc=231
[0095] 9) ECU connection status: mc = 281
[0096] 2. Warning: trace = w
[0097] 1) GPS abnormality: mc=321
[0098] 2) Network connection abnormality: mc=331
[0099] 3) ECU disconnect state: mc = 381
[0100] 4) Backup battery voltage alarm: mc=391
[0101] 5) Demolition alarm: mc=313
[0102] 3. ecu alarm: trace = dm
[0103] 1) Real-time alarm: ecudtc=%x
[0104] 2) Historical alarm: pecudtc=%x
[0105] It should be noted that the above word segmentation processing of agricultural messages to obtain the device code, instruction type, instruction number, reporting time, and the specific content of the instruction type and instruction number is only an exemplary description and should not be understood as a specific limitation on the embodiments of the present application. In other embodiments of the present application, different word segmentation results can be obtained by word segmentation of agricultural messages, and even if the word segmentation results are the same, the information content corresponding to the word segmentation results may be different due to the different agricultural equipment that generates the agricultural messages.
[0106] For example, when the agricultural message is generated by the gateway, the agricultural message can be segmented to obtain information such as the gateway number, controller number, instruction number, instruction type, gateway status, and reporting time. Among them, the instruction type includes uplink instructions and downlink instructions, the gateway status includes node loss and relay loss, and the instruction number includes:
[0107] Read device data: msg_id:1
[0108] Control device switch valve: msg_id: 2
[0109] Modify device address: msg_id:3
[0110] Modify device lora channel: msg_id:4
[0111] Read device traffic: msg_id:5
[0112] Read and write device parameters: msg_id:6msg_id:7
[0113] Read and write relay forwarding address: msg_id:8msg_id:9
[0114] Boot report message (heartbeat): msg_id: 50
[0115] Start / stop meter reading: msg_id:20
[0116] Read gateway data: msg_id:21
[0117] Read and write reporting cycle: msg_id:22msg_id:23
[0118] Write gateway time: msg_id:24
[0119] Write gateway address: msg_id:25
[0120] Read and write mqtt information: msg_id:26msg_id:27
[0121] Reset command: msg_id:28
[0122] Read and write device address: msg_id:29msg_id:30
[0123] Read / write gateway side lora channel: msg_id:31msg_id:32
[0124] Switch to TCP protocol: msg_id: 33
[0125] Open multiple switch valves: msg_id:34
[0126] Modify the gateway device address: msg_id: 36
[0127] Issue upgrade command: msg_id:60
[0128] Gateway will message:msg_id:70
[0129] It should be noted that the type of word segmenter is not specifically limited in the embodiments of the present application, and any suitable word segmenter can be used to segment agricultural messages.
[0130] For example, the standard word segmenter and the ik_max_word word segmenter can be used to perform word segmentation on the agricultural messages generated by navigation and unmanned agricultural machinery.
[0131] For another example, a custom word segmenter can be used to segment agricultural messages generated by drones.
[0132] After the Elasticsearch cluster 240 receives N agricultural messages, the subscription device 250 may obtain Q agricultural messages associated with the search condition from the Elasticsearch cluster 240 according to the search condition, where N≥Q≥1 and Q is an integer.
[0133] In the embodiment of the present application, by bridging the agricultural messages to the Kafka cluster, persistent storage of the agricultural messages is achieved, ensuring that the agricultural messages will not be lost.
[0134] In the embodiment of the present application, agricultural messages can also be mounted to the Elasticsearch cluster, realizing double backup and storage of agricultural messages, and ensuring the integrity and invariance of agricultural messages, making agricultural message storage more reliable. The Elasticsearch cluster provides a full-text search engine, and the subscription device can retrieve and query agricultural messages in real time. The process of agricultural messages from publishing to storage and then to retrieval is efficient and fast, which improves the real-time and response speed of the system and meets the real-time requirements for message data. The Elasticsearch cluster has full-text search and complex query functions. The subscription device can not only retrieve historical agricultural messages, but also set different query conditions and keywords for flexible data retrieval and analysis.
[0135] In some embodiments, the system may further include a database, and the kafka cluster 230 may further store the N agricultural messages in the database.
[0136] In the embodiments of the present application, there is no specific limitation on the type of database. For example, the database may be Postgresql.
[0137] It should be noted that Figure 2 The system architecture described is only an example and should not be understood as a specific limitation of the present application. In other embodiments of the present application, the following are also provided: Figure 3 The system architecture is shown.
[0138] like Figure 3 As shown, the system includes agricultural devices 310 - 1 , 310 - 2 . . . 310 - n , and EMQX clusters 320 - 1 , 320 - 2 . . . 320 - n , a kafka cluster 330 , an Elasticsearch cluster 340 , and a subscription device 350 corresponding to the agricultural devices.
[0139] It should be understood that the detailed description of the EMQX cluster, the Kafka cluster, and the Elasticsearch cluster can be found above, and for the sake of brevity, they will not be repeated here.
[0140] It should be noted that in Figure 3 In the example shown, there may be multiple kafka clusters 330 and Elasticsearch clusters 340. For example, the number of kafka clusters 330 and Elasticsearch clusters 340 is the same as the number of agricultural equipment, and there is a one-to-one correspondence.
[0141] For another example, the number of kafka clusters 330 and Elasticsearch clusters 340 is greater than 1 and less than the number of agricultural equipment. In other words, in this example, one kafka cluster and one Elasticsearch cluster can correspond to multiple agricultural equipment.
[0142] In some embodiments, the Elasticsearch cluster 240 may also manage the life cycle of the index. The Elasticsearch cluster may manage the life cycle of the index in the following possible implementations.
[0143] In a possible implementation, when the Elasticsearch cluster 240 determines that the creation time of an index is greater than or equal to a first threshold, it may perform rolling update processing on the message corresponding to the index.
[0144] For example, the Elasticsearch cluster 240 includes index #1. When the creation time of the index #1 is greater than or equal to 7 days, the Elasticsearch cluster 240 may perform rolling updates on the messages corresponding to the index #1.
[0145] In a possible implementation, when the Elasticsearch cluster 240 determines that the size of the message corresponding to the index is greater than or equal to the second threshold, it can perform rolling update processing on the message corresponding to the index.
[0146] For example, the Elasticsearch cluster 240 includes index #1. When the size of the message corresponding to the index #1 is greater than or equal to 500 GB, the Elasticsearch cluster 240 may perform a rolling update on the message corresponding to the index #1.
[0147] It should be noted that the above two possible implementation methods are only exemplary descriptions. In other embodiments of the present application, different first preset conditions may be set according to the actual situation of agricultural production to trigger rolling updates.
[0148] Through the system architecture provided by the embodiment of the present application, a large amount of original agricultural messages can be obtained. It is not difficult to understand that the original agricultural message can reflect the situation of agricultural production (for example, the pH value of the soil, the temperature and humidity of the soil, etc.), so that the agricultural producer can retrieve the agricultural message it needs through the subscription device 250 to better adjust the production decision. However, due to the large number of agricultural equipment involved in the agricultural production process, correspondingly, more agricultural messages will also be generated. It may be difficult for agricultural producers to quickly retrieve the required agricultural messages, and a production decision may involve multiple agricultural messages, and agricultural producers also need to perform multiple retrievals. Therefore, in other embodiments of the present application, a message processing module may also be included in the system architecture provided in the embodiment of the present application, and the message processing module is used to process agricultural messages.
[0149] In some embodiments, the message processing module may be a separate module, that is, independent of the EMQX cluster 220 , the Kafka cluster 230 , and the Elasticsearch cluster 240 .
[0150] For example, the message processing module can extract agricultural messages from the Kafka cluster 230 , and can generate indication messages based on the agricultural messages, and then send the indication messages to the Elasticsearch cluster 240 .
[0151] For another example, the message processing module can extract agricultural messages from the Elasticsearch cluster 240 , and can generate an indication message based on the agricultural message, and then send the indication message to the Elasticsearch cluster 240 .
[0152] For example, Figure 2 As shown, the system also includes a message processing module 260 and a RabbitMQ cluster 270, wherein the message processing module 260 can extract agricultural messages from the Elasticsearch cluster 240, then generate indication messages based on the agricultural messages, and then publish the indication messages to the RabbitMQ cluster 270.
[0153] For example, Figure 3 As shown, the system also includes a message processing module 360 and a RabbitMQ cluster 370, wherein the message processing module 360 can extract agricultural messages from the Elasticsearch cluster 340, then generate indication messages based on the agricultural messages, and then publish the indication messages to the RabbitMQ cluster 370.
[0154] The instruction message in the embodiment of the present application can be understood as a message for guiding agricultural production. The message processing module can generate an instruction message according to agricultural messages of multiple agricultural devices to guide agricultural production activities of agricultural producers.
[0155] In some embodiments, the message processing module includes a pre-trained model, the input of the pre-trained model is an agricultural message, and the output is an instruction message.
[0156] In some embodiments, the message processing module includes one or more scripts, and the one or more scripts correspond to different processing logics, so that agricultural messages can be processed differently.
[0157] In the embodiment of the present application, agricultural messages may include one or more of the following: soil information, crop information, agricultural equipment status information, and environmental information.
[0158] Exemplarily, the soil information includes soil moisture, soil temperature, soil pH value, soil conductivity, soil nitrogen content, soil phosphorus content, soil potassium content, etc.
[0159] For example, the crop information includes the type of crop, the height of the crop, the growth stage of the crop, the disease and insect pest situation of the crop, the leaf area index, the chlorophyll content, the leaf surface temperature, etc.
[0160] For example, the agricultural equipment status information includes the irrigation flow of the irrigation equipment, the speed of the drone, the irrigation flow of the integrated water and fertilizer machine, etc.
[0161] Exemplarily, the environmental information includes environmental temperature, environmental humidity, environmental light intensity, etc.
[0162] The system architecture of the embodiment of the present application described above may also include a message processing module, through which the original N agricultural messages obtained may be processed to generate M indication messages, where M≥1 and is an integer, and the M indication messages are used to indicate the decision of agricultural production. After the RabbitMQ cluster 270 receives the M indication messages, the subscription device 250 may obtain P indication messages from the RabbitMQ cluster 270, where M≥P≥1 and P is an integer. The following will be introduced in conjunction with specific application scenarios.
[0163] A possible application scenario is that the agricultural message generated by the agricultural equipment 210 includes soil moisture information and the irrigation flow of the irrigation equipment. The message processing module can generate an indication message #1 based on the humidity message and the irrigation flow of the irrigation equipment. The indication message #1 is used to indicate the adjustment of the working condition of the irrigation equipment.
[0164] For example, the current irrigation flow of the irrigation equipment is flow #1, the soil humidity is humidity #1, and the target soil humidity is humidity #2. Humidity #1 is less than humidity #2. The message processing module can determine that the time required to reach the target humidity is 3 hours based on the flow #1 and the difference between humidity #1 and humidity #2. Since this time is greater than the pre-set time threshold, the message processing module can generate an indication message #1 to instruct the agricultural producer to increase the flow of the irrigation equipment.
[0165] In a possible application scenario, the crop information can indicate the growth stage of the crop, and the environmental information is used to indicate the environmental temperature and light intensity. The message processing module can determine that the crop needs to be fertilized based on the crop information, and can determine whether it is currently suitable for fertilization based on the environmental information. When it is determined that it is suitable for fertilization, the instruction information #2 is generated, and the instruction information #2 is used to indicate the fertilization strategy. The fertilization strategy includes the type of fertilizer, the quality of the fertilizer, etc.
[0166] In a possible application scenario, soil information is used to indicate soil moisture, environmental information is used to indicate environmental temperature and precipitation, and crop information is used to indicate crop type and growth stage. The message processing module can determine that the crop needs to be irrigated based on the soil information and crop information, and can determine that the current precipitation cannot meet the irrigation demand based on the environmental information, and can generate indication information #3, which is used to indicate the irrigation strategy. The irrigation strategy includes the duration of irrigation, the flow rate of irrigation, etc.
[0167] A possible application scenario is that soil information is used to indicate the nitrogen, phosphorus and potassium content of the soil. The message processing module can determine whether one or more of the nitrogen, phosphorus and potassium in the soil are insufficient based on the soil information. When it is determined that one or more of the nitrogen, phosphorus and potassium in the soil are insufficient, indication information #4 can be generated. The indication information #4 is used to indicate a fertilization strategy, which includes the type of fertilizer, the quality of the fertilizer, etc.
[0168] In a possible application scenario, soil information is used to indicate the nitrogen, phosphorus and potassium content of the soil, crop information can indicate the type and growth stage of the crop, and environmental information is used to indicate the ambient temperature and light intensity. The message processing module can determine whether the crop needs to be fertilized based on the crop information, and which fertilizer needs to be applied based on the crop growth stage and the nitrogen, phosphorus and potassium content in the soil. It can also determine whether it is suitable for fertilization based on the environmental information, and when it is determined that it is suitable for fertilization, it generates indication information #5, which is used to indicate the fertilization strategy. The fertilization strategy includes the type of fertilizer, the quality of the fertilizer, etc.
[0169] In some embodiments, the message processing module 260 may also store the M indication messages in a database.
[0170] In some embodiments, the system also includes a monitoring module, which can be a submodule of the message processing module 260, that is, integrated in the message processing module 260, so that the message processing module 260 is also used to: monitor the system parameters of the message retrieval cluster 240; when the second preset condition is met, send a first warning message to the equipment of the operation and maintenance personnel.
[0171] It should be noted that the second preset condition is not specifically limited in the embodiment of the present application, and the operation and maintenance personnel can set different second preset conditions. The following exemplarily introduces several possible implementation methods:
[0172] Exemplarily, the second preset condition includes that the maximum processor utilization of the message retrieval system is greater than or equal to a third threshold.
[0173] Exemplarily, the second preset condition includes that a storage device usage rate of the message storage system is greater than or equal to a fourth threshold.
[0174] Exemplarily, the second preset condition includes that the number of queued tasks in the write queue of the message storage system is greater than or equal to a fifth threshold.
[0175] Exemplarily, the second preset condition includes that a delay of the message storage system is greater than or equal to a sixth threshold.
[0176] Exemplarily, the second preset condition includes that the number of queued tasks in the index queue of the message storage system is greater than or equal to a seventh threshold.
[0177] In some embodiments, the message processing module 260 is also used to send a second warning message to the agricultural producer's equipment and / or RabbitMQ cluster 270 when an abnormal event is detected.
[0178] It should be noted that the embodiments of the present application do not specifically limit abnormal events, and agricultural producers can set different abnormal events according to actual production needs. The following are several possible implementation methods:
[0179] Exemplarily, when the monitoring module detects that the agricultural producer has issued an instruction to stop irrigation, but the monitoring module monitors that the irrigation equipment is still performing irrigation operations, the monitoring module can send an alarm message to the agricultural producer's equipment and / or RabbitMQ cluster 270 to warn the irrigation equipment of abnormality.
[0180] Exemplarily, when the monitoring module detects that the agricultural producer has issued an instruction to spray pesticides, but the monitoring module monitors that the drone has not performed the pesticide spraying operation, the monitoring module can send an alarm message to the agricultural producer's equipment and / or RabbitMQ cluster 270 to alert the drone of the abnormality.
[0181] In some embodiments, the levels of abnormal events can be divided, so that the monitoring module can determine whether to send a second warning message to the agricultural producer's equipment, to send a second warning message to the RabbitMQ cluster 270, or to send a second warning message to the agricultural producer's equipment and the RabbitMQ cluster 270 at the same time according to the level of the abnormal event.
[0182] For example, the abnormal event is divided into the first level, the second level and the third level, wherein the third level is higher than the second level, and the second level is higher than the first level. When the monitoring module determines that the abnormal event is the first level, a second warning message is sent to the RabbitMQ cluster 270. When the monitoring module determines that the abnormal event is the second level, a second warning message is sent to the equipment of the agricultural producer. When the monitoring module determines that the abnormal event is the third level, a second warning message is sent to the equipment of the agricultural producer and the RabbitMQ cluster 270.
[0183] In the above-described embodiment, the EMQX cluster is used to send agricultural messages to the Kafka cluster as an example. In other embodiments of the present application, Figure 2 The Kafka cluster 230 shown in the figure is replaced with a RabbitMQ cluster or a Redis cluster, and Figure 2 The RabbitMQ cluster 270 shown in the figure is replaced with a Kafka cluster or a Redis cluster.
[0184] In some embodiments, the Elasticsearch cluster may also be replaced with an InfluxDB cluster or a MongoDB cluster.
[0185] In the embodiment of the present application, the Kafka cluster, RabbitMQ cluster and Redis cluster can be collectively referred to as a message storage cluster, and the Elasticsearch cluster, InfluxDB cluster and MongoDB cluster can be collectively referred to as a message retrieval cluster. Figure 2 The Kafka cluster 230 shown may also be referred to as a first message storage cluster, and the RabbitMQ cluster may also be referred to as a second message storage cluster.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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 each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0191] 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. A system for storing, retrieving and processing agricultural information, characterized in that: The system includes multiple agricultural equipment, an EMQX cluster, a first message storage cluster, a second message storage cluster, a message retrieval cluster, a message processing module and a subscription device, wherein the first message storage cluster is any one of the following: a kafka cluster, a RabbitMQ cluster, and a Redis cluster, the second message storage cluster is any one of the following: a kafka cluster, a RabbitMQ cluster, and a Redis cluster, and the message retrieval cluster is any one of the following: an Elasticsearch cluster, an InfluxDB cluster, and a MongoDB cluster, wherein: The plurality of agricultural equipment is used to: generate N agricultural messages, where N≥1 and is an integer, wherein the plurality of agricultural equipment includes at least two different types of agricultural equipment, and the N agricultural messages include one or more of the following: soil information, crop information, agricultural equipment status information, and environmental information; Sending the N agricultural messages to the EMQX cluster; The EMQX cluster is used to send the N agricultural messages to the first message storage cluster; The first message storage cluster is used to send the N agricultural messages to the message retrieval cluster; The message processing module is used to: extract the N agricultural messages from the message retrieval cluster; Generate M indication messages according to the N agricultural messages, where M≥1 and is an integer, and the M indication messages are used to indicate production decisions; Sending the M indication messages to the second message storage cluster; The subscription device is used to: obtain, according to a retrieval condition, Q agricultural information from the N agricultural messages associated with the retrieval condition from the message retrieval cluster, where N≥Q≥1, and Q is an integer; Obtain P indication messages among the M indication messages from the second message storage cluster, where M≥P≥1.
2. The system according to claim 1, characterized in that The message retrieval cluster also includes a first index. The message retrieval cluster is further used to perform rolling updates on agricultural messages associated with the first index when a first preset condition is met.
3. The system according to claim 2, characterized in that The first preset condition includes: The creation time of the first index is greater than or equal to a first threshold; and / or The size of the agricultural message associated with the first index is greater than or equal to a second threshold.
4. The system according to any one of claims 1 to 3, characterized in that The multiple agricultural equipment include irrigation equipment, the soil information is used to indicate soil moisture, the agricultural equipment status information is used to indicate irrigation flow of the irrigation equipment, the M indication messages include a first indication message, the first indication message is used to indicate adjustment of the working condition of the irrigation equipment, and the first indication message is determined based on the soil information and the status information of the agricultural equipment.
5. The system according to any one of claims 1 to 3, characterized in that The crop information is used to indicate the growth stage of the crop, the environmental information is used to indicate the ambient temperature and light intensity, the M indication messages include a second indication message, the second indication message is used to indicate a fertilization strategy, and the second indication message is determined based on the crop information and the environmental information.
6. The system according to any one of claims 1 to 3, characterized in that The soil information is used to indicate the nitrogen, phosphorus and potassium content of the soil. The M indication messages include a third indication message. The third indication message is used to indicate a fertilization strategy. The third indication message is determined based on the soil information.
7. The system according to any one of claims 1 to 3, characterized in that The soil information is used to indicate soil moisture, the crop information is used to indicate crop type and growth stage, the environmental information is used to indicate ambient temperature and precipitation, the M indication messages include a fourth indication message, the fourth indication message is used to indicate an irrigation strategy, and the fourth indication message is determined based on the soil information, the environmental information and the crop information.
8. The system according to any one of claims 1 to 3, characterized in that The soil information is used to indicate the nitrogen, phosphorus and potassium content of the soil, the crop information is used to indicate the type and growth stage of the crop, the environmental information is used to indicate the ambient temperature and light intensity, the M indication messages include a fifth indication message, the fifth indication message is used to indicate the fertilization strategy, and the fifth indication message is determined based on the crop information, the environmental information and the soil information.
9. The system according to any one of claims 1 to 3, characterized in that The message processing module is further used to: monitor the system parameters of the message retrieval cluster; When the second preset condition is met, a first warning message is sent to the equipment of the operation and maintenance personnel.
10. The system according to any one of claims 1 to 3, characterized in that The message processing module is also used to send a second warning message to the agricultural producer's equipment and / or a second message storage cluster when an abnormal production event is detected.
Citation Information
Patent Citations
Intelligent agricultural machine system based on RabbitMQ and MQTT and communication method
CN114051041A
Data processing method and Internet of Things platform system
CN114567650A
Message queue processing method and device, computer equipment and storage medium
CN116662034A
Device monitoring method and system, electronic device, and storage medium
WO2024065988A1