A product information collection method, a collection system, and a storage medium of an enterprise

By using an automated product information collection method, which utilizes the BERT word vector model and the BiLSTM model, the problem of low efficiency and poor accuracy in manually acquiring enterprise product information has been solved. This method achieves efficient and accurate enterprise product information collection, adapts to different website data structures, and reduces labor costs.

CN118364162BActive Publication Date: 2026-11-24DATA SPACE RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410467698.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-18
Publication Date
2026-11-24
Estimated Expiration
2044-04-18

AI Technical Summary

Technical Problem

In existing technologies, manually obtaining enterprise product information from online data sources is inefficient, inaccurate, highly susceptible to personal factors and search engine ranking, and requires a large amount of manpower.

Method used

An automated product information collection method is adopted. By acquiring page source code data, parsing and cleaning it to form standard data, a training set is built to pre-train the product information collection module. Text feature extraction is performed using BERT word vector model and BiLSTM model. Combined with conditional gradient random field and Viterbi algorithm, the structured data is automatically labeled and output.

Benefits of technology

It enables efficient and accurate automatic collection of enterprise product information from online data sources, reducing manual intervention, improving collection efficiency and accuracy, adapting to different website data structures, and reducing time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364162B_ABST
    Figure CN118364162B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of information acquisition technology, and particularly relates to a method, system, and storage medium for acquiring product information from enterprises. The product information acquisition method includes: S1, acquiring page source code data containing the target enterprise; S2, parsing and cleaning the page source code data to form corresponding standard data and storing it in a first database; S3, extracting several standard data entries from the first database, manually annotating them to construct a training set, and using the training set to pre-train the product information acquisition module; S4, using the pre-trained product information acquisition module to acquire the target enterprise's product information based on the standard data in the first database, and storing the target enterprise's product information in a second database. This invention can efficiently and accurately acquire enterprise product information, reducing labor costs during the acquisition process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information acquisition technology, and in particular relates to a method, acquisition system and storage medium for acquiring product information of an enterprise. Background Technology

[0002] With the rapid development of society and information technology, in the operation of an enterprise, whether it is listing competitors when making market plans or purchasing necessary consumables, there is an increasing tendency to obtain product information through the vast data source of the Internet.

[0003] In existing technologies, it is common practice to manually search for products using keywords and then manually extract the required product information from the search results.

[0004] However, keyword searches can only filter out a portion of completely irrelevant information, yet the search results remain vast. Limited by different search engines, some results are not displayed in descending order of relevance, impacting the efficiency of subsequent manual refinement and becoming time-consuming and labor-intensive. Furthermore, the complex data structure and presentation of search results, including not only company profiles from official websites and financial news, but also product descriptions from shopping websites, further reduces the efficiency of manual refinement. The accuracy and completeness of manual refinement are also affected by individual factors. Therefore, there is an urgent need for a method that can efficiently and accurately extract product information from online data sources. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for enterprises to collect product information, which can efficiently and accurately obtain product information from network data sources and reduce labor costs.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A method for collecting product information for an enterprise includes the following steps:

[0008] S1, retrieve the page source code data containing the target company;

[0009] S2, after parsing and cleaning the page source code data, forms the corresponding standard data and stores it in the first database;

[0010] S3. Extract several standard data from the first database, and construct a training set by manually labeling the tag set corresponding to each standard data. Use the training set to pre-train the product information collection module.

[0011] S4. After obtaining the corresponding tag set based on the standard data in the first database using the pre-trained product information collection module, each piece of standard data is bound to the corresponding tag set and input into the product information output module. The product information output module outputs the target company's product information contained in each piece of standard data according to the tag set and stores the target company's product information in the second database.

[0012] Preferably, S1 further includes the following sub-steps:

[0013] S11, obtain the target URL containing the target company, and store it in the web page request module in the order of obtaining the target URL to form a URL sequence; record each target URL in the URL sequence as the main target URL;

[0014] S12, the web page request module sends a request body to the server of the main target URL in the URL sequence according to the set collection frequency, and the main target URL server returns the corresponding response body to the web page request module.

[0015] S13, the web page request module determines whether the current request is successful based on the status code contained in the response body. If successful, it collects the page source code data in the current main target URL through the web crawler. Otherwise, the web page request module records the reason for the failure of the current request in the log based on the status code in the current response body, updates the request header in the request body according to the reason for the failure of the current request, and sends the new request body to the server of the current main target URL to make another request.

[0016] Preferably, S13 is followed by S14:

[0017] S14, after collecting the page source code data in the current main target URL, if the current page source code data contains subpage links and the remaining collection depth N0 of the current main target URL is greater than 0, the web page request module sends a request body to the server of the subpage link contained in the current page source code data. After the request is successful, the web page request module collects the page source code data of the corresponding subpage link. If the page source code data in the current main target URL does not contain subpage links, and / or the remaining collection depth N0 of the current main target URL is 0, then return to S12, and the web page request module sends a request body to the server of the subpage link contained in the current page source code data. The server of the next primary target URL in the target URL sequence sends a request body to make a request, where the remaining collection depth N0 of the primary target URL is a non-negative integer. After collecting the page source code data of the current subpage link, if the page source code data of the current subpage link still contains a next-level subpage link, the web page request module calculates the remaining collection depth N of the current subpage link: N = N0 - n, where N0 is the remaining collection depth N0 of the primary target URL corresponding to the current subpage link, and n represents the depth used. n starts from 1 and increases by 1 for each level of subpage link.

