Soil texture type rapid retrieval system construction method based on computer language

By using VBA and Python to write macros in Excel, combined with international and US soil texture classification standards, an automated and rapid retrieval of soil texture types was achieved. This solved the problems of time-consuming, labor-intensive, and error-prone traditional manual retrieval, improved the efficiency and accuracy of soil texture queries, and promoted the unification and standardization of soil texture classification.

CN120804098APending Publication Date: 2025-10-17HUNAN UNIV OF FINANCE & ECONOMICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510952961.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In existing technologies, traditional manual methods for retrieving soil texture are time-consuming and labor-intensive, prone to human error, and cannot be run directly in Excel. Furthermore, existing computer programs are limited to a single classification standard and cannot achieve comprehensive soil texture classification.

Method used

Using a computer language-based approach, macros were written in VBA and Python, and combined with international and US soil texture classification standards, to achieve automated and rapid retrieval of soil texture types in Excel. Soil texture types were determined through conditional formulas, and the results were output in Excel.

Benefits of technology

It enables rapid and accurate determination of soil texture type, eliminates human error, improves retrieval efficiency and accuracy, is applicable to large-scale soil texture surveys and analyses, and promotes the unification and standardization of soil texture classification systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804098A_ABST
    Figure CN120804098A_ABST
Patent Text Reader

Abstract

The invention discloses a computer language-based soil texture type rapid retrieval system construction method. The method comprises the following steps of: retrieving a soil texture type by utilizing excel; and searching the soil texture type by utilizing python. According to the method, automatic and rapid retrieval of soil texture types under different classification standards is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of soil texture type retrieval, and particularly relates to a soil texture type rapid retrieval system construction method based on computer language. BACKGROUND

[0002] Soil texture refers to the composition ratio of mineral particles of different particle sizes in soil, which directly affects the soil ventilation, fertilizer and water conservation conditions and the degree of difficulty of tillage, and has important influence on the physicochemical properties and biological activity of soil. The accurate determination of soil mechanical composition and the accurate discrimination of soil texture are one of the most basic links in the field of soil scientific investigation and research. At present, the commonly used soil texture classification standards in academic research and production practice are American system, international system and Karginsky system. The soil system classification originated in the United States has gradually gained wide recognition and acceptance on the international stage in recent years, and the international system has also been widely used in the process of agricultural production in China. The establishment of a rapid, accurate and automatic retrieval system of two classification standards can provide great convenience for soil research and agricultural production.

[0003] In the soil texture triangle, the traditional way is to use manual operation to accurately find the soil texture classification name corresponding to the percentage content of any two of the three particle size levels of clay, silt and sand. Therefore, it is crucial to ensure the use of standardized soil texture triangle and the implementation of accurate query process for accurate determination of soil texture. In the wide research fields of soil survey and mapping, agricultural land classification, precision fertilization scheme design, soil genesis classification and the interaction between soil erodibility, hydrological cycle process, ecological environmental factors and soil texture, there are soil texture information retrieval tasks that need to be efficiently processed for a large number of soil samples. At this time, if the traditional manual query method is used, not only the human resources and time cost will be greatly consumed, but also the soil texture classification error may be caused by the subjective difference of human judgment. Especially in the transition zone of soil texture type, manual operation will greatly reduce the accuracy. Using a computer to automatically query soil texture can not only effectively eliminate human error, but also efficiently and accurately realize the automatic determination of soil texture type. Since the 1970s and 1980s, some developing and improved soil texture query computer programs have appeared at home and abroad. For example, Zhang Liping et al. developed a soil texture classification green software based on the American soil texture triangle by using Visual Basic programming language and polygon inside point discrimination algorithm; Li Jianbo et al. developed an automatic soil texture type identification system by using C language, which realizes the American and international soil texture classification according to the coordinate system. However, these programs are based on complex computer programming knowledge or graphics knowledge, and the automatic query of soil texture is realized by writing related programs. They cannot be directly run in more popular and convenient Excel, have many limitations in use, have slow processing speed when the data volume is large, and users cannot make personalized modifications. Python has simple syntax, powerful functions, strong extensibility and wide adaptability, and can process a large amount of data. In addition, the above studies are limited to the use of single American or international soil classification standard, and have not realized a comprehensive and comprehensive soil texture classification system.

