Plastic particle transaction information automatic acquisition method, medium and system

Obtaining data in parallel through multi-threading or coroutine technology, combined with GPU parallel computing and multi-evidence reasoning, solves the problem of insufficient information filtering capabilities in the existing technology, achieves efficient and accurate collection and filtering of plastic particle transaction information, and improves information reliability.

CN118628146APending Publication Date: 2024-09-10QINGDAO MENGDOU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410793889.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The existing technology has weak information filtering capabilities in collecting plastic particle trading information, making it difficult to fully mine and utilize the correlation between information from different sources, making it difficult to effectively screen the reliability and accuracy of the information.

Method used

Use multi-threading or coroutine technology to obtain web page data from multiple plastic trading websites in parallel, use GPU parallel computing for feature extraction and classification, use multi-evidence reasoning methods for information filtering, and use CUDA streams and thread grids for parallel reasoning, setting Confidence thresholds ensure information accuracy.

Benefits of technology

It significantly improves the efficiency of data acquisition and the accuracy of information extraction, enhances the reliability of information filtering, and ensures the accuracy and credibility of information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628146A
    Figure CN118628146A
Patent Text Reader

Abstract

The invention provides a plastic particle transaction information automatic collection method, medium and system, and belongs to the technical field of information automatic collection, and the method comprises the steps: collecting and analyzing plastic transaction information through parallel computing; multiple pieces of website data are obtained through a web crawler, key information is extracted, and feature extraction is carried out. The feature vectors are classified through GPU parallel computing, support evidences are selected from the feature vectors, and a reasoning chain is constructed to obtain result confidence. When the confidence is above a threshold, the cleaned standardized data is stored. The system gives full play to parallel computing advantages and realizes efficient information acquisition and analysis. According to the plastic particle transaction information automatic acquisition method, the medium and the system provided by the invention, the technical problem that in the prior art, the correlation between information of different sources cannot be fully mined and utilized, the reliability and the accuracy of the information are difficult to effectively discriminate, and the information filtering capability is relatively weak is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automatic information collection, and in particular, relates to a method, medium and system for automatic collection of plastic particle transaction information. Background Art

[0002] In the current rapidly developing industrial society, plastic particles are important basic chemical raw materials. Their trading activity and price fluctuations directly reflect the operating situation of the entire manufacturing industry. Understanding the trading information of plastic particles is not only crucial for plastic manufacturers to formulate procurement strategies and production plans, but also extremely critical for financial investment institutions to analyze the overall economic situation. Therefore, how to quickly and accurately obtain and analyze the trading information of plastic particles has always been an important issue that the industry needs to solve.

[0003] At present, some methods for collecting plastic transaction information based on web crawler technology have emerged in the industry. Such methods usually first use a preset crawler program to continuously crawl web page data from multiple plastic transaction websites. Then, through some data analysis technology, key information such as plastic type, transaction price, transaction quantity, etc. are extracted from these web page data. Finally, this key information will be sorted and stored for subsequent analysis.

[0004] This web crawler-based method can indeed effectively obtain a large amount of plastic transaction information. However, it also has the technical problem of weak information filtering ability. That is, the existing methods mainly rely on some simple rules or machine learning models when classifying the extracted key information. It is impossible to fully explore and utilize the correlation between information from different sources, and it is difficult to effectively identify the reliability and accuracy of this information. Summary of the invention

[0005] In view of this, the present invention provides a method, medium and system for automatically collecting plastic particle transaction information, which can solve the technical problem that the existing technology of automatically collecting plastic particle transaction information has weak information filtering ability.

[0006] The present invention is achieved in that:

[0007] A first aspect of the present invention provides a method for automatically collecting plastic particle transaction information, which includes the following steps:

[0008] S10, using a preset web crawler program and multi-threading or coroutine technology to continuously and parallelly obtain web page data from multiple plastic trading websites;

[0009] S20, parsing the acquired web page data to extract key information;

[0010] S30, using GPU parallel computing to extract features of the key information to obtain a feature vector;

[0011] S40, preliminarily classify the feature vectors and assign them to different candidate categories;

[0012] S50, for each candidate category, selecting facts or feature data supporting the category from the extracted key information as evidence based on preset rules;

[0013] S60, loading the evidence into the GPU memory, starting multiple CUDA streams, the number of which is equal to the number of candidate categories, and loading each candidate category and its evidence into a corresponding CUDA stream;

[0014] S70, each CUDA stream divides the evidence corresponding to the candidate category into blocks and evenly distributes them to the thread grid; if all the evidence blocks cannot be accommodated at one time, batch processing is adopted to submit them one by one;

[0015] S80, each thread uses the corresponding evidence block to perform layer-by-layer reasoning until the final classification result and its confidence are obtained, forming a complete chain of evidence;

[0016] S90. When the confidence of the chain of evidence is higher than the preset confidence threshold, it is confirmed that information needs to be collected, and the corresponding web page data is crawled through the web crawler program, and then cleaned, formatted and standardized before storage.

