Agricultural machine data query method and device, electronic equipment and storage medium
By defining the processing logic of each data source and using the Spring Express expression language, the complexity of agricultural machinery data query is solved, and the rapid and accurate query of agricultural machinery data is realized, ensuring real-time monitoring of resource allocation is ensured.
Patent Information
- Application Number
- CN202411206731.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-26
AI Technical Summary
In the process of agricultural modernization, the process of querying and counting agricultural machinery data from multiple data sources is complicated, resulting in a long query time and it is impossible to accurately grasp the real situation of resource allocation in real time.
By defining the agricultural machinery data processing logic of each data source and using the expression language Spring Express custom expressions, the agricultural machinery data in multiple data sources are queried and processed, the target agricultural machinery data is generated and sent to the user.
The time for querying and statistics of agricultural machinery data has been shortened, and real-time and accurate monitoring of resource allocation has been achieved.
Smart Images

Figure CN119025546A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural modernization, and in particular to a method, device, electronic equipment and storage medium for querying agricultural machinery data. Background Art
[0002] As the process of agricultural modernization continues to accelerate, the agricultural machinery industry faces more challenges and opportunities. The service efficiency and quality of the agricultural machinery industry for users have become the key breakthrough points for improving competitiveness and enhancing user experience. During the busy harvest season, the customer service center needs to query the original agricultural machinery data from multiple data sources such as CRM customer management and accessories, and perform statistics on them to obtain target agricultural machinery data (such as operating area, per capita workload, etc.), roughly estimate the progress of the operation, roughly grasp the repair situation, and make decisions on the dispatch of agricultural machinery resources and accessories resources.
[0003] However, the process of querying and compiling agricultural machinery data from multiple data sources is very complicated, which makes the query time of agricultural machinery data longer and makes it impossible to accurately grasp the real situation of resource allocation in real time. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a query method, device, electronic device and storage medium for agricultural machinery data, which can query and process agricultural machinery data from multiple data sources, shorten the query and statistical time of agricultural machinery data, and can accurately grasp the actual situation of resource allocation in real time.
[0005] In a first aspect, an embodiment of the present application provides a method for querying agricultural machinery data, the method for querying agricultural machinery data comprising:
[0006] In response to the type of agricultural machinery data to be queried selected by the query user in the query interface, determine the first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and the second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; different agricultural machinery data are stored in different data sources;
[0007] Based on the first agricultural machinery data processing logic of each data source, querying each data source for original agricultural machinery data corresponding to the type of agricultural machinery data to be queried;
[0008] All original agricultural machinery data are processed based on the second agricultural machinery data processing logic to obtain target agricultural machinery data; the second agricultural machinery data processing logic is a custom expression based on the expression language Spring Express;
[0009] The target agricultural machinery data is sent to the querying user.
[0010] In a possible implementation, the second agricultural machinery data processing logic includes a logic code identifier and an association relationship between the original agricultural machinery data; wherein different second agricultural machinery data processing logics may include the same logic code identifier;
[0011] If the second agricultural machinery data processing logic includes multiple association relationships, the second agricultural machinery data processing logic also includes operation logic between all agricultural machinery data obtained after association based on all the association relationships.
[0012] In a possible implementation, if the second agricultural machinery data processing logic includes an association relationship, all original agricultural machinery data are processed based on the second agricultural machinery data processing logic to obtain target agricultural machinery data, including:
[0013] All original agricultural machinery data are input into the logic code corresponding to the logic code identifier, and all original agricultural machinery data are associated based on the association relationship to obtain the target agricultural machinery data.
[0014] In a possible implementation, if the second agricultural machinery data processing logic includes multiple association relationships, all original agricultural machinery data are processed based on the second agricultural machinery data processing logic to obtain target agricultural machinery data, including:
[0015] Input all original agricultural machinery data into the logic code corresponding to the logic code identifier, associate different original agricultural machinery data based on various association relationships, and obtain intermediate agricultural machinery data;
[0016] All intermediate agricultural machinery data are calculated based on the calculation logic to obtain the target agricultural machinery data.
[0017] In a possible implementation, the method further includes:
[0018] In response to the target agricultural machinery data directory, the type of agricultural machinery data to be created, the target data source, and the agricultural machinery data processing logic input by the creation user in the creation interface;
[0019] Under the target agricultural machinery data directory, create the agricultural machinery data type to be created according to the target data source and agricultural machinery data processing logic.
[0020] In a possible implementation, the method further includes:
[0021] The target agricultural machinery data is formatted according to the preset formatting rules corresponding to the type of agricultural machinery data to be queried.
[0022] In a second aspect, an embodiment of the present application further provides a device for querying agricultural machinery data, the device for querying agricultural machinery data comprising:
[0023] A response module, configured to determine, in response to the type of agricultural machinery data to be queried selected by the query user on the query interface, a first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and a second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; and different agricultural machinery data are stored in different data sources;
[0024] A query module, used for querying original agricultural machinery data corresponding to the type of agricultural machinery data to be queried in each data source based on the first agricultural machinery data processing logic of each data source;
[0025] A data processing module, used for processing all original agricultural machinery data based on a second agricultural machinery data processing logic to obtain target agricultural machinery data; the second agricultural machinery data processing logic is a custom expression based on an expression language Spring Express;
[0026] The sending module is used to send the target agricultural machinery data to the query user.
[0027] In a possible implementation, the second agricultural machinery data processing logic includes a logic code identifier and an association relationship between the original agricultural machinery data; wherein different second agricultural machinery data processing logics may include the same logic code identifier;
[0028] If the second agricultural machinery data processing logic includes multiple association relationships, the second agricultural machinery data processing logic also includes operation logic between all agricultural machinery data obtained after association based on all the association relationships.
[0029] In a possible implementation, if the second agricultural machinery data processing logic contains an association relationship, the data processing module is specifically used to input all original agricultural machinery data into the logic code corresponding to the logic code identifier, associate all original agricultural machinery data based on the association relationship, and obtain target agricultural machinery data.
[0030] In a possible implementation, if the second agricultural machinery data processing logic contains multiple association relationships, the data processing module is specifically used to input all original agricultural machinery data into the logic code corresponding to the logic code identifier, associate different original agricultural machinery data based on each association relationship to obtain intermediate agricultural machinery data; and calculate all intermediate agricultural machinery data based on the calculation logic to obtain target agricultural machinery data.
[0031] In a possible implementation, the device further includes: a creation module;
[0032] The response module is also used to respond to the target agricultural machinery data directory, the type of agricultural machinery data to be created, the target data source, and the agricultural machinery data processing logic input by the creation user in the creation interface;
[0033] The creation module is used to create the agricultural machinery data type to be created under the target agricultural machinery data directory according to the target data source and agricultural machinery data processing logic.
[0034] In a possible implementation, the device further includes: a formatting module;
[0035] The formatting module is used to format the target agricultural machinery data according to the preset formatting rules corresponding to the type of agricultural machinery data to be queried.
[0036] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of any method for querying agricultural machinery data in the first aspect.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for querying agricultural machinery data as described in any one of the first aspects are executed.
[0038] The embodiment of the present application provides a method, device, electronic device and storage medium for querying agricultural machinery data, the method comprising: in response to the type of agricultural machinery data to be queried selected by the querying user in the query interface, determining the first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and the second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; different data sources store different agricultural machinery data; based on the first agricultural machinery data processing logic of each data source, query the original agricultural machinery data corresponding to the type of agricultural machinery data to be queried in each data source; based on the second agricultural machinery data processing logic, perform data processing on all the original agricultural machinery data to obtain the target agricultural machinery data; the second agricultural machinery data processing logic is an expression customized based on the expression language Spring Express; and send the target agricultural machinery data to the querying user. The present application can query and process agricultural machinery data from multiple data sources based on the first agricultural machinery data processing logic and the second agricultural machinery data processing logic, shorten the statistical time of agricultural machinery data query, and can accurately grasp the real situation of resource allocation in real time. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flow chart of a method for querying agricultural machinery data provided by an embodiment of the present application is shown;
[0041] Figure 2 A storage flow diagram of a data source provided by an embodiment of the present application is shown;
[0042] Figure 3 A schematic diagram of the structure of a query device for agricultural machinery data provided by an embodiment of the present application is shown;
[0043] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0044] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0045] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0046] In order to enable those skilled in the art to use the content of this application, the following implementation is provided in conjunction with the specific application scenario "agricultural modernization technology field". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the "agricultural modernization technology field", it should be understood that this is only an exemplary embodiment.
[0047] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0048] The following is a detailed description of a method for querying agricultural machinery data provided in an embodiment of the present application.
[0049] Reference Figure 1 As shown, it is a structural diagram of a method for querying agricultural machinery data provided by an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0050] S101. In response to a type of agricultural machinery data to be queried selected by a querying user in a query interface, determine a first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and a second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried.
[0051] In the implementation mode of the present application, the query page includes query interfaces (which can be in the form of buttons) for various created agricultural machinery data types, and the query user can query the agricultural machinery data corresponding to the agricultural machinery data type through the query interface in the query interface; in response to the agricultural machinery data type to be queried selected by the query user in the query interface, the first agricultural machinery data processing logic of at least one data source corresponding to the agricultural machinery data type to be queried and the second agricultural machinery data processing logic corresponding to the agricultural machinery data type to be queried are determined; the data source corresponding to the agricultural machinery data type to be queried and the first agricultural machinery data processing logic of the data source, and the second agricultural machinery data processing logic corresponding to the agricultural machinery data type to be queried are set by the creating user when creating; the first agricultural machinery data processing logic of each data source includes the code for the processing operation of each data source on the respective agricultural machinery data, which is used to complete the processing operation of each data source on the respective agricultural machinery data; the second agricultural machinery data processing logic corresponding to the agricultural machinery data type to be queried includes the code for processing the original agricultural machinery data obtained after processing all data sources, which is used to process all original agricultural machinery data. The data source refers to the database or database server used by the database application; different data sources store different agricultural machinery data.
[0052] like Figure 2As shown, it is a storage flow diagram of the data source provided in the embodiment of the present application. The embodiment of the present application provides a variety of data sources, such as ClickHouse, MySQL, Http, ElasticSearch and other databases; among them, (1) the system data with a large proportion and complex business in the entire network is uniformly processed in hive through the big data platform, and imported into the ClickHouse database of the MPP large-scale parallel processing architecture for storage, such as the customer management system CRM, the warehouse management system WMS and the service engineering support system SES; (2) static data that is updated less frequently, is relatively fixed or has not been updated for a long time is stored in the MySQL database, such as remote sensing, Internet of Vehicles and dispatching; (3) The real-time query interface uses Apache Calcite to expand support for Http interface calls and ElasticSearch for information retrieval, such as the data open platform interface, the Internet of Vehicles interface and other open interfaces.
[0053] Here, the customer management system CRM includes the whole machine management of agricultural machinery (such as sales, shipping work, basic information management of dealers, etc.), parts management (such as parts orders, parts retail and sales reports, etc.), and at the same time, the customer management system CRM undertakes the role of reporting, dispatching repair work orders, and managing maintenance claims. It is the information basis for agricultural machinery resource scheduling and parts management; the service engineering support system SES is an information query system created in the after-sales maintenance process to determine the parts required for repairing faulty vehicles. It maintains the network subordinate relationship between product codes, assemblies and drawing numbers, and can be found through vehicle numbers. , product code, parts drawing number and other information query; the warehouse management system WMS saves the inventory data of different parts in service vehicles, service personnel, dealers or (sub) central warehouses in various places, and is the last link in the parts dispatch work; the remote sensing system can obtain extreme weather warnings, regional crop operation progress, crop maturity and other agricultural information, and is one of the core systems that can have a significant impact on the final decision-making judgment; the Internet of Vehicles can obtain basic information such as the positioning time, positioning position, sales time of a certain agricultural machinery, manage service vehicles and service personnel, and assist in dispatching work; the dispatch order stores agricultural machinery failure repair work orders, etc.
[0054] Among them, the functions of various systems seem to be parallel and independent of each other, but in fact they complement each other. For example, the Internet of Vehicles maintains the basic information of service vehicles and service personnel, the data open platform provides the real-time and historical location information of service vehicles, and CRM provides personnel location information. Different systems describe the same thing from different dimensions.
[0055] Furthermore, the agricultural machinery data type is created through the following steps:
[0056] Step 1: Create a target agricultural machinery data directory, the type of agricultural machinery data to be created, the target data source, and the agricultural machinery data processing logic in response to input by the user in the creation interface.
[0057] In the implementation mode of the present application, a plurality of agricultural machinery data directories and a plurality of data sources are displayed in the creation interface, and the creating user will select one as the target agricultural machinery data directory among all agricultural machinery data directories, and select the target data source among all data sources. In addition, the creation interface also includes a text box for inputting the type of agricultural machinery data to be created and a text box for agricultural machinery data processing logic. The agricultural machinery data processing logic is an SQL script file, and the agricultural machinery data processing logic includes a first agricultural machinery data processing logic corresponding to each target data source and a second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be created. Among them, each agricultural machinery data directory corresponds to at least one agricultural machinery data type. Creating an agricultural machinery data directory can more intuitively distinguish and manage agricultural machinery data belonging to different businesses. From the perspective of resource allocation, the access pressure carried by the agricultural machinery data interface in different business scenarios is different. Each directory corresponds to its own independent and isolated physical resources to handle the user query load. Using the directory can reasonably divide the processor resources, making the load more balanced, while ensuring the stability of operation.
[0058] Step 2: Under the target agricultural machinery data directory, create the agricultural machinery data type to be created according to the target data source and agricultural machinery data processing logic.
[0059] In the implementation mode of the present application, the data source (i.e., target data source) required for the agricultural machinery data type to be created is selected, the creation user and agricultural machinery data processing logic of the agricultural machinery data type to be created are marked, and SQL is written to implement the physical implementation of the abstract business logic to the actual data logic. When the user queries, data from different data sources can be obtained from the disk, and after executing SQL queries to load agricultural data into memory, the agricultural data can be integrated through the custom target agricultural machinery data processing script to obtain the final result required by the user.
[0060] S102 . Based on the first agricultural machinery data processing logic of each data source, query each data source for original agricultural machinery data corresponding to the type of agricultural machinery data to be queried.
[0061] In the implementation manner of the present application, the first agricultural machinery data processing logic based on each data source processes the agricultural machinery data in each data source to obtain the original agricultural machinery data corresponding to the agricultural machinery data to be queried. The agricultural machinery data stored in each data source is stored in a disk, and the original agricultural machinery data is stored in a memory. The first agricultural machinery data processing logic can perform simple queries, paging processing, etc. based on the data query syntax of each data source.
[0062] Each data source has its own data query syntax, and the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source.
[0063] Here, based on the native application programming interface of jdbc, each data source can only use its own data query syntax internally to perform processing operations such as the union and grouping of agricultural machinery data, and cannot perform data operations across data sources. For example, MySQL and ClickHouse are both based on the MyBatis framework for querying. Mybatis's sqlSession can directly execute SQL statements or dynamically constructed SQL statements, and can return different types of data under the same processing statement. The mathematical model formula of the type processor of MyBatis can be expressed as: f(x)=yf(x)=y, where $f(x)$ represents the data type returned by the database, $x$ represents the Java object, and $y$ represents the converted Java object. ElasticSearch is based on Apache Calcite. The architecture of Calcite has three characteristics: flexible, embeddable, and extensible, which means flexibility, pluggable components, and extensibility. The adapter can be customized, which is very convenient when expanding the data source horizontally. Therefore, the first agricultural machinery data processing logic of each data source needs to be defined based on the data query syntax of each data source.
[0064] S103, performing data processing on all original agricultural machinery data based on the second agricultural machinery data processing logic to obtain target agricultural machinery data; the second agricultural machinery data processing logic is a user-defined expression based on the expression language Spring Express.
[0065] In the implementation manner of the present application, the second agricultural machinery data processing logic may include connection processing, field renaming processing, field retention processing, field deletion processing, default value addition processing, grouping aggregation processing, joint processing and basic operation processing, etc. Among them, the second agricultural machinery data processing logic is based on Spring Express custom express expression, and uses algebraic logic to calculate and integrate agricultural machinery data, as shown in Table 1, which is an algebraic logic table provided in the embodiment of the present application:
[0066] Table 1
[0067]
[0068] In the implementation manner of the present application, the second agricultural machinery data processing logic includes a logic code identifier and an association relationship between original agricultural machinery data; if the second agricultural machinery data processing logic includes multiple association relationships, the second agricultural machinery data processing logic also includes an operation logic between all agricultural machinery data obtained after association based on all association relationships. Different second agricultural machinery data processing logics may include the same logic code identifier.
[0069] Here, if the second agricultural machinery data processing logic contains one association relationship, the expression of the second agricultural machinery data processing logic is: "express(no...):action(field / value...)"; if the second agricultural machinery data processing logic contains multiple association relationships, the expression of the second agricultural machinery data processing logic is: "express(no...):action(field / value...):#field+-* / #filed as field".
[0070] Among them, the statement starting with express is the second agricultural machinery data processing logic, no represents the original agricultural machinery data, action represents the logic code identifier, field / value represents the association relationship between the original agricultural machinery data (which can be identified by the associated field field / associated field value value), and #field+-* / #filed as field represents the operation logic (spel expression).
[0071] Here, some commonly used judgments or repeatedly used code snippets are represented in advance by logical code identifiers, and can be directly represented by logical code identifiers in the second agricultural machinery data processing logic, thereby reducing repetitive code work and beautifying the SQL format of the second agricultural machinery data processing logic.
[0072] Specifically, if the second agricultural machinery data processing logic contains an association relationship, all original agricultural machinery data are processed based on the second agricultural machinery data processing logic to obtain target agricultural machinery data, including: inputting all original agricultural machinery data into the logic code corresponding to the logic code identifier, and associating all original agricultural machinery data based on the association relationship to obtain the target agricultural machinery data.
[0073] Specifically, if the second agricultural machinery data processing logic contains multiple association relationships, all original agricultural machinery data are processed based on the second agricultural machinery data processing logic to obtain target agricultural machinery data, including: inputting all original agricultural machinery data into the logic code corresponding to the logic code identifier, associating different original agricultural machinery data based on each association relationship to obtain intermediate agricultural machinery data; and calculating all intermediate agricultural machinery data based on the calculation logic to obtain target agricultural machinery data.
[0074] S104: Send the target agricultural machinery data to the querying user.
[0075] In an implementation manner of the present application, after the target agricultural machinery data is sent to the querying user, the target agricultural machinery data can also be formatted according to the preset formatting rules corresponding to the type of agricultural machinery data to be queried, and the preset formatting rules include formatting types and formatting values; formatting types include field formatting, date formatting, and structure formatting; formatting values are used to limit the content that needs to be formatted.
[0076] Among them, field formatting refers to adjusting the format of a certain field and its corresponding data in the target agricultural machinery data (such as camel case naming); date formatting refers to adjusting the format of the data of a certain date in the target agricultural machinery data (such as year, month and day separated by " / ", etc.); structure formatting refers to adjusting the structure of the target agricultural machinery data.
[0077] Furthermore, the method is applied to distributed systems, and based on Hystrix (an open source project developed by Netflix), it handles the failure and delay problems between services in distributed systems. The agricultural machinery data query process is nested in each isolated thread resource, and the availability and stability of the distributed system are guaranteed through the fault tolerance mechanism. Among them, the Hystrix fuse occupies half of the indicator construction engine, and the entire agricultural machinery data query process is in the operation method of the fuse. Unlike the common annotation method, it embeds code in the application layer, captures the fuse result through the degradation method, distinguishes the exceptions recorded in the fuse, and pushes them to the global exception handler for secondary processing, converts them into user-oriented prompt text, and returns them through the interface.
[0078] The method also includes: fundamentally storing all data as time series based on the Prometheus client: refers to a stream of timestamped values belonging to the same agricultural machinery data type and the same set of tag dimensions. Sample represents the sampling of a certain indicator at a certain moment. Generally speaking, at the same moment, there are as many sample points as there are surviving time series streams, but each sample point cannot be sent separately, so a structure (MetricFamilySamples) is needed to package the time series sample points. MetricFamily represents a family of agricultural machinery data types. These agricultural machinery data types have the same name (or similar names), the same label name, but different label values themselves, and are distributed in different time series streams.
[0079] Furthermore, the interface was expanded on the existing samples and indicator families of Prometheus, and agricultural machinery data type exporters and label value converters were derived. Different agricultural machinery data type exporters are registered to the collector registry to implement the agricultural machinery data type collection method, collect the required monitoring agricultural machinery data type data, format it according to the data standard of Grafana, and then export it. The access end can use the http interface to obtain agricultural machinery data type data for real-time monitoring.
[0080] The embodiment of the present application provides a method for querying agricultural machinery data, the method comprising: in response to the type of agricultural machinery data to be queried selected by the query user in the query interface, determining the first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and the second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; different data sources store different agricultural machinery data; based on the first agricultural machinery data processing logic of each data source, query the original agricultural machinery data corresponding to the type of agricultural machinery data to be queried in each data source; based on the second agricultural machinery data processing logic, perform data processing on all original agricultural machinery data to obtain target agricultural machinery data; the second agricultural machinery data processing logic is an expression customized based on the expression language SpringExpress; and send the target agricultural machinery data to the query user. The present application can query and process agricultural machinery data from multiple data sources based on the first agricultural machinery data processing logic and the second agricultural machinery data processing logic, shorten the statistical time of agricultural machinery data query, and can accurately grasp the real situation of resource allocation in real time.
[0081] Based on the same inventive concept, an agricultural machinery data query device corresponding to the agricultural machinery data query method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned agricultural machinery data query method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0082] Reference Figure 3 FIG. 1 is a schematic diagram of a query device for agricultural machinery data provided by an embodiment of the present application, and the query device for agricultural machinery data includes:
[0083] The response module 301 is used to determine the first agricultural machinery data processing logic of at least one data source corresponding to the agricultural machinery data type to be queried and the second agricultural machinery data processing logic corresponding to the agricultural machinery data type to be queried in response to the agricultural machinery data type to be queried selected by the query user in the query interface; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; different agricultural machinery data are stored in different data sources;
[0084] A query module 302 is used to query the original agricultural machinery data corresponding to the agricultural machinery data type to be queried in each data source based on the first agricultural machinery data processing logic of each data source;
[0085] The data processing module 303 is used to process all the original agricultural machinery data based on the second agricultural machinery data processing logic to obtain the target agricultural machinery data; the second agricultural machinery data processing logic is a custom expression based on the expression language Spring Express;
[0086] The sending module 304 is used to send the target agricultural machinery data to the query user.
[0087] In a possible implementation, the second agricultural machinery data processing logic includes a logic code identifier and an association relationship between the original agricultural machinery data; wherein different second agricultural machinery data processing logics may include the same logic code identifier;
[0088] If the second agricultural machinery data processing logic includes multiple association relationships, the second agricultural machinery data processing logic also includes operation logic between all agricultural machinery data obtained after association based on all the association relationships.
[0089] In a possible implementation, if the second agricultural machinery data processing logic contains an association relationship, the data processing module 303 is specifically used to input all original agricultural machinery data into the logic code corresponding to the logic code identifier, associate all original agricultural machinery data based on the association relationship, and obtain target agricultural machinery data.
[0090] In a possible implementation, if the second agricultural machinery data processing logic contains multiple association relationships, the data processing module 303 is specifically used to input all original agricultural machinery data into the logic code corresponding to the logic code identifier, associate different original agricultural machinery data based on each association relationship to obtain intermediate agricultural machinery data; and calculate all intermediate agricultural machinery data based on the calculation logic to obtain target agricultural machinery data.
[0091] In a possible implementation, the device further includes: a creation module 305;
[0092] The response module 301 is also used to respond to the target agricultural machinery data directory, the type of agricultural machinery data to be created, the target data source, and the agricultural machinery data processing logic input by the creation user in the creation interface;
[0093] The creation module 305 is used to create the agricultural machinery data type to be created under the target agricultural machinery data directory according to the target data source and the agricultural machinery data processing logic.
[0094] In a possible implementation, the device further includes: a formatting module 306;
[0095] The formatting module 306 is used to format the target agricultural machinery data according to the preset formatting rules corresponding to the type of agricultural machinery data to be queried.
[0096] The embodiment of the present application provides a query device for agricultural machinery data, which includes: a response module 301, which is used to respond to the type of agricultural machinery data to be queried selected by the query user in the query interface, determine the first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried, and the second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; different data sources store different agricultural machinery data; a query module 302, which is used to query the original agricultural machinery data corresponding to the type of agricultural machinery data to be queried in each data source based on the first agricultural machinery data processing logic of each data source; a data processing module 303, which is used to process all the original agricultural machinery data based on the second agricultural machinery data processing logic to obtain the target agricultural machinery data; the second agricultural machinery data processing logic is an expression customized based on the expression language Spring Express; a sending module 304, which is used to send the target agricultural machinery data to the query user. The present application can query and process agricultural machinery data from multiple data sources based on the first agricultural machinery data processing logic and the second agricultural machinery data processing logic, shorten the statistical time of agricultural machinery data query, and can accurately grasp the real situation of resource allocation in real time.
[0097] like Figure 4 As shown, an electronic device 400 provided in an embodiment of the present application includes: a processor 401, a memory 402 and a bus, the memory 402 stores machine-readable instructions executable by the processor 401, when the electronic device is running, the processor 401 communicates with the memory 402 through the bus, and the processor 401 executes the machine-readable instructions to perform the steps of the query method for agricultural machinery data as described above.
[0098] Specifically, the memory 402 and the processor 401 can be general-purpose memories and processors, which are not specifically limited here. When the processor 401 runs the computer program stored in the memory 402, the query method for the agricultural machinery data can be executed.
[0099] Corresponding to the above-mentioned method for querying agricultural machinery data, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for querying agricultural machinery data are executed.
[0100] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules 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 communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0101] The modules described as separate components may or may not be physically separated, and the components shown as modules 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.
[0102] 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.
[0103] 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 non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the information processing method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0104] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the 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 method for querying agricultural machinery data, characterized in that: The method for querying agricultural machinery data includes: In response to the type of agricultural machinery data to be queried selected by the query user on the query interface, determine the first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and the second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; different agricultural machinery data are stored in different data sources; Based on the first agricultural machinery data processing logic of each data source, querying each data source for original agricultural machinery data corresponding to the type of agricultural machinery data to be queried; Based on the second agricultural machinery data processing logic, all the original agricultural machinery data are processed to obtain target agricultural machinery data; the second agricultural machinery data processing logic is a custom expression based on the expression language Spring Express; The target agricultural machinery data is sent to the query user.
2. The method for querying agricultural machinery data according to claim 1, characterized in that: The second agricultural machinery data processing logic includes a logic code identifier and an association relationship between the original agricultural machinery data; wherein different second agricultural machinery data processing logics may include the same logic code identifier; If the second agricultural machinery data processing logic includes multiple association relationships, the second agricultural machinery data processing logic also includes an operation logic between all agricultural machinery data obtained after association based on all the association relationships.
3. The method for querying agricultural machinery data according to claim 2, characterized in that: If the second agricultural machinery data processing logic includes an association relationship, then the data processing is performed on all the original agricultural machinery data based on the second agricultural machinery data processing logic to obtain target agricultural machinery data, including: All the original agricultural machinery data are input into the logic code corresponding to the logic code identifier, and all the original agricultural machinery data are associated based on the association relationship to obtain the target agricultural machinery data.
4. The method for querying agricultural machinery data according to claim 2, characterized in that: If the second agricultural machinery data processing logic contains multiple association relationships, then the data processing is performed on all the original agricultural machinery data based on the second agricultural machinery data processing logic to obtain target agricultural machinery data, including: Inputting all the original agricultural machinery data into the logic code corresponding to the logic code identifier, and associating different original agricultural machinery data based on various association relationships to obtain intermediate agricultural machinery data; All the intermediate agricultural machinery data are operated based on the operation logic to obtain the target agricultural machinery data.
5. The method for querying agricultural machinery data according to claim 1, characterized in that: The method further comprises: In response to the target agricultural machinery data directory, the type of agricultural machinery data to be created, the target data source, and the agricultural machinery data processing logic input by the creation user in the creation interface; Under the target agricultural machinery data directory, the agricultural machinery data type to be created is created according to the target data source and the agricultural machinery data processing logic.
6. The method for querying agricultural machinery data according to any one of claims 1 to 5, characterized in that: The method further comprises: The target agricultural machinery data is formatted according to a preset formatting rule corresponding to the type of agricultural machinery data to be queried.
7. A query device for agricultural machinery data, characterized in that: The agricultural machinery data query device comprises: A response module, configured to determine, in response to the type of agricultural machinery data to be queried selected by the query user on the query interface, a first agricultural machinery data processing logic of at least one data source corresponding to the type of agricultural machinery data to be queried and a second agricultural machinery data processing logic corresponding to the type of agricultural machinery data to be queried; wherein the first agricultural machinery data processing logic of each data source is defined based on the data query syntax of each data source; and different agricultural machinery data are stored in different data sources; A query module, configured to query the original agricultural machinery data corresponding to the agricultural machinery data type to be queried in each data source based on the first agricultural machinery data processing logic of each data source; A data processing module, used for performing data processing on all the raw agricultural machinery data based on the second agricultural machinery data processing logic to obtain target agricultural machinery data; the second agricultural machinery data processing logic is a custom expression based on the expression language SpringExpress; A sending module is used to send the target agricultural machinery data to the query user.
8. The agricultural machinery data query device according to claim 7, characterized in that: The second agricultural machinery data processing logic includes a logic code identifier and an association relationship between the original agricultural machinery data; wherein different second agricultural machinery data processing logics may include the same logic code identifier; If the second agricultural machinery data processing logic includes multiple association relationships, the second agricultural machinery data processing logic also includes an operation logic between all agricultural machinery data obtained after association based on all the association relationships.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the agricultural machinery data query method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for querying agricultural machinery data as described in any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Business data processing method and device, computer equipment and storage medium
CN111061766A
Business processing method and device, medium and electronic equipment
CN111241107A
Data query method and related equipment
CN111475534A
Data association query method and device, electronic equipment and storage medium
CN112148771A
Data query method and system, electronic equipment and storage medium
CN115408417A