[0004] In view of these problems, how to provide a soil texture type rapid retrieval system construction method based on computer language has become a technical problem urgently to be solved by the person skilled in the art. SUMMARY

[0005] Therefore, the present application provides a soil texture type rapid retrieval system construction method based on computer language to solve the problems in the traditional manual retrieval of soil texture categories, realizing the automatic and rapid retrieval of soil texture types under different classification standards.

[0006] The technical problems solved by the present application adopt the following technical solutions: A soil texture type rapid retrieval system construction method based on computer language comprises: Retrieving soil texture types by Excel; Retrieving soil texture types by Python.

[0007] Further, a macro is written by VBA to determine and output the corresponding soil texture types to the designated column according to the international system and the U.S. system, thereby completing the rapid retrieval of soil texture types in Excel.

[0008] Further, the soil texture type T is determined by the following conditional formula, and the formula is listed in descending order of priority; if none of the conditions are met, output "unclassified";

[0009] S Sand content, indicating the mass percentage of sand particles in the soil; Si Silt content, indicating the mass percentage of silt particles in the soil; Cl Clay content, indicating the mass percentage of clay particles in the soil.

[0010] Further, according to the U.S. soil texture classification rules, the priority order is determined as follows: when the sand content is ≥55%, the silt content is ≤15%, and the clay content is ≤10%, it is sandy soil; when the sand content is 70%-85%, the silt content is ≤30%, and the clay content is ≤15%, it is loamy sand; when the sand content is <20%, the silt content is ≥80%, and the clay content is ≤12%, it is silt sand; when the sand content is 43%-85%, the silt content is ≤50%, and the clay content is ≤20%, it is sandy loam; when the sand content is 23%-52%, the silt content is 28%-50%, and the clay content is 7%-27%, it is loam; when the sand content is <50%, the silt content is 50%-80%, and the clay content is ≤27%, it is silt loam; when the sand content is 45%-80%, the silt content is ≤28%, and the clay content is 20%-35%, it is sandy clay loam; when the sand content is 20%-45%, the silt content is 15%-53%, and the clay content is 27%-40%, it is clay loam; when the sand content is ≤20%, the silt content is 40%-73%, and the clay content is 27%-40%, it is silt clay loam; when the sand content is 45%-65%, the silt content is ≤20%, and the clay content is 35%-55%, it is sandy clay; when the sand content is ≤20%, the silt content is 40%-60%, and the clay content is 40%-60%, it is silt clay; when the sand content is ≤55%, the silt content is ≤40%, and the clay content is ≥40%, it is clay; and when none of the above conditions are met, it is unclassified.

[0011] Further, the soil texture type classification process defined according to different classification standards is as follows: file path recognition, identify the Excel file format and verify file accessibility → data loading → column verification → type conversion → classification by classification function, line by line, effectiveness marking, classification decision → result storage → file output.

[0012] The beneficial effects of the present application are: The present application aims to overcome the shortcomings of traditional soil texture query methods and constructs an automatic retrieval and recognition system for automated soil texture query and classification using computer language. By writing VBA and Python codes, the system realizes fast and accurate determination of soil texture types according to international and American soil texture classification standards. Especially in a large number of soil texture investigation and analysis, the system can better demonstrate the advantages of automation. This method not only effectively eliminates human error, but also greatly improves the efficiency and accuracy of soil texture query. It simplifies the process of soil texture query and has important significance for promoting the unification and standardization of soil texture classification system, providing strong support for scientific research and technical application in related fields. However, both VBA and Python automatic recognition systems have certain difficulties in code setting process. In the future, we will continue to explore and improve the method and try to apply it to a wider range of soil management and practice fields to promote the continuous progress of soil science. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 The present application defines a soil texture type classification process according to different classification standards. DETAILED DESCRIPTION

