WO2021022933A1 - Method and device for multitask prediction, electronic device, and storage medium - Google Patents

Method and device for multitask prediction, electronic device, and storage medium Download PDF

Info

Publication number
WO2021022933A1
WO2021022933A1 PCT/CN2020/098233 CN2020098233W WO2021022933A1 WO 2021022933 A1 WO2021022933 A1 WO 2021022933A1 CN 2020098233 W CN2020098233 W CN 2020098233W WO 2021022933 A1 WO2021022933 A1 WO 2021022933A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
data
task
training
prediction
Prior art date
Application number
PCT/CN2020/098233
Other languages
French (fr)
Chinese (zh)
Inventor
王涛
朱葛
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021022933A1 publication Critical patent/WO2021022933A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2465Query processing support for facilitating data mining operations in structured databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/80ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for detecting, monitoring or modelling epidemics or pandemics, e.g. flu
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the technical field of intelligent decision-making, and in particular to a multi-task prediction method, device, electronic equipment and storage medium.
  • a multi-task prediction method includes:
  • the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
  • the second data set is input into the target model to obtain a target result.
  • a multi-task prediction device includes:
  • the acquiring unit is used to acquire current scene data when the prediction instruction is received;
  • a determining unit configured to determine a target task corresponding to the current scene data according to the current scene data
  • a judging unit for judging whether the target task is a prediction task that appears for the first time
  • the acquiring unit is further configured to acquire target data related to the target task when the target task is a predicted task that appears for the first time;
  • a splitting unit configured to split the target data in proportion to obtain a first data set and a second data set
  • a preprocessing unit configured to preprocess the first data set to obtain data characteristics
  • the input unit is used to input the data feature into at least one pre-trained model to obtain at least one prediction result;
  • a training unit configured to train the at least one prediction result by using a long and short-term memory algorithm to obtain a target model
  • the input unit is also used to input the second data set into the target model to obtain a target result.
  • An electronic device which includes:
  • the memory stores at least one computer readable instruction
  • the processor executes at least one computer-readable instruction stored in the memory to implement the following steps:
  • the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
  • the second data set is input into the target model to obtain a target result.
  • a computer-readable storage medium in which at least one computer-readable instruction is stored, and the at least one computer-readable instruction is executed by a processor in an electronic device to implement the following steps:
  • the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
  • the second data set is input into the target model to obtain a target result.
  • the present application can be applied to the field of intelligent decision-making of artificial intelligence, not only can predict on-demand through the target model, but also can make sequential predictions based on the prediction task.
  • Fig. 1 is a flowchart of a preferred embodiment of the multi-task prediction method of the present application.
  • Fig. 2 is a functional block diagram of a preferred embodiment of the multi-task prediction device of the present application.
  • FIG. 3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the multi-task prediction method according to the present application.
  • FIG. 1 it is a flowchart of a preferred embodiment of the multi-task prediction method of the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
  • the multi-task prediction method is applied to one or more electronic devices.
  • the electronic device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes but not Limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (Field-Programmable Gate Arrays, FPGAs), digital processors (Digital Signal Processors, DSPs), embedded devices, etc.
  • ASICs application specific integrated circuits
  • FPGAs Field-Programmable Gate Arrays
  • DSPs Digital Signal Processors
  • the electronic device may be any electronic product that can interact with a user with a human machine, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television ( Internet Protocol Television, IPTV), smart wearable devices, etc.
  • a human machine such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television ( Internet Protocol Television, IPTV), smart wearable devices, etc.
  • PDA personal digital assistant
  • IPTV Internet Protocol Television
  • smart wearable devices etc.
  • the electronic device may also include a network device and/or user equipment.
  • the network device includes, but is not limited to, a single network server, a server group composed of multiple network servers, or a cloud composed of a large number of hosts or network servers based on Cloud Computing.
  • the network where the electronic device is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (Virtual Private Network, VPN), etc.
  • the current scenario data may include, but is not limited to: stock trend scenario, product sales volume scenario, disease incidence scenario, etc.
  • the prediction instruction may be triggered by the user, or may be automatically triggered when certain conditions are met, which is not limited in the present application.
  • the meeting certain conditions includes, but is not limited to: meeting a preset time, etc.
  • the preset time may include a determined time point, or include a time period, etc., for example: the preset time may be 7 o'clock in the morning every day.
  • S11 Determine a target task corresponding to the current scene data according to the current scene data.
  • the electronic device determining the target task to which the current scene data belongs according to the current scene data includes:
  • the electronic device matches the current scene data with pre-configured scene data, and determines a task corresponding to the matched scene data as the target task.
  • the target task may include, but is not limited to: predicting the sales volume of A product, predicting the stock trend of X stock, predicting the incidence of D disease, etc.
  • the target task can be quickly and accurately identified, so that it is convenient to determine whether the target task is a predicted task that appears for the first time.
  • S12 Determine whether the target task is a predicted task that appears for the first time.
  • the electronic device determining whether the target task is a predicted task that appears for the first time includes:
  • the electronic device detects the target task, and when it is detected that the target task has not been trained before a preset time point, the electronic device determines that the target task is a prediction task that appears for the first time, and when the target task is detected The task is out of training before the preset time point, and the electronic device determines that the target task is not a predicted task that appears for the first time.
  • the preset time point may include the time when the prediction task is received, which is not limited in this application.
  • the electronic device acquiring target data related to the target task includes, but is not limited to, one or a combination of the following methods:
  • the electronic device uses Web crawler technology to obtain target data related to the target task from the Internet.
  • the Internet may include any website that supports access, such as Baidu, Google, Tencent, Weibo, etc.
  • web crawler technology also known as web spider, web robot
  • web spider web robot
  • the target task when the target task is to predict the stock trend of X stock, then the target data is the trend of X stock in the past preset time period; when the target task is to predict the sales volume of A product, then the target The data is the sales volume of A product in the past preset time period.
  • the electronic device receives target data related to the target task uploaded by the user.
  • the electronic device splits the target data in proportion to obtain the first data set and the second data set.
  • the electronic device determines a preset proportion of target data in the target data as the first data set, wherein the first data set is used to train at least one model, and further, the electronic device The target data except for the first data set in the target data is determined as the second data set, wherein the second data set is used as the input data of the target model.
  • the preset ratio is not limited, and may be 0.8, 0.6, etc.
  • S15 Perform preprocessing on the first data set to obtain data characteristics.
  • the electronic device preprocessing the first data set to obtain data characteristics includes:
  • the electronic device performs deviation detection on the first data set to obtain deviation data. Further, the electronic device deletes the deviation data to obtain the data characteristics.
  • the electronic device uses a density-based outlier detection method to perform deviation detection on the first data set to obtain deviation data.
  • the electronic device uses a relative density detection technology to divide the first data set into several objects, calculates the density of each object separately, and obtains the outlier score of each object. Further, the electronic The device calculates the neighborhood average density of each object, and when the outlier score of the object is less than the neighborhood average density corresponding to the object, the object is determined as deviation data.
  • the electronic device deletes the deviation data from the first data set to obtain the data characteristics.
  • the deviation data can be accurately obtained and eliminated, which is beneficial to the subsequent accurate training of the target model, thereby improving the accuracy of the target model.
  • the method of preprocessing the first data set is not limited in this application as long as it is legal and reasonable.
  • the electronic device trains the at least one model before inputting the data features into the at least one pre-trained model to obtain at least one prediction result.
  • training the at least one model by the electronic device includes, but is not limited to, one or a combination of the following methods:
  • the electronic device acquires a first training set related to the target task, wherein the first training set does not intersect with the first data set; further, the electronic device uses neural network algorithm training In the first training set, the at least one model is obtained.
  • the electronic device performs normalization processing on the first training set, and further, the electronic device constructs a network using the first training set after the normalization processing to obtain the first network, and the electronic device Training the first network by using a preset learning rate to obtain the at least one model.
  • the learning rate of the at least one model obtained by training may be the same or different.
  • the learning rate of the at least one model is infinitely close to the learning rate, and when multiple learning rates are configured, the relationship between the at least one model and the multiple learning rates
  • the configuration can be customized (for example, the electronic device is configured with a learning rate A and a learning rate B, and it is determined that there are 3 models that need to be trained based on the learning rate A, and it is determined that 4 models need to be trained based on the learning rate B, Then the at least one model is the 7 models trained above).
  • the electronic device acquires a first training set related to the target task, wherein the first training set does not intersect with the first data set; further, the electronic device uses a linear regression algorithm for training In the first training set, the at least one model is obtained.
  • the electronic device constructs a model based on the first training set to obtain a prediction function. Further, the electronic device uses a gradient descent algorithm to reduce the error of the prediction function, and obtains a prediction function with an error less than a threshold, which is The at least one model.
  • the threshold is set in advance and can be: 0.2, etc., which is not limited in this application.
  • the electronic device can quickly obtain a model, which improves the speed of subsequent training of the target model.
  • the electronic device inputs the data feature into the at least one pre-trained model to obtain at least one prediction result.
  • the electronic device inputs the data characteristics into each of the at least one model to obtain at least one first result of each model, and further, the electronic device integrates at least one of each model
  • the first result is the at least one prediction result.
  • the Long Short-Term Memory (LSTM) algorithm includes three network layers, where the three network layers are an input gate layer, a forget gate layer, and an output gate layer.
  • the electronic device training the at least one prediction result by using a long- and short-term memory algorithm to obtain a target model includes:
  • the electronic device inputs the at least one prediction result into the forgetting gate layer to perform forgetting processing to obtain second training data. Further, the electronic device uses a cross-validation method to divide the second training data into a second training set And a second verification set, input the second training set to the input gate layer for training to obtain a secondary learner, and adjust the secondary learner according to the second verification set to obtain a target model.
  • the electronic device uses a cross-validation method to divide the second training data into a second training set and a second verification set, which specifically includes:
  • the electronic device randomly divides the second training data into at least one data packet according to a preset number, determines any one of the at least one data packet as the second verification set, and determines the remaining data packets For the second training set, repeat the above steps until all data packets are used as the second verification set in turn.
  • the electronic device divides the second training data into three data packets, namely data packet E, data packet F, and data packet G, and determines the data packet E as the verification set, and the data packet F and data packet G are determined to be the second training set.
  • the data packet F is determined as the verification set
  • the data packet E and the data packet G are determined as the second training set.
  • the data packet G is determined to be the verification set
  • the data packet E and the data packet F are determined to be the second training set.
  • the second training data is divided by a cross-validation method, so that all of the second training data participates in training and verification, thereby improving the fitness of training the target model.
  • the electronic device adjusting the secondary learner according to the second verification set to obtain the target model includes:
  • the electronic device uses a hyperparameter grid search method to obtain optimal hyperparameter points from the second verification set, and further, the electronic device adjusts the secondary learner through the optimal hyperparameter points, Obtain the target model.
  • the electronic device splits the second verification set according to a fixed step to obtain a target subset, traverses the parameters of the two end points on the target subset, and passes the parameter verification point of the two end points.
  • the secondary learner obtains the learning rate of each parameter, determines the parameter with the best learning rate as the first hyperparameter point, and in the neighborhood of the first hyperparameter point, reduces the step size and continues Traverse until the step length is the preset step length, that is, the obtained hyperparameter point is the optimal hyperparameter point, and further, the electronic device adjusts the secondary learning according to the optimal hyperparameter point Device to obtain the target model.
  • this application does not limit the preset step length.
  • the target model trained by the long- and short-term memory algorithm since the long and short-term memory algorithm has the advantage of time series, the target model trained by the long- and short-term memory algorithm also has a certain time sequence. Through the above-mentioned embodiments, The sequential target model is quickly obtained, which is convenient for subsequent sequential prediction of the prediction task.
  • the method further includes:
  • the electronic device When it is determined that the target task is not the predicted task that appears for the first time, the electronic device obtains target data when the target task first appears, and inputs the target data into the target model to obtain a target result.
  • the target model can be directly used for prediction, which can avoid repeated training of the target model, thereby improving the efficiency of prediction.
  • the method further includes:
  • the electronic device detects whether the target result is abnormal, and when it detects that the target result is abnormal, generates alarm information, and sends the alarm information to a terminal device of a designated contact.
  • the alarm information may include target tasks, target results, and predicted time points.
  • the designated contact person may include the user who triggered the prediction task, and the like.
  • the target result when the target result is abnormal, the target result can be alerted in advance and reminded in time, which is beneficial for the user to take precautionary measures in advance.
  • the electronic device detects that the stock trend of X stock exists in the next week Risk, further, the electronic device generates the alarm information, and sends the alarm information to the terminal device of the designated contact.
  • the electronic device detects that the sales volume of product A is less than a threshold, and further, The electronic device generates the alarm information, and sends the alarm information to the terminal device of the designated contact.
  • the threshold may be a preset sales volume, which is not limited in this application.
  • this application can be applied to the field of intelligent decision-making in artificial intelligence.
  • a prediction instruction When a prediction instruction is received, current scene data can be obtained, and the target task to which the current scene data belongs can be determined according to the current scene data. , Judge whether the target task is a predicted task that appears for the first time, and when the target task is a predicted task that appears for the first time, obtain target data related to the target task, divide the target data in proportion to obtain the first data
  • the first data set is preprocessed to obtain the data feature, and the data feature is input into at least one pre-trained model to obtain at least one prediction result.
  • the long and short-term memory algorithm is used to train the
  • the at least one prediction result is used to obtain a target model, and the second data set is input to the target model to obtain the target result.
  • the target model be predicted on-demand, but also time-series predictions can be made according to the prediction task .
  • the multi-task prediction device 11 includes an acquisition unit 110, a determination unit 111, a judgment unit 112, a split unit 113, a preprocessing unit 114, an input unit 115, a training unit 116, a generation unit 117, a sending unit 118, and a detection unit 119.
  • the module/unit referred to in this application refers to a series of computer program segments that can be executed by the processor 13 and can complete fixed functions, and are stored in the memory 12. In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.
  • the obtaining unit 110 obtains current scene data.
  • the current scenario data may include, but is not limited to: stock trend scenario, product sales volume scenario, disease incidence scenario, etc.
  • the prediction instruction may be triggered by the user, or may be automatically triggered when certain conditions are met, which is not limited in the present application.
  • the meeting certain conditions includes, but is not limited to: meeting a preset time, etc.
  • the preset time may include a determined time point, or include a time period, etc., for example: the preset time may be 7 o'clock in the morning every day.
  • the determining unit 111 determines the target task corresponding to the current scene data according to the current scene data.
  • the determining unit 111 determining the target task to which the current scene data belongs according to the current scene data includes:
  • the determining unit 111 matches the current scene data with pre-configured scene data, and determines a task corresponding to the matched scene data as the target task.
  • the target task may include, but is not limited to: predicting the sales volume of A product, predicting the stock trend of X stock, predicting the incidence of D disease, etc.
  • the target task can be quickly and accurately identified, so that it is convenient to determine whether the target task is a predicted task that appears for the first time.
  • the judging unit 112 judges whether the target task is a predicted task that appears for the first time.
  • the judging unit 112 judging whether the target task is a predicted task that appears for the first time includes:
  • the judgment unit 112 detects the target task. When it is detected that the target task has not been trained before a preset time point, the judgment unit 112 determines that the target task is a prediction task that appears for the first time. If the target task is out of training before the preset time point, the judgment unit 112 determines that the target task is not a prediction task that appears for the first time.
  • the preset time point may include the time when the prediction task is received, which is not limited in this application.
  • the obtaining unit 110 obtains target data related to the target task.
  • the acquiring unit 110 acquiring target data related to the target task includes, but is not limited to, one or a combination of the following methods:
  • the obtaining unit 110 uses web crawler technology to obtain target data related to the target task from the Internet.
  • the Internet may include any website that supports access, such as Baidu, Google, Tencent, Weibo, etc.
  • web crawler technology also known as web spider, web robot
  • web spider web robot
  • the target task when the target task is to predict the stock trend of X stock, then the target data is the trend of X stock in the past preset time period; when the target task is to predict the sales volume of A product, then the target The data is the sales volume of A product in the past preset time period.
  • the acquiring unit 110 receives target data related to the target task uploaded by the user.
  • the splitting unit 113 splits the target data in proportion to obtain the first data set and the second data set.
  • the splitting unit 113 splits the target data in proportion to obtain a first data set and a second data set.
  • the splitting unit 113 determines a preset ratio of target data in the target data as the first data set, where the first data set is used to train at least one model, and further, the The splitting unit 113 determines the target data except for the first data set in the target data as the second data set, where the second data set is used as the input data of the target model.
  • the preset ratio is not limited, and may be 0.8, 0.6, etc.
  • the preprocessing unit 114 preprocesses the first data set to obtain data characteristics.
  • the preprocessing unit 114 preprocessing the first data set to obtain data characteristics includes:
  • the preprocessing unit 114 performs deviation detection on the first data set to obtain deviation data. Further, the preprocessing unit 114 deletes the deviation data to obtain the data characteristics.
  • the preprocessing unit 114 adopts a density-based outlier detection method to perform deviation detection on the first data set to obtain deviation data.
  • the preprocessing unit 114 uses relative density detection technology to divide the first data set into several objects, calculates the density of each object separately, and then obtains the outlier score of each object. Further, The preprocessing unit 114 calculates the average density of the neighborhood of each object, and when the outlier score of the object is less than the average density of the neighborhood corresponding to the object, the object is determined as deviation data.
  • the preprocessing unit 114 deletes the deviation data from the first data set to obtain the data characteristics.
  • the deviation data can be accurately obtained and eliminated, which is beneficial to the subsequent accurate training of the target model, thereby improving the accuracy of the target model.
  • the method of preprocessing the first data set is not limited in this application as long as it is legal and reasonable.
  • the input unit 115 inputs the data feature into at least one pre-trained model to obtain at least one prediction result.
  • training the at least one model includes, but is not limited to, one or a combination of the following methods:
  • the acquiring unit 110 acquires a first training set related to the target task, wherein the first training set does not intersect with the first data set; further, the training unit 116 uses neural network algorithm training In the first training set, the at least one model is obtained.
  • the training unit 116 performs normalization processing on the first training set, and further, the training unit 116 uses the normalized first training set to construct a network to obtain the first network.
  • the training unit 116 uses a preset learning rate to train the first network to obtain the at least one model.
  • the learning rate of the at least one model obtained by training may be the same or different.
  • the learning rate of the at least one model is infinitely close to the learning rate, and when multiple learning rates are configured, the relationship between the at least one model and the multiple learning rates
  • the configuration can be customized (for example, the training unit 116 is configured with learning rate A and learning rate B, and it is determined that there are 3 models that need to be trained based on the learning rate A, and it is determined that there are 4 models that need to be trained based on the learning rate B ,
  • the at least one model is the 7 models trained above).
  • the acquiring unit 110 acquires a first training set related to the target task, wherein the first training set and the first data set are not intersected; further, the training unit 116 adopts linear regression The algorithm trains the first training set to obtain the at least one model.
  • the training unit 116 constructs a model based on the first training set to obtain a prediction function. Further, the training unit 116 uses a gradient descent algorithm to reduce the error of the prediction function to obtain a prediction function with an error less than a threshold, That is the at least one model.
  • the threshold is set in advance and can be: 0.2, etc., which is not limited in this application.
  • the training unit 116 can quickly obtain a model, which improves the speed of subsequent training of the target model.
  • the input unit 115 inputs the data feature into the at least one pre-trained model to obtain at least one prediction result.
  • the input unit 115 inputs the data features into each of the at least one model to obtain at least one first result of each model. Further, the input unit 115 integrates the data of each model At least one first result, the at least one prediction result is obtained.
  • the training unit 116 uses a long and short-term memory algorithm to train the at least one prediction result to obtain a target model.
  • the Long Short-Term Memory (LSTM) algorithm includes three network layers, where the three network layers are an input gate layer, a forget gate layer, and an output gate layer.
  • the training unit 116 adopts a long and short-term memory algorithm to train the at least one prediction result, and obtaining a target model includes:
  • the training unit 116 inputs the at least one prediction result to the forgetting gate layer to perform forgetting processing to obtain second training data. Further, the training unit 116 uses a cross-validation method to divide the second training data into second training data. The training set and the second verification set, the second training set is input to the input gate layer for training to obtain a secondary learner, and the secondary learner is adjusted according to the second verification set to obtain a target model.
  • the training unit 116 uses a cross-validation method to divide the second training data into a second training set and a second verification set, which specifically includes:
  • the training unit 116 randomly divides the second training data into at least one data packet according to a preset number, determines any one of the at least one data packet as the second verification set, and the remaining data packets It is determined as the second training set, and the above steps are repeated until all data packets are sequentially used as the second verification set.
  • the training unit 116 divides the second training data into three data packets, namely data packet E, data packet F, and data packet G, and determines the data packet E as the verification set, and the data The packet F and the data packet G are determined as the second training set. Secondly, the data packet F is determined as the verification set, and the data packet E and the data packet G are determined as the second training set. Finally, the data packet G is determined to be the verification set, and the data packet E and the data packet F are determined to be the second training set.
  • the second training data is divided by a cross-validation method, so that all of the second training data participates in training and verification, thereby improving the fitness of training the target model.
  • the training unit 116 adjusting the secondary learner according to the second verification set to obtain a target model includes:
  • the training unit 116 uses a hyperparameter grid search method to obtain the optimal hyperparameter points from the second verification set. Further, the training unit 116 performs an operation on the secondary learner through the optimal hyperparameter points. Adjust to obtain the target model.
  • the training unit 116 splits the second verification set according to a fixed step size to obtain a target subset, traverses the parameters of the two ends of the target subset, and passes the parameter verification of the two ends.
  • the secondary learner obtains the learning rate of each parameter, determines the parameter with the best learning rate as the first hyperparameter point, and reduces the step size in the neighborhood of the first hyperparameter point Continue to traverse until the step length is the preset step length, that is, the obtained hyperparameter point is the optimal hyperparameter point, and further, the training unit 116 adjusts the secondary hyperparameter point according to the optimal hyperparameter point. Level learner to obtain the target model.
  • this application does not limit the preset step length.
  • the target model trained by the long- and short-term memory algorithm since the long and short-term memory algorithm has the advantage of time series, the target model trained by the long- and short-term memory algorithm also has a certain time sequence. Through the above-mentioned embodiments, The sequential target model is quickly obtained, which is convenient for subsequent sequential prediction of the prediction task.
  • the method further includes:
  • the obtaining unit 110 obtains the target data when the target task first appears, and further, the input unit 115 inputs the target data to the target model In, get the target result.
  • the target model can be directly used for prediction, which can avoid repeated training of the target model, thereby improving the efficiency of prediction.
  • the input unit 115 inputs the second data set into the target model to obtain a target result.
  • the method further includes:
  • the detection unit 119 detects whether the target result is abnormal, and when it is detected that the target result is abnormal, the generating unit 117 generates alarm information. Further, the sending unit 118 sends the alarm information to the terminal device of the designated contact.
  • the alarm information may include target tasks, target results, and predicted time points.
  • the designated contact person may include the user who triggered the prediction task, and the like.
  • the target result when the target result is abnormal, the target result can be alerted in advance and reminded in time, which is beneficial for the user to take precautionary measures in advance.
  • the generating unit 117 generates the alarm information, and further, the sending unit 118 sends the alarm information to the terminal device of the designated contact.
  • the generating unit 117 When the target task is to predict the sales volume of product A, and the target result is the sales volume of product A in the next month, when it is detected that the sales volume of product A is less than a threshold, further, the generating unit 117 generates the alarm information, and further, the sending unit 118 sends the alarm information to the terminal device of the designated contact.
  • the threshold may be a preset sales volume, which is not limited in this application.
  • this application can be applied to the field of intelligent decision-making in artificial intelligence.
  • a prediction instruction When a prediction instruction is received, current scene data can be obtained, and the target task to which the current scene data belongs can be determined according to the current scene data. , Judge whether the target task is a predicted task that appears for the first time, and when the target task is a predicted task that appears for the first time, obtain target data related to the target task, divide the target data in proportion to obtain the first data
  • the first data set is preprocessed to obtain the data feature, and the data feature is input into at least one pre-trained model to obtain at least one prediction result.
  • the long and short-term memory algorithm is used to train the
  • the at least one prediction result is used to obtain a target model, and the second data set is input to the target model to obtain the target result.
  • the target model be predicted on-demand, but also time-series predictions can be made according to the prediction task .
  • FIG. 3 it is a schematic structural diagram of an electronic device according to a preferred embodiment of the multi-task prediction method of the present application.
  • the electronic device 1 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC) ), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • embedded equipment etc.
  • the electronic device 1 can also be, but is not limited to, any electronic product that can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device, for example, a personal computer, a tablet computer, or a smart phone. , Personal Digital Assistant (PDA), game consoles, interactive network TV (Internet Protocol Television, IPTV), smart wearable devices, etc.
  • PDA Personal Digital Assistant
  • IPTV Internet Protocol Television
  • smart wearable devices etc.
  • the electronic device 1 may also be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the network where the electronic device 1 is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), etc.
  • the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program stored in the memory 12 and running on the processor 13, such as Multi-task prediction program.
  • the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. Components, for example, the electronic device 1 may also include input and output devices, network access devices, buses, and the like.
  • the processor 13 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (ASICs), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
  • the processor 13 is the computing core and control center of the electronic device 1 and connects the entire electronic device with various interfaces and lines. Each part of 1, and executes the operating system of the electronic device 1, and various installed applications, program codes, etc.
  • the processor 13 executes the operating system of the electronic device 1 and various installed applications.
  • the processor 13 executes the application program to implement the steps in the foregoing embodiments of the multi-task prediction method, such as steps S10, S11, S12, S13, S14, S15, S16, S17, and S18 shown in FIG. 1.
  • each module/unit in the foregoing device embodiments is implemented, for example: when a prediction instruction is received, current scene data is acquired; according to the current scene data, all The target task corresponding to the current scene data; determine whether the target task is a predicted task that appears for the first time; when the target task is a predicted task that appears for the first time, obtain target data related to the target task; split according to proportions
  • the target data obtains a first data set and a second data set; preprocessing the first data set to obtain data features; inputting the data features into at least one pre-trained model to obtain at least one prediction Result; training the at least one prediction result using a long and short-term memory algorithm to obtain a target model; inputting the second data set into the target model to obtain a target result.
  • the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 12 and executed by the processor 13 to complete this Application.
  • the one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1.
  • the computer program can be divided into an acquisition unit 110, a determination unit 111, a judgment unit 112, a split unit 113, a preprocessing unit 114, an input unit 115, a training unit 116, a generation unit 117, a transmission unit 118, and a detection unit. 119.
  • the memory 12 may be used to store the computer program and/or module, and the processor 13 runs or executes the computer program and/or module stored in the memory 12 and calls the data stored in the memory 12, Various functions of the electronic device 1 are realized.
  • the memory 12 may mainly include a storage program area and a storage data area.
  • the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Store data (such as audio data, phone book, etc.) created based on the use of mobile phones.
  • the memory 12 may include high-speed random access memory, and may also include computer memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory.
  • SMC Smart Media Card
  • SD Secure Digital
  • flash Card At least one magnetic disk storage device, flash memory device, or other volatile/non-volatile storage device.
  • the memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a circuit with a storage function without a physical form in an integrated circuit, such as RAM (Random-Access Memory, random access memory), FIFO (First In First Out), etc. Alternatively, the memory 12 may also be a memory in physical form, such as a memory stick, a TF card (Trans-flash Card), and so on.
  • RAM Random-Access Memory
  • FIFO First In First Out
  • the memory 12 may also be a memory in physical form, such as a memory stick, a TF card (Trans-flash Card), and so on.
  • the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the computer program includes computer program code
  • the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), etc.
  • the memory 12 in the electronic device 1 stores multiple instructions to implement a multi-task prediction method, and the processor 13 can execute the multiple instructions to realize: when a prediction instruction is received, Acquire current scene data; determine the target task corresponding to the current scene data according to the current scene data; determine whether the target task is a prediction task that appears for the first time; when the target task is a prediction task that appears for the first time, obtain Target data related to the target task; split the target data in proportion to obtain a first data set and a second data set; preprocess the first data set to obtain data characteristics; combine the data characteristics Input into at least one pre-trained model to obtain at least one prediction result; train the at least one prediction result using a long and short-term memory algorithm to obtain a target model; input the second data set into the target model to obtain a target result.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