[0018] If the current subpage link's page source code data does not contain any subpage links, and / or the remaining collection depth N of the current subpage link is 0, then return to S12. The web page request module sends a request body to the server of the next main target URL in the main target URL sequence. If the remaining collection depth N of the current subpage link is greater than 0, then the web page request module sends a request body to the server of the next-level subpage link contained in the current subpage link's page source code data. After the request is successful, the corresponding next-level subpage link's page source code data is collected, and S14 is repeated until the remaining collection depth N of the current subpage link is 0, and / or the current subpage link's page source code data does not contain any new subpage links, then return to S12.

[0019] Preferably, S2 further includes the following sub-steps:

[0020] S21, the web page request module sends the collected page source code data into the data parsing module for parsing and processing to obtain unstructured data; one URL corresponds to one page source code data, and one page source code data corresponds to one piece of unstructured data;

[0021] S22, after the data parsing module extracts the corresponding text data and hyperlinks from each piece of unstructured data, the data parsing module cleans the text data and forms standard data corresponding to each piece of unstructured data, which is then stored in the first database.

[0022] Preferably, S3 further includes the following sub-steps:

[0023] S31, after extracting x standard data from the first database, extract the text data from these x standard data and unify the length of each text data to L, forming a text dataset D: D = {D1,...,D...} t ,...,D x}, where D t Let x represent the t-th text data in the text dataset D, where 1 ≤ t ≤ x and t and x are both positive integers;

[0024] S32, After manually labeling the entity labels of each character in all text data in the text dataset D, a corresponding label set Y is formed: Y = {Y1, ..., Y...} t ,...,Y x},

[0025] Where 1 ≤ t ≤ x and t and x are both positive integers, Y t This represents the t-th label set in the training set Y, which is also the t-th text data D in the text dataset D. t The corresponding set of manually labeled tags,

[0026] Y t ={y (t,1) ,...,y (t,i) ,...,y (t,L)},

[0027] Where 1 ≤ i ≤ L and i and L are both positive integers, y (t,i) Represents the label set Y t The entity tag of the i-th character in the text includes BP, IP and O, where BP indicates that the current character is at the beginning of the current product entity keyword, IP indicates that the current character is not at the beginning of the current product entity keyword, and O indicates that the current character does not belong to any product entity keyword;

[0028] S33, use the text dataset D and the corresponding label set Y as the training set to pre-train the product information collection module.

[0029] Preferably, step S33 further includes the following sub-steps:

[0030] S331, the text dataset D and the corresponding label set Y are fed into the BERT word vector model in the product information collection module for pre-training. The BERT word vector model is used to perform one-hot encoding on the characters of each text data in the text dataset D, and then the one-hot encoding is mapped to the character embedding space. The BERT word vector model outputs the character feature vector corresponding to each text data in the text dataset D:

[0031] Ft =BERT(D t )={F (t,1) ,...,F (t,i) ,...,F (t,L)},

[0032] Among them, BERT(D t ) represents the t-th text data D in the text dataset D, as defined by the BERT word vector model. t Transform into the corresponding character feature vector sequence F t F (t,i) Represents the character feature vector sequence F t The feature value in the i-th dimension, i.e., the text data D t The character feature vector corresponding to the i-th character in the string, where 1 ≤ i ≤ L and i and L are both positive integers. H represents the dimension of the text data;

[0033] S332, then input the character feature vector sequence corresponding to each text data in the text dataset D into the BiLSTM model in the product information acquisition module, and concatenate the outputs of the two directions in the BiLSTM model to obtain the global features of each text data:

[0034]

[0035] Among them, Q t Represents the character feature vector sequence F t The global feature is that `concat` represents a concatenation operation. This indicates the forward propagation of LSTM. This indicates the backpropagation of the LSTM;

[0036] S333 maps the global features of each text data point to the label space through the feedforward neural network (FW) within the product information acquisition module, forming corresponding label feature vectors:

[0037] V t =FW(Q t ),

[0038] Among them, V t Represents text data D t global features Q t The label feature vector is generated by the feedforward neural network (FW) mapping;

[0039] S334: Input the label feature vectors of each text data obtained in S333 and the label set Y into the conditional gradient random field in the product information acquisition module to train the conditional gradient random field and obtain the label probability matrix of each label feature vector.

[0040]

[0041]

[0042] P(y|V t ) represents the label feature vector V t The label probability matrix, Z(V) t ) represents the label feature vector V t The normalization factor is f[·], where f[·] represents the first characteristic function of the conditional gradient random field, and g[·] represents the second characteristic function of the conditional gradient random field. Both f[·] and g[·] are binary functions, meaning they take the value 1 if the characteristic conditions of the characteristic functions are met, and 0 otherwise. λ represents the first training parameter matrix, and η represents the second training parameter matrix. T Let η be the transpose of the first training parameter matrix. T Let represent the transpose of the second training parameter matrix, where 1≤t≤x, 1≤j≤L, and t, x, j, and L are all positive integers;

[0043] S335, within the product information acquisition module, the probability matrix of each label is decoded and calculated using the Viterbi algorithm. After obtaining the label set of the text data corresponding to each label probability matrix, the loss function L of the product information acquisition module is calculated based on the label set Y.

[0044]

[0045] Among them, y (t,j) Represents the label set Y t The entity label of the j-th character in Y t This represents the t-th label set in the training set Y, which is also the t-th text data D in the text dataset D. t The product information collection module will collect text data D. t The label feature vector V t The corresponding label probability matrix P(y|V) t The set of tags obtained by performing decoding calculations is denoted as . That is, a set of tags The label of the j-th character in the text is