[0017] Among them, the method for obtaining web page data of multiple plastic trading websites is to crawl the data of plastic trading websites that support third-party data crawling protocols.

[0018] Among them, key information includes plastic particle types, transaction prices, and transaction quantities.

[0019] The method for extracting features from the key information is to convert the key information into a feature vector in numerical form.

[0020] Among them, the method for preliminarily classifying the feature vectors is to obtain manual classification results or use a machine learning classification algorithm to classify the feature vectors.

[0021] The calculation of the confidence level is based on the reliability and relevance of the evidence used.

[0022] The preset confidence threshold is 75% to 95%.

[0023] Furthermore, the preset confidence threshold is 80%.

[0024] Wherein, the step S10 specifically includes: using a preset web crawler program, through multi-threading or coroutine technology, continuously and parallelly obtaining web page data of multiple plastic trading websites. First, the program will initialize a multi-thread or coroutine pool, and each thread or coroutine in the pool will be responsible for accessing and obtaining web page data of a plastic trading website. In order to improve the efficiency of data acquisition, these threads or coroutines will be executed in parallel without interfering with each other. At the same time, the program will also set a suitable time interval to periodically crawl website data to ensure the real-time and integrity of the data. When each thread or coroutine obtains web page data, it will first check the robots.txt file of the target website to ensure that the crawling behavior complies with the rules of the website to avoid being prohibited from access by the website. The obtained web page data will be temporarily stored in the memory for subsequent data analysis.

[0025] Wherein, the step S20 specifically includes: parsing the acquired web page data to extract key information, including plastic particle varieties, transaction prices, and transaction quantities. First, the program will formulate special data parsing rules for different transaction websites. These rules usually include: identifying key tags or CSS selectors in the web page structure and extracting corresponding text content; performing preliminary formatting and cleaning of the text content to remove useless information; identifying keywords or patterns to extract the required plastic particle varieties, transaction prices, transaction quantities and other information. In order to improve the parsing efficiency, the program will adopt a parallel processing method to divide the acquired web page data into blocks and start multiple parsing threads for processing at the same time. Each thread will independently extract the corresponding key information according to the preset parsing rules, and finally summarize the results to form a complete set of key information.

[0026] Wherein, the step S30 specifically includes: using GPU parallel computing to extract features from the extracted key information and obtain feature vectors. First, the program will convert the extracted key information, such as plastic particle varieties, transaction prices, transaction quantities, etc., into numerical feature values. These feature values ​​may include: numerical features (such as price, quantity), category features (such as varieties), time features (such as transaction time), etc. Then, the program will use the advantages of GPU parallel computing to perform feature engineering on these feature values, including: standardization or normalization, principal component analysis, dimensionality reduction, etc. Finally, the program will assemble these feature values ​​processed by feature engineering into a multidimensional feature vector for subsequent classification tasks. The advantage of using GPU parallel computing is that it can greatly improve the speed and efficiency of feature extraction, which is particularly important when processing large-scale data.

[0027] Wherein, the step S40 specifically includes: preliminary classification of feature vectors and assigning them to different candidate categories. First, the program will predefine several candidate categories according to business needs, such as: types of plastic particles, transaction price ranges, transaction quantity ranges, etc. Then, the program will use some common machine learning classification algorithms, such as k-nearest neighbor algorithm, decision tree algorithm, naive Bayes algorithm, etc., to perform preliminary classification of the extracted feature vectors. The purpose of this preliminary classification is to quickly divide the feature vectors into corresponding candidate categories to provide a basis for subsequent evidence collection and reasoning. In order to improve the accuracy of classification, the program will also tune the hyperparameters of the classification algorithm and select the optimal classification model by cross-validation.

[0028] Wherein, the step S50 specifically includes: for each candidate category, based on the preset rules, select the facts or characteristic data supporting the category from the extracted key information as evidence. First, the program will formulate corresponding evidence collection rules according to different candidate categories. These rules usually include: identifying keywords or patterns related to the category; extracting data matching the keywords or patterns as evidence; conducting a preliminary credibility assessment on the evidence, and filtering out evidence that is obviously irrelevant or less credible. For example, for the candidate category of "plastic particle price range", the program may collect some price-related data as evidence, such as: the price change trend of a certain type of plastic particles in a certain period of time, the price comparison of the same type of plastic particles on different websites, etc. In this way, the program can collect a series of supporting evidence data for each candidate category.

[0029] Wherein, the step S60 specifically includes: loading the evidence into the GPU memory, starting multiple CUDA streams, the number of which is equal to the number of candidate categories, and loading each candidate category and its evidence into the corresponding CUDA stream. First, the program will load all the evidence data collected above into the GPU memory. The advantage of doing so is that the powerful parallel computing capability of the GPU can be fully utilized to greatly improve the subsequent reasoning speed. Then, the program will start a CUDA stream for each candidate category, and the number of CUDA streams is equal to the number of candidate categories. Each CUDA stream will independently load the corresponding candidate category and its evidence data to prepare for the subsequent parallel reasoning. In this way, the program can give full play to the advantages of the GPU, while ensuring that the calculations between different candidate categories do not interfere with each other, thereby improving the overall processing efficiency.