Abstract

A method and device for multitask prediction, an electronic device, and a storage medium. The method: when a prediction instruction is received, acquiring current scenario data (S10); determining, on the basis of the current scenario data, a target task corresponding to the current scenario data (S11); determining whether the target task is a prediction task appearing for the first time (S12); when the target task is a prediction task appearing for the first time, acquiring target data related to the target task (S13); proportionally splitting the target data to produce a first dataset and a second dataset (S14); preprocessing the first dataset to produce data characteristics (S15); inputting the data characteristics into at least one pretrained model to produce at least one prediction result (S16); employing a long short-term memory algorithm to train the at least one prediction result to produce a target model (S17); and inputting the second dataset into the target model to produce a target result (S18). Not only can a prediction be made as required via the target model, but a time series prediction can also be made on the basis of the prediction task.

Description

多任务预测方法、装置、电子设备及存储介质Multitask prediction method, device, electronic equipment and storage medium
本申请要求于2019年08月06日提交中国专利局、申请号为201910722718.4,发明名称为“多任务预测方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on August 6, 2019, with the application number 201910722718.4 and the invention title "Multitasking prediction method, device, electronic equipment and storage medium", the entire content of which is incorporated by reference Incorporated in this application.
技术领域Technical field
本申请涉及智能决策技术领域,尤其涉及一种多任务预测方法、装置、电子设备及存储介质。This application relates to the technical field of intelligent decision-making, and in particular to a multi-task prediction method, device, electronic equipment and storage medium.
背景技术Background technique
随着人工智能的快速发展,计算机技术在各行各业中方便着人们的生活,在对特定场景的预测方面也不例外。然而,在现有的技术方案中,对多种场景进行预测,发明人意识到需要针对每一种场景训练一个模型,从而导致预测的效率低下,因此,如何训练出一个对多种场景进行预测的模型成了亟待解决的问题,除此之外,每次对相同的任务进行预测时,仍然需要从互联网中获取数据预测,这也降低了预测的效率。With the rapid development of artificial intelligence, computer technology has facilitated people's lives in all walks of life, and it is no exception in terms of predicting specific scenarios. However, in the existing technical solutions, multiple scenarios are predicted. The inventor realizes that a model needs to be trained for each scenario, resulting in low prediction efficiency. Therefore, how to train a prediction for multiple scenarios The model has become an urgent problem to be solved. In addition, every time the same task is predicted, it is still necessary to obtain data prediction from the Internet, which also reduces the efficiency of prediction.
发明内容Summary of the invention
鉴于以上内容,有必要提供一种多任务预测方法、装置、电子设备及存储介质,能够通过目标模型按需预测,还能够根据所述预测任务进行时序性的预测。In view of the above, it is necessary to provide a multi-task prediction method, device, electronic device, and storage medium, which can predict on-demand through the target model, and can also perform sequential prediction based on the prediction task.
一种多任务预测方法,所述方法包括:A multi-task prediction method, the method includes:
当接收到预测指令时,获取当前场景数据;When receiving the prediction instruction, obtain the current scene data;
根据所述当前场景数据,确定所述当前场景数据对应的目标任务;Determine the target task corresponding to the current scene data according to the current scene data;
判断所述目标任务是否为首次出现的预测任务;Judging whether the target task is a predicted task that appears for the first time;
当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;When the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
按照比例拆分所述目标数据,得到第一数据集及第二数据集;Split the target data in proportion to obtain a first data set and a second data set;
对所述第一数据集进行预处理,得到数据特征;Preprocessing the first data set to obtain data characteristics;
将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;Input the data feature into at least one pre-trained model to obtain at least one prediction result;
采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;Training the at least one prediction result using a long and short-term memory algorithm to obtain a target model;
将所述第二数据集输入至所述目标模型中,得到目标结果。The second data set is input into the target model to obtain a target result.
一种多任务预测装置,所述装置包括:A multi-task prediction device, the device includes:
获取单元,用于当接收到预测指令时,获取当前场景数据;The acquiring unit is used to acquire current scene data when the prediction instruction is received;
确定单元,用于根据所述当前场景数据,确定所述当前场景数据对应的目标任务;A determining unit, configured to determine a target task corresponding to the current scene data according to the current scene data;
判断单元,用于判断所述目标任务是否为首次出现的预测任务;A judging unit for judging whether the target task is a prediction task that appears for the first time;
所述获取单元,还用于当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;The acquiring unit is further configured to acquire target data related to the target task when the target task is a predicted task that appears for the first time;
拆分单元,用于按照比例拆分所述目标数据,得到第一数据集及第二数据集;A splitting unit, configured to split the target data in proportion to obtain a first data set and a second data set;
预处理单元,用于对所述第一数据集进行预处理,得到数据特征;A preprocessing unit, configured to preprocess the first data set to obtain data characteristics;
输入单元,用于将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;The input unit is used to input the data feature into at least one pre-trained model to obtain at least one prediction result;
训练单元,用于采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;A training unit, configured to train the at least one prediction result by using a long and short-term memory algorithm to obtain a target model;
所述输入单元,还用于将所述第二数据集输入至所述目标模型中,得到目标结果。The input unit is also used to input the second data set into the target model to obtain a target result.
一种电子设备,所述电子设备包括:An electronic device, which includes:
存储器,存储至少一个计算机可读指令;及The memory stores at least one computer readable instruction; and
处理器,执行所述存储器中存储的至少一个计算机可读指令以实现以下步骤:The processor executes at least one computer-readable instruction stored in the memory to implement the following steps:
当接收到预测指令时,获取当前场景数据;When receiving the prediction instruction, obtain the current scene data;
根据所述当前场景数据,确定所述当前场景数据对应的目标任务;Determine the target task corresponding to the current scene data according to the current scene data;
判断所述目标任务是否为首次出现的预测任务;Judging whether the target task is a predicted task that appears for the first time;
当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;When the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
按照比例拆分所述目标数据,得到第一数据集及第二数据集;Split the target data in proportion to obtain a first data set and a second data set;
对所述第一数据集进行预处理,得到数据特征;Preprocessing the first data set to obtain data characteristics;
将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;Input the data feature into at least one pre-trained model to obtain at least one prediction result;
采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;Training the at least one prediction result using a long and short-term memory algorithm to obtain a target model;
将所述第二数据集输入至所述目标模型中,得到目标结果。The second data set is input into the target model to obtain a target result.
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个计算机可读指令,所述至少一个计算机可读指令被电子设备中的处理器执行以实现以下步骤:A computer-readable storage medium in which at least one computer-readable instruction is stored, and the at least one computer-readable instruction is executed by a processor in an electronic device to implement the following steps:
当接收到预测指令时,获取当前场景数据;When receiving the prediction instruction, obtain the current scene data;
根据所述当前场景数据,确定所述当前场景数据对应的目标任务;Determine the target task corresponding to the current scene data according to the current scene data;
判断所述目标任务是否为首次出现的预测任务;Judging whether the target task is a predicted task that appears for the first time;
当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;When the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
按照比例拆分所述目标数据,得到第一数据集及第二数据集;Split the target data in proportion to obtain a first data set and a second data set;
对所述第一数据集进行预处理,得到数据特征;Preprocessing the first data set to obtain data characteristics;
将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;Input the data feature into at least one pre-trained model to obtain at least one prediction result;
采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;Training the at least one prediction result using a long and short-term memory algorithm to obtain a target model;
将所述第二数据集输入至所述目标模型中,得到目标结果。The second data set is input into the target model to obtain a target result.
由以上技术方案可以看出,本申请可应用于人工智能的智能决策领域,不仅能够通过目标模型按需预测,还能够根据所述预测任务进行时序性的预测。It can be seen from the above technical solutions that the present application can be applied to the field of intelligent decision-making of artificial intelligence, not only can predict on-demand through the target model, but also can make sequential predictions based on the prediction task.
附图说明Description of the drawings
图1是本申请多任务预测方法的较佳实施例的流程图。Fig. 1 is a flowchart of a preferred embodiment of the multi-task prediction method of the present application.
图2是本申请多任务预测装置的较佳实施例的功能模块图。Fig. 2 is a functional block diagram of a preferred embodiment of the multi-task prediction device of the present application.
图3是本申请实现多任务预测方法的较佳实施例的电子设备的结构示意图。3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the multi-task prediction method according to the present application.
具体实施方式detailed description
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本申请进行详细描述。In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be described in detail below with reference to the drawings and specific embodiments.
如图1所示,是本申请多任务预测方法的较佳实施例的流程图。根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。As shown in FIG. 1, it is a flowchart of a preferred embodiment of the multi-task prediction method of the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
所述多任务预测方法应用于一个或者多个电子设备中,所述电子设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The multi-task prediction method is applied to one or more electronic devices. The electronic device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes but not Limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (Field-Programmable Gate Arrays, FPGAs), digital processors (Digital Signal Processors, DSPs), embedded devices, etc.
所述电子设备可以是任何一种可与用户进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏机、交互式网络电视(Internet Protocol Television,IPTV)、智能式穿戴式设备等。The electronic device may be any electronic product that can interact with a user with a human machine, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television ( Internet Protocol Television, IPTV), smart wearable devices, etc.
所述电子设备还可以包括网络设备和/或用户设备。其中,所述网络设备包括,但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(Cloud Computing)的由大量主机或网络服务器构成的云。The electronic device may also include a network device and/or user equipment. Wherein, the network device includes, but is not limited to, a single network server, a server group composed of multiple network servers, or a cloud composed of a large number of hosts or network servers based on Cloud Computing.
所述电子设备所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。The network where the electronic device is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (Virtual Private Network, VPN), etc.
S10,当接收到预测指令时,获取当前场景数据。S10: Acquire current scene data when a prediction instruction is received.
在本申请的至少一个实施例中,所述当前场景数据可以包括,但不限于:股票走势场景、产品销售量场景、疾病发病率场景等。In at least one embodiment of the present application, the current scenario data may include, but is not limited to: stock trend scenario, product sales volume scenario, disease incidence scenario, etc.
在本申请的至少一个实施例中,所述预测指令可以由用户触发,也可以在满足一定条件时自动触发,本申请不限制。In at least one embodiment of the present application, the prediction instruction may be triggered by the user, or may be automatically triggered when certain conditions are met, which is not limited in the present application.
其中,所述满足一定条件包括,但不限于:满足预设时间等。Wherein, the meeting certain conditions includes, but is not limited to: meeting a preset time, etc.
所述预设时间可以包括确定的时间点,或者包括一个时间段等,例如:所述预设时间可以是每天早上七点。The preset time may include a determined time point, or include a time period, etc., for example: the preset time may be 7 o'clock in the morning every day.
S11,根据所述当前场景数据,确定所述当前场景数据对应的目标任务。S11: Determine a target task corresponding to the current scene data according to the current scene data.
在本申请的至少一个实施例中,所述电子设备根据所述当前场景数据,确定所述当前场景数据所属的目标任务包括:In at least one embodiment of the present application, the electronic device determining the target task to which the current scene data belongs according to the current scene data includes:
所述电子设备将所述当前场景数据与预先配置的场景数据进行匹配,并将匹配的场景数据对应的任务确定为所述目标任务。The electronic device matches the current scene data with pre-configured scene data, and determines a task corresponding to the matched scene data as the target task.
例如:所述目标任务可以包括,但不限于:预测A产品的销售量、预测X股票的股票走势、预测D疾病的发病率等。For example, the target task may include, but is not limited to: predicting the sales volume of A product, predicting the stock trend of X stock, predicting the incidence of D disease, etc.
通过上述实施方式,能够快速、准确地识别出所述目标任务,从而便于判断所述目标任务是否为首次出现的预测任务。Through the foregoing implementation manners, the target task can be quickly and accurately identified, so that it is convenient to determine whether the target task is a predicted task that appears for the first time.
S12,判断所述目标任务是否为首次出现的预测任务。S12: Determine whether the target task is a predicted task that appears for the first time.
在本申请的至少一个实施例中,所述电子设备判断所述目标任务是否为首次出现的预测任务包括:In at least one embodiment of the present application, the electronic device determining whether the target task is a predicted task that appears for the first time includes:
所述电子设备检测所述目标任务,当检测到所述目标任务在预设时间点之前未被训练时,所述电子设备确定所述目标任务为首次出现的预测任务,当检测到所述目标任务在所述预设时间点之前被训练过时,所述电子设备确定所述目标任务不是首次出现的预测任务。其中,所述预设时间点可以包括接收到所述预测任务的时间,本申请不作限制。The electronic device detects the target task, and when it is detected that the target task has not been trained before a preset time point, the electronic device determines that the target task is a prediction task that appears for the first time, and when the target task is detected The task is out of training before the preset time point, and the electronic device determines that the target task is not a predicted task that appears for the first time. Wherein, the preset time point may include the time when the prediction task is received, which is not limited in this application.
通过上述实施方式,能够准确判断出所述目标任务是否为首次出现的预测任务,便于后续对所述目标任务进行处理。Through the foregoing implementation manners, it can be accurately determined whether the target task is a predicted task that appears for the first time, which facilitates subsequent processing of the target task.
S13,当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据。S13: When the target task is a predicted task that appears for the first time, obtain target data related to the target task.
在本申请的至少一个实施例中,所述电子设备获取与所述目标任务相关的目标数据包括,但不限于以下一种或者多种方式的组合:In at least one embodiment of the present application, the electronic device acquiring target data related to the target task includes, but is not limited to, one or a combination of the following methods:
(1)所述电子设备采用网络爬虫技术(Web crawler)从互联网中获取与所述目标任务相关的目标数据。(1) The electronic device uses Web crawler technology to obtain target data related to the target task from the Internet.
其中,所述互联网可以包括任何支持访问的网站,例如:百度、谷歌、腾讯、微博等。Wherein, the Internet may include any website that supports access, such as Baidu, Google, Tencent, Weibo, etc.
进一步地,所述网络爬虫技术(又被称为网页蜘蛛,网络机器人),是一种按照一定的规则,自动地抓取万维网信息的方式。Further, the web crawler technology (also known as web spider, web robot) is a way to automatically grab information on the World Wide Web according to certain rules.
例如:当所述目标任务为预测X股票的股票走势时,则所述目标数据为X股票过去预设时间段的走势;当所述目标任务为预测A产品的销售量时,则所述目标数据为A产品在过去预设时间段的销售量。For example: when the target task is to predict the stock trend of X stock, then the target data is the trend of X stock in the past preset time period; when the target task is to predict the sales volume of A product, then the target The data is the sales volume of A product in the past preset time period.
通过上述实施方式,能够获取到更多的目标数据,从而能够提高目标模型的训练效果,降低目标模型训练误差。Through the foregoing implementation manners, more target data can be obtained, thereby improving the training effect of the target model and reducing the training error of the target model.
(2)所述电子设备接收所述用户上传的与所述目标任务相关的目标数据。(2) The electronic device receives target data related to the target task uploaded by the user.
通过上述实施方式,能够获取到准确的目标数据,从而有利于后续得到更精确的目标模型。Through the foregoing implementation manners, accurate target data can be obtained, which is beneficial to obtaining a more accurate target model later.
S14,按照比例拆分所述目标数据,得到第一数据集及第二数据集。S14: Split the target data in proportion to obtain a first data set and a second data set.
在本申请的至少一个实施例中,所述电子设备按照比例拆分所述目标数据,得到第 一数据集及第二数据集。In at least one embodiment of the present application, the electronic device splits the target data in proportion to obtain the first data set and the second data set.
具体地,所述电子设备将所述目标数据中预设比例的目标数据确定为所述第一数据集,其中,所述第一数据集用于训练至少一个模型,进一步地,所述电子设备将所述目标数据中除所述第一数据集的目标数据确定为所述第二数据集,其中,所述第二数据集作为所述目标模型的输入数据。其中,所述预设比例不作限制,可以是0.8、0.6等。Specifically, the electronic device determines a preset proportion of target data in the target data as the first data set, wherein the first data set is used to train at least one model, and further, the electronic device The target data except for the first data set in the target data is determined as the second data set, wherein the second data set is used as the input data of the target model. Wherein, the preset ratio is not limited, and may be 0.8, 0.6, etc.
S15,对所述第一数据集进行预处理,得到数据特征。S15: Perform preprocessing on the first data set to obtain data characteristics.
在本申请的至少一个实施例中,所述电子设备对所述第一数据集进行预处理,得到数据特征包括:In at least one embodiment of the present application, the electronic device preprocessing the first data set to obtain data characteristics includes:
所述电子设备对所述第一数据集进行偏差检测,得到偏差数据,进一步地,所述电子设备删除所述偏差数据,得到所述数据特征。The electronic device performs deviation detection on the first data set to obtain deviation data. Further, the electronic device deletes the deviation data to obtain the data characteristics.
在本申请的至少一个实施例中,所述电子设备采用基于密度的离群点检测方法对所述第一数据集进行偏差检测,得到偏差数据。In at least one embodiment of the present application, the electronic device uses a density-based outlier detection method to perform deviation detection on the first data set to obtain deviation data.
具体地,所述电子设备采用相对密度检测技术将所述第一数据集划分为若干个对象,分别计算每个对象的密度,进而得到每个对象的离群点得分,进一步地,所述电子设备计算每个对象的邻近平均密度,当所述对象的离群点得分小于所述对象对应的邻近平均密度时,将所述对象确定为偏差数据。Specifically, the electronic device uses a relative density detection technology to divide the first data set into several objects, calculates the density of each object separately, and obtains the outlier score of each object. Further, the electronic The device calculates the neighborhood average density of each object, and when the outlier score of the object is less than the neighborhood average density corresponding to the object, the object is determined as deviation data.
进一步地,所述电子设备将所述偏差数据从所述第一数据集中删除,得到所述数据特征。Further, the electronic device deletes the deviation data from the first data set to obtain the data characteristics.
通过上述实施方式,能够准确地得出并排除所述偏差数据,有利于后续准确地对目标模型进行训练,从而提高目标模型的准确性。Through the foregoing implementation manners, the deviation data can be accurately obtained and eliminated, which is beneficial to the subsequent accurate training of the target model, thereby improving the accuracy of the target model.
当然,对所述第一数据集进行预处理的方式,只要合法合理,本申请不作限制。Of course, the method of preprocessing the first data set is not limited in this application as long as it is legal and reasonable.
S16,将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果。S16. Input the data feature into at least one pre-trained model to obtain at least one prediction result.
在本申请的至少一个实施例中,在将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果之前,所述电子设备训练所述至少一个模型。In at least one embodiment of the present application, the electronic device trains the at least one model before inputting the data features into the at least one pre-trained model to obtain at least one prediction result.
具体地,所述电子设备训练所述至少一个模型包括,但不限于以下一种或者多种方式的组合:Specifically, training the at least one model by the electronic device includes, but is not limited to, one or a combination of the following methods:
(1)所述电子设备获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;进一步地,所述电子设备采用神经网络算法训练所述第一训练集,得到所述至少一个模型。(1) The electronic device acquires a first training set related to the target task, wherein the first training set does not intersect with the first data set; further, the electronic device uses neural network algorithm training In the first training set, the at least one model is obtained.
具体地,所述电子设备对所述第一训练集进行归一化处理,进一步地,所述电子设备采用归一化处理后的第一训练集构建网络,得到第一网络,所述电子设备利用预先设定的学习率对所述第一网络进行训练,得到所述至少一个模型。Specifically, the electronic device performs normalization processing on the first training set, and further, the electronic device constructs a network using the first training set after the normalization processing to obtain the first network, and the electronic device Training the first network by using a preset learning rate to obtain the at least one model.
需要说明的是,训练得到的所述至少一个模型的学习率可以是相同的,也可以是不同的。当预先配置了一个学习率时,所述至少一个模型的学习率都无限接近所述学习率,而当配置了多个学习率时,则所述至少一个模型与所述多个学习率的关系可以自定义配置(例如:所述电子设备配置了学习率A及学习率B,并确定有3个模型需要依据所述学习率A训练,确定有4个模型需要依据所述学习率B训练,则所述至少一个模型为上述训练的7个模型)。It should be noted that the learning rate of the at least one model obtained by training may be the same or different. When a learning rate is configured in advance, the learning rate of the at least one model is infinitely close to the learning rate, and when multiple learning rates are configured, the relationship between the at least one model and the multiple learning rates The configuration can be customized (for example, the electronic device is configured with a learning rate A and a learning rate B, and it is determined that there are 3 models that need to be trained based on the learning rate A, and it is determined that 4 models need to be trained based on the learning rate B, Then the at least one model is the 7 models trained above).
通过上述实施方式,能够得到较精确的模型,提高后续所述目标模型训练的精确度。Through the foregoing implementation manners, a more accurate model can be obtained, and the accuracy of subsequent training of the target model can be improved.
(2)所述电子设备获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;进一步地,所述电子设备采用线性回归算法训练所述第一训练集,得到所述至少一个模型。(2) The electronic device acquires a first training set related to the target task, wherein the first training set does not intersect with the first data set; further, the electronic device uses a linear regression algorithm for training In the first training set, the at least one model is obtained.
具体地,所述电子设备基于所述第一训练集构建模型,得到预测函数,进一步地,所述电子设备采用梯度下降算法缩小所述预测函数的误差,得到误差小于阈值的预测函数,即为所述至少一个模型。Specifically, the electronic device constructs a model based on the first training set to obtain a prediction function. Further, the electronic device uses a gradient descent algorithm to reduce the error of the prediction function, and obtains a prediction function with an error less than a threshold, which is The at least one model.
其中,所述阈值是预先设定的,可以是:0.2等,本申请不作限制。Wherein, the threshold is set in advance and can be: 0.2, etc., which is not limited in this application.
通过上述实施方式,所述电子设备能够快速得到模型,提高后续训练所述目标模型的速度。Through the foregoing implementation manners, the electronic device can quickly obtain a model, which improves the speed of subsequent training of the target model.
在本申请的至少一个实施例中,所述电子设备将所述数据特征输入至预先训练的所述至少一个模型中,得到至少一个预测结果。In at least one embodiment of the present application, the electronic device inputs the data feature into the at least one pre-trained model to obtain at least one prediction result.
具体地,所述电子设备将所述数据特征输入至所述至少一个模型中的每个模型,得到每个模型的至少一个第一结果,进一步地,所述电子设备整合每个模型的至少一个第一结果,得到所述至少一个预测结果。Specifically, the electronic device inputs the data characteristics into each of the at least one model to obtain at least one first result of each model, and further, the electronic device integrates at least one of each model The first result is the at least one prediction result.
通过上述实施方式,能够得到多个预测结果,为训练所述目标模型提供了训练基础。Through the foregoing implementation manners, multiple prediction results can be obtained, providing a training basis for training the target model.
S17,采用长短期记忆算法训练所述至少一个预测结果,得到目标模型。S17. Train the at least one prediction result using a long- and short-term memory algorithm to obtain a target model.
所述长短期记忆算法(Long Short-Term Memory,LSTM)包括三个网络层,其中,所述三个网络层分别为输入门层、遗忘门层以及输出门层。The Long Short-Term Memory (LSTM) algorithm includes three network layers, where the three network layers are an input gate layer, a forget gate layer, and an output gate layer.
在本申请的至少一个实施例中,所述电子设备采用长短期记忆算法训练所述至少一个预测结果,得到目标模型包括:In at least one embodiment of the present application, the electronic device training the at least one prediction result by using a long- and short-term memory algorithm to obtain a target model includes:
所述电子设备将所述至少一个预测结果输入到遗忘门层进行遗忘处理,得到第二训练数据,进一步地,所述电子设备采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集,将所述第二训练集输入到输入门层进行训练,得到次级学习器,根据所述第二验证集,调整所述次级学习器,得到目标模型。The electronic device inputs the at least one prediction result into the forgetting gate layer to perform forgetting processing to obtain second training data. Further, the electronic device uses a cross-validation method to divide the second training data into a second training set And a second verification set, input the second training set to the input gate layer for training to obtain a secondary learner, and adjust the secondary learner according to the second verification set to obtain a target model.
在本申请的至少一个实施例中,所述电子设备采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集,具体包括:In at least one embodiment of the present application, the electronic device uses a cross-validation method to divide the second training data into a second training set and a second verification set, which specifically includes:
所述电子设备将所述第二训练数据按照预设数目随机划分为至少一个数据包,将所述至少一个数据包中的任意一个数据包确定为所述第二验证集,其余的数据包确定为所述第二训练集,重复上述步骤,直至所有的数据包全都依次被用作为所述第二验证集。The electronic device randomly divides the second training data into at least one data packet according to a preset number, determines any one of the at least one data packet as the second verification set, and determines the remaining data packets For the second training set, repeat the above steps until all data packets are used as the second verification set in turn.
例如:所述电子设备将所述第二训练数据划分为3个数据包,分别为数据包E、数据包F、数据包G,并将所述数据包E确定为所述验证集,数据包F以及数据包G确定为所述第二训练集。其次,将所述数据包F确定为所述验证集,数据包E以及数据包G确定为所述第二训练集。最后,所述数据包G确定为所述验证集,数据包E以及数据包F确定为所述第二训练集。For example: the electronic device divides the second training data into three data packets, namely data packet E, data packet F, and data packet G, and determines the data packet E as the verification set, and the data packet F and data packet G are determined to be the second training set. Secondly, the data packet F is determined as the verification set, and the data packet E and the data packet G are determined as the second training set. Finally, the data packet G is determined to be the verification set, and the data packet E and the data packet F are determined to be the second training set.
通过上述实施方式,通过交叉验证法划分所述第二训练数据,使所述第二训练数据的全量均参加训练及验证,由此,提高训练所述目标模型的拟合度。Through the foregoing implementation manner, the second training data is divided by a cross-validation method, so that all of the second training data participates in training and verification, thereby improving the fitness of training the target model.
在本申请的至少一个实施例中,所述电子设备根据所述第二验证集,调整所述次级学习器,得到目标模型包括:In at least one embodiment of the present application, the electronic device adjusting the secondary learner according to the second verification set to obtain the target model includes:
所述电子设备采用超参数网格搜索方法从所述第二验证集中获取最优超参数点,进一步地,所述电子设备通过所述最优超参数点对所述次级学习器进行调整,得到所述目标模型。The electronic device uses a hyperparameter grid search method to obtain optimal hyperparameter points from the second verification set, and further, the electronic device adjusts the secondary learner through the optimal hyperparameter points, Obtain the target model.
具体地,所述电子设备将所述第二验证集按照固定步长进行拆分,得到目标子集,遍历所述目标子集上两端端点的参数,通过所述两端端点的参数验证所述次级学习器,得到每个参数的学习率,将所述学习率最好的参数确定为第一超参数点,并在所述第一超参数点的邻域内,缩小所述步长继续遍历,直至所述步长为预设步长,即得到的超参数点为所述最优超参数点,更进一步地,所述电子设备根据所述最优超参数点调整所述次级学习器,得到所述目标模型。Specifically, the electronic device splits the second verification set according to a fixed step to obtain a target subset, traverses the parameters of the two end points on the target subset, and passes the parameter verification point of the two end points. The secondary learner obtains the learning rate of each parameter, determines the parameter with the best learning rate as the first hyperparameter point, and in the neighborhood of the first hyperparameter point, reduces the step size and continues Traverse until the step length is the preset step length, that is, the obtained hyperparameter point is the optimal hyperparameter point, and further, the electronic device adjusts the secondary learning according to the optimal hyperparameter point Device to obtain the target model.
其中,本申请对所述预设步长不作限制。Among them, this application does not limit the preset step length.
通过上述实施方式,能够得到较为精确的所述目标模型,进一步得到精确的目标结果。Through the foregoing implementation manners, a more accurate target model can be obtained, and further accurate target results can be obtained.
在本申请的至少一个实施例中,由于所述长短期记忆算法具有时间序列的优点,因此,通过所述长短期记忆算法训练的目标模型,也具有一定的时序性,通过上述实施方式,能够快速得到时序性的目标模型,便于后续对所述预测任务的时序性预测。In at least one embodiment of the present application, since the long and short-term memory algorithm has the advantage of time series, the target model trained by the long- and short-term memory algorithm also has a certain time sequence. Through the above-mentioned embodiments, The sequential target model is quickly obtained, which is convenient for subsequent sequential prediction of the prediction task.
在本申请的至少一个实施例中,在判断所述目标任务是否为首次出现的预测任务之后,所述方法还包括:In at least one embodiment of the present application, after determining whether the target task is a predicted task that appears for the first time, the method further includes:
当判断所述目标任务不是首次出现的预测任务时,所述电子设备获取所述目标任务首次出现时的目标数据,并将所述目标数据输入至所述目标模型中,得到目标结果。When it is determined that the target task is not the predicted task that appears for the first time, the electronic device obtains target data when the target task first appears, and inputs the target data into the target model to obtain a target result.
通过上述实施方式,在判断所述目标任务不是首次出现的预测任务后,能够直接采用所述目标模型进行预测,能够避免重复训练所述目标模型,进而能够提高预测的效率。Through the foregoing implementation manners, after judging that the target task is not a prediction task that appears for the first time, the target model can be directly used for prediction, which can avoid repeated training of the target model, thereby improving the efficiency of prediction.
S18,将所述第二数据集输入至所述目标模型中,得到目标结果。S18: Input the second data set into the target model to obtain a target result.
在本申请的至少一个实施例中,在将所述第二数据集输入至所述目标模型中,得到目标结果后,所述方法还包括:In at least one embodiment of the present application, after the second data set is input into the target model and the target result is obtained, the method further includes:
所述电子设备检测所述目标结果是否出现异常,当检测到所述目标结果出现异常时,生成警报信息,并将所述警报信息发送到指定联系人的终端设备。The electronic device detects whether the target result is abnormal, and when it detects that the target result is abnormal, generates alarm information, and sends the alarm information to a terminal device of a designated contact.
其中,所述警报信息可以包括目标任务、目标结果以及预测的时间点等。Wherein, the alarm information may include target tasks, target results, and predicted time points.
进一步地,所述指定联系人可以包括触发预测任务的用户等。Further, the designated contact person may include the user who triggered the prediction task, and the like.
通过上述实施方式,当所述目标结果存在异常时,能够提前对所述目标结果进行警报,并及时提醒,有利于用户提前做好防备措施。Through the foregoing implementation manners, when the target result is abnormal, the target result can be alerted in advance and reminded in time, which is beneficial for the user to take precautionary measures in advance.
例如:当所述目标任务为预测X股票的股票走势,并且所述目标结果为未来预设时间段内的X股票的股票走势时,所述电子设备检测到未来一个星期X股票的股票走势存在风险,进一步地,所述电子设备生成所述警报信息,并将所述警报信息发送到所述指定联系人的终端设备。For example: when the target task is to predict the stock trend of X stock, and the target result is the stock trend of X stock in the future preset time period, the electronic device detects that the stock trend of X stock exists in the next week Risk, further, the electronic device generates the alarm information, and sends the alarm information to the terminal device of the designated contact.
当所述目标任务为预测A产品的销售量,并且所述目标结果为未来一个月内A产品的销售量时,所述电子设备检测到所述A产品的销售量小于阈值,进一步地,所述电子设备生成所述警报信息,并将所述警报信息发送到所述指定联系人的终端设备。When the target task is to predict the sales volume of product A, and the target result is the sales volume of product A in the next month, the electronic device detects that the sales volume of product A is less than a threshold, and further, The electronic device generates the alarm information, and sends the alarm information to the terminal device of the designated contact.
其中,所述阈值可以是预先设定的销售量,本申请不作限制。Wherein, the threshold may be a preset sales volume, which is not limited in this application.
由以上技术方案可以看出,本申请可应用于人工智能的智能决策领域,能够当接收到预测指令时,获取当前场景数据,根据所述当前场景数据,确定所述当前场景数据所属的目标任务,判断所述目标任务是否为首次出现的预测任务,当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据,按照比例划分所述目标数据,得到第一数据集及第二数据集,对所述第一数据集进行预处理,得到数据特征,将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果,采用长短期记忆算法训练所述至少一个预测结果,得到目标模型,将所述第二数据集输入至所述目标模型中,得到目标结果,不仅能够通过目标模型按需预测,还能够根据所述预测任务进行时序性的预测。It can be seen from the above technical solutions that this application can be applied to the field of intelligent decision-making in artificial intelligence. When a prediction instruction is received, current scene data can be obtained, and the target task to which the current scene data belongs can be determined according to the current scene data. , Judge whether the target task is a predicted task that appears for the first time, and when the target task is a predicted task that appears for the first time, obtain target data related to the target task, divide the target data in proportion to obtain the first data The first data set is preprocessed to obtain the data feature, and the data feature is input into at least one pre-trained model to obtain at least one prediction result. The long and short-term memory algorithm is used to train the The at least one prediction result is used to obtain a target model, and the second data set is input to the target model to obtain the target result. Not only can the target model be predicted on-demand, but also time-series predictions can be made according to the prediction task .
如图2所示,是本申请多任务预测装置的较佳实施例的功能模块图。所述多任务预测装置11包括获取单元110、确定单元111、判断单元112、拆分单元113、预处理单元114、输入单元115、训练单元116、生成单元117、发送单元118以及检测单元119。本申请所称的模块/单元是指一种能够被处理器13所执行,并且能够完成固定功能的一系列计算机程序段,其存储在存储器12中。在本实施例中,关于各模块/单元的功能将在后续的实施例中详述。As shown in FIG. 2, it is a functional block diagram of a preferred embodiment of the multi-task prediction device of the present application. The multi-task prediction device 11 includes an acquisition unit 110, a determination unit 111, a judgment unit 112, a split unit 113, a preprocessing unit 114, an input unit 115, a training unit 116, a generation unit 117, a sending unit 118, and a detection unit 119. The module/unit referred to in this application refers to a series of computer program segments that can be executed by the processor 13 and can complete fixed functions, and are stored in the memory 12. In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.
当接收到预测指令时,获取单元110获取当前场景数据。When a prediction instruction is received, the obtaining unit 110 obtains current scene data.
在本申请的至少一个实施例中,所述当前场景数据可以包括,但不限于:股票走势场景、产品销售量场景、疾病发病率场景等。In at least one embodiment of the present application, the current scenario data may include, but is not limited to: stock trend scenario, product sales volume scenario, disease incidence scenario, etc.
在本申请的至少一个实施例中,所述预测指令可以由用户触发,也可以在满足一定条件时自动触发,本申请不限制。In at least one embodiment of the present application, the prediction instruction may be triggered by the user, or may be automatically triggered when certain conditions are met, which is not limited in the present application.
其中,所述满足一定条件包括,但不限于:满足预设时间等。Wherein, the meeting certain conditions includes, but is not limited to: meeting a preset time, etc.
所述预设时间可以包括确定的时间点,或者包括一个时间段等,例如:所述预设时 间可以是每天早上七点。The preset time may include a determined time point, or include a time period, etc., for example: the preset time may be 7 o'clock in the morning every day.
确定单元111根据所述当前场景数据,确定所述当前场景数据对应的目标任务。The determining unit 111 determines the target task corresponding to the current scene data according to the current scene data.
在本申请的至少一个实施例中,所述确定单元111根据所述当前场景数据,确定所述当前场景数据所属的目标任务包括:In at least one embodiment of the present application, the determining unit 111 determining the target task to which the current scene data belongs according to the current scene data includes:
所述确定单元111将所述当前场景数据与预先配置的场景数据进行匹配,并将匹配的场景数据对应的任务确定为所述目标任务。The determining unit 111 matches the current scene data with pre-configured scene data, and determines a task corresponding to the matched scene data as the target task.
例如:所述目标任务可以包括,但不限于:预测A产品的销售量、预测X股票的股票走势、预测D疾病的发病率等。For example, the target task may include, but is not limited to: predicting the sales volume of A product, predicting the stock trend of X stock, predicting the incidence of D disease, etc.
通过上述实施方式,能够快速、准确地识别出所述目标任务,从而便于判断所述目标任务是否为首次出现的预测任务。Through the foregoing implementation manners, the target task can be quickly and accurately identified, so that it is convenient to determine whether the target task is a predicted task that appears for the first time.
判断单元112判断所述目标任务是否为首次出现的预测任务。The judging unit 112 judges whether the target task is a predicted task that appears for the first time.
在本申请的至少一个实施例中,所述判断单元112判断所述目标任务是否为首次出现的预测任务包括:In at least one embodiment of the present application, the judging unit 112 judging whether the target task is a predicted task that appears for the first time includes:
所述判断单元112检测所述目标任务,当检测到所述目标任务在预设时间点之前未被训练时,所述判断单元112确定所述目标任务为首次出现的预测任务,当检测到所述目标任务在所述预设时间点之前被训练过时,所述判断单元112确定所述目标任务不是首次出现的预测任务。其中,所述预设时间点可以包括接收到所述预测任务的时间,本申请不作限制。The judgment unit 112 detects the target task. When it is detected that the target task has not been trained before a preset time point, the judgment unit 112 determines that the target task is a prediction task that appears for the first time. If the target task is out of training before the preset time point, the judgment unit 112 determines that the target task is not a prediction task that appears for the first time. Wherein, the preset time point may include the time when the prediction task is received, which is not limited in this application.
通过上述实施方式,能够准确判断出所述目标任务是否为首次出现的预测任务,便于后续对所述目标任务进行处理。Through the foregoing implementation manners, it can be accurately determined whether the target task is a predicted task that appears for the first time, which facilitates subsequent processing of the target task.
当所述目标任务为首次出现的预测任务时,所述获取单元110获取与所述目标任务相关的目标数据。When the target task is a predicted task that appears for the first time, the obtaining unit 110 obtains target data related to the target task.
在本申请的至少一个实施例中,所述获取单元110获取与所述目标任务相关的目标数据包括,但不限于以下一种或者多种方式的组合:In at least one embodiment of the present application, the acquiring unit 110 acquiring target data related to the target task includes, but is not limited to, one or a combination of the following methods:
(1)所述获取单元110采用网络爬虫技术(Web crawler)从互联网中获取与所述目标任务相关的目标数据。(1) The obtaining unit 110 uses web crawler technology to obtain target data related to the target task from the Internet.
其中,所述互联网可以包括任何支持访问的网站,例如:百度、谷歌、腾讯、微博等。Wherein, the Internet may include any website that supports access, such as Baidu, Google, Tencent, Weibo, etc.
进一步地,所述网络爬虫技术(又被称为网页蜘蛛,网络机器人),是一种按照一定的规则,自动地抓取万维网信息的方式。Further, the web crawler technology (also known as web spider, web robot) is a way to automatically grab information on the World Wide Web according to certain rules.
例如:当所述目标任务为预测X股票的股票走势时,则所述目标数据为X股票过去预设时间段的走势;当所述目标任务为预测A产品的销售量时,则所述目标数据为A产品在过去预设时间段的销售量。For example: when the target task is to predict the stock trend of X stock, then the target data is the trend of X stock in the past preset time period; when the target task is to predict the sales volume of A product, then the target The data is the sales volume of A product in the past preset time period.
通过上述实施方式,能够获取到更多的目标数据,从而能够提高目标模型的训练效果,降低目标模型训练误差。Through the foregoing implementation manners, more target data can be obtained, thereby improving the training effect of the target model and reducing the training error of the target model.
(2)所述获取单元110接收所述用户上传的与所述目标任务相关的目标数据。(2) The acquiring unit 110 receives target data related to the target task uploaded by the user.
通过上述实施方式,能够获取到准确的目标数据,从而有利于后续得到更精确的目标模型。Through the foregoing implementation manners, accurate target data can be obtained, which is beneficial to obtaining a more accurate target model later.
拆分单元113按照比例拆分所述目标数据,得到第一数据集及第二数据集。The splitting unit 113 splits the target data in proportion to obtain the first data set and the second data set.
在本申请的至少一个实施例中,所述拆分单元113按照比例拆分所述目标数据,得到第一数据集及第二数据集。In at least one embodiment of the present application, the splitting unit 113 splits the target data in proportion to obtain a first data set and a second data set.
具体地,所述拆分单元113将所述目标数据中预设比例的目标数据确定为所述第一数据集,其中,所述第一数据集用于训练至少一个模型,进一步地,所述拆分单元113将所述目标数据中除所述第一数据集的目标数据确定为所述第二数据集,其中,所述第二数据集作为所述目标模型的输入数据。其中,所述预设比例不作限制,可以是0.8、0.6等。Specifically, the splitting unit 113 determines a preset ratio of target data in the target data as the first data set, where the first data set is used to train at least one model, and further, the The splitting unit 113 determines the target data except for the first data set in the target data as the second data set, where the second data set is used as the input data of the target model. Wherein, the preset ratio is not limited, and may be 0.8, 0.6, etc.
预处理单元114对所述第一数据集进行预处理,得到数据特征。The preprocessing unit 114 preprocesses the first data set to obtain data characteristics.
在本申请的至少一个实施例中,所述预处理单元114对所述第一数据集进行预处理,得到数据特征包括:In at least one embodiment of the present application, the preprocessing unit 114 preprocessing the first data set to obtain data characteristics includes:
所述预处理单元114对所述第一数据集进行偏差检测,得到偏差数据,进一步地,所述预处理单元114删除所述偏差数据,得到所述数据特征。The preprocessing unit 114 performs deviation detection on the first data set to obtain deviation data. Further, the preprocessing unit 114 deletes the deviation data to obtain the data characteristics.
在本申请的至少一个实施例中,所述预处理单元114采用基于密度的离群点检测方法对所述第一数据集进行偏差检测,得到偏差数据。In at least one embodiment of the present application, the preprocessing unit 114 adopts a density-based outlier detection method to perform deviation detection on the first data set to obtain deviation data.
具体地,所述预处理单元114采用相对密度检测技术将所述第一数据集划分为若干个对象,分别计算每个对象的密度,进而得到每个对象的离群点得分,进一步地,所述预处理单元114计算每个对象的邻近平均密度,当所述对象的离群点得分小于所述对象对应的邻近平均密度时,将所述对象确定为偏差数据。Specifically, the preprocessing unit 114 uses relative density detection technology to divide the first data set into several objects, calculates the density of each object separately, and then obtains the outlier score of each object. Further, The preprocessing unit 114 calculates the average density of the neighborhood of each object, and when the outlier score of the object is less than the average density of the neighborhood corresponding to the object, the object is determined as deviation data.
进一步地,所述预处理单元114将所述偏差数据从所述第一数据集中删除,得到所述数据特征。Further, the preprocessing unit 114 deletes the deviation data from the first data set to obtain the data characteristics.
通过上述实施方式,能够准确地得出并排除所述偏差数据,有利于后续准确地对目标模型进行训练,从而提高目标模型的准确性。Through the foregoing implementation manners, the deviation data can be accurately obtained and eliminated, which is beneficial to the subsequent accurate training of the target model, thereby improving the accuracy of the target model.
当然,对所述第一数据集进行预处理的方式,只要合法合理,本申请不作限制。Of course, the method of preprocessing the first data set is not limited in this application as long as it is legal and reasonable.
输入单元115将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果。The input unit 115 inputs the data feature into at least one pre-trained model to obtain at least one prediction result.
在本申请的至少一个实施例中,在将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果之前,训练所述至少一个模型。In at least one embodiment of the present application, before inputting the data features into at least one pre-trained model and obtaining at least one prediction result, train the at least one model.
具体地,训练所述至少一个模型包括,但不限于以下一种或者多种方式的组合:Specifically, training the at least one model includes, but is not limited to, one or a combination of the following methods:
(1)所述获取单元110获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;进一步地,训练单元116采用神经网络算法训练所述第一训练集,得到所述至少一个模型。(1) The acquiring unit 110 acquires a first training set related to the target task, wherein the first training set does not intersect with the first data set; further, the training unit 116 uses neural network algorithm training In the first training set, the at least one model is obtained.
具体地,所述训练单元116对所述第一训练集进行归一化处理,进一步地,所述训练单元116采用归一化处理后的第一训练集构建网络,得到第一网络,所述训练单元116利用预先设定的学习率对所述第一网络进行训练,得到所述至少一个模型。Specifically, the training unit 116 performs normalization processing on the first training set, and further, the training unit 116 uses the normalized first training set to construct a network to obtain the first network. The training unit 116 uses a preset learning rate to train the first network to obtain the at least one model.
需要说明的是,训练得到的所述至少一个模型的学习率可以是相同的,也可以是不同的。当预先配置了一个学习率时,所述至少一个模型的学习率都无限接近所述学习率,而当配置了多个学习率时,则所述至少一个模型与所述多个学习率的关系可以自定义配置(例如:所述训练单元116配置了学习率A及学习率B,并确定有3个模型需要依据所述学习率A训练,确定有4个模型需要依据所述学习率B训练,则所述至少一个模型为上述训练的7个模型)。It should be noted that the learning rate of the at least one model obtained by training may be the same or different. When a learning rate is configured in advance, the learning rate of the at least one model is infinitely close to the learning rate, and when multiple learning rates are configured, the relationship between the at least one model and the multiple learning rates The configuration can be customized (for example, the training unit 116 is configured with learning rate A and learning rate B, and it is determined that there are 3 models that need to be trained based on the learning rate A, and it is determined that there are 4 models that need to be trained based on the learning rate B , The at least one model is the 7 models trained above).
通过上述实施方式,能够得到较精确的模型,提高后续所述目标模型训练的精确度。Through the foregoing implementation manners, a more accurate model can be obtained, and the accuracy of subsequent training of the target model can be improved.
(2)所述获取单元110获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;进一步地,所述训练单元116采用线性回归算法训练所述第一训练集,得到所述至少一个模型。(2) The acquiring unit 110 acquires a first training set related to the target task, wherein the first training set and the first data set are not intersected; further, the training unit 116 adopts linear regression The algorithm trains the first training set to obtain the at least one model.
具体地,所述训练单元116基于所述第一训练集构建模型,得到预测函数,进一步地,所述训练单元116采用梯度下降算法缩小所述预测函数的误差,得到误差小于阈值的预测函数,即为所述至少一个模型。Specifically, the training unit 116 constructs a model based on the first training set to obtain a prediction function. Further, the training unit 116 uses a gradient descent algorithm to reduce the error of the prediction function to obtain a prediction function with an error less than a threshold, That is the at least one model.
其中,所述阈值是预先设定的,可以是:0.2等,本申请不作限制。Wherein, the threshold is set in advance and can be: 0.2, etc., which is not limited in this application.
通过上述实施方式,所述训练单元116能够快速得到模型,提高后续训练所述目标模型的速度。Through the foregoing implementation manner, the training unit 116 can quickly obtain a model, which improves the speed of subsequent training of the target model.
在本申请的至少一个实施例中,所述输入单元115将所述数据特征输入至预先训练的所述至少一个模型中,得到至少一个预测结果。In at least one embodiment of the present application, the input unit 115 inputs the data feature into the at least one pre-trained model to obtain at least one prediction result.
具体地,所述输入单元115将所述数据特征输入至所述至少一个模型中的每个模型, 得到每个模型的至少一个第一结果,进一步地,所述输入单元115整合每个模型的至少一个第一结果,得到所述至少一个预测结果。Specifically, the input unit 115 inputs the data features into each of the at least one model to obtain at least one first result of each model. Further, the input unit 115 integrates the data of each model At least one first result, the at least one prediction result is obtained.
通过上述实施方式,能够得到多个预测结果,为训练所述目标模型提供了训练基础。Through the foregoing implementation manners, multiple prediction results can be obtained, providing a training basis for training the target model.
所述训练单元116采用长短期记忆算法训练所述至少一个预测结果,得到目标模型。The training unit 116 uses a long and short-term memory algorithm to train the at least one prediction result to obtain a target model.
所述长短期记忆算法(Long Short-Term Memory,LSTM)包括三个网络层,其中,所述三个网络层分别为输入门层、遗忘门层以及输出门层。The Long Short-Term Memory (LSTM) algorithm includes three network layers, where the three network layers are an input gate layer, a forget gate layer, and an output gate layer.
在本申请的至少一个实施例中,所述训练单元116采用长短期记忆算法训练所述至少一个预测结果,得到目标模型包括:In at least one embodiment of the present application, the training unit 116 adopts a long and short-term memory algorithm to train the at least one prediction result, and obtaining a target model includes:
所述训练单元116将所述至少一个预测结果输入到遗忘门层进行遗忘处理,得到第二训练数据,进一步地,所述训练单元116采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集,将所述第二训练集输入到输入门层进行训练,得到次级学习器,根据所述第二验证集,调整所述次级学习器,得到目标模型。The training unit 116 inputs the at least one prediction result to the forgetting gate layer to perform forgetting processing to obtain second training data. Further, the training unit 116 uses a cross-validation method to divide the second training data into second training data. The training set and the second verification set, the second training set is input to the input gate layer for training to obtain a secondary learner, and the secondary learner is adjusted according to the second verification set to obtain a target model.
在本申请的至少一个实施例中,所述训练单元116采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集,具体包括:In at least one embodiment of the present application, the training unit 116 uses a cross-validation method to divide the second training data into a second training set and a second verification set, which specifically includes:
所述训练单元116将所述第二训练数据按照预设数目随机划分为至少一个数据包,将所述至少一个数据包中的任意一个数据包确定为所述第二验证集,其余的数据包确定为所述第二训练集,重复上述步骤,直至所有的数据包全都依次被用作为所述第二验证集。The training unit 116 randomly divides the second training data into at least one data packet according to a preset number, determines any one of the at least one data packet as the second verification set, and the remaining data packets It is determined as the second training set, and the above steps are repeated until all data packets are sequentially used as the second verification set.
例如:所述训练单元116将所述第二训练数据划分为3个数据包,分别为数据包E、数据包F、数据包G,并将所述数据包E确定为所述验证集,数据包F以及数据包G确定为所述第二训练集。其次,将所述数据包F确定为所述验证集,数据包E以及数据包G确定为所述第二训练集。最后,所述数据包G确定为所述验证集,数据包E以及数据包F确定为所述第二训练集。For example: the training unit 116 divides the second training data into three data packets, namely data packet E, data packet F, and data packet G, and determines the data packet E as the verification set, and the data The packet F and the data packet G are determined as the second training set. Secondly, the data packet F is determined as the verification set, and the data packet E and the data packet G are determined as the second training set. Finally, the data packet G is determined to be the verification set, and the data packet E and the data packet F are determined to be the second training set.
通过上述实施方式,通过交叉验证法划分所述第二训练数据,使所述第二训练数据的全量均参加训练及验证,由此,提高训练所述目标模型的拟合度。Through the foregoing implementation manner, the second training data is divided by a cross-validation method, so that all of the second training data participates in training and verification, thereby improving the fitness of training the target model.
在本申请的至少一个实施例中,所述训练单元116根据所述第二验证集,调整所述次级学习器,得到目标模型包括:In at least one embodiment of the present application, the training unit 116 adjusting the secondary learner according to the second verification set to obtain a target model includes:
所述训练单元116采用超参数网格搜索方法从所述第二验证集中获取最优超参数点,进一步地,所述训练单元116通过所述最优超参数点对所述次级学习器进行调整,得到所述目标模型。The training unit 116 uses a hyperparameter grid search method to obtain the optimal hyperparameter points from the second verification set. Further, the training unit 116 performs an operation on the secondary learner through the optimal hyperparameter points. Adjust to obtain the target model.
具体地,所述训练单元116将所述第二验证集按照固定步长进行拆分,得到目标子集,遍历所述目标子集上两端端点的参数,通过所述两端端点的参数验证所述次级学习器,得到每个参数的学习率,将所述学习率最好的参数确定为第一超参数点,并在所述第一超参数点的邻域内,缩小所述步长继续遍历,直至所述步长为预设步长,即得到的超参数点为所述最优超参数点,更进一步地,所述训练单元116根据所述最优超参数点调整所述次级学习器,得到所述目标模型。Specifically, the training unit 116 splits the second verification set according to a fixed step size to obtain a target subset, traverses the parameters of the two ends of the target subset, and passes the parameter verification of the two ends. The secondary learner obtains the learning rate of each parameter, determines the parameter with the best learning rate as the first hyperparameter point, and reduces the step size in the neighborhood of the first hyperparameter point Continue to traverse until the step length is the preset step length, that is, the obtained hyperparameter point is the optimal hyperparameter point, and further, the training unit 116 adjusts the secondary hyperparameter point according to the optimal hyperparameter point. Level learner to obtain the target model.
其中,本申请对所述预设步长不作限制。Among them, this application does not limit the preset step length.
通过上述实施方式,能够得到较为精确的所述目标模型,进一步得到精确的目标结果。Through the foregoing implementation manners, a more accurate target model can be obtained, and further accurate target results can be obtained.
在本申请的至少一个实施例中,由于所述长短期记忆算法具有时间序列的优点,因此,通过所述长短期记忆算法训练的目标模型,也具有一定的时序性,通过上述实施方式,能够快速得到时序性的目标模型,便于后续对所述预测任务的时序性预测。In at least one embodiment of the present application, since the long and short-term memory algorithm has the advantage of time series, the target model trained by the long- and short-term memory algorithm also has a certain time sequence. Through the above-mentioned embodiments, The sequential target model is quickly obtained, which is convenient for subsequent sequential prediction of the prediction task.
在本申请的至少一个实施例中,在判断所述目标任务是否为首次出现的预测任务之后,所述方法还包括:In at least one embodiment of the present application, after determining whether the target task is a predicted task that appears for the first time, the method further includes:
当判断所述目标任务不是首次出现的预测任务时,所述获取单元110获取所述目标任务首次出现时的目标数据,进一步地,所述输入单元115将所述目标数据输入至所述 目标模型中,得到目标结果。When it is determined that the target task is not the predicted task that appears for the first time, the obtaining unit 110 obtains the target data when the target task first appears, and further, the input unit 115 inputs the target data to the target model In, get the target result.
通过上述实施方式,在判断所述目标任务不是首次出现的预测任务后,能够直接采用所述目标模型进行预测,能够避免重复训练所述目标模型,进而能够提高预测的效率。Through the foregoing implementation manners, after judging that the target task is not a prediction task that appears for the first time, the target model can be directly used for prediction, which can avoid repeated training of the target model, thereby improving the efficiency of prediction.
所述输入单元115将所述第二数据集输入至所述目标模型中,得到目标结果。The input unit 115 inputs the second data set into the target model to obtain a target result.
在本申请的至少一个实施例中,在将所述第二数据集输入至所述目标模型中,得到目标结果后,所述方法还包括:In at least one embodiment of the present application, after the second data set is input into the target model and the target result is obtained, the method further includes:
检测单元119检测所述目标结果是否出现异常,当检测到所述目标结果出现异常时,生成单元117生成警报信息,进一步地,发送单元118将所述警报信息发送到指定联系人的终端设备。The detection unit 119 detects whether the target result is abnormal, and when it is detected that the target result is abnormal, the generating unit 117 generates alarm information. Further, the sending unit 118 sends the alarm information to the terminal device of the designated contact.
其中,所述警报信息可以包括目标任务、目标结果以及预测的时间点等。Wherein, the alarm information may include target tasks, target results, and predicted time points.
进一步地,所述指定联系人可以包括触发预测任务的用户等。Further, the designated contact person may include the user who triggered the prediction task, and the like.
通过上述实施方式,当所述目标结果存在异常时,能够提前对所述目标结果进行警报,并及时提醒,有利于用户提前做好防备措施。Through the foregoing implementation manners, when the target result is abnormal, the target result can be alerted in advance and reminded in time, which is beneficial for the user to take precautionary measures in advance.
例如:当所述目标任务为预测X股票的股票走势,并且所述目标结果为未来预设时间段内的X股票的股票走势时,当检测到未来一个星期X股票的股票走势存在风险,进一步地,所述生成单元117生成所述警报信息,更进一步地,所述发送单元118将所述警报信息发送到所述指定联系人的终端设备。For example: when the target task is to predict the stock trend of X stock, and the target result is the stock trend of X stock in the future preset time period, when it is detected that the stock trend of X stock in the next week is at risk, further Preferably, the generating unit 117 generates the alarm information, and further, the sending unit 118 sends the alarm information to the terminal device of the designated contact.
当所述目标任务为预测A产品的销售量,并且所述目标结果为未来一个月内A产品的销售量时,当检测到所述A产品的销售量小于阈值,进一步地,所述生成单元117生成所述警报信息,更进一步地,所述发送单元118将所述警报信息发送到所述指定联系人的终端设备。When the target task is to predict the sales volume of product A, and the target result is the sales volume of product A in the next month, when it is detected that the sales volume of product A is less than a threshold, further, the generating unit 117 generates the alarm information, and further, the sending unit 118 sends the alarm information to the terminal device of the designated contact.
其中,所述阈值可以是预先设定的销售量,本申请不作限制。Wherein, the threshold may be a preset sales volume, which is not limited in this application.
由以上技术方案可以看出,本申请可应用于人工智能的智能决策领域,能够当接收到预测指令时,获取当前场景数据,根据所述当前场景数据,确定所述当前场景数据所属的目标任务,判断所述目标任务是否为首次出现的预测任务,当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据,按照比例划分所述目标数据,得到第一数据集及第二数据集,对所述第一数据集进行预处理,得到数据特征,将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果,采用长短期记忆算法训练所述至少一个预测结果,得到目标模型,将所述第二数据集输入至所述目标模型中,得到目标结果,不仅能够通过目标模型按需预测,还能够根据所述预测任务进行时序性的预测。It can be seen from the above technical solutions that this application can be applied to the field of intelligent decision-making in artificial intelligence. When a prediction instruction is received, current scene data can be obtained, and the target task to which the current scene data belongs can be determined according to the current scene data. , Judge whether the target task is a predicted task that appears for the first time, and when the target task is a predicted task that appears for the first time, obtain target data related to the target task, divide the target data in proportion to obtain the first data The first data set is preprocessed to obtain the data feature, and the data feature is input into at least one pre-trained model to obtain at least one prediction result. The long and short-term memory algorithm is used to train the The at least one prediction result is used to obtain a target model, and the second data set is input to the target model to obtain the target result. Not only can the target model be predicted on-demand, but also time-series predictions can be made according to the prediction task .
如图3所示,是本申请实现多任务预测方法的较佳实施例的电子设备的结构示意图。As shown in FIG. 3, it is a schematic structural diagram of an electronic device according to a preferred embodiment of the multi-task prediction method of the present application.
所述电子设备1是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The electronic device 1 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC) ), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
所述电子设备1还可以是但不限于任何一种可与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏机、交互式网络电视(Internet Protocol Television,IPTV)、智能式穿戴式设备等。The electronic device 1 can also be, but is not limited to, any electronic product that can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device, for example, a personal computer, a tablet computer, or a smart phone. , Personal Digital Assistant (PDA), game consoles, interactive network TV (Internet Protocol Television, IPTV), smart wearable devices, etc.
所述电子设备1还可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。The electronic device 1 may also be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
所述电子设备1所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。The network where the electronic device 1 is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), etc.
在本申请的一个实施例中,所述电子设备1包括,但不限于,存储器12、处理器13, 以及存储在所述存储器12中并可在所述处理器13上运行的计算机程序,例如多任务预测程序。In an embodiment of the present application, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program stored in the memory 12 and running on the processor 13, such as Multi-task prediction program.
本领域技术人员可以理解,所述示意图仅仅是电子设备1的示例,并不构成对电子设备1的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备1还可以包括输入输出设备、网络接入设备、总线等。Those skilled in the art can understand that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. Components, for example, the electronic device 1 may also include input and output devices, network access devices, buses, and the like.
所述处理器13可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器13是所述电子设备1的运算核心和控制中心,利用各种接口和线路连接整个电子设备1的各个部分,及执行所述电子设备1的操作系统以及安装的各类应用程序、程序代码等。The processor 13 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (ASICs), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1 and connects the entire electronic device with various interfaces and lines. Each part of 1, and executes the operating system of the electronic device 1, and various installed applications, program codes, etc.
所述处理器13执行所述电子设备1的操作系统以及安装的各类应用程序。所述处理器13执行所述应用程序以实现上述各个多任务预测方法实施例中的步骤,例如图1所示的步骤S10、S11、S12、S13、S14、S15、S16、S17、S18。The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the application program to implement the steps in the foregoing embodiments of the multi-task prediction method, such as steps S10, S11, S12, S13, S14, S15, S16, S17, and S18 shown in FIG. 1.
或者,所述处理器13执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如:当接收到预测指令时,获取当前场景数据;根据所述当前场景数据,确定所述当前场景数据对应的目标任务;判断所述目标任务是否为首次出现的预测任务;当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;按照比例拆分所述目标数据,得到第一数据集及第二数据集;对所述第一数据集进行预处理,得到数据特征;将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;将所述第二数据集输入至所述目标模型中,得到目标结果。Alternatively, when the processor 13 executes the computer program, the function of each module/unit in the foregoing device embodiments is implemented, for example: when a prediction instruction is received, current scene data is acquired; according to the current scene data, all The target task corresponding to the current scene data; determine whether the target task is a predicted task that appears for the first time; when the target task is a predicted task that appears for the first time, obtain target data related to the target task; split according to proportions The target data obtains a first data set and a second data set; preprocessing the first data set to obtain data features; inputting the data features into at least one pre-trained model to obtain at least one prediction Result; training the at least one prediction result using a long and short-term memory algorithm to obtain a target model; inputting the second data set into the target model to obtain a target result.
示例性的,所述计算机程序可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器12中,并由所述处理器13执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在所述电子设备1中的执行过程。例如,所述计算机程序可以被分割成获取单元110、确定单元111、判断单元112、拆分单元113、预处理单元114、输入单元115、训练单元116、生成单元117、发送单元118以及检测单元119。Exemplarily, the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 12 and executed by the processor 13 to complete this Application. The one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program can be divided into an acquisition unit 110, a determination unit 111, a judgment unit 112, a split unit 113, a preprocessing unit 114, an input unit 115, a training unit 116, a generation unit 117, a transmission unit 118, and a detection unit. 119.
所述存储器12可用于存储所述计算机程序和/或模块,所述处理器13通过运行或执行存储在所述存储器12内的计算机程序和/或模块,以及调用存储在存储器12内的数据,实现所述电子设备1的各种功能。所述存储器12可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器12可以包括高速随机存取存储器,还可以包括计算机存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性/非易失性存储器件。The memory 12 may be used to store the computer program and/or module, and the processor 13 runs or executes the computer program and/or module stored in the memory 12 and calls the data stored in the memory 12, Various functions of the electronic device 1 are realized. The memory 12 may mainly include a storage program area and a storage data area. The storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Store data (such as audio data, phone book, etc.) created based on the use of mobile phones. In addition, the memory 12 may include high-speed random access memory, and may also include computer memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory. Card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile/non-volatile storage device.
所述存储器12可以是电子设备1的外部存储器和/或内部存储器。进一步地,所述存储器12可以是集成电路中没有实物形式的具有存储功能的电路,如RAM(Random-Access Memory,随机存取存储器)、FIFO(First In First Out,)等。或者,所述存储器12也可以是具有实物形式的存储器,如内存条、TF卡(Trans-flash Card)等等。The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a circuit with a storage function without a physical form in an integrated circuit, such as RAM (Random-Access Memory, random access memory), FIFO (First In First Out), etc. Alternatively, the memory 12 may also be a memory in physical form, such as a memory stick, a TF card (Trans-flash Card), and so on.
所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读存储介质可以是非易失性,也可以是易失性。基于这样的理解,本申请实现上述实施例方法中的全 部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。If the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. The computer-readable storage medium may be non-volatile or volatile. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented.
其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)等。Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), etc.
结合图1,所述电子设备1中的所述存储器12存储多个指令以实现一种多任务预测方法,所述处理器13可执行所述多个指令从而实现:当接收到预测指令时,获取当前场景数据;根据所述当前场景数据,确定所述当前场景数据对应的目标任务;判断所述目标任务是否为首次出现的预测任务;当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;按照比例拆分所述目标数据,得到第一数据集及第二数据集;对所述第一数据集进行预处理,得到数据特征;将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;将所述第二数据集输入至所述目标模型中,得到目标结果。With reference to FIG. 1, the memory 12 in the electronic device 1 stores multiple instructions to implement a multi-task prediction method, and the processor 13 can execute the multiple instructions to realize: when a prediction instruction is received, Acquire current scene data; determine the target task corresponding to the current scene data according to the current scene data; determine whether the target task is a prediction task that appears for the first time; when the target task is a prediction task that appears for the first time, obtain Target data related to the target task; split the target data in proportion to obtain a first data set and a second data set; preprocess the first data set to obtain data characteristics; combine the data characteristics Input into at least one pre-trained model to obtain at least one prediction result; train the at least one prediction result using a long and short-term memory algorithm to obtain a target model; input the second data set into the target model to obtain a target result.
具体地,所述处理器13对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the processor 13 for the foregoing instructions, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1, which is not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagram marks in the claims should not be regarded as limiting the claims involved.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second class words are used to indicate names, and do not indicate any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (22)

  1. 一种多任务预测方法,其中,所述方法包括:A multi-task prediction method, wherein the method includes:
    当接收到预测指令时,获取当前场景数据;When receiving the prediction instruction, obtain the current scene data;
    根据所述当前场景数据,确定所述当前场景数据对应的目标任务;Determine the target task corresponding to the current scene data according to the current scene data;
    判断所述目标任务是否为首次出现的预测任务;Judging whether the target task is a predicted task that appears for the first time;
    当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;When the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
    按照比例拆分所述目标数据,得到第一数据集及第二数据集;Split the target data in proportion to obtain a first data set and a second data set;
    对所述第一数据集进行预处理,得到数据特征;Preprocessing the first data set to obtain data characteristics;
    将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;Input the data feature into at least one pre-trained model to obtain at least one prediction result;
    采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;Training the at least one prediction result using a long and short-term memory algorithm to obtain a target model;
    将所述第二数据集输入至所述目标模型中,得到目标结果。The second data set is input into the target model to obtain a target result.
  2. 如权利要求1所述的多任务预测方法,其中,所述获取与所述目标任务相关的目标数据包括以下一种或者多种方式的组合:The multi-task prediction method according to claim 1, wherein said obtaining target data related to said target task comprises one or a combination of the following methods:
    采用网络爬虫技术从互联网中获取与所述目标任务相关的目标数据;及/或Use web crawler technology to obtain target data related to the target task from the Internet; and/or
    接收用户上传的与所述目标任务相关的目标数据。Receive target data related to the target task uploaded by the user.
  3. 如权利要求1所述的多任务预测方法,其中,所述对所述第一数据集进行预处理,得到数据特征包括:The multi-task prediction method according to claim 1, wherein said preprocessing said first data set to obtain data features comprises:
    对所述第一数据集进行偏差检测,得到偏差数据;Performing deviation detection on the first data set to obtain deviation data;
    删除所述偏差数据,得到所述数据特征。Delete the deviation data to obtain the data characteristics.
  4. 如权利要求1所述的多任务预测方法,其中,在将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果之前,所述方法还包括:The multi-task prediction method of claim 1, wherein, before inputting the data features into at least one pre-trained model and obtaining at least one prediction result, the method further comprises:
    获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;Acquiring a first training set related to the target task, wherein the first training set and the first data set do not intersect;
    采用神经网络算法及/或线性回归算法训练所述第一训练集,得到所述至少一个模型。The neural network algorithm and/or linear regression algorithm are used to train the first training set to obtain the at least one model.
  5. 如权利要求1所述的多任务预测方法,其中,所述采用长短期记忆算法训练所述至少一个预测结果,得到目标模型包括:8. The multi-task prediction method according to claim 1, wherein the training of the at least one prediction result using a long and short-term memory algorithm to obtain a target model comprises:
    将所述至少一个预测结果输入到遗忘门层进行遗忘处理,得到第二训练数据;Inputting the at least one prediction result to the forgetting gate layer for forgetting processing to obtain second training data;
    采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集;Dividing the second training data into a second training set and a second verification set by using a cross-validation method;
    将所述第二训练集输入到输入门层进行训练,得到次级学习器;Input the second training set to the input gate layer for training to obtain a secondary learner;
    根据所述第二验证集,调整所述次级学习器,得到目标模型。According to the second verification set, the secondary learner is adjusted to obtain the target model.
  6. 如权利要求1所述的多任务预测方法,其中,在判断所述目标任务是否为首次出现的预测任务之后,所述方法还包括:The multi-task prediction method according to claim 1, wherein after determining whether the target task is a prediction task that appears for the first time, the method further comprises:
    当判断所述目标任务不是首次出现的预测任务时,获取所述目标任务首次出现时的目标数据;When it is judged that the target task is not the predicted task that appears for the first time, acquiring the target data when the target task first appears;
    将所述目标数据输入至所述目标模型中,得到目标结果。Input the target data into the target model to obtain the target result.
  7. 如权利要求1所述的多任务预测方法,其中,在将所述第二数据集输入至所述目标模型中,得到目标结果后,所述方法还包括:The multi-task prediction method of claim 1, wherein after the second data set is input into the target model and the target result is obtained, the method further comprises:
    检测所述目标结果是否出现异常;Detecting whether the target result is abnormal;
    当检测到所述目标结果出现异常时,生成警报信息;When an abnormality in the target result is detected, an alarm message is generated;
    将所述警报信息发送到指定联系人的终端设备。Send the alarm information to the terminal device of the designated contact.
  8. 一种多任务预测装置,其中,所述装置包括:A multi-task prediction device, wherein the device includes:
    获取单元,用于当接收到预测指令时,获取当前场景数据;The acquiring unit is used to acquire current scene data when the prediction instruction is received;
    确定单元,用于根据所述当前场景数据,确定所述当前场景数据对应的目标任务;A determining unit, configured to determine a target task corresponding to the current scene data according to the current scene data;
    判断单元,用于判断所述目标任务是否为首次出现的预测任务;A judging unit for judging whether the target task is a prediction task that appears for the first time;
    所述获取单元,还用于当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;The acquiring unit is further configured to acquire target data related to the target task when the target task is a predicted task that appears for the first time;
    拆分单元,用于按照比例拆分所述目标数据,得到第一数据集及第二数据集;A splitting unit, configured to split the target data in proportion to obtain a first data set and a second data set;
    预处理单元,用于对所述第一数据集进行预处理,得到数据特征;A preprocessing unit, configured to preprocess the first data set to obtain data characteristics;
    输入单元,用于将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;The input unit is used to input the data feature into at least one pre-trained model to obtain at least one prediction result;
    训练单元,用于采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;A training unit, configured to train the at least one prediction result by using a long and short-term memory algorithm to obtain a target model;
    所述输入单元,还用于将所述第二数据集输入至所述目标模型中,得到目标结果。The input unit is also used to input the second data set into the target model to obtain a target result.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device includes:
    存储器,存储至少一个计算机可读指令;及The memory stores at least one computer readable instruction; and
    处理器,执行所述存储器中存储的至少一个计算机可读指令以实现以下步骤:The processor executes at least one computer-readable instruction stored in the memory to implement the following steps:
    当接收到预测指令时,获取当前场景数据;When receiving the prediction instruction, obtain the current scene data;
    根据所述当前场景数据,确定所述当前场景数据对应的目标任务;Determine the target task corresponding to the current scene data according to the current scene data;
    判断所述目标任务是否为首次出现的预测任务;Judging whether the target task is a predicted task that appears for the first time;
    当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;When the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
    按照比例拆分所述目标数据,得到第一数据集及第二数据集;Split the target data in proportion to obtain a first data set and a second data set;
    对所述第一数据集进行预处理,得到数据特征;Preprocessing the first data set to obtain data characteristics;
    将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;Input the data feature into at least one pre-trained model to obtain at least one prediction result;
    采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;Training the at least one prediction result using a long and short-term memory algorithm to obtain a target model;
    将所述第二数据集输入至所述目标模型中,得到目标结果。The second data set is input into the target model to obtain a target result.
  10. 如权利要求9所述的电子设备,其中,所述处理器执行至少一个计算机可读指令以实现所述获取与所述目标任务相关的目标数据时,包括以下一种或者多种方式的组合:9. The electronic device according to claim 9, wherein the execution of at least one computer-readable instruction by the processor to achieve the acquisition of target data related to the target task comprises one or a combination of the following methods:
    采用网络爬虫技术从互联网中获取与所述目标任务相关的目标数据;及/或Use web crawler technology to obtain target data related to the target task from the Internet; and/or
    接收用户上传的与所述目标任务相关的目标数据。Receive target data related to the target task uploaded by the user.
  11. 如权利要求9所述的电子设备,其中,所述处理器执行至少一个计算机可读指令以实现所述对所述第一数据集进行预处理,得到数据特征时,包括以下步骤:9. The electronic device of claim 9, wherein the processor executes at least one computer readable instruction to implement the preprocessing of the first data set to obtain the data characteristics, comprising the following steps:
    对所述第一数据集进行偏差检测,得到偏差数据;Performing deviation detection on the first data set to obtain deviation data;
    删除所述偏差数据,得到所述数据特征。Delete the deviation data to obtain the data characteristics.
  12. 如权利要求9所述的电子设备,其中,在将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果之前,所述处理器执行至少一个计算机可读指令还用以实现以下步骤:The electronic device of claim 9, wherein, before the data feature is input into at least one pre-trained model to obtain at least one prediction result, the processor executes at least one computer-readable instruction to further implement The following steps:
    获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;Acquiring a first training set related to the target task, wherein the first training set and the first data set do not intersect;
    采用神经网络算法及/或线性回归算法训练所述第一训练集,得到所述至少一个模型。The neural network algorithm and/or linear regression algorithm are used to train the first training set to obtain the at least one model.
  13. 如权利要求9所述的电子设备,其中,所述处理器执行至少一个计算机可读指令以实现所述采用长短期记忆算法训练所述至少一个预测结果,得到目标模型时,包括以下步骤:9. The electronic device according to claim 9, wherein the processor executes at least one computer-readable instruction to implement the training of the at least one prediction result using a long- and short-term memory algorithm, and when the target model is obtained, the method comprises the following steps:
    将所述至少一个预测结果输入到遗忘门层进行遗忘处理,得到第二训练数据;Inputting the at least one prediction result to the forgetting gate layer for forgetting processing to obtain second training data;
    采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集;Dividing the second training data into a second training set and a second verification set by using a cross-validation method;
    将所述第二训练集输入到输入门层进行训练,得到次级学习器;Input the second training set to the input gate layer for training to obtain a secondary learner;
    根据所述第二验证集,调整所述次级学习器,得到目标模型。According to the second verification set, the secondary learner is adjusted to obtain the target model.
  14. 如权利要求9所述的电子设备,其中,在判断所述目标任务是否为首次出现的预测任务之后,所述处理器执行至少一个计算机可读指令还用以实现以下步骤:9. The electronic device of claim 9, wherein after determining whether the target task is a predicted task that appears for the first time, the processor executes at least one computer-readable instruction to further implement the following steps:
    当判断所述目标任务不是首次出现的预测任务时,获取所述目标任务首次出现时的 目标数据;When it is judged that the target task is not the predicted task that appears for the first time, obtain the target data when the target task first appears;
    将所述目标数据输入至所述目标模型中,得到目标结果。Input the target data into the target model to obtain the target result.
  15. 如权利要求9所述的电子设备,其中,在将所述第二数据集输入至所述目标模型中,得到目标结果后,所述处理器执行至少一个计算机可读指令还用以实现以下步骤:The electronic device according to claim 9, wherein, after the second data set is input into the target model and the target result is obtained, the processor executes at least one computer-readable instruction to further implement the following steps :
    检测所述目标结果是否出现异常;Detecting whether the target result is abnormal;
    当检测到所述目标结果出现异常时,生成警报信息;When an abnormality in the target result is detected, an alarm message is generated;
    将所述警报信息发送到指定联系人的终端设备。Send the alarm information to the terminal device of the designated contact.
  16. 一种计算机可读存储介质,其中:所述计算机可读存储介质中存储有至少一个计算机可读指令,所述至少一个计算机可读指令被电子设备中的处理器执行以实现以下步骤:A computer-readable storage medium, wherein: the computer-readable storage medium stores at least one computer-readable instruction, and the at least one computer-readable instruction is executed by a processor in an electronic device to implement the following steps:
    当接收到预测指令时,获取当前场景数据;When receiving the prediction instruction, obtain the current scene data;
    根据所述当前场景数据,确定所述当前场景数据对应的目标任务;Determine the target task corresponding to the current scene data according to the current scene data;
    判断所述目标任务是否为首次出现的预测任务;Judging whether the target task is a predicted task that appears for the first time;
    当所述目标任务为首次出现的预测任务时,获取与所述目标任务相关的目标数据;When the target task is a predicted task that appears for the first time, acquiring target data related to the target task;
    按照比例拆分所述目标数据,得到第一数据集及第二数据集;Split the target data in proportion to obtain a first data set and a second data set;
    对所述第一数据集进行预处理,得到数据特征;Preprocessing the first data set to obtain data characteristics;
    将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果;Input the data feature into at least one pre-trained model to obtain at least one prediction result;
    采用长短期记忆算法训练所述至少一个预测结果,得到目标模型;Training the at least one prediction result using a long and short-term memory algorithm to obtain a target model;
    将所述第二数据集输入至所述目标模型中,得到目标结果。The second data set is input into the target model to obtain a target result.
  17. 如权利要求16所述的存储介质,其中,所述至少一个计算机可读指令被处理器执行以实现所述获取与所述目标任务相关的目标数据时,包括以下一种或者多种方式的组合:The storage medium according to claim 16, wherein, when the at least one computer-readable instruction is executed by a processor to realize the obtaining of target data related to the target task, the method includes one or a combination of the following: :
    采用网络爬虫技术从互联网中获取与所述目标任务相关的目标数据;及/或Use web crawler technology to obtain target data related to the target task from the Internet; and/or
    接收用户上传的与所述目标任务相关的目标数据。Receive target data related to the target task uploaded by the user.
  18. 如权利要求16所述的存储介质,其中,所述至少一个计算机可读指令被处理器执行以实现所述对所述第一数据集进行预处理,得到数据特征时,包括以下步骤:15. The storage medium of claim 16, wherein the at least one computer-readable instruction is executed by a processor to perform the preprocessing of the first data set to obtain the data characteristics, comprising the following steps:
    对所述第一数据集进行偏差检测,得到偏差数据;Performing deviation detection on the first data set to obtain deviation data;
    删除所述偏差数据,得到所述数据特征。Delete the deviation data to obtain the data characteristics.
  19. 如权利要求16所述的存储介质,其中,在将所述数据特征输入至预先训练的至少一个模型中,得到至少一个预测结果之前,所述至少一个计算机可读指令被处理器执行还用以实现以下步骤:The storage medium of claim 16, wherein, before the data feature is input into at least one pre-trained model to obtain at least one prediction result, the at least one computer readable instruction is executed by the processor for Implement the following steps:
    获取与所述目标任务相关的第一训练集,其中,所述第一训练集与所述第一数据集不相交;Acquiring a first training set related to the target task, wherein the first training set and the first data set do not intersect;
    采用神经网络算法及/或线性回归算法训练所述第一训练集,得到所述至少一个模型。The neural network algorithm and/or linear regression algorithm are used to train the first training set to obtain the at least one model.
  20. 如权利要求16所述的存储介质,其中,所述至少一个计算机可读指令被处理器执行以实现所述采用长短期记忆算法训练所述至少一个预测结果,得到目标模型时,包括以下步骤:15. The storage medium according to claim 16, wherein the at least one computer readable instruction is executed by a processor to implement the training of the at least one prediction result using a long and short-term memory algorithm to obtain a target model, comprising the following steps:
    将所述至少一个预测结果输入到遗忘门层进行遗忘处理,得到第二训练数据;Inputting the at least one prediction result to the forgetting gate layer for forgetting processing to obtain second training data;
    采用交叉验证法将所述第二训练数据划分为第二训练集及第二验证集;Dividing the second training data into a second training set and a second verification set by using a cross-validation method;
    将所述第二训练集输入到输入门层进行训练,得到次级学习器;Input the second training set to the input gate layer for training to obtain a secondary learner;
    根据所述第二验证集,调整所述次级学习器,得到目标模型。According to the second verification set, the secondary learner is adjusted to obtain the target model.
  21. 如权利要求16所述的存储介质,其中,在判断所述目标任务是否为首次出现的预测任务之后,所述至少一个计算机可读指令被处理器执行还用以实现以下步骤:15. The storage medium of claim 16, wherein after determining whether the target task is a predicted task that appears for the first time, the at least one computer readable instruction is executed by the processor to further implement the following steps:
    当判断所述目标任务不是首次出现的预测任务时,获取所述目标任务首次出现时的目标数据;When it is judged that the target task is not the predicted task that appears for the first time, acquiring the target data when the target task first appears;
    将所述目标数据输入至所述目标模型中,得到目标结果。Input the target data into the target model to obtain the target result.
  22. 如权利要求16所述的存储介质,其中,在将所述第二数据集输入至所述目标模型中,得到目标结果后,所述至少一个计算机可读指令被处理器执行还用以实现以下步骤:The storage medium according to claim 16, wherein, after the second data set is input into the target model and the target result is obtained, the at least one computer readable instruction is executed by the processor to further implement the following step:
    检测所述目标结果是否出现异常;Detecting whether the target result is abnormal;
    当检测到所述目标结果出现异常时,生成警报信息;When an abnormality in the target result is detected, an alarm message is generated;
    将所述警报信息发送到指定联系人的终端设备。Send the alarm information to the terminal device of the designated contact.