[0046] S336 utilizes the Adam optimization algorithm to optimize the network parameters of each model within the product information collection module based on the loss function Loss, until the loss function Loss converges.

[0047] Preferably, step S4 further includes the following sub-steps:

[0048] S41, input the standard data stored in the first database into the pre-trained product information collection module. The product information collection module binds the tag set corresponding to the text data in each standard data and the hyperlink in each standard data and then inputs it into the product information output module.

[0049] S42, the product information output module outputs the target company's product information contained in each text according to the tag set corresponding to each text data, and stores it in the second database in the form of structured data together with the corresponding hyperlinks.

[0050] Preferably, when there is no target company and the goal is only to understand the product market, steps 1 through 4 are included before S1:

[0051] Step 1: Obtain the source code data of the page containing the target product;

[0052] Step 2: After parsing and cleaning the page source code data, the corresponding standard data is generated and stored in a third database;

[0053] Step 3: Extract several standard data points from the third database, manually label them, construct a training set, and use the training set to pre-train the enterprise information output module;

[0054] Step 4: Use the pre-trained enterprise information output module to collect enterprise information based on the standard data in the third database, and store the collected enterprise information in the fourth database. Use the enterprise information stored in the fourth database as the target enterprise, and execute S1 to S4 to collect the enterprise's product information.

[0055] This invention also provides a product information collection system for enterprises, comprising:

[0056] The system comprises a webpage request module, a data parsing module, a product information collection module, a product information output module, a first database, and a second database. The webpage request module retrieves the target company's page source code data and sends it to the data parsing module. The data parsing module parses and cleans the page source code data to form corresponding standard data, which is then stored in the first database. The product information collection module, based on the standard data in the first database, outputs a set of tags corresponding to the standard data and sends the tag set to the product information output module. The product information output module outputs the target company's product information based on the tag set and stores it in the second database. Each module and database is programmed or configured to execute the steps of a product information collection method for an enterprise as described above.

[0057] The present invention also provides a computer-readable storage medium storing a computer program programmed or configured to perform the above-described method for collecting product information of an enterprise.

[0058] The beneficial effects of this invention are as follows:

[0059] (1) The product information collection method of the present invention only requires manual annotation of the data in the training set during the pre-training process of the product information collection module; after the product information collection module is trained, no manual intervention is required. The present invention can automatically obtain the product information of the target enterprise from the huge network data source, saving a lot of manpower.

[0060] (2) Data from online data sources is complex. Manually collecting product information from target companies by searching keywords is still a huge workload and is affected by the ranking of search results from different search engines, making the manual extraction of product information inefficient, time-consuming, and labor-intensive. Furthermore, the accuracy of manually collected product information is greatly affected by individual factors. In contrast, this invention does not need to consider the ranking of search results from different search engines. It uses a unified standard and a specified collection depth to obtain text data from the target company's page source code data. Then, a pre-trained product information collection module is used to tag the text data, and finally, the target company's product information is output based on the tag annotations. There is no need to formulate different collection rules for different websites, resulting in a high degree of universality. In other words, this invention can quickly and efficiently collect product information from massive online data sources with high accuracy, saving a lot of time and costs.

[0061] (3) In the product information collection module of this invention, the trained BERT word vector model can understand the semantic information of text data, thus eliminating noisy data and more accurately capturing and extracting product information of target enterprises, and precisely determining product entity keywords. At the same time, this invention also leverages the powerful capabilities of the BERT word vector model to achieve a universal and efficient target enterprise product information collection process based on neural networks. It can identify the product information data of the target enterprise that needs to be collected, adapt to the data structure of different websites, and greatly improve the efficiency and adaptability of web crawlers in collecting page source code data, maintaining continuous crawling of product information data of target enterprises. This adaptability and flexibility make web crawlers more robust and reliable.

[0062] (4) The product information of the target enterprise collected by the present invention is stored in the second database in the form of structured data. The product information is highly consistent, which provides a solid foundation for subsequent market research, market analysis, market layout and market mining. Attached Figure Description

[0063] Figure 1 This is a flowchart illustrating a method for collecting product information from an enterprise, as described in this invention. Detailed Implementation

[0064] To make the technical solution of the present invention clearer and more explicit, the present invention will be clearly and completely described below with reference to the accompanying drawings. Solutions derived by those skilled in the art through equivalent substitution and conventional reasoning of the technical features of the present invention without creative effort all fall within the protection scope of the present invention.

[0065] like Figure 1 The diagram shows a flowchart of a method for collecting product information of an enterprise according to the present invention. Taking the acquisition of product information of a target enterprise as an example, the method includes the following steps:

[0066] S1, retrieve the page source code data containing the target company;

[0067] S2, after parsing and cleaning the page source code data, forms the corresponding standard data and stores it in the first database;

[0068] S3. Extract several standard data from the first database, and construct a training set by manually labeling the tag set corresponding to each standard data. Use the training set to pre-train the product information collection module.

[0069] S4. After obtaining the corresponding tag set based on the standard data in the first database using the pre-trained product information collection module, each piece of standard data is bound to the corresponding tag set and input into the product information output module. The product information output module outputs the target company's product information contained in each piece of standard data according to the tag set and stores the target company's product information in the second database.

[0070] S1 also includes the following sub-steps:

[0071] S11, obtain the target URL containing the target company, and store it in the web page request module in the order of obtaining the target URL to form a URL sequence; record each target URL in the URL sequence as the main target URL;

[0072] S12, the web page request module sends a request body to the server of the main target URL in the URL sequence according to the set collection frequency, and the main target URL server returns the corresponding response body to the web page request module.

[0073] S13, the web page request module determines whether the current request is successful based on the status code contained in the response body. If successful, it collects the page source code data in the current main target URL through the web crawler. Otherwise, the web page request module records the reason for the failure of the current request in the log based on the status code in the current response body, updates the request header in the request body according to the reason for the failure of the current request, and sends the new request body to the server of the current main target URL to make another request.

[0074] The status code in the response body not only indicates whether the current request was successful, but also contains the identifier corresponding to the reason why the current request failed.

[0075] Optionally, S14 may be included after S13:

[0076] S14, after collecting the page source code data in the current main target URL, if the current page source code data contains subpage links and the remaining collection depth N0 of the current main target URL is greater than 0, the web page request module sends a request body to the server of the subpage link contained in the current page source code data to make a request. After the request is successful, the page source code data of the corresponding subpage link is collected. If the page source code data in the current main target URL does not contain subpage links, and / or the remaining collection depth N0 of the current main target URL is 0, then return to S12, and the web page request module sends a request body to the server of the next main target URL in the main target URL sequence to make a request, where the remaining collection depth N0 of the main target URL is a non-negative integer.

[0077] Similarly, after the web page request module collects the page source code data of the current subpage link, if the page source code data of the current subpage link also contains links to the next level subpage, then it calculates the remaining collection depth N of the current subpage link:

[0078] N = N0 - n, where N0 is the remaining crawling depth of the main target URL corresponding to the current subpage link, and n represents the depth used. n starts from 1 and increases by 1 for each level of subpage link.

[0079] If the current subpage link's page source code data does not contain any subpage links, and / or the remaining collection depth N of the current subpage link is 0, then return to S12. The web page request module sends a request body to the server of the next main target URL in the main target URL sequence. If the remaining collection depth N of the current subpage link is greater than 0, then the web page request module sends a request body to the server of the next-level subpage link contained in the current subpage link's page source code data. After the request is successful, the corresponding next-level subpage link's page source code data is collected, and S14 is repeated until the remaining collection depth N of the current subpage link is 0, and / or the current subpage link's page source code data does not contain any new subpage links, then return to S12.

[0080] To prevent unlimited collection of page source code data from lower-level subpages, a unified remaining collection depth N0 for the main target URL is usually pre-set in the web page request module. In this embodiment, N0 = 3. That is, when the remaining collection depth N0 = 3 for a main target URL, the remaining collection depth N = N0 - n = 3 - 1 = 2 for the subpage links (i.e., first-level subpages) contained in the source code data of this main target URL; if the current subpage link (i.e., the first-level subpage) also contains the next-level subpage link (i.e., the second-level subpage), then the remaining collection depth N = N0 - n = 3 - 2 = 1; similarly, the remaining collection depth N = N0 - n = 3 - 3 = 0 for the third-level subpage. Therefore, after the web page request module successfully collects the source code data of the third-level subpage links of the current main target URL, regardless of whether the source code data of the third-level subpage links contains new subpage links, the web page request module will not continue to collect downwards, but will return to S12 and send a request body to the server of the next main target URL in the main target URL sequence.

[0081] Optionally, in S13, if the web page request module has made m consecutive requests to the current main target URL and all requests have failed, the web page request module sends a request body to the server of the next main target URL in the current main target URL sequence, and at the same time, the web page request module moves the current main target URL to the end of the current URL sequence.

[0082] In this embodiment, m=5, meaning the web page request module uses an asynchronous crawling method. When a request is blocked, the next request will be executed asynchronously, and the problematic request will be placed at the end of the URL sequence and executed later.

[0083] S2 includes the following sub-steps:

[0084] S21, the web page request module sends the collected page source code data into the data parsing module for parsing and processing to obtain unstructured data; one URL corresponds to one page source code data, and one page source code data corresponds to one piece of unstructured data.

[0085] The data parsing module uses BeautifulSoup selectors to parse and process the webpage source code data.

[0086] S22, after the data parsing module extracts the corresponding text data and hyperlinks from each piece of unstructured data, the data parsing module cleans the text data and forms standard data corresponding to each piece of unstructured data, which is then stored in the first database.

[0087] Optionally, the data parsing module has anomaly capture and logging functions. It can capture all anomalies that occur within the data parsing module, record the causes of the anomalies in the log, analyze the logs, and provide feedback to technical personnel. This facilitates timely adjustments to the parsing and cleaning rules within the data parsing module and the collection rules of the web page request module.

[0088] In S22, text data cleaning includes removing HTML tags, removing spaces, removing line breaks, removing punctuation marks at the beginning and end, removing special characters, word segmentation, and stop words.

[0089] Optionally, the first database includes a data ingestion unit. This unit has an exception handling function, capable of capturing all possible exceptions during the storage of cleaned text data and hyperlinks into the first database. If an error occurs during ingestion, a rollback operation is performed and a notification is issued. The data ingestion unit also includes a logging function, which records the cause of the error and the ingested data at the time of the error when an error is captured. The data ingestion unit also includes an error retry function, i.e., if the current text data and hyperlinks experience a consecutive ingestion exceptions (a times), the data ingestion unit moves the current text data and hyperlinks to the end of the text data and hyperlinks to be stored, waiting for subsequent retry ingestion operations.

