Agricultural product classification method and system based on agricultural product orders
Through the analysis and classification database of agricultural product order data, the unit price and quantity change trends of commodities are identified, and the problems of lack of comprehensiveness and hierarchy in the existing technology are solved, and the scientific classification and sales benefits of agricultural products are maximized.
Patent Information
- Application Number
- CN202411545928.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2024-11-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There is a lack of comprehensive analysis of factors of different dimensions of agricultural products in the prior art, and it is not possible to effectively conduct comprehensive and hierarchical analysis of classification, especially the lack of analysis of the dimensions of agricultural product quantity and unit price.
By obtaining order text data, extracting keywords and constructing a classification database, calculating the average and deviation values of the unit price and quantity of the product, analyzing the stable interval and the fluctuation interval, and identifying variable factors to classify the product.
The comprehensiveness and hierarchy of classification are improved, and merchants can quickly understand the overlapping relationship of agricultural products, realize the scientificization of inventory and purchase, and maximize sales benefits.
Smart Images

Figure CN119046470A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent classification, and in particular to a method and system for classifying agricultural products based on agricultural product orders. Background Art
[0002] In recent years, smart agriculture has developed rapidly, and information technology, artificial intelligence and big data have been widely used in the field of agricultural product classification. Order-based data analysis and decision-making help merchants better understand the characteristics of agricultural products and divide them into different categories, thereby better understanding the characteristics and differences of agricultural products and improving the sales quality of agricultural products.
[0003] At present, a Chinese invention patent with application publication number CN 112801220 B discloses a method, device, computer equipment and storage medium for classifying agricultural product quality, which obtains surface image data of agricultural products; inputs the surface image data of the agricultural products into a preset quality classification model to obtain a classification vector of the agricultural products, multiplies each element in all the classification vectors by the quality score of the samples of the corresponding category and then adds them up to obtain the quality score of the agricultural products. However, the related technology does not conduct a comprehensive analysis of factors of different dimensions of agricultural products, lacks comprehensiveness of classification, does not analyze the supply and demand relationship through the dimensions of agricultural product quantity and unit price of agricultural products, and lacks hierarchy of classification. Summary of the invention
[0004] The technical problem solved by the present invention is that the related technology does not conduct a comprehensive analysis of factors of different dimensions of agricultural products, lacks comprehensiveness of classification, does not analyze the supply and demand relationship through the dimensions of agricultural product quantity and unit price, and lacks hierarchy of classification.
[0005] In order to achieve the above object, the present invention is implemented through the following technical solutions: In the first aspect, a method for classifying agricultural products based on agricultural product orders comprises the following steps:
[0006] Step S1, acquiring order text data, extracting the order text data in the order generation time sequence and performing sentence processing, generating primary text data, and extracting keywords from the primary text data, wherein the keywords include product name, product quantity and product unit price;
[0007] Step S2, calling the statistical classification of agriculture and related industries, obtaining the name data set of agricultural products, agricultural product ancillary products and their processed products, and constructing a classification database, wherein the classification database is used to classify agricultural products, including a primary directory, a secondary directory and a tertiary directory, wherein the secondary directory is a subdirectory of the primary directory, and the tertiary directory is a subdirectory of the secondary directory;
[0008] Step S3, obtaining the commodity name, calling the classification database, obtaining the classification of agricultural products, and marking the commodity name, commodity unit price and commodity quantity respectively;
[0009] Step S4, respectively calculating the average value of the commodity unit price, the average value of the commodity quantity, the deviation value of the commodity unit price and the deviation value of the commodity quantity, calculating the price difference and the quantity difference, and obtaining a first stable interval, a first fluctuation interval, a second stable interval and a second fluctuation interval;
[0010] Step S5, analyze the first stable interval, the first fluctuation interval, the second stable interval and the second fluctuation interval, obtain and analyze the first normal interval, the quantity increase interval, the quantity decrease interval, the price increase interval, the price decrease interval and the second normal interval, obtain the abnormal factors, and classify the products based on the abnormal factors.
[0011] As a preferred solution of the agricultural product classification method based on agricultural product orders described in the present invention, step S1 includes the following sub-steps:
[0012] Step S11, acquiring order text data according to time T1-time TN, wherein time T1-time TN is a discrete increasing time series;
[0013] Step S12, performing sentence processing on the order text data through a word segmentation processor to generate primary text data;
[0014] Step S13, extracting keywords from the primary text data through a feature word extractor, and generating keyword sequence 1-keyword sequence N, wherein the keywords include product name, product quantity and product unit price, keyword sequence 1 is {product name 1, product quantity 1 and product unit price 1}, keyword sequence 2 is {product name 2, product quantity 2 and product unit price 2}, ..., keyword sequence N is {product name N, product quantity N and product unit price N}.
[0015] As a preferred solution of the agricultural product classification method based on agricultural product orders described in the present invention, step S2 includes the following sub-steps:
[0016] Step S21, calling the statistical classification of agriculture and related industries to obtain the name dataset of agricultural products, agricultural product ancillary products and their processed products;
[0017] Step S22, constructing a classification database based on the name data set of agricultural products, agricultural product ancillary products and processed products thereof, wherein the classification database is a classification of agricultural products, including a primary directory, a secondary directory and a tertiary directory;
[0018] Step S23, the secondary directory is a subdirectory of the primary directory, the primary directory includes nature and processing, nature and processing are respectively recorded as Q1 and Q2, the secondary directory includes planting, animal husbandry and fishery corresponding to Q1 and Q2 respectively, the planting, animal husbandry and fishery corresponding to Q1 are respectively recorded as Q11, Q12 and Q13, the planting, animal husbandry and fishery corresponding to Q2 are respectively recorded as Q21, Q22 and Q23, the tertiary directory includes subcategories Q111-Q11B corresponding to Q11, subcategories Q211-Q21B' corresponding to Q21, subcategories Q121-Q12E corresponding to Q12, subcategories Q221-Q22E' corresponding to Q22, subcategories Q131-Q13V corresponding to Q13 and subcategories Q231-Q23V' corresponding to Q23, wherein B, B', E, E', V and V' are respectively positive integers greater than 1.
[0019] As a preferred solution of the agricultural product classification method based on agricultural product orders described in the present invention, step S3 includes the following sub-steps:
[0020] Step S31, obtain commodity name 1-commodity name N, call the classification database, obtain the classification of agricultural products, compare and classify commodity name 1-commodity name N with the classification of agricultural products respectively, and record the commodity name as Qijr, where i is the first-level directory, j is the second-level directory, and r is the third-level directory;
[0021] Step S32, obtaining commodity unit prices 1 to commodity unit prices N corresponding to commodity names 1 to commodity names N, respectively recorded as commodity unit prices Pijr1 to commodity unit prices PijrN, obtaining commodity quantities 1 to commodity quantities N corresponding to commodity names 1 to commodity names N, respectively recorded as commodity quantities Mijr1 to commodity quantities MijrN;
[0022] The product name 1-product name N, product unit price Pijr1-product unit price PijrN and product quantity Mijr1-product quantity MijrN constitute keywords ijr1-keyword ijrN.
[0023] As a preferred solution of the agricultural product classification method based on agricultural product orders described in the present invention, step S4 includes the following sub-steps:
[0024] Step S41, calculating the average value of the commodity unit price Pijr1-commodity unit price PijrN, setting it as the unit price reference value, calculating the average value of the commodity quantity Mijr1-commodity quantity MijrN and setting it as the quantity reference value;
[0025] Step S42: Calculate the deviation value of the unit price of each product based on the standard deviation formula Deviation value from the quantity of goods , the difference between the unit price of the commodity and the unit price reference value is taken as the absolute value, recorded as the price difference P*, the difference between the quantity of the commodity and the quantity reference value is taken as the absolute value, recorded as the quantity difference M*;
[0026] Step S43: calculate the price difference P* and the deviation value of the commodity price By comparison, a first stable interval and a first fluctuation interval are obtained;
[0027] The quantity difference M* and the deviation value of the product quantity By comparison, a second stable interval and a second fluctuation interval are obtained.
[0028] As a preferred solution of the agricultural product classification method based on agricultural product orders described in the present invention, step S5 includes the following sub-steps:
[0029] Step S51, calculating the first overlapping interval, the first overlapping interval includes the first normal interval, the quantity increase interval and the quantity decrease interval, dividing the overlapping intervals of the first stable interval with the second stable interval and the second fluctuation interval respectively, recorded as the first normal interval, the quantity increase interval and the quantity decrease interval, and the overlapping intervals of the first stable interval with the second stable interval and the second fluctuation interval respectively ∈ [T1, TN];
[0030] Step S52, calculating the second overlapping interval, the second overlapping interval includes a price increase interval, a price decrease interval and a second normal interval, dividing the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively, recorded as the price increase interval, the price decrease interval and the second normal interval, and the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively ∈ [T1, TN];
[0031] Step S53, analyzing the quantity increase interval, quantity decrease interval, price increase interval and price decrease interval to obtain abnormal factors, and classifying the commodities based on the abnormal factors.
[0032] As a preferred solution of the agricultural product classification method based on agricultural product orders described in the present invention, step S53 includes the following sub-steps:
[0033] Step S531, the abnormal factor of the quantity increase interval is the increase in demand, which is recorded as X, the abnormal factor of the quantity decrease interval is the decrease in demand, which is recorded as X', the abnormal factor of the price increase interval is the decrease in supply, which is recorded as Y, the abnormal factor of the price decrease interval is the increase in supply, which is recorded as Y', the first normal interval is recorded as K, and the second normal interval is recorded as C;
[0034] Step S532: Classify the products based on the abnormal factors, the first normal interval and the second normal interval. The classification result is expressed as product name = {Qijr, first overlapping interval + K / X / X', second overlapping interval + C / Y / Y'}.
[0035] In a second aspect, the present invention provides an agricultural product classification system based on agricultural product orders, comprising a collection module, a database module, a calculation module and a classification module;
[0036] The acquisition module is used to extract order text data for sentence processing, generate primary text data, extract keywords in the primary text data through a feature word extractor, and generate keyword sequence 1-keyword sequence N, wherein the keywords include product name, product quantity and product unit price, and transmit the keyword sequence to the database module, set labels of keyword sequence 1-keyword sequence N according to the classification database, generate keywords ijr1-keyword ijrN, and transmit the keywords ijr1-keyword ijrN to the calculation module;
[0037] The database module root is used to obtain the name data set of agricultural products, agricultural product ancillary products and processed products in the statistical classification of agriculture and related industries, and build a classification database;
[0038] The calculation module is used to calculate the average value of the commodity unit price, the average value of the commodity quantity, the deviation value of the commodity unit price and the deviation value of the commodity quantity, calculate the price difference and the quantity difference, obtain the first stable interval, the first fluctuation interval, the second stable interval and the second fluctuation interval, and transmit the first stable interval, the first fluctuation interval, the second stable interval and the second fluctuation interval to the classification module;
[0039] The classification module is used to analyze the first normal interval, the quantity increase interval, the quantity decrease interval, the price increase interval, the price decrease interval, the second normal interval and the abnormal factors, and classify the varieties.
[0040] In a third aspect, the present invention provides an electronic device comprising a memory, a processor and storage in the memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in any one of the methods described above are executed.
[0041] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in any one of the methods described above are executed.
[0042] The beneficial effects of the present invention are as follows: by comprehensively analyzing factors of different dimensions of agricultural products, the comprehensiveness of classification is improved; by analyzing the supply and demand relationship through the dimensions of agricultural product quantity and unit price, the hierarchy of classification is improved; through the classification method of the present invention, merchants can quickly know the categories of agricultural products and the overlapping relationship between price and quantity, thereby realizing scientific inventory and purchase and maximizing sales profits. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A basic flow chart of a method for classifying agricultural products based on agricultural product orders provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0045] Example, see Figure 1 , as an embodiment of the present invention, provides a method for classifying agricultural products based on agricultural product orders, comprising the following steps:
[0046] Step S1, acquiring order text data, extracting the order text data in the order generation time sequence and performing sentence processing, generating primary text data, and extracting keywords from the primary text data, wherein the keywords include product name, product quantity and product unit price;
[0047] Step S2, calling the statistical classification of agriculture and related industries, obtaining the name data set of agricultural products, agricultural product ancillary products and their processed products, and constructing a classification database, wherein the classification database is used to classify agricultural products, including a primary directory, a secondary directory and a tertiary directory, wherein the secondary directory is a subdirectory of the primary directory, and the tertiary directory is a subdirectory of the secondary directory;
[0048] Step S3, obtaining the commodity name, calling the classification database, obtaining the classification of agricultural products, and marking the commodity name, commodity unit price and commodity quantity respectively;
[0049] Step S4, respectively calculating the average value of the commodity unit price, the average value of the commodity quantity, the deviation value of the commodity unit price and the deviation value of the commodity quantity, calculating the price difference and the quantity difference, and obtaining a first stable interval, a first fluctuation interval, a second stable interval and a second fluctuation interval;
[0050] Step S5, analyze the first stable interval, the first fluctuation interval, the second stable interval and the second fluctuation interval, obtain and analyze the first normal interval, the quantity increase interval, the quantity decrease interval, the price increase interval, the price decrease interval and the second normal interval, obtain the abnormal factors, and classify the products based on the abnormal factors.
[0051] By comprehensively analyzing factors of different dimensions of agricultural products, the comprehensiveness of classification is improved. By analyzing the supply and demand relationship through the dimensions of agricultural product quantity and unit price, the hierarchy of classification is improved. Through the classification method of the present invention, merchants can quickly know the categories of agricultural products and the overlapping relationship between price and quantity, thereby realizing scientific inventory and purchasing and maximizing sales profits.
[0052] The step S1 includes the following sub-steps:
[0053] Step S11, acquiring order text data according to time T1-time TN, wherein time T1-time TN is a discrete increasing time series;
[0054] Step S12, performing sentence processing on the order text data through a word segmentation processor to generate primary text data;
[0055] Step S13, extracting keywords from the primary text data through a feature word extractor, and generating keyword sequence 1-keyword sequence N, wherein the keywords include product name, product quantity and product unit price, keyword sequence 1 is {product name 1, product quantity 1 and product unit price 1}, keyword sequence 2 is {product name 2, product quantity 2 and product unit price 2}, ..., keyword sequence N is {product name N, product quantity N and product unit price N}.
[0056] The step S2 includes the following sub-steps:
[0057] Step S21, calling the statistical classification of agriculture and related industries to obtain the name dataset of agricultural products, agricultural product ancillary products and their processed products;
[0058] Step S22, constructing a classification database based on the name data set of agricultural products, agricultural product ancillary products and processed products thereof, wherein the classification database is a classification of agricultural products, including a primary directory, a secondary directory and a tertiary directory;
[0059] Step S23, the secondary directory is a subdirectory of the primary directory, the primary directory includes nature and processing, nature and processing are respectively recorded as Q1 and Q2, the secondary directory includes planting, animal husbandry and fishery corresponding to Q1 and Q2 respectively, the planting, animal husbandry and fishery corresponding to Q1 are respectively recorded as Q11, Q12 and Q13, the planting, animal husbandry and fishery corresponding to Q2 are respectively recorded as Q21, Q22 and Q23, the tertiary directory includes subcategories Q111-Q11B corresponding to Q11, subcategories Q211-Q21B' corresponding to Q21, subcategories Q121-Q12E corresponding to Q12, subcategories Q221-Q22E' corresponding to Q22, subcategories Q131-Q13V corresponding to Q13 and subcategories Q231-Q23V' corresponding to Q23, wherein B, B', E, E', V and V' are respectively positive integers greater than 1.
[0060] The step S3 includes the following sub-steps:
[0061] Step S31, obtain commodity name 1-commodity name N, call the classification database, obtain the classification of agricultural products, compare and classify commodity name 1-commodity name N with the classification of agricultural products respectively, and record the commodity name as Qijr, where i is the first-level directory, j is the second-level directory, and r is the third-level directory;
[0062] Step S32, obtaining commodity unit prices 1 to commodity unit prices N corresponding to commodity names 1 to commodity names N, respectively recorded as commodity unit prices Pijr1 to commodity unit prices PijrN, obtaining commodity quantities 1 to commodity quantities N corresponding to commodity names 1 to commodity names N, respectively recorded as commodity quantities Mijr1 to commodity quantities MijrN;
[0063] The product name 1-product name N, product unit price Pijr1-product unit price PijrN and product quantity Mijr1-product quantity MijrN constitute keywords ijr1-keyword ijrN.
[0064] The step S4 includes the following sub-steps:
[0065] Step S41, calculating the average value of the commodity unit price Pijr1-commodity unit price PijrN, setting it as the unit price reference value, calculating the average value of the commodity quantity Mijr1-commodity quantity MijrN and setting it as the quantity reference value;
[0066] Step S42: Calculate the deviation value of the unit price of each product based on the standard deviation formula Deviation value from the quantity of goods , the difference between the unit price of the commodity and the unit price reference value is taken as the absolute value, recorded as the price difference P*, the difference between the quantity of the commodity and the quantity reference value is taken as the absolute value, recorded as the quantity difference M*;
[0067] Step S43: calculate the price difference P* and the deviation value of the commodity price By comparison, a first stable interval and a first fluctuation interval are obtained;
[0068] The quantity difference M* and the deviation value of the product quantity By comparison, a second stable interval and a second fluctuation interval are obtained.
[0069] In specific implementation, ,in, is the deviation value of the commodity price, i is the first-level directory, j is the second-level directory, r is the third-level directory, u∈[1, N], u is a variable and u is a positive integer.
[0070] The price difference P* and the deviation value of the commodity price The comparison logic includes: Get the price difference P* and the deviation value of the product price , when the price difference P* is less than or equal to the deviation value of the commodity price When the corresponding commodity price is retained, the commodity prices are traversed, the commodity prices are sorted in descending order, the commodity price with the largest value is used as the upper limit of the first stable interval, and the commodity price with the smallest value is used as the lower limit of the first stable interval to construct the first stable interval, and the first stable interval is represented as the price range in which the price of the commodity fluctuates stably; The minimum value and the maximum value of the commodity price are obtained, and the value range of the commodity price that is distributed between the minimum value and the maximum value of the commodity price and is not distributed in the first stable interval is set as the first fluctuation interval.
[0071] The quantity difference M* and the deviation value of the product quantity The comparison logic includes: Get the quantity difference M* and the deviation value of the product quantity , when the quantity difference M* is less than or equal to the deviation value of the quantity of goods When , the corresponding commodity quantity is retained, the commodity quantity is traversed, the commodity quantity is sorted in descending order, the commodity quantity with the largest value is used as the upper limit of the second stable interval, the commodity quantity with the smallest value is used as the lower limit of the second stable interval, and the second stable interval is constructed. The second stable interval represents the quantity interval in which the quantity of the commodity fluctuates stably; The minimum value and the maximum value of the commodity quantity are obtained, and the value range of the commodity price that is distributed between the minimum value and the maximum value of the commodity quantity and is not distributed in the second stable interval is set as the second fluctuation interval.
[0072] The step S5 includes the following sub-steps: Step S51, calculating the first overlapping interval, the first overlapping interval includes the first normal interval, the quantity increase interval and the quantity decrease interval, dividing the overlapping intervals of the first stable interval with the second stable interval and the second fluctuation interval respectively, recorded as the first normal interval, the quantity increase interval and the quantity decrease interval, and the overlapping intervals of the first stable interval with the second stable interval and the second fluctuation interval respectively ∈ [T1, TN]; Step S52, calculating the second overlapping interval, the second overlapping interval includes a price increase interval, a price decrease interval and a second normal interval, dividing the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively, recorded as the price increase interval, the price decrease interval and the second normal interval, and the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively ∈ [T1, TN]; Step S53, analyzing the quantity increase interval, quantity decrease interval, price increase interval and price decrease interval to obtain abnormal factors, and classifying the commodities based on the abnormal factors.
[0073] According to the market database, the commodity name and commodity price are input into the market database, the corresponding commodity quantity is matched, and a first mapping relationship between the commodity price and the commodity quantity is constructed. Through the first mapping relationship, the elements in the first stable interval are converted into commodity quantities, recorded as first quantity values, the first quantity values are sorted in descending order, the first quantity value with the largest value and the first quantity value with the smallest value are selected, and the first quantity value with the largest value and the first quantity value with the smallest value are used as the new upper limit and the new lower limit of the first stable interval, a new first stable interval is constructed, a second stable interval and a second fluctuation interval are obtained, and the intersection interval of the new first stable interval and the second stable interval is screened, and the intersection interval of the new first stable interval and the second fluctuation interval is screened; Setting the intersection interval of the new first stable interval and the second stable interval as the first normal interval; The intersection interval of the new first stable interval and the second fluctuation interval, where the average value of the elements of the intersection interval is greater than or equal to the average value of the elements of the second stable interval, is set as the quantity increase interval; The intersection interval of the new first stable interval and the second fluctuation interval, whose average value of elements is smaller than the average value of elements in the second stable interval, is set as the quantity decreasing interval.
[0074] Calculating a second overlapping interval, the second overlapping interval including a price increase interval, a price decrease interval, and a second normal interval, dividing the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively, and recording them as the price increase interval, the price decrease interval, and the second normal interval, and the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively; According to the market database, input commodity names and commodity quantities into the market database, match corresponding commodity prices, construct a second mapping relationship between commodity quantities and commodity prices, convert elements in the second stable interval into commodity prices through the second mapping relationship, record them as first price values, sort the first price values in descending order, select the first price value with the largest value and the first price value with the smallest value, and use the first price value with the largest value and the first price value with the smallest value as the new upper limit and new lower limit of the second stable interval, construct a new second stable interval, obtain the first stable interval and the first fluctuation interval, screen the intersection interval of the new second stable interval and the first stable interval, and screen the intersection interval of the new second stable interval and the first fluctuation interval; Setting the intersection interval of the new second stable interval and the first stable interval as the second normal interval; The intersection interval of the new second stable interval and the first fluctuation interval, where the average value of the elements of the intersection interval is greater than or equal to the average value of the elements of the first stable interval, is set as the price increase interval; The intersection interval of the new second stable interval and the first fluctuation interval, whose average value of elements is less than the average value of elements in the first stable interval, is set as the price decrease interval.
[0075] The step S53 includes the following sub-steps: Step S531, the abnormal factor of the quantity increase interval is the increase in demand, which is recorded as X, the abnormal factor of the quantity decrease interval is the decrease in demand, which is recorded as X', the abnormal factor of the price increase interval is the decrease in supply, which is recorded as Y, the abnormal factor of the price decrease interval is the increase in supply, which is recorded as Y', the first normal interval is recorded as K, and the second normal interval is recorded as C; Step S532: Classify the products based on the abnormal factors, the first normal interval and the second normal interval. The classification result is expressed as product name = {Qijr, first overlapping interval + K / X / X', second overlapping interval + C / Y / Y'}.
[0076] Based on the relationship between demand, supply (quantity) and equilibrium price (price); In the quantity increase interval, if the price remains unchanged and the quantity increases, the demand curve moves to the right, that is, the demand increases. The demand increase is set as the abnormal factor of the quantity increase interval, and the demand increase is recorded as X; In the quantity decrease interval, the price remains unchanged, but the quantity decreases, and the demand curve moves to the left, that is, the demand decreases. The abnormal factor in the quantity decrease interval is the demand decrease. The demand decrease is set as the abnormal factor in the quantity decrease interval, and the demand decrease is recorded as X'; Based on the relationship between demand, supply (quantity) and equilibrium price (price); In the price increase range, the quantity remains unchanged, and the price increases, then the supply curve moves to the left, that is, the supply decreases. The supply decrease is set as the abnormal factor of the price increase range, and the supply decrease is recorded as Y; In the price-falling interval, the quantity remains unchanged, but the price falls, and the demand curve moves to the right, that is, the supply rises. The abnormal factor in the price-falling interval is the supply increase. The supply increase is set as the abnormal factor in the price-falling interval, and the supply increase is recorded as Y'; The first normal interval is recorded as K, and the second normal interval is recorded as C; Classify the goods, and the classification result is expressed as the product name = {Qijr, first overlapping interval + K / X / X', second overlapping interval + C / Y / Y'}, and the classification result is expressed as the category attribute of the product name. According to the current price, it belongs to the first normal interval or the demand is increasing or the demand is decreasing. According to the current quantity, it belongs to the second normal interval or the supply is decreasing or the supply is increasing; Based on this classification, it can be suggested that the production scale of the manufacturer should be increased or decreased, and the purchase scale of the retailer should be increased or decreased, thereby reducing inventory accumulation and commodity expiration, which is conducive to saving resources and increasing economic benefits.
[0077] The present invention conducts a comprehensive analysis on factors of different dimensions of agricultural products, thereby improving the comprehensiveness of classification, and analyzes the supply and demand relationship through the dimensions of agricultural product quantity and unit price, thereby enhancing the hierarchy of classification.
[0078] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for classifying agricultural products based on agricultural product orders, characterized in that: The following steps are involved: Step S1, acquiring order text data, extracting the order text data in the order generation time sequence and performing sentence processing, generating primary text data, and extracting keywords from the primary text data, wherein the keywords include product name, product quantity and product unit price; Step S2, calling the statistical classification of agriculture and related industries, obtaining the name data set of agricultural products, agricultural product ancillary products and their processed products, and constructing a classification database, wherein the classification database is used to classify agricultural products, including a primary directory, a secondary directory and a tertiary directory, wherein the secondary directory is a subdirectory of the primary directory, and the tertiary directory is a subdirectory of the secondary directory; Step S3, obtaining the commodity name, calling the classification database, obtaining the classification of agricultural products, and marking the commodity name, commodity unit price and commodity quantity respectively; Step S4, respectively calculating the average value of the commodity unit price, the average value of the commodity quantity, the deviation value of the commodity unit price and the deviation value of the commodity quantity, calculating the price difference and the quantity difference, and obtaining a first stable interval, a first fluctuation interval, a second stable interval and a second fluctuation interval; The step S4 includes the following sub-steps: Step S41, calculating the average value of the commodity unit price Pijr1-commodity unit price PijrN, setting it as the unit price reference value, calculating the average value of the commodity quantity Mijr1-commodity quantity MijrN and setting it as the quantity reference value; Step S42: Calculate the deviation value of the unit price of each product based on the standard deviation formula Deviation value from the quantity of goods , the difference between the unit price of the commodity and the unit price reference value is taken as the absolute value, which is recorded as the price difference P*; the difference between the quantity of the commodity and the quantity reference value is taken as the absolute value, which is recorded as the quantity difference M*; Step S43: calculate the price difference P* and the deviation value of the commodity price By comparison, we can get the first stable interval and the first fluctuation interval, and the quantity difference M* and the deviation value of the quantity of goods By comparison, a second stable interval and a second fluctuation interval are obtained; The price difference P* and the deviation value of the commodity price The comparison logic includes: Get the price difference P* and the deviation value of the product price , when the price difference P* is less than or equal to the deviation value of the commodity price When the corresponding commodity price is retained, the commodity prices are traversed, the commodity prices are sorted in descending order, the commodity price with the largest value is used as the upper limit of the first stable interval, and the commodity price with the smallest value is used as the lower limit of the first stable interval to construct the first stable interval, and the first stable interval is represented as the price range in which the price of the commodity fluctuates stably; Obtaining a minimum value and a maximum value of the commodity price, and setting a value range of the commodity price that is distributed between the minimum value and the maximum value of the commodity price and is not distributed in the first stable interval as a first fluctuation interval; The quantity difference M* and the deviation value of the product quantity The comparison logic includes: Get the quantity difference M* and the deviation value of the product quantity , when the quantity difference M* is less than or equal to the deviation value of the quantity of goods When , the corresponding commodity quantity is retained, the commodity quantity is traversed, the commodity quantity is sorted in descending order, the commodity quantity with the largest value is used as the upper limit of the second stable interval, the commodity quantity with the smallest value is used as the lower limit of the second stable interval, and the second stable interval is constructed. The second stable interval represents the quantity interval in which the quantity of the commodity fluctuates stably; Obtaining a minimum value and a maximum value of the commodity quantity, and setting a value range of commodity prices that is distributed between the minimum value and the maximum value of the commodity quantity and is not distributed in the second stable interval as a second fluctuation interval; Step S5, analyzing the first stable interval, the first fluctuation interval, the second stable interval, and the second fluctuation interval, obtaining and analyzing the first normal interval, the quantity increase interval, the quantity decrease interval, the price increase interval, the price decrease interval, and the second normal interval, obtaining abnormal factors, and classifying the commodities based on the abnormal factors; The step S5 comprises the following sub-steps: Step S51, calculating the first overlapping interval, the first overlapping interval includes the first normal interval, the quantity increase interval and the quantity decrease interval, dividing the overlapping intervals of the first stable interval with the second stable interval and the second fluctuation interval respectively, recorded as the first normal interval, the quantity increase interval and the quantity decrease interval, and the overlapping intervals of the first stable interval with the second stable interval and the second fluctuation interval respectively ∈ [T1, TN]; Step S52, calculating the second overlapping interval, the second overlapping interval includes a price increase interval, a price decrease interval and a second normal interval, dividing the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively, recorded as the price increase interval, the price decrease interval and the second normal interval, and the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively ∈ [T1, TN]; Step S53, analyzing the quantity increase interval, quantity decrease interval, price increase interval, and price decrease interval to obtain abnormal factors, and classifying the commodities based on the abnormal factors; According to the market database, the commodity name and commodity price are input into the market database, the corresponding commodity quantity is matched, and a first mapping relationship between the commodity price and the commodity quantity is constructed. Through the first mapping relationship, the elements in the first stable interval are converted into commodity quantities, recorded as first quantity values, the first quantity values are sorted in descending order, the first quantity value with the largest value and the first quantity value with the smallest value are selected, and the first quantity value with the largest value and the first quantity value with the smallest value are used as the new upper limit and the new lower limit of the first stable interval, a new first stable interval is constructed, a second stable interval and a second fluctuation interval are obtained, and the intersection interval of the new first stable interval and the second stable interval is screened, and the intersection interval of the new first stable interval and the second fluctuation interval is screened; Setting the intersection interval of the new first stable interval and the second stable interval as the first normal interval; The intersection interval of the new first stable interval and the second fluctuation interval, where the average value of the elements of the intersection interval is greater than or equal to the average value of the elements of the second stable interval, is set as the quantity increase interval; The intersection interval of the new first stable interval and the second fluctuation interval, where the average value of the elements of the intersection interval is less than the average value of the elements of the second stable interval, is set as the quantity decreasing interval; Calculating a second overlapping interval, the second overlapping interval including a price increase interval, a price decrease interval, and a second normal interval, dividing the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively, and recording them as the price increase interval, the price decrease interval, and the second normal interval, and the overlapping intervals of the first fluctuation interval with the second stable interval and the second fluctuation interval respectively; According to the market database, input commodity names and commodity quantities into the market database, match corresponding commodity prices, construct a second mapping relationship between commodity quantities and commodity prices, convert elements in the second stable interval into commodity prices through the second mapping relationship, record them as first price values, sort the first price values in descending order, select the first price value with the largest value and the first price value with the smallest value, and use the first price value with the largest value and the first price value with the smallest value as the new upper limit and new lower limit of the second stable interval, construct a new second stable interval, obtain the first stable interval and the first fluctuation interval, screen the intersection interval of the new second stable interval and the first stable interval, and screen the intersection interval of the new second stable interval and the first fluctuation interval; Setting the intersection interval of the new second stable interval and the first stable interval as the second normal interval; The intersection interval of the new second stable interval and the first fluctuation interval, where the average value of the elements of the intersection interval is greater than or equal to the average value of the elements of the first stable interval, is set as the price increase interval; The intersection interval of the new second stable interval and the first fluctuation interval, where the average value of the elements of the intersection interval is less than the average value of the elements of the first stable interval, is set as a price decrease interval; The step S53 includes the following sub-steps: Step S531, the abnormal factor of the quantity increase interval is the increase in demand, which is recorded as X, the abnormal factor of the quantity decrease interval is the decrease in demand, which is recorded as X', the abnormal factor of the price increase interval is the decrease in supply, which is recorded as Y, the abnormal factor of the price decrease interval is the increase in supply, which is recorded as Y', the first normal interval is recorded as K, and the second normal interval is recorded as C; Step S532, classifying the commodities based on the abnormal factors, the first normal interval and the second normal interval, wherein the classification result is expressed as commodity name={Qijr, first overlapping interval+K / X / X', second overlapping interval+C / Y / Y'}; Based on the relationship between demand, supply and equilibrium price; In the quantity increase interval, if the price remains unchanged and the quantity increases, the demand curve moves to the right, that is, the demand increases. The demand increase is set as the abnormal factor of the quantity increase interval, and the demand increase is recorded as X; In the quantity decrease interval, the price remains unchanged, but the quantity decreases, and the demand curve moves to the left, that is, the demand decreases. The abnormal factor in the quantity decrease interval is the demand decrease. The demand decrease is set as the abnormal factor in the quantity decrease interval, and the demand decrease is recorded as X'; Based on the relationship between demand, supply and equilibrium price; In the price increase range, the quantity remains unchanged, and the price increases, then the supply curve moves to the left, that is, the supply decreases. The supply decrease is set as the abnormal factor of the price increase range, and the supply decrease is recorded as Y; In the price-falling interval, the quantity remains unchanged, but the price falls, and the demand curve moves to the right, that is, the supply rises. The abnormal factor in the price-falling interval is the supply increase. The supply increase is set as the abnormal factor in the price-falling interval, and the supply increase is recorded as Y'; The first normal interval is recorded as K, and the second normal interval is recorded as C; The commodities are classified, and the classification result is expressed as commodity name = {Qijr, first overlapping interval + K / X / X', second overlapping interval + C / Y / Y'}. The classification result is expressed as the category attribute of the commodity name. According to the current price, it belongs to the first normal interval or belongs to an increasing demand or a decreasing demand. According to the current quantity, it belongs to the second normal interval or the supply is decreasing or increasing.
2. The agricultural product classification method based on agricultural product orders according to claim 1, characterized in that: The step S1 includes the following sub-steps: Step S11, acquiring order text data according to time T1-time TN, wherein time T1-time TN is a discrete increasing time series; Step S12, performing sentence processing on the order text data through a word segmentation processor to generate primary text data; Step S13, extracting keywords from the primary text data through a feature word extractor, and generating keyword sequence 1-keyword sequence N, wherein the keywords include product name, product quantity and product unit price, keyword sequence 1 is {product name 1, product quantity 1 and product unit price 1}, keyword sequence 2 is {product name 2, product quantity 2 and product unit price 2}, ..., keyword sequence N is {product name N, product quantity N and product unit price N}.
3. The agricultural product classification method based on agricultural product orders as claimed in claim 1, characterized in that: The step S2 includes the following sub-steps: Step S21, calling the statistical classification of agriculture and related industries to obtain the name dataset of agricultural products, agricultural product ancillary products and their processed products; Step S22, constructing a classification database based on the name data set of agricultural products, agricultural product ancillary products and processed products thereof, wherein the classification database is a classification of agricultural products, including a primary directory, a secondary directory and a tertiary directory; Step S23, the secondary directory is a subdirectory of the primary directory, the primary directory includes nature and processing, nature and processing are respectively recorded as Q1 and Q2, the secondary directory includes planting, animal husbandry and fishery corresponding to Q1 and Q2 respectively, the planting, animal husbandry and fishery corresponding to Q1 are respectively recorded as Q11, Q12 and Q13, the planting, animal husbandry and fishery corresponding to Q2 are respectively recorded as Q21, Q22 and Q23, the tertiary directory includes subcategories Q111-Q11B corresponding to Q11, subcategories Q211-Q21B' corresponding to Q21, subcategories Q121-Q12E corresponding to Q12, subcategories Q221-Q22E' corresponding to Q22, subcategories Q131-Q13V corresponding to Q13 and subcategories Q231-Q23V' corresponding to Q23, wherein B, B', E, E', V and V' are respectively positive integers greater than 1.
4. The agricultural product classification method based on agricultural product orders according to claim 1, characterized in that: The step S3 includes the following sub-steps: Step S31, obtain commodity name 1-commodity name N, call the classification database, obtain the classification of agricultural products, compare and classify commodity name 1-commodity name N with the classification of agricultural products respectively, and record the commodity name as Qijr, where i is the first-level directory, j is the second-level directory, and r is the third-level directory; Step S32, obtaining commodity unit prices 1 to commodity unit prices N corresponding to commodity names 1 to commodity names N, respectively recorded as commodity unit prices Pijr1 to commodity unit prices PijrN, obtaining commodity quantities 1 to commodity quantities N corresponding to commodity names 1 to commodity names N, respectively recorded as commodity quantities Mijr1 to commodity quantities MijrN; The product name 1-product name N, product unit price Pijr1-product unit price PijrN and product quantity Mijr1-product quantity MijrN constitute keywords ijr1-keyword ijrN.
5. An agricultural product classification system based on agricultural product orders, the system is used to implement an agricultural product classification method based on agricultural product orders as described in any one of claims 1 to 4, characterized in that: It includes acquisition module, database module, calculation module and classification module; The acquisition module is used to extract order text data for sentence processing, generate primary text data, extract keywords in the primary text data through a feature word extractor, and generate keyword sequence 1-keyword sequence N, wherein the keywords include product name, product quantity and product unit price, and transmit the keyword sequence to the database module, set labels of keyword sequence 1-keyword sequence N according to the classification database, generate keywords ijr1-keyword ijrN, and transmit the keywords ijr1-keyword ijrN to the calculation module; The database module root is used to obtain the name data set of agricultural products, agricultural product ancillary products and processed products in the statistical classification of agriculture and related industries, and build a classification database; The calculation module is used to calculate the average value of the commodity unit price, the average value of the commodity quantity, the deviation value of the commodity unit price and the deviation value of the commodity quantity, calculate the price difference and the quantity difference, obtain the first stable interval, the first fluctuation interval, the second stable interval and the second fluctuation interval, and transmit the first stable interval, the first fluctuation interval, the second stable interval and the second fluctuation interval to the classification module; The classification module is used to analyze the first normal interval, the quantity increase interval, the quantity decrease interval, the price increase interval, the price decrease interval, the second normal interval and the abnormal factors, and classify the varieties.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for classifying agricultural products based on agricultural product orders as described in any one of claims 1 to 4 is implemented.
7. 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 method for classifying agricultural products based on agricultural product orders according to any one of claims 1 to 4 is implemented.