[0014] 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 described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0015] The traditional soil texture query method usually needs to make a standard soil texture triangular coordinate diagram, and the corresponding percentage content of three particle levels of clay, silt and sand is found on the soil texture triangular coordinate diagram according to the analysis results of the sieving method and the sedimentation method by artificial visual observation, then a line is drawn in the direction of the scale line into the soil texture triangular coordinate diagram, so that the three lines intersect at a point, so as to determine the soil texture name. The traditional method needs a long time and a complex operation process, and the accuracy is poor, which is not enough to meet the current demand of processing a large amount of soil texture data classification, therefore, the application provides a soil texture type rapid retrieval system construction method based on computer language, which comprises the following steps: Retrieving soil texture types by using excel; Retrieving soil texture types by using python.

[0016] Further optimize the technical scheme, use VBA to write a macro, judge and output the corresponding soil texture type to the specified column according to the international system and the American system, so as to complete the rapid retrieval of soil texture types in Excel.

[0017] Further optimize the technical scheme, the soil texture type T is determined by the following conditional formula, and the formula is listed in descending order of priority (that is, check from top to bottom, and output the corresponding type if the first condition is met); if no condition is met, output 'uncategorized';

[0018] Parameter description (all parameters are expressed in percentage, the range is [0, 100], and the constraint is satisfied: 100 S + Si + Cl =100): S Sand % is the content of sand particles, which represents the mass percentage of sand particles in the soil; Si Silt % is the content of silt particles, which represents the mass percentage of silt particles in the soil; Cl Clay % is the content of clay particles, which represents the mass percentage of clay particles in the soil.

[0019] Further, according to the priority order of the soil texture classification rules of the United States, when the sand content is ≥55%, the silt content is ≤15%, and the clay content is ≤10%, it is classified as sandy soil; when the sand content is 70%-85% (including 70% but not including 85%), the silt content is ≤30%, and the clay content is ≤15%, it is classified as loamy sand; when the sand content is <20%, the silt content is ≥80%, and the clay content is ≤12%, it is classified as silt loam; when the sand content is 43%-85% (including 43% but not including 85%), the silt content is ≤50%, and the clay content is ≤20%, it is classified as sandy loam; when the sand content is 23%-52% (including 23% but not including 52%), the silt content is 28%-50%, and the clay content is 7%-27%, it is classified as loam; when the sand content is <50%, the silt content is 50%-80%, and the clay content is ≤27%, it is classified as silt loam; when the sand content is 45%-80% (including 45% but not including 80%), the silt content is ≤28%, and the clay content is 20%-35%, it is classified as sandy clay loam; when the sand content is 20%-45%, the silt content is 15%-53%, and the clay content is 27%-40%, it is classified as clay loam; when the sand content is ≤20%, the silt content is 40%-73%, and the clay content is 27%-40%, it is classified as silt clay loam; when the sand content is 45%-65% (including 45% but not including 65%), the silt content is ≤20%, and the clay content is 35%-55%, it is classified as sandy clay; when the sand content is ≤20%, the silt content is 40%-60%, and the clay content is 40%-60%, it is classified as silt clay; when the sand content is ≤55%, the silt content is ≤40%, and the clay content is ≥40%, it is classified as clay; and when none of the above conditions is met, it is not classified.

[0020] Further optimization of the technical scheme, according to different classification standards, the soil texture type classification process is as follows: file path recognition, recognizing the format of the electronic table file and verifying the accessibility of the file→data loading→column verification→type conversion→classifying row by row through classification functions, marking validity, classification decision→result storage→file output.