[0090] In this embodiment, a = 8.

[0091] S3 also includes the following sub-steps:

[0092] S31, after extracting x standard data from the first database, extract the text data from these x standard data and standardize the length of each text data to form a text dataset D: D = {D1,...,D...} t ,...,D x}, where D t Let x represent the t-th text data in the text dataset D, where 1 ≤ t ≤ x and t and x are both positive integers.

[0093] In S31, after setting the character length of each text data to L, missing characters in text data with a character length less than L are padded with 0s, and characters exceeding the length are truncated for text data with a character length greater than L.

[0094] S32, After manually labeling the entity labels of each character in all text data in the text dataset D, a corresponding label set Y is formed: Y = {Y1, ..., Y...} t ,...,Y x},

[0095] Where 1 ≤ t ≤ x and t and x are both positive integers, Y tThis represents the t-th label set in the training set Y, which is also the t-th text data D in the text dataset D. t The corresponding set of manually labeled tags,

[0096] Y t ={y (t,1) ,...,y (t,i) ,...,y (t,L)},

[0097] Where 1 ≤ i ≤ L and i and L are both positive integers, y (t,i) Represents the label set Y t The entity tag of the i-th character in the list includes BP, IP, and O. BP indicates that the current character is at the beginning of the current product entity keyword, IP indicates that the current character is not at the beginning of the current product entity keyword, and O indicates that the current character does not belong to any product entity keyword.

[0098] In this embodiment, 5,000 standard data entries are extracted from the first database, which means that 5,000 text data entries are manually annotated.

[0099] An example illustrating the annotation process:

[0100] Such as text data D t For the title "Ruineng Product Selection Manual, About Us, Ruineng provides customers with an industry-leading full range of bipolar power semiconductor products, including thyristor rectifiers, power diodes, silicon carbide, etc.", the corresponding tag set after the label is Y. t (That is, the annotation result) is {Rui: O, Energy: O, Product: O, Selection: O, Type: O, Hand: O, Register: O, Rui: O, Energy: O, Product: O, Product: O, Selection: O, Type: O, Hand: O, Register: O, About: O, I: O, We: O, Rui: O, Energy: O, For: O, Customer: O, Customer: O, Provide: O, Supply: O, Industry: O, Leader: O, First: O, of:} O, All: O, System: O, Bipolar: O, Electrode: O, Power: O, Rate: O, Semi-polar: O, Conductor: O, Body: O, Product: O, Goods: O, Package: O, Includes: O, Can: BP, Control: IP, Silicon: IP, Rectifier: IP, Current: IP, Device: IP, , : O, Power: BP, Rate: IP, Diode: IP, Electrode: IP, , : O, Carbon: BP, Chemical: IP, Silicon: IP, etc: O, . : O}.

[0101] S33, use the text dataset D and the corresponding label set Y as the training set to pre-train the product information collection module.

[0102] S33 also includes the following sub-steps:

[0103] S331, the text dataset D and the corresponding label set Y are fed into the BERT word vector model in the product information collection module for pre-training. The BERT word vector model is used to perform one-hot encoding on the characters of each text data in the text dataset D, and then the one-hot encoding is mapped to the character embedding space. The BERT word vector model outputs the character feature vector corresponding to each text data in the text dataset D:

[0104] F t =BERT(D t )={F (t,1) ,...,F (t,i) ,...,F (t,L)},

[0105] Among them, BERT(D t ) represents the t-th text data D in the text dataset D, as defined by the BERT word vector model. t Transform into the corresponding character feature vector sequence F t F (t,i) Represents the character feature vector sequence F t The feature value in the i-th dimension, i.e., the text data D t The character feature vector corresponding to the i-th character in the string, where 1 ≤ i ≤ L and i and L are both positive integers. H represents the dimension of the text data;

[0106] S332, then input the character feature vector sequence corresponding to each text data in the text dataset D into the BiLSTM model in the product information acquisition module, and concatenate the outputs of the two directions in the BiLSTM model to obtain the global features of each text data:

[0107]

[0108] Among them, Q t Represents the character feature vector sequence F t The global feature is that `concat` represents a concatenation operation. This indicates the forward propagation of LSTM. This indicates the backpropagation of the LSTM.

[0109] After being represented by the BERT word vector model, the data is then input into the BiLSTM model to obtain the global features of each text data, thus constructing a global context network.

[0110] S333 maps the global features of each text data point to the label space through the feedforward neural network (FW) within the product information acquisition module, forming corresponding label feature vectors:

[0111] V t =FW(Q t ),

[0112] Among them, V t Represents text data D t global features Q t The label feature vector is generated by the feedforward neural network (FW) mapping;

[0113] S334: Input the label feature vectors of each text data obtained in S333 and the label set Y into the conditional gradient random field in the product information acquisition module to train the conditional gradient random field and obtain the label probability matrix of each label feature vector.

[0114]

[0115]

[0116] P(y|V t ) represents the label feature vector V t The label probability matrix, Z(V) t ) represents the label feature vector V t The normalization factor is f[·], where f[·] represents the first characteristic function of the conditional gradient random field, and g[·] represents the second characteristic function of the conditional gradient random field. Both f[·] and g[·] are binary functions, meaning they take the value 1 if the characteristic conditions of the characteristic functions are met, and 0 otherwise. λ represents the first training parameter matrix, and η represents the second training parameter matrix. T Let η be the transpose of the first training parameter matrix. T Let represent the transpose of the second training parameter matrix, where 1≤t≤x, 1≤j≤L, and t, x, j, and L are all positive integers.