[0030] Wherein, the step S70 specifically includes: each CUDA stream divides the evidence of the corresponding candidate category into blocks and evenly distributes them to the thread grid; if all the evidence blocks cannot be accommodated at one time, batch processing is adopted to submit them one by one. First, each CUDA stream divides the evidence data loaded into the GPU video memory into blocks according to certain rules. These rules may include: evenly dividing according to the size of the data; dividing at the semantic level according to the characteristics of the data; dynamically adjusting according to the parallel degree of processing, etc. Then, the program will evenly distribute these evidence blocks to the thread grid of the GPU. Each thread will independently process the evidence blocks assigned to it, thereby realizing parallel reasoning. If all the evidence blocks cannot be accommodated at one time, the program will adopt a batch processing method to submit the evidence blocks to the GPU for processing in multiple batches. This block and batch processing method can maximize the parallel computing capability of the GPU and improve the overall processing efficiency.

[0031] Wherein, the step S80 specifically includes: each thread uses the corresponding evidence block to perform layer-by-layer reasoning until the final classification result and its confidence are obtained to form a complete chain of evidence. First, each thread will perform layer-by-layer logical reasoning based on the evidence block assigned to it and the pre-defined reasoning rules. These reasoning rules may include: weighted aggregation based on the credibility of evidence; reasoning links based on the correlation between evidence; semantic level reasoning based on business knowledge, etc. Through this step-by-step reasoning method, each thread will eventually obtain a classification result of a candidate category and the corresponding confidence. The calculation of confidence will take into account multiple factors, such as the reliability, relevance, and quantity of evidence. At the same time, the reasoning process of each thread will also form a complete chain of evidence, providing a basis for subsequent decision-making.

[0032] Wherein, the step S90 specifically includes: when the confidence of the chain of evidence is higher than the preset confidence threshold, it is confirmed that information needs to be collected, and the corresponding web page data is crawled through the web crawler program, and stored after cleaning, formatting and standardization. First, the program will set a reasonable confidence threshold, such as 80%. When the confidence of the reasoning result of a candidate category exceeds this threshold, the program will determine that the classification result of the category is reliable and further relevant information needs to be collected. Next, the program will start the web crawler again to crawl the corresponding web page data for the confirmed classification result. These data will be cleaned, formatted and standardized to remove useless information, unify the data format, and facilitate subsequent storage and use. Finally, the processed data will be persistently stored for query and analysis by business personnel. By setting the confidence threshold, the program can ensure that only reliable classification results will be collected, thereby improving the accuracy and effectiveness of the entire system.

[0033] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned method for automatically collecting plastic particle trading information.

[0034] A third aspect of the present invention provides an automated collection system for plastic particle trading information, which includes the above-mentioned computer-readable storage medium.

[0035] Compared with the prior art, the method, medium and system for automatically collecting plastic particle transaction information provided by the present invention have the following beneficial effects:

[0036] 1. Greatly improve the data acquisition efficiency. The present invention makes full use of multi-threading or coroutine technology to achieve parallel crawling of multiple plastic trading websites. At the same time, the crawling behavior of each website is optimized to avoid being banned by the website. In this way, the overall data acquisition speed is significantly improved, laying a solid foundation for subsequent information processing.

[0037] 2. Significantly improve the accuracy of information extraction. In the data analysis process, the present invention not only adopts parallel processing to improve efficiency, but also introduces more intelligent and robust analysis algorithms. These algorithms can not only accurately identify key information in the web page structure, but also conduct in-depth semantic level analysis of the extracted data, thereby greatly reducing the information extraction deviation caused by differences in page structure.

[0038] 3. Greatly enhance the reliability of information filtering. When classifying the extracted key information, the present invention no longer simply relies on a single rule or machine learning model, but adopts a method based on multi-evidence reasoning. This method collects various supporting evidence for each candidate category, and combines the credibility, relevance and other factors of the evidence to conduct in-depth multi-layer reasoning, and finally obtains a robust and reliable classification result. This greatly improves the accuracy and credibility of information filtering.

[0039] Therefore, the solution of the present invention solves the technical problem that the existing technology for automatically collecting plastic particle transaction information has a weak information filtering ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0041] Figure 1A flow chart of the method provided by the present invention; DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0043] like Figure 1 As shown, it is a flow chart of a method for automatically collecting plastic particle transaction information provided by the present invention, and the method comprises the following steps:

[0044] S10, using a preset web crawler program and multi-threading or coroutine technology to continuously and parallelly obtain web page data from multiple plastic trading websites;

[0045] S20, parsing the acquired web page data to extract key information;

[0046] S30, using GPU parallel computing to extract features of key information and obtain feature vectors;

[0047] S40, preliminarily classify the feature vectors and assign them to different candidate categories;