[0021] Application example In order to verify the effectiveness of the automatic retrieval and identification system of soil texture types, this paper takes the soil samples of Hunan Province soil system survey as an example, and determines the soil particle mechanical composition of 20 soil samples by random sampling. The international system and the American system of soil texture type identification are applied to the single soil sample. The analysis results are arranged in an Excel table, including four columns of sample number, sand content, silt content and clay content. In Excel, according to the international soil texture classification standard, the soil sample data are classified by using VBA macro. The sand, silt and clay contents are filled in columns B, C and D respectively, and the corresponding soil texture types are automatically generated in column E after running the macro. At the same time, the same data are processed and classified by using Python. The Excel file is read by using the pandas library, and the classification results are written back to the Excel file by using the custom soil texture classification function.

[0022] In order to further verify the accuracy of the system, 10 samples were randomly selected for manual classification comparison, and the comparison results are shown in Table 1. The results show that the system classification results are consistent with the manual classification results, verifying the accuracy and reliability of the system.

[0023] Table 1 The present application constructs an automatic identification system for quickly retrieving soil texture types under different classification standards such as international system and American system based on computer languages (VBA and Python), and successfully realizes the automatic query and classification of soil texture. The empirical application shows that the automatic identification system of soil texture types based on computer language has an accuracy of 100% in identifying the international system and American system soil texture types, and the retrieval speed is much faster than the traditional manual retrieval.

[0024] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing examples, or make equivalent replacement to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for constructing a soil texture type rapid retrieval system based on computer language, characterized in that: include: Use Excel to retrieve soil texture type; Retrieve soil texture type using Python.

2. The method for constructing a soil texture type rapid retrieval system based on computer language according to claim 1, characterized in that: Use VBA to write a macro to determine and output the corresponding soil texture type to the specified column based on the international and US systems, thereby quickly retrieving soil texture types in Excel.

3. The method for constructing a soil texture type rapid retrieval system based on computer language according to claim 2, characterized in that: The soil texture type T is determined by the following conditional formulas, which are listed in descending order of priority; If no conditions are met, then output "unclassified"; ; S is the sand content, which indicates the mass percentage of sand particles in the soil; Si is the silt content, which indicates the mass percentage of silt particles in the soil; Cl is the clay content, which indicates the mass percentage of clay particles in the soil.

4. The method for constructing a soil texture type rapid retrieval system based on computer language according to claim 3, characterized in that: According to the American soil texture classification rules, the priority order is as follows: when the sand content is ≥55%, the silt content is ≤15%, and the clay content is ≤10%, it is sandy soil; when the sand content is between 70% and 85%, the silt content is ≤30%, and the clay content is ≤15%, it is loamy sand; when the sand content is <20%, the silt content is ≥80%, and the clay content is ≤12%, it is silt soil; when the sand content is between 43% and 85%, the silt content is ≤50%, and the clay content is ≤20%, it is sandy loam; when the sand content is between 23% and 52%, the silt content is between 28% and 50%, and the clay content is between 7% and 27%, it is loam; when the sand content is <50%, the silt content is between 50% and 80%, and the clay content is ≤27%, it is silt loam; when the sand content is between 45% and 80%, and the silt content ≤28%, and the clay content is 20%-35%, which is sandy clay loam; when the sand content is 20%-45%, the silt content is 15%-53%, and the clay content is 27%-40%, which is clay loam; when the sand content is ≤20%, the silt content is 40%-73%, and the clay content is 27%-40%, which is silt clay loam; when the sand content is 45%-65%, the silt content ≤20%, and the clay content is 35%-55%, which is sandy clay; when the sand content is ≤20%, the silt content is 40%-60%, and the clay content is 40%-60%, which is silt clay; when the sand content is ≤55%, the silt content ≤40%, and the clay content ≥40%, which is clay; when all of the above conditions are not met, it is unclassified.

5. The method for constructing a soil texture type rapid retrieval system based on computer language according to claim 4, characterized in that: The soil texture type classification process is defined according to different classification standards as follows: file path identification, identification of spreadsheet file format and verification of file accessibility → data loading → column verification → type conversion → row-by-row classification through classification function, validity marking, classification decision → result storage → file output.