PCT/CN2020/098233 2019-08-06 2020-06-24 Method and device for multitask prediction, electronic device, and storage medium WO2021022933A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910722718.4 2019-08-06
CN201910722718.4A CN110619423B (en) 2019-08-06 2019-08-06 Multitask prediction method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021022933A1 true WO2021022933A1 (en) 2021-02-11

Family

ID=68921501

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098233 WO2021022933A1 (en) 2019-08-06 2020-06-24 Method and device for multitask prediction, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN110619423B (en)
WO (1) WO2021022933A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819600A (en) * 2021-02-25 2021-05-18 深圳前海微众银行股份有限公司 Timed task execution method, timed task execution device, timed task execution equipment and computer storage medium
CN112926690A (en) * 2021-03-31 2021-06-08 北京奇艺世纪科技有限公司 Data processing method, device, equipment and storage medium
CN113057587A (en) * 2021-03-17 2021-07-02 上海电气集团股份有限公司 Disease early warning method and device, electronic equipment and storage medium
CN113407680A (en) * 2021-06-30 2021-09-17 竹间智能科技(上海)有限公司 Heterogeneous integrated model screening method and electronic equipment
CN113435502A (en) * 2021-06-25 2021-09-24 平安科技(深圳)有限公司 Site flow determination method, device, equipment and storage medium
CN113627681A (en) * 2021-08-25 2021-11-09 平安国际智慧城市科技股份有限公司 Data prediction method and device based on prediction model, computer equipment and medium
CN114334696A (en) * 2021-12-30 2022-04-12 中国电信股份有限公司 Quality detection method and device, electronic equipment and computer readable storage medium
CN114565576A (en) * 2022-02-25 2022-05-31 联合汽车电子有限公司 DMTL surface defect detection method, device and terminal
CN114581252A (en) * 2022-03-03 2022-06-03 平安科技(深圳)有限公司 Target case prediction method and device, electronic device and storage medium
CN115134614A (en) * 2021-03-29 2022-09-30 北京字节跳动网络技术有限公司 Task parameter configuration method and device, electronic equipment and computer readable storage medium
CN115439206A (en) * 2022-11-08 2022-12-06 税友信息技术有限公司 Declaration data prediction method, device, equipment and medium
CN116542310A (en) * 2023-07-01 2023-08-04 帕西尼感知科技(张家港)有限公司 Model training and motion instruction prediction method, device and system for robot
CN116880404A (en) * 2023-07-28 2023-10-13 北京远舢智能科技有限公司 Production control method, device, equipment and medium based on constant model

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110619423B (en) * 2019-08-06 2023-04-07 平安科技(深圳)有限公司 Multitask prediction method and device, electronic equipment and storage medium
CN113869521A (en) * 2020-06-30 2021-12-31 华为技术有限公司 Method, device, computing equipment and storage medium for constructing prediction model
CN111949708B (en) * 2020-08-10 2023-07-25 中国平安人寿保险股份有限公司 Multi-task prediction method, device, equipment and medium based on time sequence feature extraction
CN111950621A (en) * 2020-08-10 2020-11-17 中国平安人寿保险股份有限公司 Target data detection method, device, equipment and medium based on artificial intelligence
CN112906971B (en) * 2021-03-09 2022-02-18 清华大学 Method and device for predicting running time in batch processing operation and electronic equipment
CN113518000B (en) * 2021-05-12 2023-04-07 北京奇艺世纪科技有限公司 Method and device for adjusting number of instances of online service and electronic equipment
CN113643136A (en) * 2021-09-01 2021-11-12 京东科技信息技术有限公司 Information processing method, system and device
CN114528183B (en) * 2022-02-17 2023-05-02 厦门四信通信科技有限公司 Offline prediction method, device and equipment of LoRa equipment and readable storage medium
CN114885016A (en) * 2022-04-29 2022-08-09 青岛海尔科技有限公司 Service pushing method and device, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009593A (en) * 2017-12-15 2018-05-08 清华大学 A kind of transfer learning optimal algorithm choosing method and system
CN109376227A (en) * 2018-10-29 2019-02-22 山东大学 A kind of prison term prediction technique based on multitask artificial neural network
CN109902271A (en) * 2019-01-23 2019-06-18 平安科技(深圳)有限公司 Text data mask method, device, terminal and medium based on transfer learning
US10354184B1 (en) * 2014-06-24 2019-07-16 Amazon Technologies, Inc. Joint modeling of user behavior
CN110619423A (en) * 2019-08-06 2019-12-27 平安科技(深圳)有限公司 Multitask prediction method and device, electronic equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8924315B2 (en) * 2011-12-13 2014-12-30 Xerox Corporation Multi-task learning using bayesian model with enforced sparsity and leveraging of task correlations
CN107730087A (en) * 2017-09-20 2018-02-23 平安科技(深圳)有限公司 Forecast model training method, data monitoring method, device, equipment and medium
CN108461152A (en) * 2018-01-12 2018-08-28 平安科技(深圳)有限公司 Medical model training method, medical recognition methods, device, equipment and medium
CN109635990B (en) * 2018-10-12 2022-09-16 创新先进技术有限公司 Training method, prediction method, device, electronic equipment and storage medium
CN109344806B (en) * 2018-10-31 2019-08-23 第四范式(北京)技术有限公司 The method and system detected using multitask target detection model performance objective
CN109376869A (en) * 2018-12-25 2019-02-22 中国科学院软件研究所 A kind of super ginseng optimization system of machine learning based on asynchronous Bayes optimization and method
CN110009042A (en) * 2019-04-08 2019-07-12 中诚信征信有限公司 A kind of data predication method, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10354184B1 (en) * 2014-06-24 2019-07-16 Amazon Technologies, Inc. Joint modeling of user behavior
CN108009593A (en) * 2017-12-15 2018-05-08 清华大学 A kind of transfer learning optimal algorithm choosing method and system
CN109376227A (en) * 2018-10-29 2019-02-22 山东大学 A kind of prison term prediction technique based on multitask artificial neural network
CN109902271A (en) * 2019-01-23 2019-06-18 平安科技(深圳)有限公司 Text data mask method, device, terminal and medium based on transfer learning
CN110619423A (en) * 2019-08-06 2019-12-27 平安科技(深圳)有限公司 Multitask prediction method and device, electronic equipment and storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819600A (en) * 2021-02-25 2021-05-18 深圳前海微众银行股份有限公司 Timed task execution method, timed task execution device, timed task execution equipment and computer storage medium
CN113057587A (en) * 2021-03-17 2021-07-02 上海电气集团股份有限公司 Disease early warning method and device, electronic equipment and storage medium
CN115134614B (en) * 2021-03-29 2024-01-02 北京字节跳动网络技术有限公司 Task parameter configuration method, device, electronic equipment and computer readable storage medium
CN115134614A (en) * 2021-03-29 2022-09-30 北京字节跳动网络技术有限公司 Task parameter configuration method and device, electronic equipment and computer readable storage medium
CN112926690A (en) * 2021-03-31 2021-06-08 北京奇艺世纪科技有限公司 Data processing method, device, equipment and storage medium
CN112926690B (en) * 2021-03-31 2023-09-01 北京奇艺世纪科技有限公司 Data processing method, device, equipment and storage medium
CN113435502A (en) * 2021-06-25 2021-09-24 平安科技(深圳)有限公司 Site flow determination method, device, equipment and storage medium
CN113435502B (en) * 2021-06-25 2022-09-16 平安科技(深圳)有限公司 Site flow determination method, device, equipment and storage medium
CN113407680A (en) * 2021-06-30 2021-09-17 竹间智能科技(上海)有限公司 Heterogeneous integrated model screening method and electronic equipment
CN113627681A (en) * 2021-08-25 2021-11-09 平安国际智慧城市科技股份有限公司 Data prediction method and device based on prediction model, computer equipment and medium
CN114334696A (en) * 2021-12-30 2022-04-12 中国电信股份有限公司 Quality detection method and device, electronic equipment and computer readable storage medium
CN114334696B (en) * 2021-12-30 2024-03-05 中国电信股份有限公司 Quality detection method and device, electronic equipment and computer readable storage medium
CN114565576A (en) * 2022-02-25 2022-05-31 联合汽车电子有限公司 DMTL surface defect detection method, device and terminal
CN114581252A (en) * 2022-03-03 2022-06-03 平安科技(深圳)有限公司 Target case prediction method and device, electronic device and storage medium
CN114581252B (en) * 2022-03-03 2024-04-05 平安科技(深圳)有限公司 Target case prediction method and device, electronic equipment and storage medium
CN115439206A (en) * 2022-11-08 2022-12-06 税友信息技术有限公司 Declaration data prediction method, device, equipment and medium
CN116542310B (en) * 2023-07-01 2023-09-22 帕西尼感知科技(张家港)有限公司 Model training and motion instruction prediction method, device and system for robot
CN116542310A (en) * 2023-07-01 2023-08-04 帕西尼感知科技(张家港)有限公司 Model training and motion instruction prediction method, device and system for robot
CN116880404A (en) * 2023-07-28 2023-10-13 北京远舢智能科技有限公司 Production control method, device, equipment and medium based on constant model