[0048] S50, for each candidate category, selecting facts or feature data supporting the category from the extracted key information as evidence based on preset rules;

[0049] S60, loading the evidence into the GPU memory, starting multiple CUDA streams, the number of CUDA streams being equal to the number of candidate categories, and loading each candidate category and its evidence into the corresponding CUDA stream;

[0050] S70, each CUDA stream divides the evidence corresponding to the candidate category into blocks and evenly distributes them to the thread grid; if all the evidence blocks cannot be accommodated at one time, batch processing is adopted to submit them one by one;

[0051] S80, each thread uses the corresponding evidence block to perform layer-by-layer reasoning until the final classification result and its confidence are obtained, forming a complete chain of evidence;

[0052] S90. When the confidence of the chain of evidence is higher than the preset confidence threshold, it is confirmed that information needs to be collected, and the corresponding web page data is crawled through the web crawler program, and then cleaned, formatted and standardized before storage.

[0053] The specific implementation methods of the above steps are described in detail below:

[0054] The specific implementation method of step S10 is: using a preset web crawler program, through multi-threading or coroutine technology, continuously and parallelly obtain the web page data of multiple plastic trading websites. First, the program will initialize a multi-thread or coroutine pool, and each thread or coroutine in the pool will be responsible for accessing and obtaining the web page data of a plastic trading website that supports a third-party crawling protocol. In order to improve the efficiency of data acquisition, these threads or coroutines will be executed in parallel without interfering with each other. At the same time, the program will also set a suitable time interval to periodically crawl website data to ensure the real-time and integrity of the data. When each thread or coroutine obtains web page data, it will first check the robots.txt file of the target website to ensure that the crawling behavior complies with the rules of the website to avoid being prohibited from access by the website. The obtained web page data will be temporarily stored in the memory for subsequent data analysis.

[0055] The specific implementation method of step S20 is: parsing the acquired web page data to extract key information, including plastic particle types, transaction prices, and transaction quantities. First, the program will formulate special data parsing rules for different trading websites. These rules usually include: identifying key tags or CSS selectors in the web page structure and extracting the corresponding text content; performing preliminary formatting and cleaning of the text content to remove useless information; identifying keywords or patterns to extract the required plastic particle types, transaction prices, transaction quantities and other information. In order to improve the parsing efficiency, the program will adopt a parallel processing method to divide the acquired web page data into blocks and start multiple parsing threads for processing at the same time. Each thread will independently extract the corresponding key information according to the preset parsing rules, and finally summarize the results to form a complete set of key information.

[0056] The specific implementation method of step S30 is: using GPU parallel computing to extract features from the extracted key information and obtain feature vectors. First, the program converts the extracted key information, such as plastic particle varieties, transaction prices, transaction quantities, etc., into numerical feature values. These feature values ​​may include: numerical features (such as price, quantity), category features (such as varieties), time features (such as transaction time), etc. Then, the program will use the advantages of GPU parallel computing to perform feature engineering on these feature values, including: standardization or normalization, principal component analysis, dimensionality reduction, etc. Finally, the program will assemble these feature values ​​processed by feature engineering into a multidimensional feature vector for subsequent classification tasks. The advantage of using GPU parallel computing is that it can greatly improve the speed and efficiency of feature extraction, which is particularly important when processing large-scale data.

[0057] The specific implementation method of step S40 is: preliminarily classify the feature vectors and assign them to different candidate categories. First, the program will predefine several candidate categories according to business needs, such as: types of plastic particles, transaction price ranges, transaction quantity ranges, etc. Then, the program will use some common machine learning classification algorithms, such as k-nearest neighbor algorithm, decision tree algorithm, naive Bayes algorithm, etc., to preliminarily classify the extracted feature vectors. The purpose of this preliminary classification is to quickly divide the feature vectors into corresponding candidate categories to provide a basis for subsequent evidence collection and reasoning. In order to improve the accuracy of classification, the program will also tune the hyperparameters of the classification algorithm and select the optimal classification model by cross-validation.

[0058] The specific implementation method of step S50 is: for each candidate category, select the facts or feature data supporting the category from the extracted key information based on the preset rules as evidence. First, the program will formulate corresponding evidence collection rules according to different candidate categories. These rules usually include: identifying keywords or patterns related to the category; extracting data matching the keywords or patterns as evidence; conducting a preliminary credibility assessment on the evidence, and filtering out evidence that is obviously irrelevant or less credible. For example, for the candidate category of "plastic particle price range", the program may collect some price-related data as evidence, such as: the price change trend of a certain type of plastic particles in a certain period of time, the price comparison of the same type of plastic particles on different websites, etc. In this way, the program can collect a series of supporting evidence data for each candidate category.

