Event risk prompting method and device, electronic equipment and storage medium
By building an event risk prediction model and using real-time production data for classification and processing, the problems of risk thresholds in existing technologies relying on experience and being unable to adapt to different types of bidding events are solved, achieving more accurate and real-time risk warnings.
Patent Information
- Application Number
- CN202410276418.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-11
- Publication Date
- 2025-09-12
AI Technical Summary
The existing bidding risk warning scheme requires business personnel to specify risk thresholds based on experience. It cannot be applied to different types of bidding events and cannot reflect risk changes in a timely manner.
By acquiring real-time production data of target events and classifying them using a pre-built event risk prediction model, we generate risk prediction results and determine risk warning information based on the results. This model is trained on historical production data, including basic event data and event participant data, and can learn the risk characteristics of different event types under various event timelines.
It provides more accurate risk warning results, can effectively shorten the warning time of risk prediction, and realize real-time risk warning.
Smart Images

Figure CN120634210A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an event risk warning method, an event risk warning device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Tendering is the practice of inviting bids from willing contractors or traders for a construction project or the sale of commodities, with the goal of selecting the contractor or trader. The general procedure is: the tenderer places an advertisement or selectively invites interested parties and issues tender documents, or attaches drawings and samples. Bidders submit their bids as required. Bids are then opened and evaluated publicly under the auspices of a notary public, with the winning bidder selected as the successful bidder. Finally, the two parties sign a contract for the contract or trade.
[0003] Bidding risk occurs when the number of bidders fails to meet the opening criteria before the deadline. For example, in the logistics industry, tenders typically require a specified number of carriers to be tendered before the bid opening; otherwise, the tender will be rejected. To avoid this, it's important to encourage as many carriers as possible to bid before the deadline through outreach and promotion.
[0004] For a system with a complete bidding system, risk warnings will be issued for bids / bids that may be unsuccessful before the deadline, reminding the tenderer that the bid / bid is at risk of being unsuccessful.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0006] The purpose of the present disclosure is to provide an event risk warning method, an event risk warning device, an electronic device and a computer-readable storage medium, thereby at least to a certain extent overcoming the problem that the risk threshold of the existing bidding risk warning scheme needs to be specified by business personnel based on experience, and different types of bidding events cannot be applied to the same set of risk warning schemes, and risk changes cannot be reflected in a timely manner.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0008] According to a first aspect of the present disclosure, an event risk warning method is provided, comprising: obtaining real-time production data corresponding to a target event; obtaining a pre-constructed event risk prediction model, wherein the event risk prediction model is trained based on historical production data of the target event with a classification identifier, the historical production data including event basic data and event participant data, the event basic data including multiple event time limits, and the event participant data including the number of participants under multiple event time limits; using the event risk prediction model, classifying and processing the real-time production data to obtain a risk prediction result; and determining risk warning information of the real-time production data based on the risk prediction result.
[0009] In an exemplary embodiment of the present disclosure, obtaining real-time production data corresponding to the target event includes: monitoring the data generation message of the production database of the target event in real time; and obtaining the real-time production data from the production database using message middleware in response to the data generation message.
[0010] In an exemplary embodiment of the present disclosure, the event risk prediction model is trained by the following steps: obtaining historical production data of the target event, constructing a training sample set based on the historical production data, the training sample set including classification identifiers corresponding to the historical production data; obtaining a pre-constructed initial model, the initial model using a regression tree as a learner; using the training sample set to train the initial model until the model loss function of the initial model is in a convergence state, thereby obtaining the event risk prediction model.
[0011] In an exemplary embodiment of the present disclosure, constructing a training sample set based on the historical production data includes: obtaining the event basic data and the event participant data from the historical production data; generating historical event integrated data based on the event basic data and the event participant data, the historical event integrated data including a plurality of historical event samples; determining a classification identifier corresponding to each of the historical event samples; and constructing the training sample set based on the plurality of historical event samples and the classification identifier corresponding to each of the historical event samples.
[0012] In an exemplary embodiment of the present disclosure, the basic event data includes one or more of the basic event information, the event type, and the event time limit; the event participant data includes the number of participants corresponding to each of the multiple event time limits.
[0013] In an exemplary embodiment of the present disclosure, the initial model is trained using the training sample set until the model loss function of the initial model is in a convergent state to obtain the event risk prediction model, including: constructing a model loss function corresponding to the initial model, wherein the model loss function is determined based on the difference between the model prediction value and the classification true value; constructing a model regularization term for model training of the initial model; based on the model loss function and the model regularization term, the initial model is trained until the model loss function is in a convergent state to obtain the event risk prediction model.
[0014] In an exemplary embodiment of the present disclosure, the method further includes: outputting the event risk prediction model in a specified file format to obtain a prediction model data package; deploying the prediction model data package on a data processing platform to call the event risk prediction model through the data processing platform.
[0015] According to a second aspect of the present disclosure, an event risk warning device is provided, comprising: a real-time data acquisition module for acquiring real-time production data corresponding to a target event; a model acquisition module for acquiring a pre-built event risk prediction model, wherein the event risk prediction model is trained based on historical production data of the target event with a classification identifier, the historical production data including event basic data and event participant data, the event basic data including multiple event time limits, and the event participant data including the number of participants under multiple event time limits; an event prediction module for classifying and processing the real-time production data using the event risk prediction model to obtain a risk prediction result; and a result determination module for determining risk warning information of the real-time production data based on the risk prediction result.
[0016] In an exemplary embodiment of the present disclosure, the real-time data acquisition module includes a real-time data acquisition unit, which is used to: monitor the data generation message of the production database of the target event in real time; and obtain the real-time production data from the production database using message middleware in response to the data generation message.
[0017] In an exemplary embodiment of the present disclosure, the event risk warning device includes a model construction module, which is used to obtain historical production data of the target event, construct a training sample set based on the historical production data, and the training sample set includes a classification identifier corresponding to the historical production data; obtain a pre-constructed initial model, and the initial model uses a regression tree as a learner; use the training sample set to train the initial model until the model loss function of the initial model is in a convergence state, thereby obtaining the event risk prediction model.
[0018] In an exemplary embodiment of the present disclosure, the model building module includes a sample set building unit, which is used to: obtain the event basic data and the event participant data from the historical production data; generate historical event integrated data based on the event basic data and the event participant data, and the historical event integrated data includes multiple historical event samples; determine the classification identifier corresponding to each of the historical event samples; and construct the training sample set based on the multiple historical event samples and the classification identifier corresponding to each of the historical event samples.
[0019] In an exemplary embodiment of the present disclosure, the model construction module includes a model training unit, which is used to: construct a model loss function corresponding to the initial model, and the model loss function is determined based on the difference between the model prediction value and the classification true value; construct a model regularization term for model training of the initial model; based on the model loss function and the model regularization term, the initial model is trained until the model loss function is in a convergence state, thereby obtaining the event risk prediction model.
[0020] In an exemplary embodiment of the present disclosure, the event risk warning device also includes a model deployment module, which is used to: output the event risk prediction model in a specified file format to obtain a prediction model data package; deploy the prediction model data package on a data processing platform to call the event risk prediction model through the data processing platform.
[0021] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the event risk prompt method according to any one of the above items is implemented.
[0022] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the event risk prompt method according to any one of the above items is implemented.
[0023] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, which implements any one of the above-mentioned event risk prompt methods when executed by a processor.
[0024] The technical solution provided by the present disclosure may have the following beneficial effects:
[0025] The event risk warning method in the exemplary embodiment of this disclosure, on the one hand, uses historical production data to learn the risk characteristics of different event types under various event timelines, thereby providing more accurate risk warning results. On the other hand, by effectively analyzing the risk characteristics under different event timelines, the warning time of risk prediction can be effectively shortened, achieving real-time risk warnings.
[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0028] Figure 1 A flowchart of an event risk prompt method according to an exemplary embodiment of the present disclosure is schematically shown;
[0029] Figure 2 The overall flow chart of event risk prediction using an event risk prediction model according to an exemplary embodiment of the present disclosure is schematically shown;
[0030] Figure 3 Schematically shows a flowchart of constructing a training sample set according to an exemplary embodiment of the present disclosure;
[0031] Figure 4 Schematically illustrates a flow chart of a deployment event risk prediction model according to an exemplary embodiment of the present disclosure;
[0032] Figure 5 Schematically shows a block diagram of an event risk prompting device according to an exemplary embodiment of the present disclosure;
[0033] Figure 6 A block diagram schematically illustrates an electronic device according to an exemplary embodiment of the present disclosure;
[0034] Figure 7 A schematic diagram schematically illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. Like reference numerals in the figures denote like or similar parts, and thus their repeated description will be omitted.
[0036] In addition, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the present disclosure.
[0037] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more software-hardened modules, or in different networks and / or processor devices and / or microcontroller devices.
[0038] Taking the capacity procurement in the logistics industry as an example, a method for risk warning in bidding and tendering includes the following steps: (1) Calculate the number of days d from the current date to the bid deadline; (2) Calculate the number n of carriers who have signed up for the current bid / contract; (3) Determine the threshold N for triggering a failed bid when fewer than N carriers sign up; (4) Set a high-risk threshold N1 and a medium-risk threshold N2; (5) If N2 < N - d - n <= N1, then it is a high risk; (6) Else if 1 < N - d - n <= N2, then it is a medium risk. Calculate according to the above logic on a daily basis and label each bid / contract.
[0039] The risk prediction schemes adopted in the related solutions have the following problems: (1) The risk thresholds (N1, N2) are set by business personnel based on experience and lack data support; (2) The same risk formula is used for bids / contracts on different routes and road conditions. Some popular routes can reach the carrier registration quantity threshold in a short time, while it is difficult for unpopular routes to reach the carrier registration quantity threshold even if the remaining registration time is long enough. (3) Calculated on a daily basis, it cannot reflect the change of the failed bid risk in a timely manner, and most carriers will choose to submit bids in a period of time before the bid deadline.
[0040] Based on this, according to the embodiments of the present disclosure, an event risk warning method, an event risk warning device, a computer-readable storage medium, and an electronic device are proposed. In this article, it is necessary to understand that the terms involved, such as real-time computing, can effectively monitor the real-time status of the target time through real-time computing technology, and then make timely responses to event status. For example, in the bidding application scenario, real-time computing technology can effectively monitor the bidding and tendering status, and provide timely warnings and prompts for the risk of bid failure.
[0041] Real-time computing technology primarily utilizes two components: the open-source stream processing framework (Apache Flink) and the stream processing platform (Apache Kafka). Apache Flink executes arbitrary streaming data programs in a data-parallel, pipelined manner. Flink's pipeline runtime system can execute both batch and stream processing programs. Apache Kafka, which provides capabilities such as message publishing and subscription and stream data processing, is a commonly used messaging middleware for real-time big data computing. This disclosure only utilizes Kafka's publish-subscribe functionality, meaning that Kafka is used as a message queue.
[0042] The tree model is a logically simple machine learning algorithm. In a training dataset, each sample may have multiple attributes, each with varying degrees of impact. Therefore, feature selection aims to identify features with high correlation to the classification results—those with strong classification capabilities—for training and prediction.
[0043] In this example embodiment, an event risk prompting method is first provided. The event risk prompting method of the present disclosure can be implemented using a server, or the method described in the present disclosure can be implemented using a terminal device. The terminals described in the present disclosure may include mobile terminals such as mobile phones, tablet computers, laptops, PDAs, personal digital assistants (PDAs), and fixed terminals such as desktop computers. Figure 1 The following schematically illustrates the process flow of the event risk prompt method according to some embodiments of the present disclosure. Figure 1 The event risk warning method may include the following steps:
[0044] Step S110: Acquire real-time production data corresponding to the target event.
[0045] According to some exemplary embodiments of the present disclosure, a target event may be an event that requires a specified number of participants within a specified time to ensure that an expected result is achieved. Real-time production data may be data related to the target event generated in real time.
[0046] Since the entire process of the target event needs to last for a period of time, before the execution of the target event is completed, production data related to the target event can be obtained in real time as real-time production data. For example, the real-time production data can include the basic data of the target event and the number of participants under different event time limits, etc., so as to analyze the real-time production data and determine whether the target event can be successfully executed.
[0047] Step S120, obtain a pre-built event risk prediction model, which is trained based on historical production data of target events with classification identifiers. The historical production data includes basic event data and event participant data. The basic event data includes multiple event time limits, and the event participant data includes the number of participants under multiple event time limits.
[0048] According to some exemplary embodiments of the present disclosure, an event risk prediction model may be a model that analyzes real-time production data of a target event to predict whether the target event can be successfully executed. The classification identifier may be an identifier corresponding to a historical event sample contained in the historical production data, and the classification identifier may include two categories: successful event execution and unexecuted event; successful event execution may be marked as 0, and unexecuted event may be marked as 1. Historical production data may be data related to the target event that has occurred in the past. Event basic data may be data that describes the basic information of the target event. Event participant data may be relevant data of participants participating in the target event. Event timeliness may be a deadline for determining whether the target event can be successfully executed. The number of participants under the event timeliness may be the number of relevant individuals who have participated in the target event under different time efficiencies.
[0049] To determine the prediction results for the target event, a pre-built event risk prediction model can be obtained. This model can be used to effectively analyze the risk characteristics that may exist in real-time production data, thereby obtaining the risk prediction results for the target event. The event risk prediction model in this embodiment is trained based on a training sample set constructed using historical production data.
[0050] After acquiring historical production data, we determine basic event data and event participant data from the historical production data. The basic event data includes multiple event time periods, and the event participant data includes the number of participants under each event time period. We then integrate the historical production data into historical event samples, determine the classification identifier for each historical event sample, and construct a training sample set based on the historical time samples containing the classification identifier.
[0051] Step S130: Using the event risk prediction model, classify and process the real-time production data to obtain risk prediction results.
[0052] According to some exemplary embodiments of the present disclosure, the risk prediction result may be a prediction result of whether a target event can be successfully executed, obtained after the event risk prediction model analyzes real-time production data.
[0053] The event risk prediction model generated through the above model training process learns the risk characteristics of the target event from the training sample set. It can effectively analyze and classify real-time production data, and output risk prediction results corresponding to the real-time production data. For example, the event risk prediction model can output the risk probability of whether the real-time production data can be executed, as well as the classification identifier of the real-time production data as the risk prediction result.
[0054] Step S140: Determine risk warning information for real-time production data based on the risk prediction result.
[0055] According to some exemplary embodiments of the present disclosure, the risk prompt information may be reminder information indicating whether the target event can be successfully executed.
[0056] After obtaining the risk prediction results, the risk warning information for the real-time production data can be determined based on the risk prediction results. For example, if the risk prediction result output by the model is 0, it means that the real-time production data currently corresponding to the target event does not have the risk of non-execution, and the risk warning information can be determined as low risk. If the risk prediction result output by the model is 1, it means that the real-time production data currently corresponding to the target event has the risk of non-execution, and the risk warning information can be determined as high risk.
[0057] The event risk warning method in this example embodiment, on the one hand, uses historical production data to learn the risk characteristics of different event types under various event timelines, thereby providing more accurate risk warning results. On the other hand, by effectively analyzing the risk characteristics under different event timelines, the warning time of risk prediction can be effectively shortened, achieving real-time risk warnings.
[0058] The event risk warning method in this example embodiment will be further explained below. For example, this embodiment will be explained by taking the event of determining whether a bidding project has failed as an example.
[0059] In an exemplary embodiment of the present disclosure, for step S110, obtaining real-time production data corresponding to the target event includes: monitoring the data generation message of the production database of the target event in real time; and obtaining real-time production data from the production database using message middleware in response to the data generation message.
[0060] The production database can be a database used to store event data related to the target event. For example, the production database can store real-time production data generated based on the real-time event progress of the target event. The production database can also store historical production data for the target event. The data generation message can be a prompt message indicating the generation of real-time data. Message-based middleware can be a supporting software system that uses queue and messaging technologies to provide synchronous or asynchronous, reliable message transmission for application systems in a network environment.
[0061] refer to Figure 2 , Figure 2 The overall flow chart of event risk prediction using an event risk prediction model according to an exemplary embodiment of the present disclosure is schematically shown. Step S211: Monitor messages from the production database. For example, for the production database of the target event, the data generation messages of the production database are monitored in real time through the Kafka message queue to determine whether new real-time production data is generated at the current moment. In the bidding risk prompt scenario, if a new bid, bid, or bid registration form is generated, the bid, bid, and bid registration form information is synchronized to the real-time message queue through Kafka.
[0062] If the monitored data generation message indicates that new production data has been generated in the production database, real-time production data is retrieved in step S212. In response to the data generation message, message-based middleware, such as the open-source stream processing framework Flink, is used to retrieve real-time production data from the production database. Specifically, the Flink framework is used to perform real-time message confluence calculations on bid documents, bids, and bid application forms. Through these steps, real-time production data for the target event can be obtained in real time through the message queue, enabling risk prediction of this real-time production data.
[0063] It is easy for those skilled in the art to understand that the event risk prediction method disclosed herein can be applied to a variety of events that require a certain number of participants to trigger execution conditions, such as events related to the registration of candidates for different positions in an examination system. The present disclosure does not impose any special limitations on specific target events.
[0064] In an exemplary embodiment of the present disclosure, an event risk prediction model is trained by the following steps: obtaining historical production data of a target event, constructing a training sample set based on the historical production data, wherein the training sample set includes classification identifiers corresponding to the historical production data; obtaining a pre-constructed initial model, wherein the initial model uses a regression tree as a learner; and training the initial model using the training sample set until the model loss function of the initial model is in a convergence state, thereby obtaining an event risk prediction model.
[0065] The training sample set can be a sample set obtained by adding corresponding classification identifiers to historical production data, which is used to train the event risk prediction model. The initial model can be a pre-built classification model. For example, in this embodiment, a regression tree can be used as a classification learner. The regression tree can be a tree using a gradient boosting decision tree (GBDT).
[0066] The event risk prediction model can be based on historical production data, as follows: Figure 2 In step S221, historical production data is acquired. Since this embodiment uses a supervised classification algorithm for model training, after acquiring the historical production data, in step S222, the classification identifiers of the historical production data are determined to construct a training sample set. Data integration processing is performed on the historical production data, and the integrated samples are labeled to obtain a training sample set.
[0067] After the training sample set, model training is performed based on the training sample set, and in step S223, the event risk prediction model is trained. Before model training, an initial model is pre-constructed. For example, a regression tree is used as a learner as the initial model. After the initial model is constructed, the initial model is trained using the training sample set until the model loss function of the initial model is in a converged state, thereby obtaining the event risk prediction model. In step S224, the obtained event risk prediction model is packaged.
[0068] Specifically, model training can be performed using the eXtreme Gradient Boosting (XGBoost) algorithm, which can be viewed as an optimization of the Gradient Boosting Tree (GBDT). This model automatically utilizes CPU multi-threaded parallel computing and performs a second-order Taylor expansion of the loss function. A regularization term is added to the loss function to constrain the loss function and reduce the overall model complexity.
[0069] The core algorithmic concept is to continuously add trees and perform feature splitting to grow a tree. Each time a tree is added, a new function f(x) is learned to fit the residual of the previous prediction. Once training is complete and k trees are obtained, the score of a sample is predicted. This is done by assigning a score to a leaf node in each tree based on the sample's features. Finally, the predicted value for the sample is obtained by summing the scores of each tree.
[0070] The goal of this algorithm is to make the predicted value y′ of the tree group i As close to the true value y as possible i, and with maximum generalization capabilities. This algorithm accumulates the scores of multiple trees to obtain the final prediction score. Each iteration adds a new tree to the existing tree to fit the residual between the previous tree's prediction and the true value. Through this training process, the model fully learns the risk classification characteristics of historical production data, classifies real-time production data, and obtains corresponding prediction results.
[0071] It is readily understood by those skilled in the art that, in other exemplary embodiments of the present disclosure, the initial model may also employ other model structures as classification learners, such as a support vector machine (SVM), a quadratic classifier, a boosting algorithm, etc., as long as the event risk prediction model obtained through model training can learn the classification features of the samples and complete the classification task. The present disclosure does not impose any particular limitation on the specific model structure employed by the initial model.
[0072] In an exemplary embodiment of the present disclosure, a training sample set is constructed based on historical production data, including: obtaining basic event data and event participant data from the historical production data; generating historical event integrated data based on the basic event data and event participant data, the historical event integrated data including a plurality of historical event samples; determining a classification identifier corresponding to each historical event sample; and constructing a training sample set based on the plurality of historical event samples and the classification identifier corresponding to each historical event sample.
[0073] The historical event integrated data may be data obtained by integrating the basic event data and the event participant data in the historical production data. The historical event samples may be each sample data included in the data table corresponding to the historical event integrated data.
[0074] refer to Figure 3 , Figure 3 The following schematically illustrates a flow chart for constructing a training sample set according to an exemplary embodiment of the present disclosure. Step S310: Obtain basic event data and event participant data from historical production data. Historical production data for target events that have occurred in the past is obtained, such as data on historical bids / bids before the closing date, and basic event data and event participant data are obtained from this data.
[0075] In an exemplary embodiment of the present disclosure, the basic event data includes one or more of the basic event information, event type, and event time limit; the event participant data includes the number of participants corresponding to multiple event time limits.
[0076] The basic event information may be information describing the basic situation of the event, for example, the basic event information may include the project name corresponding to the target event, the starting point of the project, and the project price, etc. The event type may be the specific type of the target event.
[0077] This example uses sample data from a carrier bidding in the logistics industry as an example to illustrate the basic event data and event participant data. This data can be the basic data of the bidding project, including information such as the bidding route, route type, timeliness requirements, and bid price. For details, see Table 1.
[0078] Table 1 Basic information of the tender document
[0079] Bid ID Target ID Bidding Line Line Type Time limit requirements Bid price 100001 1000011 City A-City B Type 1 1d 1000 100002 1000021 City B-City C Type 2 5d 10000 100003 1000031 City C-City A Type 2 5d 10000
[0080] The event participant data may be the number of participants at different event time limits, including: the number of carriers that registered 0.5 days from the bid deadline, the number of carriers that registered 1 day from the bid deadline, the number of carriers that registered 3 days from the bid deadline, the number of carriers that registered 5 days from the bid deadline, the number of carriers that registered 10 days from the bid deadline, and the number of carriers that registered 15 days from the bid deadline. Please refer to Table 2 for details.
[0081] Table 2 Target Registration Status
[0082]
[0083] After obtaining the above data, in step S320, historical event integration data is generated based on the basic event data and event participant data. The historical event integration data includes multiple historical event samples. For example, two data tables are integrated into a single data table to obtain a historical event integration table, which contains multiple historical event samples. In step S330, the classification identifier corresponding to each historical event sample is determined, that is, the bid / bid failure status is marked, resulting in Table 3. Table 3 omits some data from Tables 1 and 2.
[0084] Table 3: Tender / bid failure status
[0085] Bid ID Target ID Whether the bid was unsuccessful 100001 1000011 no 100002 1000021 yes 100003 1000031 no
[0086] Step S340: construct a training sample set based on the multiple historical event samples and the classification identifiers corresponding to each historical event sample. Through the above processing steps, the historical production data can be integrated and labeled to obtain the corresponding training sample set.
[0087] In an exemplary embodiment of the present disclosure, an initial model is trained using a training sample set until the model loss function of the initial model is in a convergent state, thereby obtaining an event risk prediction model, including: constructing a model loss function corresponding to the initial model, wherein the model loss function is determined based on the difference between the model predicted value and the classification true value; constructing a model regularization term for model training of the initial model; and training the initial model based on the model loss function and the model regularization term until the model loss function is in a convergent state, thereby obtaining an event risk prediction model.
[0088] The model prediction value can be the predicted value output by the model. The classification true value can be the true classification value of the historical event sample. The model regularization term can be used to constrain the decrease of the model loss function and the overall complexity of the model.
[0089] After obtaining the training sample set, the event risk prediction model is trained based on the training sample set. XGBoost uses regression trees as weak learners in the continuous learning process. These decision trees assign continuous scores to each leaf node, and each iteration of the tree calculates a score that can be used to predict the probability of a target failure. The learning process aims to continuously learn from previous iterations to obtain the optimal weights. Furthermore, the Least Absolute Shrinkage and Selection Operator (LASSO) L1 regularization term is added after the loss function to constrain the model complexity and prevent overfitting.
[0090] When there are many sample features but a relatively small number of samples, the model is prone to overfitting. To alleviate this problem, specific optimization methods include reducing the number of features, such as manually selecting important features to retain and discarding some information; or introducing regularization terms and regularization parameters to reduce the order of magnitude of feature parameters.
[0091] In an exemplary embodiment of the present disclosure, the event risk prediction model is output in a specified file format to obtain a prediction model data package; the prediction model data package is deployed on a data processing platform to call the event risk prediction model through the data processing platform.
[0092] The specified file format may be a pre-specified file format, for example, an Extensible Markup Language (XML) format. The prediction model data package may be an event risk prediction model stored in the specified file format. The data processing platform may be a processing platform for labeling and classifying real-time production data of target events.
[0093] Continue to refer Figure 2, step S213, deploy the event risk prediction model on the data processing platform. Package the data preprocessing process and the model inference process into a pipeline model, and package the pipeline model into a predictive model markup language (PMML) file. The PMML file can be understood as a file format similar to an xml, which can export the machine learning model in a file format. In addition, the file content is a description of the algorithm rules. The XGBoost flow risk prediction model trained in the training part is deployed on the map operator in the Flink project. Step S214, perform risk prediction on real-time production data. Perform prediction and labeling calculations on each target, and output the identification of whether it is a risk target on the data dashboard.
[0094] The advantages of PMML files include: (1) Platform independence. PMML allows the model deployment environment to be separated from the development environment, enabling cross-platform deployment. This is the biggest advantage of PMML compared to other model deployment methods. For example, a model built using Python can be deployed in a Java production environment after exporting to PMML. (2) Interoperability. This is the biggest advantage of the standard protocol, which enables PMML-compatible prediction programs to read standard PMML models exported by other applications. (3) Widespread support. It has obtained support from more than 30 manufacturers and open source projects. Through multiple existing open source libraries, many heavyweight and popular open source data mining models can be converted into PMML. (4) Readability. The PMML model is an XML-based text file that can be opened and viewed using any text editor. It is more secure and reliable than binary serialized files.
[0095] refer to Figure 4 , Figure 4 The flowchart of deploying the event risk prediction model according to the exemplary embodiment of the present disclosure is schematically shown. The acquired real-time production data is input into the event risk prediction model. Step S410, data preprocessing. The event risk prediction model can preprocess the acquired real-time production data, and the data after data preprocessing has corresponding derived fields. Step S420, model prediction. The preprocessed data is input into the event risk prediction model, the model prediction processing process is executed, and the model outputs the corresponding prediction field. Step S430, prediction post-processing. After obtaining the prediction field output by the model, the prediction post-processing process is performed. The predicted value corresponding to the real-time production data is output. The event risk prediction model is deployed on the data processing platform in a specified file format, so that the model has the advantages of platform independence, interoperability, wide support and readability during use.
[0096] In summary, the event risk warning method disclosed in the present invention obtains real-time production data corresponding to the target event; obtains a pre-built event risk prediction model, which is trained based on the historical production data of the target event with classification identification, and the historical production data includes event basic data and event participant data, and the event basic data includes multiple event time limits, and the event participant data includes the number of participants under multiple event time limits; uses the event risk prediction model to classify and process the real-time production data to obtain risk prediction results; and determines the risk warning information of the real-time production data based on the risk prediction results. On the one hand, the model learns the risk characteristics of different event types under multiple event time limits through historical production data, and can provide more accurate risk warning results. On the other hand, by effectively analyzing the risk characteristics under different event time limits, the risk prediction prompt time limit can be effectively shortened, and real-time risk warnings can be achieved.
[0097] It should be noted that although the steps of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0098] In addition, in this exemplary embodiment, an event risk prompting device is also provided. Figure 5 The event risk prompting device 500 may include: a real-time data acquisition module 510, a model acquisition module 520, an event prediction module 530 and a result determination module 540.
[0099] Specifically, the real-time data acquisition module 510 is used to obtain real-time production data corresponding to the target event; the model acquisition module 520 is used to obtain a pre-built event risk prediction model, which is trained based on the historical production data of the target event with a classification identifier. The historical production data includes basic event data and event participant data. The basic event data includes multiple event time limits, and the event participant data includes the number of participants under multiple event time limits; the event prediction module 530 is used to use the event risk prediction model to classify and process the real-time production data to obtain a risk prediction result; the result determination module 540 is used to determine the risk warning information of the real-time production data based on the risk prediction result.
[0100] In an exemplary embodiment of the present disclosure, the real-time data acquisition module 510 includes a real-time data acquisition unit for: monitoring the data generation message of the production database of the target event in real time; and acquiring real-time production data from the production database using a message middleware in response to the data generation message.
[0101] In an exemplary embodiment of the present disclosure, the event risk warning device 500 includes a model construction module, which is used to obtain historical production data of the target event, construct a training sample set based on the historical production data, and the training sample set includes classification identifiers corresponding to the historical production data; obtain a pre-constructed initial model, and the initial model uses a regression tree as a learner; use the training sample set to train the initial model until the model loss function of the initial model is in a convergence state, and obtain an event risk prediction model.
[0102] In an exemplary embodiment of the present disclosure, the model building module includes a sample set building unit, which is used to: obtain event basic data and event participant data from historical production data; generate historical event integrated data based on the event basic data and event participant data, and the historical event integrated data includes multiple historical event samples; determine the classification identifier corresponding to each historical event sample; and construct a training sample set based on multiple historical event samples and the classification identifier corresponding to each historical event sample.
[0103] In an exemplary embodiment of the present disclosure, the model construction module includes a model training unit, which is used to: construct a model loss function corresponding to the initial model, where the model loss function is determined based on the difference between the model prediction value and the classification true value; construct a model regularization term for model training of the initial model; based on the model loss function and the model regularization term, the initial model is trained until the model loss function is in a convergence state, thereby obtaining an event risk prediction model.
[0104] In an exemplary embodiment of the present disclosure, the event risk warning device 500 also includes a model deployment module, which is used to: output the event risk prediction model in a specified file format to obtain a prediction model data package; deploy the prediction model data package on a data processing platform to call the event risk prediction model through the data processing platform.
[0105] The specific details of the virtual modules of each of the above-mentioned event risk warning devices have been described in detail in the corresponding event risk warning methods, so they will not be repeated here.
[0106] It should be noted that although several modules or units of the event risk prompt device are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units for concretization.
[0107] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0108] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Accordingly, various aspects of the present invention may be implemented as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or a combination of hardware and software embodiments, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0109] Reference below Figure 6 6 to describe the electronic device 600 according to such an embodiment of the present disclosure. Figure 6 The electronic device 600 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0110] like Figure 6 As shown, electronic device 600 is implemented as a general-purpose computing device. Components of electronic device 600 may include, but are not limited to, the aforementioned at least one processing unit 610, the aforementioned at least one storage unit 620, a bus 630 connecting various system components (including storage unit 620 and processing unit 610), and a display unit 640.
[0111] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0112] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .
[0113] The storage unit 620 may include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0114] Bus 630 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0115] The electronic device 600 can also communicate with one or more external devices 670 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 650. Furthermore, the electronic device 600 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0116] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0117] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, storing a program product capable of implementing the aforementioned methods of this specification. In some possible embodiments, various aspects of the present invention may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section of this specification.
[0118] refer to Figure 7 As shown, a program product 700 for implementing the above method according to an embodiment of the present invention is described. The program product 700 may be a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0119] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0120] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0121] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0122] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0123] Furthermore, the above-described figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention and are not intended to be limiting. It is readily understood that the processes illustrated in the above-described figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0124] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
[0125] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An event risk prompt method, characterized in that: include: Obtain real-time production data corresponding to the target event; Obtain a pre-built event risk prediction model, wherein the event risk prediction model is trained based on historical production data of the target event with a classification identifier, the historical production data including basic event data and event participant data, the basic event data including multiple event time limits, and the event participant data including the number of participants under the multiple event time limits; Using the event risk prediction model, classify and process the real-time production data to obtain a risk prediction result; Determine risk warning information of the real-time production data based on the risk prediction result.
2. The method according to claim 1, characterized in that The obtaining of real-time production data corresponding to the target event includes: Monitor the data generation message of the production database of the target event in real time; In response to the data generating message, the real-time production data is acquired from the production database using a message middleware.
3. The method according to claim 1, characterized in that The event risk prediction model is trained by the following steps: Acquire historical production data of the target event, and construct a training sample set based on the historical production data, wherein the training sample set includes a classification identifier corresponding to the historical production data; Obtaining a pre-built initial model, wherein the initial model uses a regression tree as a learner; The initial model is trained using the training sample set until the model loss function of the initial model is in a convergent state, thereby obtaining the event risk prediction model.
4. The method according to claim 3, characterized in that The constructing of a training sample set based on the historical production data includes: Obtaining the event basic data and the event participant data from the historical production data; Generate historical event integrated data based on the event basic data and the event participant data, wherein the historical event integrated data includes a plurality of historical event samples; Determining a classification identifier corresponding to each of the historical event samples; The training sample set is constructed based on the plurality of historical event samples and the classification identifier corresponding to each of the historical event samples.
5. The method according to claim 1 or 4, characterized in that The basic event data includes one or more of the basic event information, the event type, and the event time limit; the event participant data includes the number of participants corresponding to each of the multiple event time limits.
6. The method according to claim 3, characterized in that The initial model is trained using the training sample set until the model loss function of the initial model is in a convergent state, thereby obtaining the event risk prediction model, including: Constructing a model loss function corresponding to the initial model, wherein the model loss function is determined based on the difference between the model prediction value and the classification true value; Constructing a model regularization term for performing model training on the initial model; Based on the model loss function and the model regularization term, the initial model is trained until the model loss function is in a convergent state, thereby obtaining the event risk prediction model.
7. The method according to claim 1 or 3, characterized in that The method further comprises: Outputting the event risk prediction model in a specified file format to obtain a prediction model data package; The prediction model data package is deployed on a data processing platform to call the event risk prediction model through the data processing platform.
8. An event risk warning device, characterized in that: include: Real-time data acquisition module, used to obtain real-time production data corresponding to the target event; A model acquisition module is used to obtain a pre-built event risk prediction model, wherein the event risk prediction model is trained based on historical production data of the target event with a classification identifier, wherein the historical production data includes basic event data and event participant data, wherein the basic event data includes multiple event time limits, and the event participant data includes the number of participants under the multiple event time limits; An event prediction module, configured to classify and process the real-time production data using the event risk prediction model to obtain a risk prediction result; A result determination module is used to determine risk warning information of the real-time production data according to the risk prediction result.
9. An electronic device, characterized in that: include: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the event risk prompt method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the event risk prompt method according to any one of claims 1 to 7 is implemented.