Adaptive network data acquisition method
Through browser loading and image recognition technology combined with NOSQL database and GPT system, it solves the problems of in-depth data correlation analysis and event prediction of traditional web crawlers, realizes the avoidance of automatic adaptation and anti-grabbing technology, and provides efficient network data acquisition. method.
Patent Information
- Application Number
- CN202410678771.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional web crawlers are difficult to perform in-depth data correlation analysis and cannot effectively predict future events. At the same time, they need to frequently update the code to adapt to changes in the website structure, and there are problems with website anti-scraping.
Use browser loading to obtain web page information, use OpenCV for text recognition and image processing, combine NOSQL database and GPT system for data analysis and prediction, obtain data correlation through correlation and hidden Markov chain analysis, and use graphical representation Provide results.
It realizes in-depth data correlation analysis and event prediction, avoids the use of website anti-grabbing technology, and meets the needs of automatic adaptation of network data acquisition and direct browser acquisition of data.
Smart Images

Figure CN118708792A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of adaptive network data acquisition, and in particular relates to an adaptive network data acquisition method. Background Art
[0002] With the advent of the big data era, people's demand for data is becoming more and more urgent. The public data on the Internet and the website revision are relatively frequent. For example, many websites are revised every ten to fifteen days. Generally, each revision requires rewriting the code to adapt to its web page structure.
[0003] The current mainstream web crawler technology for acquiring data is mainly divided into the following steps: 1. Select a web crawler framework and design a web crawler thread pool and memory pool; 2. Set up access proxies and access message headers to solve the problem of website anti-theft; 3. Find the corresponding node labels in the web page and parse the content of the node labels; 4. Clean the parsed data; 5. Save the cleaned data to the database for analysis and processing.
[0004] In traditional web crawlers, a web crawler system needs to be developed independently for each website to parse the website data. Traditional data statistics and analysis techniques are used in the parsing process, which cannot dig out the deep correlation of the data.
[0005] Therefore, it is necessary to provide a new adaptive network data acquisition method to solve the above technical problems. Summary of the invention
[0006] The technical problem solved by the present invention is to provide a method that solves the problem that traditional web crawlers cannot perform deep data correlation analysis and solves the problem of predicting subsequent events through currently acquired data. At the same time, the present invention can also avoid acquiring content by acquiring tags through graphics and direct data acquisition, thereby satisfying the automatic adaptation of network data acquisition and acquiring data through direct browsers, avoiding the adaptive network data acquisition method of website anti-piracy technology.
[0007] To solve the above technical problems, the present invention provides an adaptive network data acquisition method comprising the following steps: S1. When acquiring website data, directly acquiring web page information by loading with a browser, and loading the web page information into an adaptive network data acquisition application;
[0008] S2. Use the OpenCV image recognition algorithm to identify the text information of the current web page, and record the identified text information and text coordinate information;
[0009] S3. Recognize text information in the required web page through OpenCV, obtain the required text information, and then download the web page data through the se l en i um component, and obtain the position of the downloaded text in the web page node by comparing the downloaded text and the text recognized by OpenCV;
[0010] S4. By using the correlation principle, the label corresponding to the identified text and the data in the label of the same level are identified and obtained, thereby obtaining the required data;
[0011] S5. If the required data is numeric data, short word data, and keyword data, the title and data corresponding to the data will be directly saved in the key-value pair through the NOSQL database;
[0012] S6. If it is a long text and the content needs to be analyzed, then the long text needs to be summarized through the GPT system and the final summary information needs to be saved in the NOSQL database;
[0013] S7. If it is audio or video data, it is necessary to convert the audio or video data into text, and finally perform summary statistics on the converted text through the GPT system and save the summary information into the NOSQL database;
[0014] S8. Finally, the obtained data is analyzed, and the correlation of relevant information is expressed through the correlation coefficient through word frequency analysis and word correlation analysis.
[0015] S9. Perform hidden Markov chain analysis on correlation data to predict the stock price or the probability of an event;
[0016] S10. Through different graphic presentations, the analyzed data is statistically analyzed to allow customers to obtain the desired data results.
[0017] As a further solution of the present invention, when the text information and text coordinate information identified in step S2 are recorded, if the current information is not on the page, it is necessary to control the mouse click event to make the browser display the required web page.
[0018] As a further solution of the present invention, the specific form in which the relevance of the relevant information in step S8 is expressed by the correlation coefficient is as follows:
[0019] (1) If the current stock price is rising, then analyze the word frequency information and word relevance information in all texts;
[0020] (2) Obtain the correlation coefficient between stock price increases and certain implicit data. If there is a long-term strong correlation, then we believe that the two sets of data are related.
[0021] As a further solution of the present invention, the step S10 performs statistics on the analyzed data through different graphic representation forms, including scatter plots, correlation graphs, line graphs and box plots.
[0022] As a further solution of the present invention, the web page information is directly obtained by loading it in a browser, thereby avoiding website anti-piracy technology.
[0023] As a further solution of the present invention, the OpenCV is an image processing library, and the NOSQL is a non-relational database.
[0024] Compared with the related art, the adaptive network data acquisition method provided by the present invention has the following beneficial effects:
[0025] 1. The present invention solves the problem that traditional web crawlers cannot perform deep data correlation analysis and solves the problem of predicting subsequent events through currently acquired data. At the same time, the present invention can also avoid acquiring content by acquiring tags through graphics and direct data acquisition, thus satisfying the automatic adaptation of network data acquisition and acquiring data through direct browsers, avoiding website anti-piracy technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0027] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0028] Please refer to Figure 1 ,in, Figure 1 A method for obtaining adaptive network data includes the following steps:
[0029] S1. When acquiring website data, the web page information is directly acquired by loading the browser, and the web page information is loaded into the adaptive network data acquisition application;
[0030] S2. Use the OpenCV image recognition algorithm to identify the text information of the current web page, and record the identified text information and text coordinate information. If the current information is not on the page, it is necessary to control the mouse click event to let the browser display the required web page;
[0031] S3. Recognize text information in the required web page through OpenCV, obtain the required text information, and then download the web page data through the se l en i um component, and obtain the position of the downloaded text in the web page node by comparing the downloaded text and the text recognized by OpenCV;
[0032] S4. By using the correlation principle, the label corresponding to the identified text and the data in the label of the same level are identified and obtained, thereby obtaining the required data;
[0033] S5. If the required data is numeric data, short word data, and keyword data, the title and data corresponding to the data will be directly saved in the key-value pair through the NOSQL database;
[0034] S6. If it is a long text and the content needs to be analyzed, then the long text needs to be summarized through the GPT system and the final summary information needs to be saved in the NOSQL database;
[0035] S7. If it is audio or video data, it is necessary to convert the audio or video data into text, and finally perform summary statistics on the converted text through the GPT system and save the summary information into the NOSQL database;
[0036] S8. Finally, we analyze the acquired data and express the correlation of relevant information through the correlation coefficient through word frequency analysis and word correlation analysis. For example, if the current stock price rises, we analyze the word frequency information and word correlation information in all texts to obtain the correlation coefficient between the stock price rise and some implicit data. If there is a long-term strong correlation, we believe that the two sets of data are correlated.
[0037] S9. Perform hidden Markov chain analysis on correlation data to predict the stock price or the probability of an event;
[0038] S10. Through different graphic representations, the analyzed data is statistically analyzed, such as scatter plots, correlation plots, line graphs, and box plots, so that customers can obtain the desired data results.
[0039] The method of directly acquiring web page information by loading with a browser can avoid website anti-piracy technology.
[0040] The OpenCV is an image processing library, and the NOSQL is a non-relational database.
[0041] The present invention solves the problem that traditional web crawlers cannot perform deep data correlation analysis and solves the problem of predicting subsequent events through currently acquired data. At the same time, the present invention can also avoid acquiring content by acquiring tags through graphics and direct data acquisition, thus satisfying the automatic adaptation of network data acquisition and acquiring data through direct browsers, avoiding website anti-piracy technology.
[0042] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. An adaptive network data acquisition method, characterized in that: The following steps are involved: S1. When acquiring website data, the web page information is directly acquired by loading the browser, and the web page information is loaded into the adaptive network data acquisition application; S2. Use the OpenCV image recognition algorithm to identify the text information of the current web page, and record the identified text information and text coordinate information; S3. Recognize text information in the required web page through OpenCV to obtain the required text information, then download the web page data through the selenium component, and obtain the position of the downloaded text in the web page node by comparing the downloaded text with the text recognized by OpenCV; S4. By using the correlation principle, the label corresponding to the identified text and the data in the label of the same level are identified and obtained, thereby obtaining the required data; S5. If the required data is numeric data, short word data, and keyword data, the title and data corresponding to the data will be directly saved into a key-value pair through the NOSQL database; S6. If it is a long text and the content needs to be analyzed, then the long text needs to be summarized through the GPT system and the final summary information needs to be saved in the NOSQL database; S7. If it is audio or video data, it is necessary to convert the audio or video data into text, and finally perform summary statistics on the converted text through the GPT system and save the summary information into the NOSQL database; S8. Finally, the obtained data is analyzed, and the correlation of relevant information is expressed through the correlation coefficient through word frequency analysis and word correlation analysis. S9. Perform hidden Markov chain analysis on correlation data to predict the stock price or the probability of an event; S10. Through different graphic presentations, the analyzed data is statistically analyzed to allow customers to obtain the desired data results.
2. The method for acquiring adaptive network data according to claim 1, characterized in that: When recording the text information and text coordinate information identified in step S2, if the current information is not on the page, it is necessary to control the mouse click event to make the browser display the required web page.
3. The adaptive network data acquisition method according to claim 1, characterized in that: The specific form in which the relevance of the relevant information in step S8 is expressed by the correlation coefficient is as follows: (1) If the current stock price is rising, then analyze the word frequency information and word relevance information in all texts; (2) Obtain the correlation coefficient between stock price increases and certain implicit data. If there is a long-term strong correlation, then we believe that the two sets of data are related.
4. The adaptive network data acquisition method according to claim 1, characterized in that: The step S10 performs statistics on the analyzed data through different graphic representation forms, including scatter plots, correlation graphs, line graphs and box plots.
5. The adaptive network data acquisition method according to claim 1, characterized in that: The method of directly acquiring web page information by loading with a browser can avoid website anti-piracy technology.
6. The adaptive network data acquisition method according to claim 1, characterized in that: The OpenCV is an image processing library, and the NOSQL is a non-relational database.