[0059] The specific implementation of step S60 is: load the evidence into the GPU memory, start multiple CUDA streams, the number of which is equal to the number of candidate categories, and load each candidate category and its evidence into the corresponding CUDA stream. First, the program will load all the evidence data collected above into the GPU memory. The advantage of doing so is that the powerful parallel computing capability of the GPU can be fully utilized to greatly improve the subsequent reasoning speed. Then, the program will start a CUDA stream for each candidate category, and the number of CUDA streams is equal to the number of candidate categories. Each CUDA stream will independently load the corresponding candidate category and its evidence data to prepare for the subsequent parallel reasoning. In this way, the program can give full play to the advantages of the GPU, while ensuring that the calculations between different candidate categories do not interfere with each other, thereby improving the overall processing efficiency.

[0060] The specific implementation method of step S70 is: each CUDA stream divides the evidence of the corresponding candidate category into blocks and evenly distributes them to the thread grid; if all the evidence blocks cannot be accommodated at one time, batch processing is adopted to submit them one by one. First, each CUDA stream divides the evidence data loaded into the GPU video memory into blocks according to certain rules. These rules may include: evenly dividing according to the size of the data; dividing at the semantic level according to the characteristics of the data; dynamically adjusting according to the parallel degree of processing, etc. Then, the program will evenly distribute these evidence blocks to the thread grid of the GPU. Each thread will independently process the evidence blocks assigned to it, thereby realizing parallel reasoning. If all the evidence blocks cannot be accommodated at a single time, the program will adopt a batch processing method to submit the evidence blocks to the GPU for processing in multiple batches. This block and batch processing method can maximize the parallel computing capability of the GPU and improve the overall processing efficiency.

[0061] The specific implementation method of step S80 is: each thread uses the corresponding evidence block to perform layer-by-layer reasoning until the final classification result and its confidence are obtained, forming a complete chain of evidence. First, each thread will perform layer-by-layer logical reasoning based on the evidence block assigned to it and combined with pre-defined reasoning rules. These reasoning rules may include: weighted aggregation based on the credibility of evidence; reasoning links based on the correlation between evidence; semantic level reasoning based on business knowledge, etc. Through this step-by-step reasoning method, each thread will eventually obtain a classification result of a candidate category and the corresponding confidence. The calculation of confidence will take into account multiple factors, such as the reliability, relevance, and quantity of evidence. At the same time, the reasoning process of each thread will also form a complete chain of evidence, providing a basis for subsequent decision-making.

[0062] The specific implementation method of step S90 is: when the confidence of the evidence chain is higher than the preset confidence threshold, it is confirmed that information needs to be collected, and the corresponding web page data is crawled through the web crawler program, and stored after cleaning, formatting and standardization. First, the program will set a reasonable confidence threshold, such as 80%. When the confidence of the reasoning result of a candidate category exceeds this threshold, the program will determine that the classification result of the category is reliable and further relevant information needs to be collected. Next, the program will start the web crawler again to crawl the corresponding web page data for the confirmed classification result. These data will be cleaned, formatted and standardized to remove useless information, unify the data format, and facilitate subsequent storage and use. Finally, the processed data will be persistently stored for query and analysis by business personnel. By setting the confidence threshold, the program can ensure that only reliable classification results will be collected, improving the accuracy and effectiveness of the entire system.

[0063] In summary, this method of automated collection of plastic particle trading information makes full use of modern computer technology, including web crawlers, parallel computing, machine learning, etc., to achieve efficient and accurate collection and processing of plastic trading information. Among them, the key technical points include:

[0064] 1. Use multi-threading or coroutine technology to obtain data from multiple trading websites in parallel to improve data collection efficiency.

[0065] 2. Use GPU parallel computing to quickly extract key features and perform preliminary classification.

[0066] 3. Collect supporting evidence for each candidate category and build a complete chain of evidence.

[0067] 4. Make full use of the parallel computing capabilities of the GPU and perform layer-by-layer reasoning to obtain the final classification results and confidence levels.

[0068] 5. Set a reasonable confidence threshold to ensure that only reliable classification results are collected.

[0069] Through the combination of these technical means, this method realizes the automated collection of plastic particle transaction information, greatly improves the efficiency and accuracy of information acquisition, and provides reliable data support for subsequent business analysis and decision-making.

[0070] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned method for automatically collecting plastic particle trading information.

[0071] A third aspect of the present invention provides an automated collection system for plastic particle trading information, which includes the above-mentioned computer-readable storage medium.

[0072] In order to better implement the present invention on a computer, a specific embodiment of the present invention implemented on a computer is provided below in combination with a specific formula:

[0073] The specific implementation of step S10 is as follows:

[0074] Using the preset web crawler program, through multi-threading or coroutine technology, the web page data of multiple plastic trading websites are continuously and parallelly obtained. First, a multi-thread or coroutine pool is initialized, and each thread or coroutine in the pool is responsible for accessing and obtaining the web page data of a plastic trading website. In order to improve the efficiency of data acquisition, these threads or coroutines will be executed in parallel without interfering with each other.

[0075] Let N be the number of plastic trading websites to be crawled, and T be the time interval for crawling data from each website. Then the execution process of each thread or coroutine i can be described as:

[0076] for t=1 to T:

[0077] visit website

[0078] fetch webpage data

[0079] store data in memory