[0117] Conditional gradient random fields and their two characteristic functions are existing technologies.

[0118] The Conditional Gradient Random Field (CFR) generates corresponding label probability matrices based on each label feature vector. The product information acquisition module then decodes these probability matrices to obtain the corresponding label sets. After training, the accuracy of the label probability matrices obtained by the CFR is significantly improved; that is, the label set corresponding to the global features of a text data point, after decoding the label probability matrix obtained from the trained CFR, should be very close to the label annotation results verified manually. Therefore, in S334, the label feature vectors and label set Y are input into the CFR to train it to learn the relationship between the label feature vectors of each text data point and the corresponding label sets in label set Y. This improves the accuracy of the label probability matrices obtained based on the label feature vectors, ensuring highly accurate product information output during subsequent formal product information output.

[0119] S335, within the product information acquisition module, the probability matrix of each label is decoded and calculated using the Viterbi algorithm. After obtaining the label set of the text data corresponding to each label probability matrix, the loss function Loss of the product information acquisition module is calculated based on the label set Y.

[0120]

[0121] Among them, y (t,j) Represents the label set Y t The entity tag of the j-th character in the text.

[0122] Y t This represents the t-th label set in the training set Y, which is also the t-th text data D in the text dataset D. t ,

[0123] The product information collection module will be compared with text data D. t The label feature vector V t The corresponding label probability matrix P(y|V) t The set of tags obtained by performing decoding calculations is denoted as . That is, a collection of tags The label of the j-th character in the text is

[0124] S336 utilizes the Adam optimization algorithm to optimize the network parameters of each model within the product information collection module based on the loss function L until the loss function L converges, thus obtaining the model with optimal parameters. This optimizes the entire product information collection module and improves the accuracy of the entire module in predicting the entity labels corresponding to each character in each piece of text data.

[0125] S4 also includes the following sub-steps:

[0126] S41, input the standard data stored in the first database into the pre-trained product information collection module. The product information collection module binds the tag set corresponding to the text data in each standard data and the hyperlink in each standard data and then inputs it into the product information output module.

[0127] S42, the product information output module outputs the target company's product information contained in each text according to the tag set corresponding to each text data, and stores it in the second database in the form of structured data together with the corresponding hyperlinks.

[0128] In S42, the second database is a relational database. The structured data stored within it includes three fields: company, url, and products. The company field contains company name data, the url field contains hyperlinks and company website addresses, and the products field contains company product data. The company field is defined as a unique index for the second database, thus establishing its index information. Technical personnel can directly retrieve all product information under the target company by indexing it in the second database.

[0129] Table 1 shows a comparison between the product information collection method of this invention and manual product information collection:

[0130] Table 1:

[0131]

[0132] As can be seen from Table 1, the product information collection method of the present invention not only significantly improves the accuracy of the collected product information and greatly improves the collection efficiency compared with manual collection, but also automatically collects product information throughout the entire process by only knowing the target company, without the need for manpower, thus greatly reducing labor costs.

[0133] The product information collection method for enterprises according to the present invention can also be used for market research and market layout: when there is no target enterprise and only the desire to understand the market for a certain product is desired, steps 1 to 4 are included before S1:

[0134] Step 1: Obtain the source code data of the page containing the target product;

[0135] Step 2: After parsing and cleaning the page source code data, the corresponding standard data is generated and stored in a third database;

[0136] Step 3: Extract several standard data points from the third database, manually label them, construct a training set, and use the training set to pre-train the enterprise information output module;

[0137] Step 4: Use the pre-trained enterprise information output module to collect enterprise information based on the standard data in the third database, and store the collected enterprise information in the fourth database. Use the enterprise information stored in the fourth database as the target enterprise, and execute S1 to S4 to collect the enterprise's product information.

[0138] Steps 1 through 4 are similar to those in S1 through S4 and their sub-steps, so they will not be repeated here.

[0139] The present invention provides a method for collecting product information of an enterprise. During the pre-training process of the product information collection module, only manual annotation of the data in the training set is required. After the product information collection module is trained, no manual intervention is needed. The present invention can automatically obtain the product information of the target enterprise from a vast network data source, saving a lot of manpower.

[0140] Data from online data sources is often complex. Manually collecting product information from target companies by searching keywords is still a massive undertaking, and is further hampered by the ranking of search results from different search engines, making the manual extraction of product information inefficient, time-consuming, and labor-intensive. Furthermore, the accuracy of manually collected product information is significantly affected by individual factors. This invention, however, eliminates the need to consider the ranking of search results from different search engines. It uses a unified standard and a specified collection depth to obtain text data from the target company's page source code. A pre-trained product information collection module then tags the text data, ultimately outputting the target company's product information based on these tags. This eliminates the need to develop different collection rules for different websites, resulting in high versatility. In short, this invention can quickly and efficiently collect highly accurate product information from massive online data sources, saving significant time and costs.

[0141] In the product information collection module of this invention, the trained BERT word vector model can understand the semantic information of text data, thus eliminating noisy data and more accurately capturing and extracting product information from target companies, precisely identifying product entity keywords. Simultaneously, this invention leverages the powerful capabilities of the BERT word vector model to achieve a universal and efficient target company product information collection process based on neural networks. It can identify the product information data of the target company to be collected, adapt to the data structures of different websites, greatly improving the efficiency and adaptability of web crawlers in collecting page source code data, and maintaining continuous crawling of target company product information data. This adaptability and flexibility make the web crawler more robust and reliable.

