Neural network apparatus, method, and device
By deploying a fluid prediction model with adjustable time resolution in a neural network device, the problem of fixed time resolution of the existing neural network model is solved, and the time resolution is dynamically adjusted according to user needs, meeting the requirements of different prediction time spans, and improving user experience.
Patent Information
- Application Number
- PCT/CN2024/131586
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-15
- Filing Date
- 2024-11-12
- Publication Date
- 2025-05-22
AI Technical Summary
After training, the time resolution of existing neural network models is fixed and cannot meet the different requirements of users for predicting time spans.
A neural network device is designed and a fluid prediction model is deployed, which includes a first spatial mapping operator, a time prediction operator and a second spatial mapping operator, and the time resolution is adjustable by providing an interface for configuring the time resolution.
The time resolution of the fluid prediction model is dynamically adjusted according to user needs, thereby meeting the requirements of different users for predicting time spans and improving user experience.
Smart Images

Figure CN2024131586_22052025_PF_FP_ABST
Abstract
Description
A neural network device, method and apparatus
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on November 15, 2023, with application number 202311528909.X and application name "A neural network device, method and equipment", the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of communication technology, and in particular to a neural network device, method, and equipment. Background Art
[0004] Many disciplines such as economics, social sciences, fluid mechanics, and meteorology involve a type of time-related data, which is often called a time series. A time series is a collection of data arranged in chronological order.
[0005] Time series analysis considers not only the relationship between data and time but also the relationship between data at different times. An important application of time series analysis is time-based forecasting. Time-based forecasting involves predicting possible future data based on historical data. For example, in meteorology, it is necessary to predict weather data for a specific time in the future based on historical weather data.
[0006] Taking the meteorological field as an example, the time-based prediction process is explained: first, the basic neural network model is trained; after the neural network model training is completed, the meteorological data of a certain time that has been measured is input into the neural network model. The neural network model analyzes the meteorological data and outputs the meteorological data of a certain time in the future. The meteorological data of the certain time in the future is the predicted data.
[0007] In actual applications, users may have different requirements for the forecast time span, that is, the interval between the time corresponding to the input weather data and the time corresponding to the forecast data. For example, users may need to predict weather data for the next day, week, or month.
[0008] However, after the training of the neural network model is completed, its time resolution (that is, the time span between the input data and output data of the neural network model) is fixed and cannot meet the different requirements of users for the prediction time span.
[0009] Summary of the Invention
[0010] The embodiments of the present application provide a neural network device, method, and apparatus for meeting different user requirements for prediction time spans.
[0011] In a first aspect, embodiments of the present application provide a neural network device that deploys a fluid prediction model. The temporal resolution of the fluid prediction model is adjustable, and an interface for configuring the temporal resolution of the fluid prediction model is provided. Specifically, the fluid prediction model includes a first spatial mapping operator, a temporal prediction operator, and a second spatial mapping operator. The functions of these three operators are as follows:
[0012] The first space mapping operator is used to receive the measurement data corresponding to the first time input into the fluid prediction model, and map the measurement data corresponding to the first time from the first data space to the second data space.
[0013] The time prediction operator provides an interface for configuring the time resolution of the fluid prediction model, and is used to iteratively process the measured data corresponding to the mapped first time according to the parameters received from the interface to obtain the predicted data corresponding to the second time.
[0014] The second space mapping operator is used to map the prediction data corresponding to the second time from the second data space to the first data space, and output the prediction data corresponding to the second time.
[0015] Through the above device, a fluid prediction model with adjustable time resolution is deployed in the neural network device. The time resolution model is no longer fixed, but can be set to different values according to needs, which can meet the user's different needs for time span and effectively improve the user experience.
[0016] In one possible implementation, the fluid prediction model needs to be pre-trained before deployment. In the embodiment of the present application, a gradient descent algorithm can be used to optimize the fluid prediction model during training, wherein the loss function calculated during the optimization using the gradient descent algorithm indicates some or all of the following:
[0017] The sample data is processed by the first spatial mapping operator and the second spatial mapping operator in sequence, and the difference between the output data of the second spatial mapping operator and the sample data.
[0018] The difference between the output data of the sample data after being processed by the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator and the real data.
[0019] Through the above device, the possible errors caused by the first space mapping operator and the second space mapping operator are taken into account during the training of the fluid prediction model, thereby ensuring that the trained fluid prediction model is more accurate.
[0020] In one possible implementation, the parameter received from the interface is a time resolution parameter, which is linearly related to the time resolution of the fluid prediction model. The relationship between the time resolution parameter and the time resolution of the fluid prediction model is relatively simple, making it convenient to use the time resolution parameter to configure the time resolution of the fluid prediction model.
[0021] In one possible implementation, the product of the time resolution parameter and the basic time resolution of the fluid prediction model is equal to the time resolution of the fluid prediction model, and the basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
[0022] Through the above device, the time resolution of the fluid prediction model can be quickly obtained by calculating the product of the time resolution parameter and the basic time resolution of the fluid prediction model. The time resolution calculation method of the fluid prediction model is simple and efficient.
[0023] In one possible implementation, when the time prediction operator iteratively processes the measurement data corresponding to the mapped first time based on the parameters received from the interface, the time prediction operator may perform r iterations on the measurement data corresponding to the mapped first time, where r is equal to the time resolution parameter. The time prediction operator only needs to receive the time resolution parameter through the interface to determine the number of required iterations.
[0024] In a possible implementation, the parameter received from the interface is the time resolution of the fluid prediction model. The time resolution of the fluid prediction model can be directly received through the interface.
[0025] In one possible implementation, when the time prediction operator iteratively processes the measurement data corresponding to the first time after mapping according to the parameters received from the interface, it first determines the number of iterations r according to the parameters received from the interface. After determining the number of iterations r, it iterates the measurement data corresponding to the first time after mapping r times, where r is equal to the ratio of the time resolution to the basic time resolution of the fluid prediction model. The basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
[0026] Through the above device, the time prediction operator can determine the number of required iterations based on the time resolution of the fluid prediction model, ensuring that after completing the determined number of iterations, the time resolution of the fluid prediction model is equal to the parameters received from the interface.
[0027] In one possible implementation, the time prediction operator can be regarded as a time series model running in the second data space, so the time prediction model also has a time resolution, wherein the basic time resolution of the fluid prediction model is equal to the time resolution of the time prediction operator.
[0028] In a possible implementation, the second data space is a time-linearly correlated space.
[0029] Through the above device, the relationship between data and time in the second data space is a relatively simple linear relationship, which facilitates the time prediction operator to process the measurement data corresponding to the first time mapped to the second data space and accurately output the corresponding prediction data.
[0030] In one possible implementation, this fluid prediction model can be applied to various scenarios that require predicting future data based on past data. For example, it can be applied to weather forecasting scenarios, where the measured data describes the weather conditions at a first time, and the predicted data describes the weather conditions at a second time. Another example is a sales forecasting scenario where the measured data describes sales within a first time, and the predicted data describes sales within a second time.
[0031] In one possible embodiment, the neural network device also includes a transmission module, which can obtain measurement data corresponding to the first time and the predicted time span provided by the user. The transmission module inputs parameters to the interface according to the predicted time span to configure the time resolution of the fluid prediction model to the predicted time span, and inputs the data corresponding to the first time into the fluid prediction model.
[0032] Through the above device, the transmission module can receive information provided by the user and input parameters to the interface to configure the time resolution of the fluid prediction model, so as to facilitate the normal operation of the subsequent fluid prediction model and output the prediction data corresponding to the second time.
[0033] In a possible implementation, the transmission module may obtain the prediction data corresponding to the second time, and transmit the prediction data corresponding to the second time to the user, so that the user can obtain the required prediction data in a timely manner.
[0034] In a second aspect, an embodiment of the present application further provides a model training method, which is used to train the fluid prediction model mentioned in the example of the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The fluid prediction model includes a first spatial mapping operator, a time prediction operator, and a second spatial mapping operator, wherein the first spatial mapping operator and the second spatial mapping operator are used to implement spatial mapping, and the time prediction operator is used to iteratively process the input data and output predicted data. In this model training method, a gradient descent algorithm can be used to optimize the fluid prediction model training, wherein the loss function calculated in the optimization using the gradient descent algorithm indicates the following differences:
[0035] The sample data is processed by the first spatial mapping operator and the second spatial mapping operator in sequence, and the difference between the output data of the second spatial mapping operator and the sample data.
[0036] The difference between the data output by the second spatial mapping operator and the real data after the sample data is processed by the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator.
[0037] In a possible implementation, when a gradient descent algorithm is used to optimize the fluid prediction model during training, the gradient descent algorithm is called to calculate the gradient of the loss function, and the weights in the fluid prediction model are adjusted according to the gradient.
[0038] In a possible implementation, before the time prediction operator uses the gradient descent algorithm to optimize the fluid prediction model during training, the time resolution of the fluid prediction model is configured as a set value through an interface.
[0039] In a possible implementation, when the time resolution of the fluid prediction model is configured as a set value through the interface, a time resolution parameter may be input into the slave interface, and the time resolution parameter is in a linear relationship with the set value.
[0040] In one possible implementation, the product of the time resolution parameter and the basic time resolution of the fluid prediction model is equal to a set value, and the basic time resolution of the fluid prediction model is the minimum time span between input data and output data of the fluid prediction model.
[0041] In a possible implementation, the time resolution parameter is the number of iterations when the time prediction operator iteratively processes the input data.
[0042] In a third aspect, the present application also provides a time-based prediction method. This time-based prediction method is performed by the neural network device provided in the example of the first aspect. The beneficial effects can be found in the description of the first aspect and will not be repeated here. In this method:
[0043] The neural network device obtains the measurement data corresponding to the first time and the predicted time span provided by the user.
[0044] The neural network device configures the time resolution of the fluid prediction model through the interface according to the prediction time span, and inputs the measurement data corresponding to the first time into the fluid prediction model, wherein the time resolution of the fluid prediction model is equal to the prediction time span.
[0045] The neural network device obtains the prediction data corresponding to the second time output by the fluid prediction model and feeds back the prediction data corresponding to the second time to the user, wherein the first time and the second time meet the prediction time span.
[0046] In a possible implementation, when the fluid prediction model outputs prediction data corresponding to the second time, the data processing process within the fluid prediction model is as follows:
[0047] The first space mapping operator in the fluid prediction model maps the measurement data corresponding to the first time from the first data space to the second data space.
[0048] The time prediction operator in the fluid prediction model provides an interface for configuring the time resolution of the fluid prediction model. The time prediction operator in the fluid prediction model iteratively processes the measured data corresponding to the mapped first time according to the parameters received from the interface to obtain the predicted data corresponding to the second time.
[0049] The second space mapping operator in the fluid prediction model maps the prediction data corresponding to the second time from the second data space to the first data space, and outputs the prediction data corresponding to the second time.
[0050] In a possible implementation, the parameter received from the interface is a time resolution parameter, and the time resolution parameter is linearly related to the time resolution of the fluid prediction model.
[0051] In one possible implementation, the product of the time resolution parameter and the basic time resolution of the fluid prediction model is equal to the time resolution of the fluid prediction model, and the basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
[0052] In one possible implementation, when the time prediction operator iteratively processes the data corresponding to the first time after mapping according to the parameters received from the interface, the time prediction operator iterates the data corresponding to the first time after mapping r times, where r is equal to the time resolution parameter.
[0053] In a fourth aspect, the present application further provides a computing device comprising a processor and a memory, and may also include a communication interface. The processor executes program instructions in the memory to perform the method provided by any possible implementation of the second aspect or any possible implementation of the third aspect. The memory is coupled to the processor and stores computer program instructions and data necessary for model training or time-based prediction. The communication interface is used to communicate with other devices, such as obtaining prediction data corresponding to a first time and a prediction time span, and transmitting prediction data corresponding to a second time.
[0054] In a fifth aspect, the present application provides a computing device system comprising at least one computing device. Each computing device comprises a memory and a processor. The processor of at least one computing device is configured to access code in the memory to execute the method provided by any possible implementation of the second aspect or any possible implementation of the third aspect.
[0055] In a sixth aspect, the present application provides a non-transitory readable storage medium. When the non-transitory readable storage medium is executed by a computing device, the computing device executes the method provided by any possible implementation of the second aspect or any possible implementation of the third aspect. The storage medium stores a program. The storage medium includes, but is not limited to, volatile memory, such as random access memory, and non-volatile memory, such as flash memory, a hard disk drive (HDD), and a solid state drive (SSD).
[0056] In a seventh aspect, the present application provides a computing device program product, comprising computer instructions. When executed by a computing device, the computing device performs the method provided by any possible implementation of the second aspect or any possible implementation of the third aspect. The computer program product may be a software installation package. When it is desired to use the method provided by any possible implementation of the second aspect or any possible implementation of the third aspect, the computer program product may be downloaded and executed on the computing device. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] FIG1 is a schematic diagram of the architecture of a data prediction system provided by this application;
[0058] FIG2 is a schematic diagram of the structure of a fluid prediction model provided by this application;
[0059] FIG3 is a schematic diagram of a model training method provided by this application;
[0060] FIG4 is a schematic diagram of a data processing process of a fluid prediction model during training provided by the present application;
[0061] FIG5 is a schematic diagram of a time-based prediction method provided by the present application;
[0062] FIG6 is a schematic diagram of a data input interface provided by the present application;
[0063] FIG7 is a schematic diagram of a data display interface provided by this application;
[0064] FIG8 is a schematic structural diagram of a neural network device provided by the present application;
[0065] 9 and 10 are schematic structural diagrams of a computing device provided in this application. DETAILED DESCRIPTION
[0066] Before describing the time-based prediction method provided in the embodiments of the present application, some concepts involved in the embodiments of the present application are first explained.
[0067] (1) Time series model.
[0068] A time series is a collection of data arranged in chronological order. Time series arise in many disciplines. For example, in meteorology, it's necessary to record meteorological data such as temperature, humidity, air pressure, precipitation, and wind speed over a specific area over time in order to analyze trends in these data. Another example is economics, where monthly sales figures, advertising expenses, product quantity, and unit price are recorded to analyze the relationships between sales, advertising expenses, product quantity, and unit price.
[0069] A time series model is a type of neural network model used to analyze time series. It can predict future data based on past data. It learns trends or patterns in historical time series data and uses these trends or patterns to predict future data.
[0070] Common time series models include autoregressive model (AR), moving average model (MA), and autoregressive integrated moving average model (ARIMA).
[0071] In an embodiment of the present application, a new time series model is provided. In order to distinguish it from the existing time series model, the new time series model provided in the embodiment of the present application is referred to as a fluid prediction model. In an embodiment of the present application, a spatial mapping operator (such as a first spatial mapping operator and a second spatial mapping operator) for realizing spatial mapping is added to the fluid prediction model to ensure that when the fluid prediction model learns the input data, it can learn in a time-linearly related space that can fully reflect the relationship between data and time, and then output prediction data that is more in line with the actual situation. The structure of the fluid prediction model provided in the embodiment of the present application and the training process of the fluid prediction model will be introduced below.
[0072] It's worth noting that while the "fluid prediction model" is used to name this new time series model in the examples of this application, it doesn't necessarily apply only to the fluid field. The fluid prediction model provided in the examples of this application can be used to analyze and predict data in any field requiring analysis and prediction based on time series data.
[0073] (2) Spatial mapping operators and time-linearly related spaces.
[0074] The spatial mapping operator can establish a mapping relationship between two data spaces and can map data in one data space to another data space; the spatial mapping operator can convert data A in one data space into data B in another data space. Data B can be regarded as the representation of data A in another data space.
[0075] The time series model provided in the embodiments of this application includes two spatial mapping operators. For ease of distinction, these two spatial mapping operators are referred to as the first spatial mapping operator and the second spatial mapping operator, respectively. The first spatial mapping operator is used to map data from the first data space to the second data space, and the second spatial mapping operator is used to map data from the second data space to the first data space. The first spatial mapping operator and the second spatial mapping operator are inverse operators of each other.
[0076] During the training of the time series model, the first spatial mapping operator is trained to be able to map data into a time-linearly correlated space. The second spatial mapping operator is trained to be able to map data from a time-linearly correlated space into the space to which the data originally belonged (i.e., the first data space).
[0077] The distribution of variables in a time-linearly correlated space over time is linearly correlated. In the embodiments of the present application, the variable is the variable represented by the measured data, predicted data, or sample data. The measured data, predicted data, or sample data is the specific value of the variable.
[0078] To put it another way, in this time-linearly dependent space, a linear relationship between variables and time can always be found. A time-linearly dependent space refers to a data space that covers the linear relationship between variables and time.
[0079] (3), prediction time span, time resolution, time resolution parameter, and time prediction operator.
[0080] Since the data involved in the embodiments of the present application (such as measurement data, prediction data, and sample data) are all time-related data, that is, there is a corresponding relationship between data and time in the embodiments of the present application.
[0081] Taking the measurement data corresponding to the first time as an example, the measurement data corresponding to the first time can be understood as the measurement data valid at the first time, or the measurement data applicable at the first time. In practical applications, such as in the meteorological field, the measurement data corresponding to the first time can be the meteorological data at the first time, describing the meteorological conditions at the first time; in another example, in the sales statistics scenario, the measurement data corresponding to the first time can be the sales volume at the first time.
[0082] Taking the forecast data corresponding to the second time as an example, the forecast data corresponding to the second time can be understood as the predicted data valid within the second time, or the predicted data applicable at the second time. In practical applications, such as in meteorology, the forecast data corresponding to the second time can be the predicted meteorological data at the second time, describing the predicted weather conditions at the second time. Another example is when applied to sales statistics, the forecast data corresponding to the second time can be the predicted sales volume at the second time.
[0083] The prediction time span describes the time span between the measurement data provided by the user and the prediction data that the user needs to obtain, that is, the time span between the first time and the second time.
[0084] Time resolution is an important parameter of a time series model (such as the fluid prediction model provided in the embodiments of the present application). The time resolution describes the time span between the input data and the output data of the time series model, that is, it describes the time span between the time corresponding to the input data and the time corresponding to the output data (which can also be understood as the time interval).
[0085] The time resolution of the fluid prediction model provided in the embodiment of the present application is adjustable, that is, the time span between the input data and the output data of the fluid prediction model can be adjusted.
[0086] In the embodiment of the present application, the fluid prediction model provides an interface for configuring the time resolution, through which the time resolution of the fluid prediction model can be configured.
[0087] The embodiments of the present application do not limit the specific presentation method of the interface. For example, the interface can be presented as an interface for directly inputting the time resolution, that is, the parameter inputted by the interface is the time resolution of the fluid prediction model. For another example, the interface can also be presented as an interface for inputting parameters related to the time resolution, that is, the parameter inputted by the interface is not the time resolution of the fluid prediction model, but a parameter related to the time resolution. For the convenience of explanation, the parameter related to the time resolution is referred to as the time resolution parameter.
[0088] The specific value of the time resolution parameter determines the time resolution of the fluid prediction model. The time resolution of the fluid prediction model is linearly related to the time resolution parameter, and the linear relationship is pre-configured. For example, the time resolution of the fluid prediction model can be equal to the product of the basic time resolution of the fluid prediction model and the time resolution parameter, wherein the basic time resolution of the fluid prediction model is a constant, which is a unique attribute of the fluid prediction model. The basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model, that is, the minimum time interval between the time corresponding to the input data of the fluid prediction model and the time corresponding to the output data of the fluid prediction model.
[0089] In addition to the spatial mapping operator, the fluid prediction model in the embodiment of the present application also includes a time prediction operator. The time prediction operator is a major component of the fluid prediction model. The time prediction operator has a prediction function and can output prediction data based on the input measurement data. The input data and output data of the time prediction operator are both data in the second data space. Therefore, the time prediction operator can be understood as a "time series model" applicable to the second data space. The time prediction operator also has a time resolution, which is equal to the basic time resolution of the fluid prediction model provided in the embodiment of the present application.
[0090] As shown in FIG1 , it is a schematic diagram of the architecture of a data prediction system provided in an embodiment of the present application. The data prediction system includes a neural network device 100 and a client 200 .
[0091] The client 200 can be deployed at a location close to the user. The client 200 serves as the "front end" of the data prediction system, facing the user, receiving data provided by the user or instructions triggered by the user, and can also display or transmit data to the user. In an embodiment of the present application, the client 200 can obtain the measurement data corresponding to the first time and the prediction time span provided by the user, and initiate a prediction request to the neural network device 100 under the triggering of the user. The prediction request is used to request a prediction based on the measurement data corresponding to the first time. The prediction request carries the measurement data corresponding to the first time and the prediction time span provided by the user. In addition, the client 200 can also receive the prediction data corresponding to the second time from the neural network device 100, and display or transmit the prediction data corresponding to the second time to the user.
[0092] The specific form of client 200 is not limited in the embodiments of the present application. For example, client 200 can be a client program running on a computing device, such as a browser, or a front-end application dedicated to prediction. Client 200 can also be a physical device, such as a computing device deployed on the user side, a mobile terminal, etc.
[0093] The neural network device 100 can process the prediction request initiated by the client 200, perform a prediction based on the measurement data corresponding to the first time, and obtain the predicted data corresponding to the second time. The neural network device is equipped with a fluid prediction model. The fluid prediction model has a prediction function and can output predicted data based on the input data.
[0094] In an embodiment of the present application, after receiving a prediction request from the client 200, the neural network device 100 obtains the measurement data corresponding to the first time and the prediction time span, configures the time resolution of the fluid prediction model according to the prediction time span, the time resolution of the configured fluid prediction model is equal to the prediction time span, inputs the measurement data corresponding to the first time into the fluid prediction model, obtains the prediction data corresponding to the second time output by the fluid prediction model, and transmits the prediction data to the client 200.
[0095] The fluid prediction model deployed on the neural network device 100 may be obtained by pre-training the fluid prediction model by the neural network device 100, or may be deployed on the neural network device 100 after training the fluid prediction model by another device. The embodiments of the present application do not limit the device for training the fluid prediction model.
[0096] The neural network device 100 can be a hardware device, such as a server or terminal computing device, or a software device, specifically a software system running on a computing device. The embodiments of the present application do not limit the location of the neural network device 100. For example, the neural network device 100 can run on a cloud computing device system (including at least one cloud computing device, such as a server), on an edge computing device system (including at least one edge computing device, such as a server or desktop computer), or on various terminal computing devices, such as laptop computers and personal desktop computers.
[0097] In the data prediction system shown in FIG1 , the neural network device 100 interacts with the user via the client 200 to obtain the measurement data corresponding to the first time and the predicted time span provided by the user, and transmits or displays the predicted data corresponding to the second time to the user. In actual applications, the neural network device 100 can also be deployed on the user side to interact directly with the user. In the embodiments of this application, the interaction between the neural network device 100 and the user via the client 200 is used as an example for explanation.
[0098] In the embodiments of the application, the fluid prediction model deployed on the neural network device 100 provides an interface for configuring the time resolution, allowing the neural network device 100 to configure the time resolution for the fluid prediction model. The fluid prediction model deployed on the neural network device 100 is a fluid prediction model with adjustable time resolution. The user can provide the measurement data corresponding to the first time and the prediction time span according to their needs. The neural network device 100 can configure the time resolution of the fluid prediction model based on the prediction time span. After the time resolution of the fluid prediction model is configured, the fluid prediction model only needs to input the measurement data corresponding to the first time, and the fluid prediction model can output the prediction data corresponding to the second time. The prediction time span required by the user is no longer limited by the time resolution of the fluid prediction model, which improves the user experience and ensures the efficiency of obtaining prediction data.
[0099] The structure of a fluid prediction model provided in an embodiment of the present application and the training process of the fluid prediction model are described below.
[0100] Structure of the fluid prediction model:
[0101] As shown in Figure 2, a schematic diagram of the structure of a fluid prediction model provided in an embodiment of the present application is shown. The fluid prediction model includes a first spatial mapping operator, a time prediction operator, and a second spatial mapping operator. The first spatial mapping operator, the time prediction operator, and the second spatial mapping operator are connected at the end.
[0102] The first spatial mapping operator is used to map data input to the first spatial mapping operator (such as measurement data corresponding to the first time) from the first data space to the second data space.
[0103] The time prediction operator is used to perform iterative processing based on the data output by the first spatial mapping operator and output prediction data.
[0104] The second space mapping operator is used to map the prediction data output by the time prediction operator from the second data space to the first data space.
[0105] In this embodiment of the present application, the first data space refers to the data space containing the user-provided measurement data corresponding to the first time and the user-required predicted data corresponding to the second time. The second data space is the data space in which the time prediction operator operates, that is, the data space containing the input data and output data of the time prediction operator.
[0106] The time prediction operator can actually be regarded as a "time series model" running in the second data space, and the time resolution of the time prediction operator is the basic time resolution of the fluid prediction model. "Iterative processing" refers to a cyclic processing process of data. In this iterative processing process, the time prediction operator can run multiple times (that is, iterate multiple times). During each run, the output data of the time prediction operator in the previous run is used as the input data for this run. The number of times the time prediction operator runs is the number of iterations in the iterative processing process. Among them, running the time prediction operator once can be regarded as a special "iterative processing", that is, the number of iterations in the iterative processing process is one. It can be seen that the number of iterations of the time prediction operator determines the time resolution of the fluid prediction model. The time resolution of the fluid prediction model is equal to the product of the number of iterations of the time prediction operator and the basic time resolution of the fluid prediction model.
[0107] Within the fluid prediction model, the fluid prediction model provides an interface for configuring the time resolution, which is essentially an interface provided by the time prediction operator to configure the time resolution. Configuring the time resolution for the fluid prediction model through this interface is essentially configuring the number of iterations of the time prediction operator through this interface.
[0108] When the interface is expressed as an interface for directly inputting the time resolution, the fluid prediction model needs to convert the parameters input by the interface into the number of iterations of the time prediction operator, that is, the number of iterations of the time prediction operator is equal to the ratio of the parameters input by the interface to the time resolution of the time prediction operator (that is, the basic time resolution of the fluid prediction model).
[0109] When the interface is an interface for inputting parameters related to time resolution, the fluid prediction model needs to convert the parameters input by the interface into the number of iterations of the time prediction operator. According to the linear relationship between the time resolution of the fluid prediction model and the time resolution parameter, the time resolution parameter is converted into the time resolution of the fluid prediction model, and then the number of iterations of the time prediction operator is determined based on the time resolution of the fluid prediction model. Among them, the number of iterations of the time prediction operator is equal to the ratio of the parameter input by the interface to the time resolution of the time prediction operator (that is, the basic time resolution of the fluid prediction model). Exemplarily, when the time resolution of the fluid prediction model can be equal to the product of the basic time resolution of the fluid prediction model and the time resolution parameter, the time resolution parameter is equal to the number of iterations of the time prediction operator, that is, the value input by the interface is the number of iterations of the time prediction operator.
[0110] As a time series model, the fluid prediction model processes data that is time-related. In the process of processing the input data, the fluid prediction model also needs to analyze the relationship between data and time. Therefore, the clearer or more specific the relationship between data and time, the more conducive it is for the fluid prediction model to analyze the relationship between data and time, and the accuracy of the fluid prediction model can be effectively guaranteed. It can be seen that in the data space, the simpler the relationship between data and time, the more accurate the fluid prediction model can be. For a fluid prediction model that has been trained, the second data space can be a space that is linearly related to time or a data space that is close to a space that is linearly related to time. In the second data space, data and time can present a relatively simple linear relationship. In such a data space, the relationship between data and time can be more accurately reflected, and thus data within a certain time in the future can be efficiently predicted. In the fluid prediction model provided in the embodiment of the present application, a first space mapping operator and a second space mapping operator are added to ensure that the time prediction operator that bears the main prediction function in the fluid prediction model runs in the second data space, so that the time prediction operator can accurately output the predicted data corresponding to the second time.
[0111] In the embodiments of the present application, the internal structures of the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator are not limited. For example, the first spatial mapping operator and the second spatial mapping operator can adopt a multilayer perceptron (MLP) structure, and the time prediction operator can adopt a convolutional structure, a fully connected structure, or a transformer structure. The transformer structure is a structure of a graph neural network (GNN). Any neural network model that can achieve the corresponding function can be used as the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator.
[0112] As can be seen from the structural description of the fluid prediction model, the three main operators in the fluid prediction model (i.e., the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator) have corresponding functions. The fluid prediction model needs to be trained to ensure that the three main operators in the fluid prediction model have the corresponding functions.
[0113] Training of fluid prediction model:
[0114] The following describes the training process of the fluid prediction model. In the embodiment of the present application, a gradient descent algorithm can be used for optimization during the training process of the fluid prediction model. As shown in FIG3 , a training process of a fluid prediction model provided in the embodiment of the present application is shown.
[0115] Step 300: Configure the time resolution of the fluid prediction model. For example, the time resolution of the fluid prediction model can be configured as the basic time resolution of the fluid prediction model or a set value, or the time resolution of the fluid prediction model can be configured as the product of the basic time resolution of the fluid prediction model and a certain value.
[0116] When executing step 300, the time resolution of the configured fluid prediction model is the time resolution used by the fluid prediction model during the training process, which can also be understood as the time resolution that the fluid prediction model hopes to have during the training process. Therefore, step 300 can be understood as the fluid prediction model assuming a time resolution value, and when executing step 300, the number of iterations of the time prediction operator in the fluid prediction model can be determined. When training the fluid prediction model, the time resolution of the time prediction operator is uncertain and is an unknown number. It is a parameter that can only be determined through training. By training the fluid prediction model, it can be ensured that the time resolution of the time prediction operator or the basic time resolution of the fluid prediction model is equal to the ratio of the time resolution of the fluid prediction model configured in step 300 to the number of iterations of the time prediction operator in the fluid prediction model.
[0117] Assume that the interface provided by the fluid prediction model for configuring and adjusting the time resolution is an interface for inputting a time resolution parameter, where the time resolution parameter is the number of iterations of the time prediction operator. When executing step 300, the time resolution parameter can be input into this interface to configure the time resolution of the fluid prediction model. The configured time resolution of the fluid prediction model is equal to the product of the time resolution parameter and the base time resolution of the fluid prediction model. The time resolution of the fluid prediction model can remain unchanged throughout the training process.
[0118] Step 301: Prepare a training set for a fluid prediction model. The training set includes multiple sample data, each of which is measurement data corresponding to a certain time. Each sample data corresponds to a different time. Each sample data is provided with a data label, which records the real data. The time span between the real data and the sample data is equal to the time resolution of the fluid prediction model. In other words, the time interval between the time corresponding to the real data and the data corresponding to the sample data is equal to the time resolution of the fluid prediction model (i.e., the time resolution of the fluid prediction model configured in step 300).
[0119] Step 302: Input the sample data in the training set into the fluid prediction model to obtain the prediction data output by the fluid prediction model, as well as the data output by the sample data after passing through the first spatial mapping operator and the second spatial mapping operator in the fluid prediction model in sequence. For the sake of convenience, the data output by the second spatial mapping operator after the sample data passes through the first spatial mapping operator and the second spatial mapping operator in the fluid prediction model in sequence is called reference sample data.
[0120] As shown in FIG4 , for any sample data in the training set, the sample data undergoes the following two processing steps in the fluid prediction model.
[0121] Processing process 1: The sample data is input into the first spatial mapping operator and processed by the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator. In this processing process, the data output by the second spatial mapping operator is the predicted data.
[0122] Processing step 1 is the normal data processing process within the fluid prediction model. After sample data is input into the first spatial mapping operator, the first spatial mapping operator maps the sample data from the first data space to another data space. Since this is the training process, this other data space is not necessarily the second data space; that is, it is not a space linearly correlated in time or a space close to linearly correlated in time. Only during the training process does this other data space gradually become the second data space. For ease of explanation, this other data space involved in the training process will be referred to as the third data space. During the training process, the third data space gradually approaches the second data space, eventually becoming the second data space.
[0123] The sample data is mapped to the third data space via the first spatial mapping operator. The temporal prediction operator then acquires the sample data mapped to the third data space and iterates the temporal prediction operator. If the temporal resolution parameter is N, the temporal prediction operator iterates N times. After N iterations, the temporal prediction operator outputs predicted data in the third data space.
[0124] The second space mapping operator obtains the prediction data in the third data space output by the time prediction operator, maps the prediction data in the third data space to the first data space, and outputs the final prediction data.
[0125] Processing process 2: The sample data is input into the first spatial mapping operator and processed by the first spatial mapping operator and the second spatial mapping operator. In this processing process, the data output by the second spatial mapping operator is the reference sample data.
[0126] Process 2 does not involve data prediction; it simply maps the sample data from the first data space to the third data space, and then from the third data space back to the first data space. Theoretically, the data output after mapping the sample data from the first data space to the third data space and then from the third data space back to the first data space should be the sample data. However, due to potential errors in the spatial mapping process between the first and second spatial mapping operators, the data output by the second spatial mapping operator may not be consistent with the sample data. Therefore, the data output by the second spatial mapping operator is referred to as reference sample data.
[0127] Step 303: Calculate a loss function based on the prediction data output by the fluid prediction model and the reference sample data output after the sample data passes through the first spatial mapping operator and the second spatial mapping operator in the fluid prediction model in sequence.
[0128] One goal of training the fluid prediction model is to make the predicted data output by the second space mapping operator close to or equal to the real data, that is, to reduce the difference between the predicted data and the real data.
[0129] Since the fluid prediction model adds a first spatial mapping operator and a second spatial mapping operator, in an embodiment of the present application, another goal of training is to reduce the errors that may exist in the spatial mapping process of the first spatial mapping operator and the second spatial mapping operator, that is, to reduce the difference between the reference sample data and the sample data.
[0130] When calculating the loss function, the loss function may indicate at least some or all of the following:
[0131] The difference between the output data of the second spatial mapping operator and the sample data after the sample data is processed by the first spatial mapping operator and the second spatial mapping operator in sequence is referred to as the reconstruction loss for the convenience of explanation.
[0132] The difference between the predicted data output by the temporal prediction operator after processing by the second spatial mapping operator and the actual data is referred to as the prediction loss for the sake of convenience.
[0133] For example, the loss function F can be specified as: F = |XX`| + |YY`|
[0134] Among them, X is the sample data, X' is the reference sample data, Y is the predicted data, and Y' is the actual data.
[0135] The embodiments of the present application do not limit the calculation method of the loss function. Any calculation method of the loss function that can characterize the reconstruction loss and / or prediction loss is applicable to the embodiments of the present application.
[0136] Step 304: Call the gradient descent algorithm to calculate the gradient according to the loss function, and adjust the weights in the fluid prediction model based on the gradient.
[0137] Gradient descent is an optimization algorithm, often also called the steepest descent method. To find the local minimum of a loss function, the weights in the fluid prediction model are adjusted in a specified step size in the opposite direction of the gradient (or approximate gradient) of the loss function at the current point.
[0138] Each time a sample data is input into the fluid prediction model, the weights in the fluid prediction model can be adjusted using the gradient descent algorithm until the calculated loss function converges and the training process is completed.
[0139] As can be seen from the training process above, the fluid prediction model's temporal resolution is preconfigured during training. This means that the model's training is completed with a fixed temporal resolution. After training, the model becomes a time series model with adjustable temporal resolution. This means that during the entire training process, there's no need to train time series models with different temporal resolutions; only the preconfigured temporal resolution is required.
[0140] The process of using this fluid prediction model to make predictions based on time:
[0141] After the fluid prediction model is trained, the fluid prediction model can deploy a neural network device to process the measurement data provided by the user and make predictions based on the measurement data. The following describes the process of the neural network device making predictions based on the measurement data provided by the user.
[0142] Taking the system architecture shown in FIG1 as an example, FIG5 shows a time-based prediction method provided by an embodiment of the present application. The method includes:
[0143] Step 501: The client 200 initiates a prediction request to the neural network device 100. The prediction request carries the measurement data corresponding to the first time and the prediction time span provided by the user. The prediction request is used to request a prediction based on the measurement data corresponding to the first time.
[0144] The user can interact with the client 200 deployed on the user side and provide the measurement data corresponding to the first time and the predicted time span. The embodiment of the present application does not limit the manner in which the user provides the measurement data corresponding to the first time and the predicted time span to the client 200.
[0145] For example, the client 200 can provide a visual data input interface for the user, as shown in Figure 6, which is a schematic diagram of a visual data input interface provided by the client 200 for the user. In this data input interface, an option for uploading the measurement data corresponding to the first time and a typing box for the predicted time span are provided.
[0146] In the data input interface, the user can upload the measurement data corresponding to the first time to the client 200 and input the predicted time span according to his / her own needs.
[0147] After detecting the user's operation on the data input interface, the client 200 obtains the measurement data corresponding to the first time and the predicted time span, and generates a prediction request carrying the measurement data corresponding to the first time and the predicted time span.
[0148] Step 502: After receiving the prediction request, the neural network device 100 obtains the measurement data corresponding to the first time and the prediction time span.
[0149] Step 503: The neural network device 100 configures a time resolution for the fluid prediction model according to the prediction time span, and inputs the measurement data corresponding to the first time into the fluid prediction model.
[0150] The fluid prediction model provides an interface for configuring the time resolution. The neural network device 100 can call the interface and input parameters to the interface according to the prediction time span to configure the time resolution for the fluid prediction model. The time resolution of the fluid prediction model is configured as the prediction time span.
[0151] For example, assuming that the interface is an interface for inputting time resolution, the neural network device 100 can input the predicted time span into the interface, and then the time resolution of the fluid prediction model is the predicted time span.
[0152] For another example, assuming the interface is an interface for inputting a time resolution parameter, where the input time resolution parameter is the number of iterations of the time prediction operator in the fluid prediction model. The neural network device 100 calculates the ratio of the prediction time span to the base time resolution of the fluid prediction model. This ratio is the number of iterations of the prediction operator when the time resolution of the fluid prediction model is equal to the prediction time span. The neural network device 100 can input this ratio into the interface.
[0153] After configuring the time resolution of the fluid prediction model, the neural network device 100 inputs the measurement data corresponding to the first time into the fluid prediction model. The fluid prediction model analyzes the measurement data and outputs the prediction data corresponding to the second time, wherein the measurement data corresponding to the first time and the prediction data corresponding to the second time meet the prediction time span.
[0154] In the fluid prediction model, after the measurement data corresponding to the first time is input into the first space mapping operator, the first space mapping operator maps the sample data from the first data space to the second data space.
[0155] The measurement data corresponding to the first time is mapped to the second data space via the first spatial mapping operator. The time prediction operator obtains the measurement data corresponding to the first time mapped into the second data space and iterates the time prediction operator. If the prediction time span is T, the number of iterations of the time prediction operator is r = T / D, where D is the time resolution of the time prediction operator. After r iterations, the time prediction operator outputs the predicted data corresponding to the second time in the second data space.
[0156] The second space mapping operator obtains the prediction data corresponding to the second time in the second data space output by the time prediction operator, maps the prediction data corresponding to the second time in the second data space to the first data space, and outputs the prediction data corresponding to the second time.
[0157] Step 504 : The neural network device 100 obtains the prediction data corresponding to the second time output by the fluid prediction model, and feeds back the prediction data corresponding to the second time to the user through the client 200 .
[0158] The neural network device 100 may transmit the prediction data corresponding to the second time to the client 200. After receiving the prediction data corresponding to the second time, the client 200 may display the prediction data corresponding to the second time to the user.
[0159] For example, the client 200 can provide a visual data display interface for the user, as shown in Figure 7, which is a schematic diagram of the client 200 providing a visual data display interface for the user. In this data display interface, a download option for the predicted data corresponding to the second time and a preview box for the predicted data are provided.
[0160] In the data display interface, the user can view the predicted data in the preview box and can also download the predicted data corresponding to the second time by clicking the download option.
[0161] Based on the same inventive concept as the method embodiment, the present embodiment further provides a neural network device for executing the method performed by neural network device 100 in the method embodiment described above. As shown in Figure 8, neural network device 800 includes a transmission module 802 and a fluid prediction model 801. Specifically, in neural network device 800, each module is connected via a communication path.
[0162] The functions of the fluid prediction model 801 can be found in the above description and will not be repeated here.
[0163] The transmission module 802 is used to obtain the measurement data and the predicted time span corresponding to the first time provided by the user; input parameters to the interface according to the predicted time span so that the time resolution of the fluid prediction model is configured to be equal to the predicted time span, and input the data corresponding to the first time into the fluid prediction model.
[0164] As a possible implementation, the transmission module 802 may further obtain prediction data corresponding to the second time, and transmit the prediction data corresponding to the second time to the user.
[0165] The division of modules in the embodiments of the present application is illustrative and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the present application may be integrated into a single processor, or may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or software functional modules.
[0166] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions for enabling a terminal device (which can be a personal computer, mobile phone, or network device, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., various media that can store program code.
[0167] The present application also provides a computing device 900 as shown in Figure 9. The computing device 900 includes a bus 901, a processor 902, a communication interface 903, and a memory 904. The processor 902, the memory 904, and the communication interface 903 communicate with each other via the bus 901.
[0168] Among them, the processor 902 can be a central processing unit (CPU) or other processors, such as a graphics processing unit (GPU), a microprocessor (MP), a digital signal processor (DSP), a coprocessor (to assist the central processor in completing corresponding processing and applications), an application specific integrated circuit (ASIC), a microcontroller unit (MCU), and other processors. The memory 904 can include a volatile memory (volatile memory), such as a random access memory (RAM). The memory 904 can also include a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, an HDD, or an SSD. The memory stores executable code, and the processor 902 executes the method described in Figures 3 or 5 above. The memory 904 can also include software modules required for other running processes such as an operating system (such as multiple modules in the neural network device 800). The operating system can be LINUX TM ,UNIX TM ,WINDOWS TM wait.
[0169] The present application also provides a computing device system, comprising at least one computing device 1000 as shown in FIG10 . The computing device 1000 comprises a bus 1001, a processor 1002, a communication interface 1003, and a memory 1004. The processor 1002, the memory 1004, and the communication interface 1003 communicate with each other via the bus 1001. The at least one computing device 1000 in the computing device system communicates with each other via a communication path.
[0170] The processor 1002 may be a CPU or other processor. The memory 1004 may include a volatile memory, such as a random access memory. The memory 1004 may also include a non-volatile memory, such as a read-only memory, a flash memory, an HDD or an SSD. The memory 1004 stores executable code, and the processor 1002 executes the executable code to execute any part or all of the methods described in Figures 3 or 5 above. The memory may also include software modules required for other running processes, such as an operating system. The operating system may be LINUX. TM ,UNIXTM ,WINDOWS TM wait.
[0171] At least one computing device 1000 in the computing device system establishes communication with each other via a communication network, and each computing device 1000 can run any one or multiple modules in the neural network device 800.
[0172] The descriptions of the processes corresponding to the above figures have different focuses. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.
[0173] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes computer program instructions that, when loaded and executed on a computer, fully or partially generate the process or functions described in FIG. 3 of the embodiment of the present invention.
[0174] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line, or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD).
[0175] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A neural network device, characterized in that: The neural network device includes a fluid prediction model, and the fluid prediction model includes: a first space mapping operator, configured to receive measurement data corresponding to a first time input into the fluid prediction model, and map the measurement data corresponding to the first time from a first data space to a second data space, The time prediction operator provides an interface for configuring the time resolution of the fluid prediction model, and is used to iteratively process the measured data corresponding to the first time after mapping according to the parameters received from the interface to obtain the prediction data corresponding to the second time; The second space mapping operator is used to map the predicted data corresponding to the second time from the second data space to the first data space, and then output the predicted data corresponding to the second time.
2. The device according to claim 1, characterized in that The fluid prediction model is trained in the following manner: The fluid prediction model is trained using a gradient descent algorithm for optimization, wherein the loss function calculated in the optimization using the gradient descent algorithm indicates part or all of the following: The difference between the sample data and the output data of the second spatial mapping operator after the sample data is processed by the first spatial mapping operator and the second spatial mapping operator in sequence; The difference between the data output by the second spatial mapping operator and the real data after the sample data is processed by the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator.
3. The device according to claim 1 or 2, characterized in that The parameter received from the interface is a time resolution parameter, which is linearly related to the time resolution of the fluid prediction model.
4. The device according to claim 3, characterized in that The product of the time resolution parameter and the basic time resolution of the fluid prediction model is equal to the time resolution of the fluid prediction model, and the basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
5. The device according to claim 4, characterized in that The time prediction operator iteratively processes the measured data corresponding to the mapped first time according to the parameters received from the interface, and is used to: The mapped measurement data corresponding to the first time is iterated r times, where r is equal to the time resolution parameter.
6. The device according to claim 1 or 2, characterized in that: The parameter received from the interface is the time resolution of the flow prediction model.
7. The device according to claim 6, characterized in that The time prediction operator iteratively processes the measured data corresponding to the mapped first time according to the parameters received from the interface, and is used to: The number of iterations r is determined according to the parameters received from the interface, and the measurement data corresponding to the first time after mapping is iterated r times, where r is equal to the ratio of the time resolution to the basic time resolution of the fluid prediction model, and the basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
8. The device according to claim 4 or 7, characterized in that The basic time resolution of the fluid prediction model is equal to the time resolution of the time prediction operator.
9. The device according to any one of claims 1 to 8, characterized in that: The second data space is a space that is linearly correlated with time.
10. The device according to any one of claims 1 to 9, characterized in that: The measurement data describes the meteorological conditions at the first time, and the forecast data describes the meteorological conditions at the second time.
11. The device according to any one of claims 1 to 10, characterized in that: The neural network device also includes a transmission module; The transmission module is used to obtain the measurement data and predicted time span corresponding to the first time provided by the user; input parameters to the interface according to the predicted time span so that the time resolution of the fluid prediction model is configured to be equal to the predicted time span, and input the data corresponding to the first time into the fluid prediction model.
12. The device according to claim 11, characterized in that The transmission module is further used to: obtain the prediction data corresponding to the second time, and transmit the prediction data corresponding to the second time to the user.
13. A model training method, characterized in that: The method is used to train a fluid prediction model, wherein the fluid prediction model includes a first space mapping operator, a time prediction operator, and a second space mapping operator, wherein the first space mapping operator and the second space mapping operator are used to implement space mapping, and the time prediction operator is used to iteratively process input data to output prediction data, and the method includes: The fluid prediction model is trained using a gradient descent algorithm for optimization, wherein the loss function calculated in the optimization using the gradient descent algorithm indicates the following differences: The difference between the sample data and the output data of the second spatial mapping operator after the sample data is processed by the first spatial mapping operator and the second spatial mapping operator in sequence; The difference between the data output by the second spatial mapping operator and the real data after the sample data is processed by the first spatial mapping operator, the time prediction operator, and the second spatial mapping operator.
14. The method according to claim 13, characterized in that The step of optimizing the fluid prediction model by using a gradient descent algorithm includes: A gradient descent algorithm is called to calculate the gradient of the loss function, and the weights in the fluid prediction model are adjusted according to the gradient.
15. The method according to claim 13 or 14, characterized in that Before the time prediction operator uses the gradient descent algorithm to optimize the fluid prediction model during training, the time prediction operator also includes: The time resolution of the fluid prediction model is configured as a set value through the interface.
16. The method according to claim 15, characterized in that The configuring the time resolution of the fluid prediction model to a set value through the interface includes: A time resolution parameter is inputted from the interface, and the time resolution parameter is linearly related to the set value.
17. The method according to claim 16, characterized in that The product of the time resolution parameter and the basic time resolution of the fluid prediction model is equal to the set value, and the basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
18. The method according to claim 16, characterized in that The time resolution parameter is the number of iterations when the time prediction operator iteratively processes the input data.
19. A time-based prediction method, characterized in that: The method is applied to a neural network device, wherein the neural network device is deployed with a fluid prediction model, and the fluid prediction model provides an interface for configuring the time resolution of the fluid prediction model. The method includes: Obtain the measurement data corresponding to the first time and the predicted time span provided by the user; Configuring the time resolution of the fluid prediction model through the interface according to the prediction time span, and inputting the measurement data corresponding to the first time into the fluid prediction model, wherein the time resolution of the fluid prediction model is equal to the prediction time span; Obtain prediction data corresponding to a second time output by the fluid prediction model, and feed back the prediction data corresponding to the second time to the user, wherein the first time and the second time satisfy the prediction time span.
20. The method of claim 19, wherein: The fluid prediction model outputs prediction data corresponding to the second time, including: A first space mapping operator in the fluid prediction model maps the measurement data corresponding to the first time from a first data space to a second data space; The time prediction operator in the fluid prediction model provides an interface for configuring the time resolution of the fluid prediction model. The time prediction operator in the fluid prediction model iteratively processes the measured data corresponding to the mapped first time according to the parameters received from the interface to obtain the predicted data corresponding to the second time. The second space mapping operator in the fluid prediction model maps the prediction data corresponding to the second time from the second data space to the first data space, and outputs the prediction data corresponding to the second time.
21. The method according to claim 19 or 20, characterized in that The parameter received from the interface is a time resolution parameter, which is linearly related to the time resolution of the fluid prediction model.
22. The method according to claim 21, characterized in that The product of the time resolution parameter and the basic time resolution of the fluid prediction model is equal to the time resolution of the fluid prediction model, and the basic time resolution of the fluid prediction model is the minimum time span between the input data of the fluid prediction model and the output data of the fluid prediction model.
23. The method of claim 22, wherein: The time prediction operator iteratively processes the mapped data corresponding to the first time according to the parameters received from the interface, including: The time prediction operator iterates the mapped data corresponding to the first time r times, where r is equal to the time resolution parameter.
24. A computing device, characterized in that The computing device comprises a processor and a memory, wherein the processor is configured to call computer program instructions stored in the memory to execute the method according to any one of claims 13 to 23.
25. A computing device program product, characterized in that The computing device program product comprises computer instructions which, when executed by a computing device, cause the computing device to perform the method of any one of claims 13 to 23.
Citation Information
Patent Citations
Network traffic prediction model establishment method and device, electronic equipment and storage medium
CN113743594A
Time sequence prediction method and device, electronic equipment and medium
CN115423080A
Expressway traffic flow prediction method and electronic equipment
CN116128082A
Airfoil profile transonic buffeting flow field rapid prediction method based on deep neural network
CN116306206A
Spatial-temporal data prediction method, weather data prediction method and energy data prediction method
CN116451827A