[0080] sleep for(i-1)*t seconds

[0081] Here, t represents the time point of the tth data crawling, and i represents the i-th thread or coroutine. By setting different time intervals, it can ensure that each thread or coroutine can crawl data from different websites in parallel, thereby improving the overall data acquisition efficiency.

[0082] At the same time, when each thread or coroutine obtains web page data, it will first check the robots.txt file of the target website to ensure that the crawling behavior complies with the website's rules and avoid being banned by the website. You can define a function check_robots(url) with a Boolean return value, indicating whether the current crawler behavior complies with the website's robots.txt rules.

[0083] The acquired web page data will be temporarily stored in the memory for subsequent data analysis. A data structure WebpageData can be defined to store this data, which contains information such as website URL, web page HTML content, etc.

[0084] The specific implementation of step S20 is as follows:

[0085] Parse the acquired web page data to extract key information, including plastic particle types, transaction prices, and transaction quantities. First, formulate special data parsing rules for different trading websites. These rules usually include: identifying key tags or CSS selectors in the web page structure and extracting the corresponding text content; performing preliminary formatting and cleaning of the text content to remove useless information; identifying keywords or patterns to extract the required plastic particle types, transaction prices, transaction quantities, and other information.

[0086] You can define a function parse_webpage(webpage_data), which takes as input the WebpageData data structure and outputs a dictionary KeyInfo containing key information:

[0087] function parse_webpage(webpage_data):

[0088]

[0089] Among them, extract_product_type(webpage_data), extract_price(webpage_data) and extract_quatity(webpage_data) extract the corresponding information from the web page data according to the predefined parsing rules.

[0090] In order to improve the parsing efficiency, parallel processing is used to divide the acquired web page data into blocks and start multiple parsing threads for processing at the same time. Assume that M parsing threads are started and each thread processes N / M web page data blocks. Then the execution process of the i-th thread can be described as:

[0091] for j=(i-1)*N / M+1to i*N / M:

[0092] webpage_data=get_webpage_data(j)

[0093] key_info=parse_webpage(webpage_data)

[0094] store key_info

[0095] Finally, the key information extracted by each thread will be aggregated to form a complete KeyInfo set.

[0096] The specific implementation of step S30 is as follows:

[0097] GPU parallel computing is used to extract features from the extracted key information and obtain feature vectors. First, the extracted key information, such as plastic particle types, transaction prices, transaction quantities, etc., is converted into numerical feature values. Let the set of these feature values ​​be X = {x1, x2, ..., x d}, where d is the total number of features.

[0098] Then, we will take advantage of GPU parallel computing to perform feature engineering on these eigenvalues. Specifically, we will first standardize or normalize the eigenvalues ​​to make them comparable:

[0099]

[0100] Among them, μ i and σ i are the mean and standard deviation of the ith feature, respectively.

[0101] Next, the standardized eigenvalues ​​X′={x1′,x2′,...,x d ′}Execute the principal component analysis (PCA) algorithm to reduce the high-dimensional feature space to k dimensions:

[0102] Y=W T X′

[0103] Where W = {w1,w2,...,w k} are the k principal components learned by the PCA algorithm, Y={y1,y2,...,y k} is the feature vector after dimensionality reduction.

[0104] Finally, these feature values ​​Y processed by feature engineering will be assembled into a k-dimensional feature vector for subsequent classification tasks. The advantage of using GPU parallel computing is that it can greatly improve the speed and efficiency of feature extraction, which is especially important when processing large-scale data.

[0105] The specific implementation of step S40 is as follows:

[0106] Perform a preliminary classification of the feature vectors and assign them to different candidate categories. First, several candidate categories are predefined according to business needs, such as: plastic particle types, transaction price ranges, transaction quantity ranges, etc. Let the set of these candidate categories be C = {c1, c2, ..., c n}, where n is the number of candidate categories.

[0107] Then, some common machine learning classification algorithms, such as k-nearest neighbor algorithm, decision tree algorithm, naive Bayes algorithm, etc., will be used to preliminarily classify the extracted feature vector Y. The purpose of this preliminary classification is to quickly divide the feature vector into the corresponding candidate category to provide a basis for subsequent evidence collection and reasoning.

[0108] Assuming that the k-nearest neighbor algorithm is chosen, its core formula is:

[0109]

[0110] Among them, N k (Y,c i ) means that the k nearest neighbors all belong to category c, with feature vector Y as the center. i Neighborhood, is the indicator function. In this way, the feature vector can be quickly divided into the corresponding candidate categories.

[0111] In order to improve the accuracy of classification, the hyperparameters of the classification algorithm, such as the value of k, will be tuned, and cross-validation will be used to select the optimal classification model.

[0112] The specific implementation of step S50 is as follows:

[0113] For each candidate category, facts or feature data supporting the category are selected from the extracted key information based on preset rules as evidence. i ∈C, formulate corresponding evidence collection rules R i These rules typically include:

[0114] 1. Identify keywords or patterns related to the category;

[0115] 2. Extract data matching keywords or patterns as evidence;