Also Published As

Publication number Publication date
CN110619423B (en) 2023-04-07
CN110619423A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
WO2021022933A1 (en) Method and device for multitask prediction, electronic device, and storage medium
US11086858B1 (en) Context-based utterance prediction for assistant systems
US11233759B2 (en) Messaging selection systems in networked environments
WO2019196280A1 (en) Disease prediction method and device, computer device and readable storage medium
US10692606B2 (en) Stress level reduction using haptic feedback
WO2019196286A1 (en) Illness prediction method and device, computer device, and readable storage medium
US11553048B2 (en) Method and apparatus, computer device and medium
WO2019134580A1 (en) Method and device for managing game users
US11527108B2 (en) Method and system for verifying users
CN104516635B (en) Method, system and storage medium for managing content display
US10789240B2 (en) Duplicative data detection
CN111125420B (en) Object recommendation method and device based on artificial intelligence and electronic equipment
US11386804B2 (en) Intelligent social interaction recognition and conveyance using computer generated prediction modeling
WO2017143773A1 (en) Crowdsourcing learning method and device
KR20220016217A (en) Systems and methods for using human recognition in a network of devices
EP3557498A1 (en) Processing multimodal user input for assistant systems
EP3557503A1 (en) Generating personalized content summaries for users
US20240020459A1 (en) Using machine learning to predict performance of secure documents
KR20220131701A (en) Method and apparatus for providing video stream based on machine learning
CN115037790B (en) Abnormal registration identification method, device, equipment and storage medium
BR112021008213A2 (en) computer-implemented communications by social media application
EP4047488A1 (en) Session-level read your writes consistency among digital data versions in a distributed network
US20210406670A1 (en) Pattern-based classification
US20240054546A1 (en) User context-based content suggestion and automatic provision
US20210174287A1 (en) Dynamic user management platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20850371

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20850371

Country of ref document: EP

Kind code of ref document: A1