Enterprise competitiveness analysis method and device, electronic equipment and storage medium
The recurrent neural network model predicts the target enterprise's next cycle index data in enterprise competitiveness analysis, and solves the problem of low accuracy of analysis results in the existing technology, real-time and accurate competitiveness analysis is achieved. The generated view data includes the current , history and predictive indicators to support efficient decision-making.
Patent Information
- Application Number
- CN202411061442.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-20
AI Technical Summary
The existing technology lacks real-time data processing and analysis capabilities in enterprise competitiveness analysis, resulting in low accuracy of analysis results, mainly relying on pre-stored data, and the association relationship in the data cannot be accurately obtained.
By obtaining the target enterprise's current cycle enterprise report data, market report data and operational activity data, using the recurrent neural network model to predict the indicator data for the next cycle, generate view data including current, historical and predictive indicator data, and improve the real-time analysis Sex and accuracy.
It has achieved real-time and accuracy improvement in enterprise competitiveness analysis, and can predict it in combination with historical data. The generated view data improves the accuracy of data analysis and supports faster and more accurate decision-making.
Smart Images

Figure CN119168443A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to a method, device, electronic device and storage medium for analyzing enterprise competitiveness. Background Art
[0002] In the prior art, data mining methods are used to analyze corporate competitiveness. This technical solution mainly includes four steps: (1) Data collection: collect relevant information from multiple sources and store it in a data center library; (2) Data screening: extract original data from the data center library and retain only data that meets the preset conditions. Through screening, the scope of processed data is reduced and data processing efficiency is improved; (3) Data analysis: use the automatic classification technology of TRS (Text Retrieval System) to classify data using predefined classification templates; (4) automatically rearrange text through feature extraction and similarity calculation of text content, set a similarity threshold of 85% for content rearrangement, use association mining models to analyze competitors, evaluate and publish data, and decide on subsequent operations based on feedback.
[0003] Existing technologies mainly rely on data pre-stored in data centers, lack the ability to process and analyze real-time data streams, and mainly focus on descriptive analysis and association rules. They are unable to accurately obtain the association relationships in the data, resulting in low accuracy of the analysis results. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for analyzing enterprise competitiveness, which help to improve the real-time and accuracy of the analysis.
[0005] In order to solve the above problems, in a first aspect, an embodiment of the present application provides a method for analyzing enterprise competitiveness, including:
[0006] Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current cycle;
[0007] Extracting current indicator data from the enterprise report data, the market report data and the operational activity data, wherein the current indicator data includes financial indicator data, market indicator data and operational indicator data in a current period;
[0008] Input the current indicator data and the first historical indicator data into a recurrent neural network model, and predict the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model; the first historical indicator data is the indicator data of each historical cycle of a first preset number of consecutive historical cycles of the target enterprise before the current cycle;
[0009] View data including the current indicator data, the first historical indicator data, and the predicted indicator data are generated.
[0010] Optionally, extracting current indicator data from the enterprise report data, the market report data, and the operational activity data includes:
[0011] Perform data cleaning on the enterprise report data, market report data and operational activity data through the Pandas library;
[0012] The financial indicator data is extracted from the enterprise report data after data cleaning, the market indicator data is extracted from the market report data after data cleaning, and the operation indicator data is extracted from the operation activity data after data cleaning.
[0013] Optionally, the training process of the recurrent neural network model includes:
[0014] Obtain historical enterprise report data, historical market report data and historical operational activity data of each enterprise;
[0015] For each of the enterprises, extracting second historical indicator data of the enterprise in each historical period from the historical enterprise report data, the historical market report data and the historical operation activity data;
[0016] Determine the second historical indicator data of a second preset number of consecutive historical periods from the second historical indicator data of the enterprise in each historical period as sample input data, and use the second historical indicator data of a historical period after the second preset number of consecutive historical periods as labeled data of the sample input data, to obtain a data set including the sample input data and the labeled data; the second preset number is the sum of the first preset number and the number 1;
[0017] Dividing the data set into a training set and a test set;
[0018] According to the training set, the initial recurrent neural network model is iteratively trained according to training rounds and training batches until the training end condition is met, thereby obtaining a trained recurrent neural network model;
[0019] The trained recurrent neural network model is evaluated according to the test set. When the evaluation index does not meet the preset conditions, the training and evaluation operations are iteratively performed until the evaluation index meets the preset conditions, thereby obtaining a trained recurrent neural network model.
[0020] Optionally, the iterative training of the initial recurrent neural network model according to the training set, according to training rounds and training batches, until a training end condition is met, to obtain a trained recurrent neural network model, includes:
[0021] When performing training in the current training round and the current training batch, inputting sample input data in the current training batch in the training set into the initial recurrent neural network model to obtain prediction data;
[0022] Determining a cross entropy loss function value according to the predicted data and the labeled data;
[0023] According to the cross entropy loss function value, the network parameters of the initial recurrent neural network model are adjusted using the Adam optimizer;
[0024] The operations of inputting sample input data, determining the cross entropy loss function value, and adjusting the network parameters are iteratively performed on the recurrent neural network model after the network parameters are adjusted until the training end condition is met, thereby obtaining a trained recurrent neural network model.
[0025] Optionally, dividing the data set into a training set and a test set includes:
[0026] Obtaining the ratio between the amount of data in the training set to be divided and the amount of data in the test set;
[0027] According to the ratio, the data set is divided into a training set and a test set.
[0028] Optionally, the obtaining of the target enterprise's enterprise report data, market report data, and operational activity data in the current period includes:
[0029] Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current period through partner data sharing; and / or
[0030] The public data on the specified Internet is regularly crawled through the Scrapy library, the enterprise report data, market report data and operation activity data of the target enterprise in the current period are obtained from the public data, and the enterprise report data, market report data and operation activity data are exported into data in a target format through the Scrapy library.
[0031] Optionally, the financial indicator data include revenue, profit and asset-liability information, the market indicator data include market share and growth rate, and the operational indicator data include information delivery data and activity data.
[0032] In a second aspect, the embodiment of the present application provides an analysis device for enterprise competitiveness, including:
[0033] The data acquisition module is used to obtain the target enterprise's enterprise report data, market report data and operation activity data in the current cycle;
[0034] An indicator data extraction module, used to extract current indicator data from the enterprise report data, the market report data and the operation activity data, wherein the current indicator data includes financial indicator data, market indicator data and operation indicator data in a current period;
[0035] A prediction module, used for inputting the current indicator data and the first historical indicator data into a recurrent neural network model, and predicting the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model; the first historical indicator data is the indicator data of each historical cycle of a first preset number of consecutive historical cycles of the target enterprise before the current cycle;
[0036] The view data generating module is used to generate view data including the current indicator data, the first historical indicator data and the predicted indicator data.
[0037] Optionally, the indicator data extraction module includes:
[0038] A cleaning unit, used for performing data cleaning processing on the enterprise report data, market report data and operation activity data through a Pandas library;
[0039] The indicator data extraction unit is used to extract the financial indicator data from the enterprise report data after data cleaning, extract the market indicator data from the market report data after data cleaning, and extract the operation indicator data from the operation activity data after data cleaning.
[0040] Optionally, the device further includes a model training module, which is used to train the recurrent neural network model, and the model training module includes:
[0041] A historical data acquisition unit, used to acquire historical enterprise report data, historical market report data and historical operation activity data of each enterprise;
[0042] A historical indicator data extraction unit, configured to extract, for each of the enterprises, second historical indicator data of the enterprise in each historical period from the historical enterprise report data, the historical market report data and the historical operation activity data;
[0043] a data set generating unit, configured to determine, from the second historical indicator data of the enterprise in each historical period, second historical indicator data of a second preset number of consecutive historical periods as sample input data, and use the second historical indicator data of a historical period after the second preset number of consecutive historical periods as labeled data of the sample input data, to obtain a data set including the sample input data and the labeled data; the second preset number is the sum of the first preset number and the number 1;
[0044] A data set division unit, used for dividing the data set into a training set and a test set;
[0045] A model training unit, used to iteratively train the initial recurrent neural network model according to the training set, training rounds and training batches, until the training end condition is met, so as to obtain a trained recurrent neural network model;
[0046] The model evaluation and optimization unit is used to evaluate the trained recurrent neural network model according to the test set. When the evaluation index does not meet the preset conditions, the training and evaluation operations are iteratively performed until the evaluation index meets the preset conditions, thereby obtaining a trained recurrent neural network model.
[0047] Optionally, the model training unit is specifically used for:
[0048] When performing training in the current training round and the current training batch, inputting sample input data in the current training batch in the training set into the initial recurrent neural network model to obtain prediction data;
[0049] Determining a cross entropy loss function value according to the predicted data and the labeled data;
[0050] According to the cross entropy loss function value, the network parameters of the initial recurrent neural network model are adjusted using the Adam optimizer;
[0051] The operations of inputting sample input data, determining the cross entropy loss function value, and adjusting the network parameters are iteratively performed on the recurrent neural network model after the network parameters are adjusted until the training end condition is met, thereby obtaining a trained recurrent neural network model.
[0052] Optionally, the data set division unit is specifically used to:
[0053] Obtaining the ratio between the amount of data in the training set to be divided and the amount of data in the test set;
[0054] According to the ratio, the data set is divided into a training set and a test set.
[0055] Optionally, the data acquisition module is specifically used for:
[0056] Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current period through partner data sharing; and / or
[0057] The public data on the specified Internet is regularly crawled through the Scrapy library, the enterprise report data, market report data and operation activity data of the target enterprise in the current period are obtained from the public data, and the enterprise report data, market report data and operation activity data are exported into data in a target format through the Scrapy library.
[0058] Optionally, the financial indicator data include revenue, profit and asset-liability information, the market indicator data include market share and growth rate, and the operational indicator data include information delivery data and activity data.
[0059] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for analyzing the enterprise competitiveness described in the embodiment of the present application is implemented.
[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method for analyzing enterprise competitiveness disclosed in the embodiment of the present application.
[0061] The enterprise competitiveness analysis method, device, electronic device and storage medium provided in the embodiments of the present application obtain enterprise report data, market report data and operational activity data of the target enterprise in the current cycle, extract current indicator data from the enterprise report data, market report data and operational activity data, input the current indicator data and the first historical indicator data into a recurrent neural network model, predict the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model, and generate view data including the current indicator data, the first historical indicator data and the predicted indicator data. Since the data of the target enterprise in the current cycle can be obtained in real time and then analyzed, the real-time nature of the enterprise competitiveness analysis can be improved, and the indicator data of the next cycle can be predicted by combining the indicator data of the target enterprise for a first preset number of consecutive historical cycles before the current cycle. The generated view data can include the current indicator data, the historical indicator data and the predicted indicator data, which can improve the accuracy of data analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0063] Figure 1It is a flow chart of a method for analyzing enterprise competitiveness provided in an embodiment of the present application;
[0064] Figure 2 is a flow chart of the training process of the recurrent neural network model in the embodiment of the present application;
[0065] Figure 3 It is a system framework diagram of the enterprise competitiveness analysis method of the embodiment of the present application;
[0066] Figure 4 It is a structural schematic diagram of an enterprise competitiveness analysis device provided in an embodiment of the present application;
[0067] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] In the e-commerce industry, competition is fierce and market trends change rapidly. Each e-commerce company needs to understand competitors' pricing strategies, product updates, and market performance in real time in order to respond quickly. The embodiment of the present application can perform enterprise competitiveness analysis in real time to understand the development trend of the target enterprise. The specific scheme is as follows.
[0070] Figure 1 is a flow chart of a method for analyzing enterprise competitiveness provided in an embodiment of the present application, such as Figure 1 As shown, the method includes: step 110 to step 140.
[0071] Step 110, obtaining the enterprise report data, market report data and operation activity data of the target enterprise in the current cycle.
[0072] The target enterprise's public data, such as news, financial websites and other information, can be obtained regularly through a scheduled task, and the target enterprise's enterprise report data, market report data and operational activity data in the current cycle can be identified from the public data. Among them, the enterprise report data may include data such as enterprise performance reports and public financial statements, the market report data may include data such as market research reports, and the operational activity data may include activity data, information delivery data, etc. The target enterprise may be a competitor of the enterprise currently conducting market competitiveness analysis. The current cycle is the current analysis cycle, and an analysis cycle can be, for example, a pre-set duration of one hour, one day, one week, one month, etc. The scheduled time of the scheduled task can be set based on demand, for example, it can be one hour, two hours, etc., so that data analysis can be performed in real time.
[0073] Based on the real-time acquisition of enterprise report data, market report data and operational activity data, an efficient real-time data processing flow is established. This can not only collect and process data in real time, but also reduce the delay of data processing and improve the real-time response capability of the system.
[0074] In one embodiment of the present application, the step of obtaining the enterprise report data, market report data, and operation activity data of the target enterprise in the current period includes:
[0075] Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current period through partner data sharing; and / or
[0076] The public data on the specified Internet is regularly crawled through the Scrapy library, the enterprise report data, market report data and operation activity data of the target enterprise in the current period are obtained from the public data, and the enterprise report data, market report data and operation activity data are exported into data in a target format through the Scrapy library.
[0077] When the target enterprise and the enterprise currently conducting market competitiveness analysis are partners, the target enterprise's public data can be obtained through partner data sharing, and the target enterprise's corporate report data, market report data and operational activity data in the current cycle can be identified from the public data.
[0078] By using the Scrapy library in Python to automatically crawl the public data on the specified Internet (such as news, financial websites, etc.) on a regular basis, the target company's corporate report data, market report data and operational activity data in the current cycle are collected, and the corporate report data, market report data and operational activity data are exported to the target format data through the FeedExporter component of the Scrapy library to facilitate subsequent cleaning and processing. Among them, the target format can be, for example, CSV format. Scrapy is an application framework for website crawling, mainly used to crawl data on web pages. FeedExporter Scrapy's component exports the crawled data into different target formats.
[0079] Step 120, extracting current indicator data from the enterprise report data, the market report data and the operational activity data, wherein the current indicator data includes financial indicator data, market indicator data and operational indicator data in a current period.
[0080] Among them, the financial indicator data includes revenue, profit and asset-liability information, the market indicator data includes market share and growth rate, and the operation indicator data includes information delivery data and activity data.
[0081] Identify and calculate enterprise report data to obtain data on various financial indicators in the current period, such as revenue, profit, and assets and liabilities information, and obtain financial indicator data; identify and calculate market report data to obtain data on various market indicators in the current period, such as market share and growth rate, and obtain market indicator data; identify and extract operational activity data, obtain operational indicator data from operational activity data, such as information delivery data and activity data, and obtain operational indicator data.
[0082] In one embodiment of the present application, extracting current indicator data from the enterprise report data, the market report data, and the operational activity data includes:
[0083] Perform data cleaning on the enterprise report data, market report data and operational activity data through the Pandas library;
[0084] The financial indicator data is extracted from the enterprise report data after data cleaning, the market indicator data is extracted from the market report data after data cleaning, and the operation indicator data is extracted from the operation activity data after data cleaning.
[0085] Use the Pandas library to read corporate report data, market report data, and operational activity data and perform data cleaning. Use the drop_duplicates() method of Pandas to process data to remove duplicate, erroneous, and irrelevant data in corporate report data, market report data, and operational activity data. Use the to_datetime function to convert all timestamp format data, and convert data in different timestamp formats to data in the same timestamp format to ensure the consistency of time series. Use regular expressions to identify and correct common input errors, and integrate corporate report data, market report data, and operational activity data from different sources into a unified format and storage. Among them, Pandas is a Python data analysis library that provides data structures and operations for data processing and analysis.
[0086] After the enterprise report data, market report data and operational activity data are cleaned, features useful for market competitiveness analysis are extracted from the enterprise report data, market report data and operational activity data, that is, financial indicator data are extracted from the enterprise report data after data cleaning, market indicator data are extracted from the market report data after data cleaning, and operational indicator data are extracted from the operational activity data after data cleaning.
[0087] By using Pandas for efficient data processing and cleaning, you can ensure the accuracy and consistency of the data.
[0088] Step 130: input the current indicator data and the first historical indicator data into a recurrent neural network model, and predict the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model.
[0089] The first historical indicator data is the indicator data of each historical period in a first preset number of consecutive historical periods of the target enterprise before the current period. The indicator data of the historical period includes financial indicator data, market indicator data and operation indicator data in the historical period.
[0090] Obtain the target enterprise's index data for each historical period in the first preset number of consecutive historical periods before the current period to obtain the target enterprise's historical index data. Input the current index data and the target enterprise's index data for each historical period in the historical period into a recurrent neural network (RNN) model, process the current index data and the index data of each historical period through the recurrent neural network model, and predict the target enterprise's predicted index data in the next period. Among them, the predicted index data is the predicted data of each indicator, including the predicted data of financial indicators, the predicted data of market indicators, and the predicted data of operational indicators. A recurrent neural network is a type of recursive neural network that takes sequence data as input, recursively in the direction of sequence evolution, and all nodes (recurrent units) are connected in a chain. The recurrent neural network model can be, for example, an LSTM (Long Short-Term Memory) model.
[0091] Use the load_model function to load the recurrent neural network model from the storage location of the trained recurrent neural network model to ensure that the recurrent neural network model can be directly called by the scheduled task. The Celery beat scheduler sets the periodic task to ensure that the prediction task is automatically triggered every hour. Perform the above preprocessing steps on the real-time acquired data, such as data normalization, regularization and other data cleaning or encoding processing to obtain the processed current indicator data. Use the processed current indicator data and historical indicator data as the input of the recurrent neural network model, call the predict method of the recurrent neural network model for prediction, and obtain the predicted indicator data of the target enterprise in the next cycle. After obtaining the prediction results such as the predicted indicator data of the target enterprise in the next cycle, the prediction results can be stored in the database for subsequent analysis.
[0092] The load_model function is used to load the trained model. Celery is an asynchronous task queue, mainly used to process distributed tasks. The beat scheduler is a component of Celery, used to execute tasks at a scheduled time.
[0093] Step 140: Generate view data including the current indicator data, the first historical indicator data, and the predicted indicator data.
[0094] After the forecast indicator data of the target enterprise in the next period is obtained, a visualization tool such as Matplotlib can be used to generate view data including the current indicator data, the first historical indicator data and the forecast indicator data. The view data can be, for example, visualization data such as charts. After the view data is generated, a report including the view data can be generated, and then the report can be sent to the person in charge through an automated method (such as email). Among them, Matplotlib is a Python drawing library for generating charts.
[0095] The enterprise competitiveness analysis method provided in the embodiment of the present application reduces the need for manual operations and improves efficiency through an automated process of automatically acquiring data and automatically performing analysis, enabling the team to focus on higher-value tasks. Regular and timely reports provide real-time business insights for senior management, supporting faster and more accurate decision-making.
[0096] The method for analyzing enterprise competitiveness provided in the embodiment of the present application obtains enterprise report data, market report data and operational activity data of the target enterprise in the current cycle, extracts current indicator data from the enterprise report data, market report data and operational activity data, inputs the current indicator data and the first historical indicator data into a recurrent neural network model, predicts the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model, and generates view data including the current indicator data, the first historical indicator data and the predicted indicator data. Since the data of the target enterprise in the current cycle can be obtained in real time and then analyzed, the real-time nature of the enterprise competitiveness analysis can be improved, and the indicator data of the next cycle can be predicted by combining the indicator data of the target enterprise for a first preset number of consecutive historical cycles before the current cycle. The generated view data can include the current indicator data, the historical indicator data and the predicted indicator data, which can improve the accuracy of data analysis.
[0097] Figure 2 is a flow chart of the training process of the recurrent neural network model in the embodiment of the present application, such as Figure 2 As shown, the training process of the recurrent neural network model includes:
[0098] Step 210, obtaining historical enterprise report data, historical market report data and historical operation activity data of each enterprise.
[0099] Through the data sharing method of partners and the use of the Scrapy library in Python, the public data on the designated Internet (such as news, financial websites, etc.) is automatically crawled regularly, thereby collecting information data such as internal reports of each enterprise (including business operation data and historical performance reports), market research reports, public financial statements, etc., and obtaining historical enterprise report data, historical market report data and historical operation activity data of each enterprise, and then using Scrapy's FeedExporter to export the historical enterprise report data, historical market report data and historical operation activity data into data in the target format for subsequent cleaning and processing. Among them, the target format can be, for example, CSV format.
[0100] Step 220: for each of the enterprises, extract the second historical indicator data of the enterprise in each historical period from the historical enterprise report data, the historical market report data and the historical operation activity data.
[0101] The data of each enterprise is processed separately. For the enterprise currently being processed, the Pandas library is used to read historical enterprise report data, historical market report data, and historical operational activity data and perform data cleaning. The drop_duplicates() method of Pandas is used to process the data to remove duplicate, erroneous, and irrelevant data in the historical enterprise report data, historical market report data, and historical operational activity data. The to_datetime function is used to convert all data in timestamp format, and data in different timestamp formats are converted to data in the same timestamp format to ensure the consistency of the time series. Regular expressions are used to identify and correct common input errors, and historical enterprise report data, historical market report data, and historical operational activity data from different sources are integrated into a unified format and storage.
[0102] After the historical enterprise report data, historical market report data and historical operating activity data are cleaned, features useful for market competitiveness analysis are extracted from the historical enterprise report data, historical market report data and historical operating activity data, that is, the historical financial indicator data of the enterprise in each historical period is extracted from the historical enterprise report data after data cleaning, the historical market indicator data of the enterprise in each historical period is extracted from the historical market report data after data cleaning, and the historical operating indicator data of the enterprise in each historical period is extracted from the historical operating activity data after data cleaning.
[0103] Step 230, determine the second historical indicator data of a second preset number of consecutive historical periods from the second historical indicator data of the enterprise in each historical period as sample input data, and use the second historical indicator data of a historical period after the second preset number of consecutive historical periods as labeled data of the sample input data, to obtain a data set including the sample input data and the labeled data.
[0104] The second preset number is the sum of the first preset number and the number 1. This ensures that the length of the input sequence of the recurrent neural network during training is the same as the length of the input sequence during prediction.
[0105] For each enterprise, the second historical indicator data of each historical period in a second preset number of consecutive historical periods is determined from the second historical indicator data of the enterprise in each historical period, and the second historical indicator data of the second preset number of consecutive historical periods is used as sample input data for input into the recurrent neural network model, and the second historical indicator data of a historical period after the second preset number of consecutive historical periods is used as the labeled data of the sample input data to obtain a sample including the sample input data and the labeled data. For each enterprise, one or more samples can be obtained through the above processing, and all samples of all enterprises constitute a data set for training and testing the recurrent neural network.
[0106] Step 240: divide the data set into a training set and a test set.
[0107] The data set can be divided into a training set and a test set according to a certain ratio. The training set is used to train the initial recurrent neural network model. The test set is used to test and evaluate the trained recurrent neural network model.
[0108] In one embodiment of the present application, dividing the data set into a training set and a test set includes: obtaining a ratio between the amount of data in the training set to be divided and the amount of data in the test set; and dividing the data set into a training set and a test set according to the ratio.
[0109] The ratio between the data volume of the training set and the data volume of the test set can be set, so that the data set can be divided into a training set and a test set according to the ratio, so that the ratio between the data volume of the training set and the data volume of the test set after division is the set ratio.
[0110] The train_test_split function can be used to divide the data set according to the set ratio (for example, the ratio is 7:3), and the data set is divided into a training set and a test set, wherein the train_size parameter (the proportion of the training set in the data set) is set to 0.7, the test_size parameter (the proportion of the test set in the data set) is set to 0.3, and in order to ensure the reproducibility of the results, the random_state parameter is assigned a value of 42, which is used to determine the random process of dividing the data set to ensure that the results of each division are consistent. The code used in the process of dividing the data set can be: X_train, X_test, y_train, y_test = train_test_split (padded_sequences, labels, test_size = 0.3, random_state = 42), padded_sequences represents the sample input data in the data set, labels represents the labeled data in the data set, X_train represents the sample input data in the training set after division, y_train represents the labeled data in the training set after division, X_test represents the sample input data in the test set after division, and y_test represents the labeled data in the test set after division. Among them, the train_test_split function is a function of the sklearn library, which is used to split the data set into training set and test set.
[0111] Step 250, according to the training set, the initial recurrent neural network model is iteratively trained according to training rounds and training batches until the training end condition is met, thereby obtaining a trained recurrent neural network model.
[0112] According to the training rounds and training batches, the sample input data in the current training round and the current training batch in the training set are respectively input into the initial recurrent neural network model to obtain the prediction data corresponding to each sample input data. Based on the prediction data and labeled data of each sample input data, the network parameters of the initial recurrent neural network model are adjusted, and the training of the next training batch is iteratively performed until the training of the current training round is completed, and the training of the next training round and training batch is performed until the training end conditions are met to obtain the trained recurrent neural network model.
[0113] In one embodiment of the present application, the initial recurrent neural network model is iteratively trained according to the training set according to training rounds and training batches until the training end condition is met to obtain a trained recurrent neural network model, including:
[0114] When performing training in the current training round and the current training batch, inputting sample input data in the current training batch in the training set into the initial recurrent neural network model to obtain prediction data;
[0115] Determining a cross entropy loss function value according to the predicted data and the labeled data;
[0116] According to the cross entropy loss function value, the network parameters of the initial recurrent neural network model are adjusted using the Adam optimizer;
[0117] The operations of inputting sample input data, determining the cross entropy loss function value, and adjusting the network parameters are iteratively performed on the recurrent neural network model after the network parameters are adjusted until the training end condition is met, thereby obtaining a trained recurrent neural network model.
[0118] When training the current training round and the current training batch, the sample input data in the current training batch in the training set is input into the initial recurrent neural network model, the sample input data is predicted by the recurrent neural network model, and the predicted data corresponding to each sample input data is obtained, and the predicted data and the labeled data corresponding to each sample input data in the current training batch are respectively substituted into the formula of the cross entropy loss function to obtain the cross entropy loss function value, and based on the cross entropy loss function value, the network parameters of the initial recurrent neural network model are optimized and adjusted using the Adam optimizer, and the recurrent neural network model after the network parameters are adjusted is iteratively executed in each training round and training batch. The sample input data is input into the recurrent neural network model, the cross entropy loss function value is determined, and the network parameters are adjusted until the training end condition is met, and the trained recurrent neural network model is obtained. Among them, the cross entropy loss function is a loss function used for classification problems, which measures the difference between the predicted distribution and the true distribution.
[0119] The recurrent neural network model can be implemented using the TensorFlow framework, where the formula of the recurrent neural network model is: the recurrent neural network model receives the input x(t) and the hidden state h(t-1) of the previous time step, and calculates the hidden state h(t) of the current time step: h(t) = f(Wx(t) + Uh(t-1) + b), where h(t) represents the hidden state of the current time step, f is the activation function, W is the weight matrix input to the hidden state, x(t) is the tth element of the input sequence, U is the weight matrix from the hidden state to the hidden state, and b is the bias term. Among them, TensorFlow is an open source machine learning framework for building and training various machine learning models.
[0120] Start building a recurrent neural network model by defining parameters, for example, the vocabulary size (vocab_size) value is 2000, the word embedding dimension (embedding_dim) value is 23, the maximum length of the sequence (max_length) value is 42, the number of units in the RNN hidden layer (hidden_units) value is 46, the number of categories of classification tasks (categories of different data that can be processed) value (num_classes) value is 18, and the number of training rounds (num_epochs) value is 32. The code to implement the construction of a recurrent neural network model by defining parameters is:
[0121] model=tf.keras.Sequential([tf.keras.layers.Embedding(2000,23,input_length=42),tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(46,return_sequences=Tru e)),tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(46)),tf.keras.layers.Dense(18,activation='softmax')]).
[0122] Using the Adam optimization algorithm as the optimizer, cross entropy as the loss function, and accuracy as the evaluation indicator, the model parameters are updated iteratively so that the model gradually approaches the optimal solution during the training process. The formula for updating the parameters of the Adam optimization algorithm is expressed as:
[0123]
[0124] θ=θ-learning_rate*m / (sqrt(v)+ε)
[0125] Where m and v are the exponentially weighted averages of the first-order moment and second-order moment estimates (i.e., the average of the gradients), β1 and β2 are the decay rates, Represents the gradient of the loss function with respect to the network parameters, learning_rate represents the learning rate, ε represents the preset constant, which is a very small number (used to avoid division by 0 errors), and θ represents the network parameters of the recurrent neural network model. The Adam optimization algorithm is used to train the recurrent neural network model, where the parameters can be set as follows: the learning rate is 0.001, the decay rate β1 of the first-order moment estimate is 0.9, the decay rate β2 of the second-order moment estimate is 0.999, and a very small constant ε is 1e-8.
[0126] Among them, the Adam optimization algorithm is an optimization algorithm with adaptive learning rate, which is used for gradient descent. Accuracy is an indicator for evaluating the performance of classification models, indicating the proportion of samples correctly predicted by the model.
[0127] Compile the recurrent neural network model through the compile method, add the Adam-based optimizer, cross entropy as the loss function and evaluation index to the model, and the specific implementation code is as follows:
[0128] model.compile(loss='sparse_categorical_crossentropy', optimizer='adam', metrics=['accuracy']).
[0129] Use the fit method to train the recurrent neural network model. During the training process, the sample input data and the corresponding labels (i.e., labeled data) after feature encoding (digital processing, such as standardization of historical financial indicator data, digital processing of historical market indicator data, etc.) are input into the recurrent neural network model for training. The network parameters of the recurrent neural network model will be continuously updated iteratively to reduce losses and improve the prediction accuracy of the recurrent neural network model. Pass in the sample input data x_train, and the label y_train, and you can set the batch size batch_size = 32 and the number of training rounds num_epochs = 12, validation_split: validation set ratio = 0.1; the specific code implementation of this process is: model.fit(x_train, y_train, epochs = num_epochs, validation_split = 0.1). The operational details of training specific data include: first, financial indicator data (Rd1) training: features include historical financial data and related economic indicators, mainly to predict future financial performance indicators, profit margins and revenue growth, etc.; second, market indicator data (Rd2) training: features include competitors' market share, product pricing strategies and consumer feedback, etc., mainly to analyze market trends and consumer behavior patterns; third, operational indicator data (Rd3) training: features may include operational efficiency indicators, cost management data and employee performance indicators, mainly to optimize internal business processes and improve operational efficiency.
[0130] Step 260, evaluating the trained recurrent neural network model according to the test set, and when the evaluation index does not meet the preset conditions, iteratively performing the training and evaluation operations until the evaluation index meets the preset conditions, thereby obtaining a trained recurrent neural network model.
[0131] The evaluation indicators may include accuracy and / or recall.
[0132] During the training process of the recurrent neural network model, the model will update its parameters according to the settings of the optimizer and loss function, and gradually approach the optimal solution. After each training is completed, the predict method is used to predict the new data in the test set (the specific implementation code is: predictions = model.predict(test_data)), and the prediction results are evaluated. If the accuracy is lower than 85% and the recall rate is lower than 90%, reconstruction and optimization operations are performed to make the recurrent neural network model reach the optimal state.
[0133] The recurrent neural network model is used for deep learning analysis of market and competitor data. The recurrent neural network model can accurately predict market trends and changes in consumer preferences, helping companies seize market opportunities. The insights output by the model can be directly used to optimize marketing activities and product development strategies to maximize return on investment.
[0134] Figure 3 is a system framework diagram of the enterprise competitiveness analysis method of the embodiment of the present application, such as Figure 3 As shown, the enterprise competitiveness analysis method provided in the embodiment of the present application can be implemented through a data collection and cleaning module, a model classification and training module, and an automatic prediction and analysis module. Among them, the data collection and cleaning module is used to automatically collect Internet and internal data, such as internal enterprise reports, etc., and obtain high-quality data after cleaning to prepare for subsequent model training and analysis. The model classification and training module is an RNN model based on deep learning, which is used to learn and predict market dynamics and competitor behavior; the trained and optimized RNN model is used to accurately predict future trends and behavior patterns. The automatic prediction and analysis module is used to apply the trained model in real time to analyze and predict new data and generate a decision support report.
[0135] The embodiment of the present application uses the train_test_split function when training the recurrent neural network model. The ratio of the training set and the test set can be customized, and training and testing can be performed according to the actual situation of the data set, thereby improving the generalization ability of the model; the Adam optimization algorithm is used, which can automatically adjust the learning rate and improve the training efficiency of the model; the method evaluates the performance of the RNN model. If the evaluation index does not meet the preset conditions (such as the accuracy rate is lower than 85% or the recall rate is lower than 90%), reconstruction and optimization operations are performed to optimize the RNN model and train it to the optimal state, which enables the model to obtain better training results while ensuring the accuracy and recall rate; the fit function is used, and by setting parameters, the training speed and memory usage can be effectively balanced, while the advantages of matrix operations are used to optimize and accelerate the gradient descent process, better learn the complex patterns in the data, and avoid underfitting; it allows monitoring the performance of the model on unseen data during the training process, which helps to adjust the model parameters and prevent overfitting.
[0136] The optimizer and parameter update optimization in the embodiment of the present application, the Adam optimizer reduces the training time through the method of adaptive learning rate, and avoids the problem of overfitting or underfitting, making the model training more efficient and stable, and the adaptive adjustment of the learning rate enables the model to adjust the training strategy more flexibly when facing different types of data features, thereby improving the adaptability and robustness of the model. Model training and evaluation, through systematic evaluation and repeated optimization, the model can achieve high accuracy and high recall in practical applications, significantly improving the efficiency and accuracy of the decision support system, accurate model evaluation and timely optimization not only ensure the optimal performance of the model, but also help enterprises to respond quickly to changes in the fiercely competitive market and maintain competitiveness. The automatic prediction and analysis module uses Celery's beat scheduler to set periodic tasks, combined with real-time data preprocessing technology, such as data normalization, regularization and other data cleaning operations or encoding, to ensure the consistency and accuracy of data input, and can accurately predict changes in market trends and consumer preferences through the RNN model, helping enterprises seize market opportunities. Visual reports and automated reports not only provide real-time business insights, but also optimize the information delivery process, reduce decision-making delays, improve the company's ability to respond to market changes, and enable the team to focus on higher-value tasks.
[0137] Figure 4 is a schematic diagram of the structure of an analysis device for enterprise competitiveness provided in an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0138] The data acquisition module 410 is used to acquire the enterprise report data, market report data and operation activity data of the target enterprise in the current cycle;
[0139] An indicator data extraction module 420 is used to extract current indicator data from the enterprise report data, the market report data and the operation activity data, wherein the current indicator data includes financial indicator data, market indicator data and operation indicator data in a current period;
[0140] A prediction module 430 is used to input the current indicator data and the first historical indicator data into a recurrent neural network model, and predict the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model; the first historical indicator data is the indicator data of each historical cycle of a first preset number of consecutive historical cycles of the target enterprise before the current cycle;
[0141] The view data generating module 440 is used to generate view data including the current indicator data, the first historical indicator data and the predicted indicator data.
[0142] Optionally, the indicator data extraction module includes:
[0143] A cleaning unit, used for performing data cleaning processing on the enterprise report data, market report data and operation activity data through a Pandas library;
[0144] The indicator data extraction unit is used to extract the financial indicator data from the enterprise report data after data cleaning, extract the market indicator data from the market report data after data cleaning, and extract the operation indicator data from the operation activity data after data cleaning.
[0145] Optionally, the device further includes a model training module, which is used to train the recurrent neural network model, and the model training module includes:
[0146] A historical data acquisition unit, used to acquire historical enterprise report data, historical market report data and historical operation activity data of each enterprise;
[0147] A historical indicator data extraction unit, configured to extract, for each of the enterprises, second historical indicator data of the enterprise in each historical period from the historical enterprise report data, the historical market report data and the historical operation activity data;
[0148] a data set generating unit, configured to determine, from the second historical indicator data of the enterprise in each historical period, second historical indicator data of a second preset number of consecutive historical periods as sample input data, and use the second historical indicator data of a historical period after the second preset number of consecutive historical periods as labeled data of the sample input data, to obtain a data set including the sample input data and the labeled data; the second preset number is the sum of the first preset number and the number 1;
[0149] A data set division unit, used for dividing the data set into a training set and a test set;
[0150] A model training unit, used to iteratively train the initial recurrent neural network model according to the training set, training rounds and training batches, until the training end condition is met, so as to obtain a trained recurrent neural network model;
[0151] The model evaluation and optimization unit is used to evaluate the trained recurrent neural network model according to the test set. When the evaluation index does not meet the preset conditions, the training and evaluation operations are iteratively performed until the evaluation index meets the preset conditions, thereby obtaining a trained recurrent neural network model.
[0152] Optionally, the model training unit is specifically used for:
[0153] When performing training in the current training round and the current training batch, inputting sample input data in the current training batch in the training set into the initial recurrent neural network model to obtain prediction data;
[0154] Determining a cross entropy loss function value according to the predicted data and the labeled data;
[0155] According to the cross entropy loss function value, the network parameters of the initial recurrent neural network model are adjusted using the Adam optimizer;
[0156] The operations of inputting sample input data, determining the cross entropy loss function value, and adjusting the network parameters are iteratively performed on the recurrent neural network model after the network parameters are adjusted until the training end condition is met, thereby obtaining a trained recurrent neural network model.
[0157] Optionally, the data set division unit is specifically used to:
[0158] Obtaining the ratio between the amount of data in the training set to be divided and the amount of data in the test set;
[0159] According to the ratio, the data set is divided into a training set and a test set.
[0160] Optionally, the data acquisition module is specifically used for:
[0161] Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current period through partner data sharing; and / or
[0162] The public data on the specified Internet is regularly crawled through the Scrapy library, the enterprise report data, market report data and operation activity data of the target enterprise in the current period are obtained from the public data, and the enterprise report data, market report data and operation activity data are exported into data in a target format through the Scrapy library.
[0163] Optionally, the financial indicator data include revenue, profit and asset-liability information, the market indicator data include market share and growth rate, and the operational indicator data include information delivery data and activity data.
[0164] The enterprise competitiveness analysis device provided in the embodiment of the present application is used to implement the various steps of the enterprise competitiveness analysis method described in the embodiment of the present application. The specific implementation methods of each module of the device refer to the corresponding steps and will not be repeated here.
[0165] The enterprise competitiveness analysis device provided in the embodiment of the present application obtains the enterprise report data, market report data and operational activity data of the target enterprise in the current cycle, extracts current indicator data from the enterprise report data, market report data and operational activity data, inputs the current indicator data and the first historical indicator data into a recurrent neural network model, predicts the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model, and generates view data including the current indicator data, the first historical indicator data and the predicted indicator data. Since the data of the target enterprise in the current cycle can be obtained in real time and then analyzed, the real-time nature of the enterprise competitiveness analysis can be improved, and the indicator data of the next cycle can be predicted by combining the indicator data of the target enterprise for a first preset number of consecutive historical cycles before the current cycle. The generated view data can include the current indicator data, the historical indicator data and the predicted indicator data, which can improve the accuracy of data analysis.
[0166] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device 500 may include one or more processors 510 and one or more memories 520 connected to the processor 510. The electronic device 500 may also include an input interface 530 and an output interface 540 for communicating with another device or system. The program code executed by the processor 510 may be stored in the memory 520.
[0167] The processor 510 in the electronic device 500 calls the program code stored in the memory 520 to execute the enterprise competitiveness analysis method in the above embodiment.
[0168] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the enterprise competitiveness analysis method as described in the embodiment of the present application are implemented.
[0169] The embodiment of the present application also provides a computer program product, which, when executed by a processor, implements the steps of the enterprise competitiveness analysis method as described in the embodiment of the present application.
[0170] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0171] The above is a detailed introduction to an enterprise competitiveness analysis method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0172] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
Claims
1. A method for analyzing enterprise competitiveness, characterized in that: include: Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current cycle; Extracting current indicator data from the enterprise report data, the market report data and the operational activity data, wherein the current indicator data includes financial indicator data, market indicator data and operational indicator data in a current period; Input the current indicator data and the first historical indicator data into a recurrent neural network model, and predict the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model; the first historical indicator data is the indicator data of each historical cycle of a first preset number of consecutive historical cycles of the target enterprise before the current cycle; View data including the current indicator data, the first historical indicator data, and the predicted indicator data are generated.
2. The method according to claim 1, characterized in that The extracting current indicator data from the enterprise report data, the market report data and the operational activity data includes: Perform data cleaning on the enterprise report data, market report data and operational activity data through the Pandas library; The financial indicator data is extracted from the enterprise report data after data cleaning, the market indicator data is extracted from the market report data after data cleaning, and the operation indicator data is extracted from the operation activity data after data cleaning.
3. The method according to claim 1, characterized in that The training process of the recurrent neural network model includes: Obtain historical enterprise report data, historical market report data and historical operational activity data of each enterprise; For each of the enterprises, extracting second historical indicator data of the enterprise in each historical period from the historical enterprise report data, the historical market report data and the historical operation activity data; Determine the second historical indicator data of a second preset number of consecutive historical periods from the second historical indicator data of the enterprise in each historical period as sample input data, and use the second historical indicator data of a historical period after the second preset number of consecutive historical periods as labeled data of the sample input data, to obtain a data set including the sample input data and the labeled data; the second preset number is the sum of the first preset number and the number 1; Dividing the data set into a training set and a test set; According to the training set, the initial recurrent neural network model is iteratively trained according to training rounds and training batches until the training end condition is met, thereby obtaining a trained recurrent neural network model; The trained recurrent neural network model is evaluated according to the test set. When the evaluation index does not meet the preset conditions, the training and evaluation operations are iteratively performed until the evaluation index meets the preset conditions, thereby obtaining a trained recurrent neural network model.
4. The method according to claim 3, characterized in that The initial recurrent neural network model is iteratively trained according to the training set according to training rounds and training batches until the training end condition is met to obtain a trained recurrent neural network model, including: When performing training in the current training round and the current training batch, inputting sample input data in the current training batch in the training set into the initial recurrent neural network model to obtain prediction data; Determining a cross entropy loss function value according to the predicted data and the labeled data; According to the cross entropy loss function value, the network parameters of the initial recurrent neural network model are adjusted using the Adam optimizer; The operations of inputting sample input data, determining the cross entropy loss function value, and adjusting the network parameters are iteratively performed on the recurrent neural network model after the network parameters are adjusted until the training end condition is met, thereby obtaining a trained recurrent neural network model.
5. The method according to claim 3, characterized in that: The step of dividing the data set into a training set and a test set comprises: Obtaining the ratio between the amount of data in the training set to be divided and the amount of data in the test set; According to the ratio, the data set is divided into a training set and a test set.
6. The method according to any one of claims 1 to 5, characterized in that: The acquisition of the target enterprise's enterprise report data, market report data and operational activity data in the current cycle includes: Obtain the target enterprise's enterprise report data, market report data and operational activity data in the current period through partner data sharing; and / or The public data on the specified Internet is regularly crawled through the Scrapy library, the enterprise report data, market report data and operation activity data of the target enterprise in the current period are obtained from the public data, and the enterprise report data, market report data and operation activity data are exported into data in a target format through the Scrapy library.
7. The method according to any one of claims 1 to 5, characterized in that: The financial indicator data include revenue, profit and asset-liability information, the market indicator data include market share and growth rate, and the operational indicator data include information delivery data and activity data.
8. An analysis device for enterprise competitiveness, characterized in that: include: The data acquisition module is used to obtain the target enterprise's enterprise report data, market report data and operation activity data in the current cycle; An indicator data extraction module, used to extract current indicator data from the enterprise report data, the market report data and the operation activity data, wherein the current indicator data includes financial indicator data, market indicator data and operation indicator data in a current period; A prediction module, used for inputting the current indicator data and the first historical indicator data into a recurrent neural network model, and predicting the predicted indicator data of the target enterprise in the next cycle through the recurrent neural network model; the first historical indicator data is the indicator data of each historical cycle of a first preset number of consecutive historical cycles of the target enterprise before the current cycle; The view data generating module is used to generate view data including the current indicator data, the first historical indicator data and the predicted indicator data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for analyzing enterprise competitiveness according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the enterprise competitiveness analysis method described in any one of claims 1 to 7 are implemented.