[0116] 3. Conduct a preliminary credibility assessment of the evidence and filter out evidence that is obviously irrelevant or of low credibility.

[0117] Assume E i Represents the candidate category c i The relevant evidence data set can be expressed as follows:

[0118] E i ={e|e∈KeyInfo,esatisfies R i}

[0119] Among them, KeyInfo is the key information set extracted in the above step S20.

[0120] For example, for the candidate category c "Plastic Particle Price Range" p , we can formulate the following evidence collection rules R p :

[0121] 1. Identify keywords related to "price";

[0122] 2. Extract data that meets the price pattern (such as "price:$\d+.?\d*") as evidence;

[0123] 3. Evaluate the credibility of the evidence data, such as considering factors such as price fluctuations and the authority of the source website.

[0124] In this way, a set of supporting evidence data Ei can be collected for each candidate category.

[0125] The specific implementation of step S60 is as follows:

[0126] Load these evidences into the GPU memory, start multiple CUDA streams, the number of CUDA streams is equal to the number of candidate categories, and load each candidate category and its evidence into the corresponding CUDA stream.

[0127] First, the evidence data E collected above will be i , i=1,2,...,n, are all loaded into the GPU memory. Assuming the total capacity of the GPU memory is M, it is necessary to reasonably distribute these evidence data:

[0128]

[0129] Among them, |E i | represents the size of the evidence dataset for the i-th candidate category.

[0130] Then, a CUDA stream is started for each candidate category, and the number of CUDA streams is equal to the number of candidate categories n. Each CUDA stream i will independently load the corresponding candidate category c i Its evidence data E i , prepare for the subsequent parallel reasoning.

[0131] In this way, the advantages of GPU can be fully utilized, while ensuring that the calculations between different candidate categories do not interfere with each other, thereby improving the overall processing efficiency.

[0132] The specific implementation of step S70 is as follows:

[0133] Each CUDA stream divides the evidence of the corresponding candidate category into blocks and evenly distributes them to the thread grid; if all evidence blocks cannot be accommodated at once, they are submitted batch by batch using batch processing.

[0134] First, each CUDA stream loads the evidence data E into the GPU memory. i , divided into blocks according to certain rules. Assuming the size of each evidence data block is b, the total number of evidence blocks is The size of b can be dynamically adjusted according to the hardware characteristics of the GPU and the characteristics of the evidence data to maximize the parallel computing capabilities of the GPU.

[0135] Next, the program will evenly distribute these evidence blocks to the GPU thread grid. Assuming that the GPU thread grid contains g threads, each thread needs to process A piece of evidence.

[0136] If all evidence blocks cannot be accommodated at a time, the program will use batch processing to submit the evidence blocks to the GPU for processing in multiple batches. Specifically, a batch size p can be set, and only p evidence blocks are processed each time until all evidence blocks are processed.

[0137] This block and batch processing method can maximize the parallel computing capabilities of the GPU and improve overall processing efficiency.

[0138] The specific implementation of step S80 is as follows:

[0139] Each thread uses the corresponding evidence block to perform layer-by-layer reasoning until the final classification result and its confidence are obtained, forming a complete chain of evidence.

[0140] First, each thread will perform logical reasoning based on the evidence blocks assigned to it and the predefined reasoning rules. You can define a function infer(E,c), which takes as input the evidence set E of a candidate category c and outputs the classification result of the category and its confidence.

[0141]

[0142] The specific implementation of this inference function infer(E,c) can be based on the Bayesian formula, considering the reliability, relevance, quantity and other factors of the evidence, and calculate the classification result. and its confidence

[0143]

[0144] Among them, P(E|c) is the probability of evidence E appearing in category c, P(c) is the prior probability of category c, and P(E) is the probability of evidence E appearing. Through this step-by-step reasoning method, each thread will eventually obtain a classification result of a candidate category and the corresponding confidence level.

[0145] At the same time, the reasoning process of each thread will form a complete chain of evidence, providing a basis for subsequent decision-making.

[0146] The specific implementation of step S90 is as follows:

[0147] When the confidence of the chain of evidence is higher than the preset confidence threshold, it is confirmed that information needs to be collected, and the corresponding web page data is crawled through the web crawler program, and then cleaned, formatted and standardized before storage.

[0148] First, a reasonable confidence threshold θ is set, for example θ = 0.8.

[0149] When the inference result of a candidate category, its confidence When this threshold θ is exceeded, the program will determine that the classification result of this category is reliable and further relevant information needs to be collected.

[0150] Next, the program will start the web crawler again to crawl the corresponding web page data for the confirmed classification results. Let the set of newly crawled web page data be W, and the following formula can be used to describe this process:

[0151]

[0152] That is, only when the confidence of a candidate category exceeds the threshold θ, the web page data corresponding to this category will be crawled.

[0153] These newly crawled data W will be cleaned, formatted and standardized to remove useless information and unify the data format for easy subsequent storage and use. Specifically, the following data processing functions can be defined:

[0154] function process_data(webpage_data):

[0155] clean_data=remove_noise(webpage_data)

[0156] formatted_data=format_data(clean_data)

[0157] standardized_data=standardize_data(formatted_data)

[0158] return standardized_data

[0159] Among them, remove_noise(webpage_data) is used to remove useless information from webpage data, format_data(clean_data) is used to unify the data format, and standardize_data(formatted_data) is used to standardize the data.

[0160] Finally, the processed data will be stored persistently for business personnel to query and analyze.

[0161] Specifically, the principle of the present invention is:

[0162] 1. Parallel crawling of web page data. In view of the large number of plastic trading websites that need to be collected, the present invention adopts multi-threading or coroutine technology to realize the parallel crawling of data from these websites. Each thread or coroutine is responsible for accessing and obtaining data from a website, which not only greatly improves the overall data acquisition speed, but also effectively avoids the problem of being prohibited from access by the website.

[0163] 2. Intelligent analysis of key information. When analyzing the acquired web page data, the present invention adopts a parallel processing method and introduces more intelligent and robust data analysis algorithms. These algorithms can not only accurately identify key information in the web page structure, but also conduct in-depth semantic level analysis of the extracted data, thereby greatly reducing the information extraction deviation caused by differences in page structure.

[0164] 3. Classification based on multi-evidence reasoning. For the extracted key information, the present invention does not simply rely on a single rule or machine learning model for classification, but adopts a method based on multi-evidence reasoning. Specifically, for each candidate category, various supporting evidence data will be collected, and in-depth layer-by-layer reasoning will be carried out based on factors such as the credibility and relevance of these evidences, and finally a robust and reliable classification result will be obtained. This method greatly improves the accuracy and credibility of information filtering.

[0165] 4. Give full play to the parallel computing capabilities of GPU. In order to further improve the efficiency and performance of the entire acquisition process, the present invention fully utilizes the parallel computing advantages of GPU. In key links such as feature extraction, evidence collection, and evidence reasoning, GPU acceleration is adopted, which greatly improves the computing speed and ensures that different computing tasks do not interfere with each other.

[0166] 5. Real-time monitoring and instant collection. Different from the existing periodic crawling method, the web crawler system of the present invention realizes continuous monitoring of trading websites. Once reliable new information is found, targeted data collection is immediately started, which greatly shortens the delay of information update.

[0167] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for automatically collecting plastic particle transaction information, characterized in that: The following steps are involved: S10, using a preset web crawler program and multi-threading or coroutine technology to continuously and parallelly obtain web page data from multiple plastic trading websites; S20, parsing the acquired web page data to extract key information; S30, using GPU parallel computing to extract features of the key information to obtain a feature vector; S40, preliminarily classify the feature vectors and assign them to different candidate categories; S50, for each candidate category, selecting facts or feature data supporting the category from the extracted key information as evidence based on preset rules; S60, loading the evidence into the GPU memory, starting multiple CUDA streams, the number of which is equal to the number of candidate categories, and loading each candidate category and its evidence into a corresponding CUDA stream; S70, each CUDA stream divides the evidence corresponding to the candidate category into blocks and evenly distributes them to the thread grid; if all the evidence blocks cannot be accommodated at one time, batch processing is adopted to submit them one by one; S80, each thread uses the corresponding evidence block to perform layer-by-layer reasoning until the final classification result and its confidence are obtained, forming a complete chain of evidence; S90. When the confidence of the chain of evidence is higher than the preset confidence threshold, it is confirmed that information needs to be collected, and the corresponding web page data is crawled through the web crawler program, and then cleaned, formatted and standardized before storage.

2. The method for automatically collecting plastic particle transaction information according to claim 1, characterized in that: The method for obtaining web page data of multiple plastic trading websites is to crawl the data of plastic trading websites that support the third-party data crawling protocol.

3. The method for automatically collecting plastic particle transaction information according to claim 1, characterized in that: Key information includes plastic particle types, transaction prices, and transaction quantities.

4. The method for automatically collecting plastic particle transaction information according to claim 1, characterized in that: The method for extracting features from the key information is to convert the key information into a feature vector in numerical form.

5. The method for automatically collecting plastic particle transaction information according to claim 1, characterized in that: The method for preliminarily classifying the feature vectors is to obtain manual classification results or to classify the feature vectors using a machine learning classification algorithm.

6. The method for automatically collecting plastic particle transaction information according to claim 1, characterized in that: The calculation of the confidence is based on the reliability and relevance of the evidence used.

7. The method for automatically collecting plastic particle transaction information according to claim 1, characterized in that: The preset confidence threshold is 75% to 95%.

8. The method for automatically collecting plastic particle transaction information according to claim 7, characterized in that: The preset confidence threshold is 80%.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, which, when executed, are used to execute the method for automatically collecting plastic particle transaction information as described in any one of claims 1 to 8.

10. A plastic particle transaction information automatic collection system, characterized in that: A computer-readable storage medium comprising the computer-readable storage medium of claim 9.