[0142] The product information of the target companies ultimately collected by this invention is stored in the second database in the form of structured data. The product information is highly consistent, which provides a solid foundation for subsequent market research, market analysis, market layout and market exploration.

[0143] This invention also provides a product information collection system for enterprises, comprising:

[0144] Webpage request module, data parsing module, product information collection module, product information output module, first database, second database.

[0145] The webpage request module is used to obtain the target company's page source code data and then send it to the data parsing module;

[0146] The data parsing module is used to parse and clean the page source code data and then store the corresponding standard data in the first database;

[0147] The product information collection module, based on the standard data in the first database, outputs a set of tags corresponding to the standard data and sends the tag set to the product information output module;

[0148] The product information output module outputs the target company's product information based on the tag set and stores it in the second database;

[0149] Each module and library is programmed or configured to perform the steps of one of the enterprise's product information collection methods described above.

[0150] The present invention also provides a computer-readable storage medium storing a computer program programmed or configured to perform the above-described method for collecting product information of an enterprise.

[0151] The technologies, shapes, and structures not described in detail in this invention are all known technologies.

Claims

1. A method for collecting product information from an enterprise, characterized in that, Includes the following steps: S1, retrieve the page source code data containing the target company; S2, after parsing and cleaning the page source code data, forms the corresponding standard data and stores it in the first database; S3. Extract several standard data from the first database, and construct a training set by manually labeling the tag set corresponding to each standard data. Use the training set to pre-train the product information collection module. S4. After obtaining the corresponding tag set based on the standard data in the first database using the pre-trained product information collection module, each piece of standard data is bound to the corresponding tag set and input into the product information output module. The product information output module outputs the target company's product information contained in each piece of standard data according to the tag set and stores the target company's product information in the second database. S3 specifically includes the following sub-steps: S31, after extracting x standard data from the first database, extract the text data from these x standard data and unify the length of each text data to L, forming a text dataset D: D={D1,...,D...} t ,...,D x }, where D t Let x represent the t-th text data in the text dataset D, where 1 ≤ t ≤ x and t and x are both positive integers; S32, After manually labeling the entity labels of each character in all text data in the text dataset D, a corresponding label set Y is formed: Y={Y1,...,Y...} t ,...,Y x }, Where 1 ≤ t ≤ x and t and x are both positive integers, Y t This represents the t-th label set in the training set Y, which is also the t-th text data D in the text dataset D. t The corresponding set of manually labeled tags, AND t ={and (t,1) ,...,and (t,i) ,...,and (t,L) }, Where 1 ≤ i ≤ L and i and L are both positive integers, y (t,i) Represents the label set Y t The entity tag of the i-th character in the text includes BP, IP and O, where BP indicates that the current character is at the beginning of the current product entity keyword, IP indicates that the current character is not at the beginning of the current product entity keyword, and O indicates that the current character does not belong to any product entity keyword; S33, use the text dataset D and the corresponding label set Y as the training set, and use the training set to pre-train the product information collection module; S33 also includes the following sub-steps: S331, the text dataset D and the corresponding label set Y are fed into the BERT word vector model in the product information collection module for pre-training. The BERT word vector model is used to perform one-hot encoding on the characters of each text data in the text dataset D, and then the one-hot encoding is mapped to the character embedding space. The BERT word vector model outputs the character feature vector corresponding to each text data in the text dataset D: F t =BERT(D t )={F (t,1) ,...,F (t,i) ,...,F (t,L) }, Among them, BERT(D t ) represents the t-th text data D in the text dataset D, as defined by the BERT word vector model. t Transform into the corresponding character feature vector sequence F t F (t,i) Represents the character feature vector sequence F t The feature value in the i-th dimension, i.e., the text data D t The character feature vector corresponding to the i-th character in the array, where 1 ≤ i ≤ L and i and L are both positive integers, F t ∈ H represents the dimension of the text data; S332, then input the character feature vector sequence corresponding to each text data in the text dataset D into the BiLSTM model in the product information acquisition module, and concatenate the outputs of the two directions in the BiLSTM model to obtain the global features of each text data: , Among them, Q t Represents the character feature vector sequence F t The global feature is that `concat` represents a concatenation operation. This indicates the forward propagation of LSTM. This indicates the backpropagation of the LSTM; S333 maps the global features of each text data point to the label space through the feedforward neural network (FW) within the product information acquisition module, forming corresponding label feature vectors: V t =FW( ), Among them, V t Represents text data D t global features Q t The label feature vector is generated by the feedforward neural network (FW) mapping; S334: Input the label feature vectors of each text data obtained in S333 and the label set Y into the conditional gradient random field in the product information acquisition module to train the conditional gradient random field and obtain the label probability matrix of each label feature vector. (y|V t )= , (V t )= , (y|V t ) represents the label feature vector V t The label probability matrix, (V t ) represents the label feature vector V t The normalization factor, f[ ] represents the first characteristic function of the conditional gradient random field, g[ ] represents the second characteristic function of the conditional gradient random field, f[ ] and g[ All are binary functions, meaning they take the value 1 if the characteristic condition of the characteristic function is met, and 0 otherwise. Represents the first training parameter matrix. This represents the second training parameter matrix. Denotes the transpose of the first training parameter matrix. Let represent the transpose of the second training parameter matrix, where 1≤t≤x, 1≤j≤L, and t, x, j, and L are all positive integers; S335, within the product information acquisition module, the probability matrix of each label is decoded and calculated using the Viterbi algorithm. After obtaining the label set of the text data corresponding to each label probability matrix, the loss function L of the product information acquisition module is calculated based on the label set Y. L=- , Among them, y (t,j) Represents the label set Y t The entity label of the j-th character in Y t This represents the t-th label set in the training set Y, which is also the t-th text data D in the text dataset D. t The product information collection module will collect text data D. t The label feature vector V t The corresponding label probability matrix (y|V t The set of tags obtained by performing decoding calculations is denoted as . That is, a set of tags The label of the j-th character in the text is ; S336 utilizes the Adam optimization algorithm to optimize the network parameters of each model within the product information collection module based on the loss function Loss, until the loss function Loss converges.

2. The method for collecting product information of an enterprise according to claim 1, characterized in that, S1 specifically includes the following sub-steps: S11, obtain the target URL containing the target company, and store it in the web page request module in the order of obtaining the target URL to form a URL sequence; record each target URL in the URL sequence as the main target URL; S12, the web page request module sends a request body to the server of the main target URL in the URL sequence according to the set collection frequency, and the main target URL server returns the corresponding response body to the web page request module. S13, the web page request module determines whether the current request is successful based on the status code contained in the response body. If successful, it collects the page source code data in the current main target URL through the web crawler. Otherwise, the web page request module records the reason for the failure of the current request in the log based on the status code in the current response body, updates the request header in the request body according to the reason for the failure of the current request, and sends the new request body to the server of the current main target URL to make another request.

3. The method for collecting product information of an enterprise according to claim 2, characterized in that, S13 is followed by S14: S14, after the web page request module collects the page source code data in the current main target URL, if the current page source code data contains subpage links and the remaining collection depth N0 of the current main target URL is greater than 0, the web page request module sends a request body to the subpage link server contained in the current page source code data to make a request, and collects the page source code data of the corresponding subpage link after the request is successful. If the page source code data in the current main target URL does not contain subpage links, and / or the remaining collection depth N0 of the current main target URL is 0, then return to S12, and the web page request module sends a request body to the server of the next main target URL in the main target URL sequence to make a request, where the remaining collection depth N0 of the main target URL is a non-negative integer; After collecting the page source code data of the current subpage link, if the page source code data of the current subpage link also contains links to the next level subpage, the webpage request module calculates the remaining collection depth N of the current subpage link: N = N0 - n, where N0 is the remaining crawling depth of the main target URL corresponding to the current subpage link, and n represents the depth already used. n starts from 1 and increases by 1 for each level of the subpage link. If the current subpage link's page source code data does not contain any subpage links, and / or the remaining collection depth N of the current subpage link is 0, then return to S12. The web page request module sends a request body to the server of the next main target URL in the main target URL sequence. If the remaining collection depth N of the current subpage link is greater than 0, then the web page request module sends a request body to the server of the next-level subpage link contained in the current subpage link's page source code data. After the request is successful, the corresponding next-level subpage link's page source code data is collected, and S14 is repeated until the remaining collection depth N of the current subpage link is 0, and / or the current subpage link's page source code data does not contain any new subpage links, then return to S12.

4. The method for collecting product information of an enterprise according to claim 1, characterized in that, S2 specifically includes the following sub-steps: S21, the web page request module sends the collected page source code data into the data parsing module for parsing and processing to obtain unstructured data; one URL corresponds to one page source code data, and one page source code data corresponds to one piece of unstructured data; S22, after the data parsing module extracts the corresponding text data and hyperlinks from each piece of unstructured data, the data parsing module cleans the text data and forms standard data corresponding to each piece of unstructured data, which is then stored in the first database.

5. A method for collecting product information of an enterprise as described in claim 1, characterized in that, S4 also includes the following sub-steps: S41, input the standard data stored in the first database into the pre-trained product information collection module. The product information collection module binds the tag set corresponding to the text data in each standard data and the hyperlink in each standard data and then inputs it into the product information output module. S42, the product information output module outputs the target company's product information contained in each text according to the tag set corresponding to each text data, and stores it in the second database in the form of structured data together with the corresponding hyperlinks.

6. The method for collecting product information of an enterprise as described in claim 1, characterized in that, When there is no target company and the goal is simply to understand the product market, steps 1 through 4 are included before S1: Step 1: Obtain the source code data of the page containing the target product; Step 2: After parsing and cleaning the page source code data, the corresponding standard data is generated and stored in a third database; Step 3: Extract several standard data points from the third database, manually label them, construct a training set, and use the training set to pre-train the enterprise information output module; Step 4: Use the pre-trained enterprise information output module to collect enterprise information based on the standard data in the third database, and store the collected enterprise information in the fourth database. Use the enterprise information stored in the fourth database as the target enterprise, and execute S1 to S4 to collect the enterprise's product information.

7. A product information collection system for an enterprise, characterized in that, include: Webpage request module, data parsing module, product information collection module, product information output module, first database, second database. The webpage request module is used to obtain the target company's page source code data and then send it to the data parsing module; The data parsing module is used to parse and clean the page source code data and then store the corresponding standard data in the first database; The product information collection module, based on the standard data in the first database, outputs a set of tags corresponding to the standard data and sends the tag set to the product information output module; The product information output module outputs the target company's product information based on the tag set and stores it in the second database; Each module and library is programmed or configured to perform the steps of a product information collection method for an enterprise as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that is programmed or configured to perform a product information collection method for an enterprise as described in any one of claims 1-6.