Calculation method and device of embedded system, equipment and storage medium
By converting floating point numbers into fixed point numbers in an embedded system, and using the activation function results after processing by the upper computer, the problem of slow computing speed of LSTM network is solved, and the efficiency of time series prediction and natural language processing is improved.
Patent Information
- Application Number
- CN202411336238.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-02-11
AI Technical Summary
In embedded systems, the LSTM network calculation speed is slow, resulting in a decrease in prediction efficiency for temperature data, etc.
By converting the floating point number in the time series data into fixed-point numbers, and using the bias results processed by the upper computer and the activation function results in the comparison, the embedded system can directly calculate the time series prediction data to improve the calculation speed.
In furniture equipment with low computing power, the output result speed of the LSTM network is improved, and the prediction speed of time series prediction and natural language processing of home equipment is improved.
Smart Images

Figure CN119415062A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a computing method for an embedded system, a computing device for an embedded system, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Art
[0002] With the rapid development of artificial intelligence technology, deep learning has become an important tool for solving complex problems. In the field of deep learning, recurrent neural networks (RNNs) have excellent sequence processing capabilities. LSTM (Long Short-Term Memory, a special recurrent neural network structure, long short-term memory network) as a variant of RNN can learn long-term dependencies and is widely used in natural language processing, speech recognition, time series prediction and other fields.
[0003] For example, in the application scenario of air conditioning energy saving, LSTM can be used in embedded systems to predict temperature data, and some speech recognition algorithms embedded in the system will also be applied to LSTM networks. However, the embedded systems of some electrical appliances usually need to use local chips to calculate the results of LSTM networks, but due to the computing power limitations of local chips, the LSTM network calculation speed may be slow, affecting the data prediction efficiency of some electrical appliances. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a computing method for an embedded system, a computing device for an embedded system, a corresponding electronic device, and a corresponding computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0005] The embodiment of the present invention discloses a computing method of an embedded system, wherein the embedded system is used to be deployed in any household device, and the deployed embedded system receives computing data based on a recurrent neural network structure from a host computer, and the method includes:
[0006] Responding to time series prediction requirements through the embedded system, obtaining time series data of the home device;
[0007] If the time series data contains floating point numbers, convert the floating point numbers in the time series data into fixed point numbers to obtain the time series data to be processed;
[0008] Obtaining a bias result obtained by the host computer performing bias processing on the time series data to be processed;
[0009] The activation function result comparison relationship is obtained from the host computer, and the time series prediction data corresponding to the bias result is obtained based on the activation function result comparison relationship.
[0010] Optionally, the time series data of the household device includes current time series data and historical time series prediction data; and obtaining the time series data of the household device includes:
[0011] An input vector is generated based on the current time series data and the historical time series prediction data, and the input vector is used as the time series data of the home device.
[0012] Optionally, converting the floating point numbers in the time series data into fixed point numbers to obtain the time series data to be processed includes:
[0013] Normalizing the floating point numbers in the time series data;
[0014] Based on the normalization processing results and the preset conversion coefficient, the time series data to be processed is obtained.
[0015] Optionally, obtaining the time series data to be processed based on the normalization processing result and the preset conversion coefficient includes:
[0016] Multiplying the normalization result by a preset conversion coefficient to obtain a product;
[0017] The integer part of the product is retained to obtain the time series data to be processed.
[0018] Optionally, when the household appliance is an air-conditioning appliance, the current time series data is used to indicate the air-conditioning temperature at the current moment, and the historical time series prediction data is used to indicate the air-conditioning temperature at the previous moment.
[0019] The embodiment of the present invention further discloses a computing method of an embedded system, which is applied to a host computer, wherein the host computer has a recurrent neural network structure, and the method comprises:
[0020] Receiving the time series data to be processed input by the embedded system deployed in any home device; the time series data to be processed is obtained by the embedded system converting the floating point numbers in the current time series data into fixed point numbers, wherein the current time series data is obtained by the embedded system based on the time series prediction demand;
[0021] Performing bias processing on the time series data to be processed to obtain a bias result;
[0022] In response to the processing data download request of the embedded system, the bias result and the activation function result comparison relationship are transmitted to the embedded system so that the embedded system obtains the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0023] Optionally, performing bias processing on the time series data to be processed to obtain a bias result includes:
[0024] Get target weight data and bias items;
[0025] The weight data and the bias item are used to perform bias processing on the time series data to be processed to obtain a bias result.
[0026] Optionally, the obtaining target weight data includes:
[0027] Get initial weight data;
[0028] If the initial weight data contains floating point numbers, the floating point numbers in the initial weight data are converted into fixed point numbers to obtain target weight data.
[0029] Optionally, the method further includes:
[0030] Obtain an activation function for calculating any time series data of any home appliance; wherein any time series data has interval values;
[0031] Discretizing the interval values to obtain a discrete data interval; the discrete data interval includes a plurality of discrete points;
[0032] Substitute each discrete point into the activation function to obtain the initial time series prediction data composed of the calculation results based on the discrete points.
[0033] Optionally, the discretizing the interval values to obtain discrete data intervals includes:
[0034] Using a bias term to perform bias processing on the interval value;
[0035] Discretization processing is performed on the interval values after the bias processing to obtain the discrete data interval.
[0036] Optionally, the method further includes:
[0037] Converting the floating point numbers in the initial time series forecast data into fixed point numbers using a preset conversion coefficient to obtain target time series forecast data;
[0038] Based on the discrete data interval and the target time series prediction data, a comparison relationship of activation function results is established.
[0039] The embodiment of the present invention further discloses a computing device of an embedded system, wherein the embedded system is used to be deployed in any household device, and the deployed embedded system receives operation data of a host computer based on a recurrent neural network structure, and the device comprises:
[0040] A forecasting demand response module, used to forecast demand through the embedded system response time series and obtain time series data of the home appliance;
[0041] A data conversion module, used for converting the floating point numbers in the time series data into fixed point numbers when there are floating point numbers in the time series data, so as to obtain the time series data to be processed;
[0042] A bias result acquisition module, used for acquiring a bias result obtained by the host computer performing bias processing on the time series data to be processed;
[0043] The prediction data search module is used to obtain the activation function result comparison relationship from the host computer, and obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0044] Optionally, the time series data of the household equipment includes current time series data and historical time series forecast data; and the forecast demand response module includes:
[0045] The time series data acquisition submodule is used to generate an input vector based on the current time series data and the historical time series prediction data, and use the input vector as the time series data of the home appliance.
[0046] Optionally, the data conversion module includes:
[0047] The data conversion submodule is used to normalize the floating point numbers in the time series data; based on the normalization processing result and the preset conversion coefficient, the time series data to be processed is obtained.
[0048] Optionally, the data conversion submodule includes:
[0049] The data conversion unit is used to multiply the normalization processing result with a preset conversion coefficient to obtain a product; retain the integer part of the product to obtain the time series data to be processed.
[0050] Optionally, when the household appliance is an air-conditioning appliance, the current time series data is used to indicate the air-conditioning temperature at the current moment, and the historical time series prediction data is used to indicate the air-conditioning temperature at the previous moment.
[0051] The embodiment of the present invention further discloses a computing device of an embedded system, which is applied to a host computer, wherein the host computer has a recurrent neural network structure, and the device comprises:
[0052] An input data receiving module is used to receive the time series data to be processed input by the embedded system deployed in any home device; the time series data to be processed is obtained by the embedded system converting the floating point numbers in the current time series data into fixed point numbers, wherein the current time series data is obtained by the embedded system based on the time series prediction demand;
[0053] A bias processing module, used for performing bias processing on the time series data to be processed to obtain a bias result;
[0054] A processing data transmission module is used to respond to the processing data download request of the embedded system and transmit the bias result and activation function result comparison relationship to the embedded system so that the embedded system can obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0055] Optionally, the bias processing module includes:
[0056] The bias processing submodule is used to obtain target weight data and bias items; using the weight data and bias items, bias processing is performed on the time series data to be processed to obtain a bias result.
[0057] Optionally, the bias processing submodule includes:
[0058] The weight data processing unit is used to obtain initial weight data; if the initial weight data contains floating point numbers, the floating point numbers in the initial weight data are converted into fixed point numbers to obtain target weight data.
[0059] Optionally, the device further comprises:
[0060] A time series data prediction module is used to obtain an activation function for calculating any time series data of any household device; wherein any time series data has interval values; the interval values are discretized to obtain a discrete data interval; the discrete data interval contains multiple discrete points; each discrete point is substituted into the activation function to obtain initial time series prediction data composed of calculation results based on the discrete points.
[0061] Optionally, the time series data prediction module includes:
[0062] The discrete processing submodule is used to use a bias term to perform bias processing on the interval values; and to perform discretization processing on the interval values after the bias processing to obtain the discrete data interval.
[0063] Optionally, the device further comprises:
[0064] A control relationship establishment module is used to convert the floating-point numbers in the initial time series prediction data into fixed-point numbers using a preset conversion coefficient to obtain target time series prediction data; based on the discrete data interval and the target time series prediction data, an activation function result control relationship is established.
[0065] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements any one of the computing methods of the embedded system when executed by the processor.
[0066] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the computing methods of the embedded system is implemented.
[0067] The embodiments of the present invention include the following advantages:
[0068] In the embodiment of the present invention, the embedded system deployed in any home appliance can receive the operation data of the host computer based on the recurrent neural network structure. The embedded system can convert the floating point numbers in the time series data of the home appliance into fixed point data by responding to the time series prediction requirements to improve the calculation speed, and can directly obtain the bias result obtained by the host computer for bias processing of the time series data to be processed, and directly obtain the time series prediction data corresponding to the bias result based on the comparison relationship of the activation function result obtained by the host computer, and then accelerate the calculation speed of the activation function by looking up the table. By optimizing the calculation method of the LSTM network, it can effectively improve the speed of output results in furniture equipment with low computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 It is a schematic diagram of the structure of the LSTM provided by an embodiment of the present invention;
[0070] Figure 2 A flowchart of a computing method for an embedded system according to an embodiment of the present invention;
[0071] Figure 3 is a flowchart of steps of another embodiment of a computing method for an embedded system of the present invention;
[0072] Figure 4 It is a schematic diagram of the process of time series data processing provided by an embodiment of the present invention;
[0073] Figure 5 is a structural block diagram of an embodiment of a computing device of an embedded system of the present invention;
[0074] Figure 6 It is a structural block diagram of another embodiment of a computing device of an embedded system of the present invention. DETAILED DESCRIPTION
[0075] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0076] There is a need for accelerated calculation of LSTM networks in embedded systems. The embodiments of the present invention optimize the calculation method of LSTM networks to improve the calculation speed of LSTM networks in embedded systems, thereby improving the prediction speed of time series prediction, such as improving the prediction speed of temperature, current, voltage and other data; and improving the processing speed of natural language, such as speech recognition.
[0077] The embodiment of the present invention improves the calculation speed by converting the floating-point numbers of the calculation data into integer fixed-point numbers, and accelerates the calculation speed of the activation function by table lookup, so as to optimize the calculation method of the LSTM network, so that the speed of outputting results can be effectively improved in furniture equipment with lower computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0078] Specifically, the LSTM model is an improvement on the RNN model. Compared with RNN, LSTM has newly added input gates, output gates, and forget gates. LSTM can effectively process long-term dependencies in sequence data by introducing gating mechanisms and memory units. Compared with RNN, it can better capture long-distance information in the sequence, making the model perform better when processing long sequences and making the prediction of time series data more accurate.
[0079] Among them, the structure diagram of LSTM can be shown as Figure 1 As shown, the hidden state of LSTM at time t can be expressed as:
[0080] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0081] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0082]
[0083] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0084] h t =o t *tanh(C t )
[0085] In the above formula, σ can refer to the sigmoid activation function, and its mathematical formula can be Tanh can refer to the Tanh activation function, which can be calculated as x t It represents the input data at time t; h t It represents the output data at time t; h t-1 It represents the output data at time t-1; W f , W i , W C , W o represents the weight matrix; b f , b i , b C , b o represents the bias term, C t represents a memory cell. * represents vector multiplication.
[0086] In the above LSTM network calculation formula:
[0087] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0088] can be equivalent to:
[0089] f t =σ(W f h t-1 +W f x t +b f )
[0090] The same goes for other formulas.
[0091] In order to further optimize the calculation speed of the LSTM network, the embodiment of the present invention can use fixed-point operations instead of floating-point operations, and the activation function table lookup optimization can speed up the calculation speed.
[0092] The specific optimization scheme for the calculation speed of the LSTM network is explained below with reference to the accompanying drawings.
[0093] Reference Figure 2 , shows a flowchart of a computing method embodiment of an embedded system of the present invention, focusing on the processing process of the embedded system on time series data, which may specifically include the following steps:
[0094] Step 201, obtaining time series data of home appliances by responding to time series prediction requirements through an embedded system;
[0095] The embedded system can be deployed in any home device to realize the prediction of time series data, such as temperature, current, voltage and other data; as well as the processing of natural language, such as speech recognition.
[0096] Specifically, the prediction of time series data and the processing of natural language can be realized by calculation through the LSTM network in the embedded system, and the data prediction results and speech recognition results can be expressed as the calculation results of the LSTM network.
[0097] In an embodiment of the present invention, an embedded system deployed in any home appliance can receive operation data of a host computer based on a recurrent neural network structure, so that some complex operations do not occupy the computing power of the embedded system. The embedded system simply stores the operation data of the host computer and directly uses it, thereby enabling it to effectively improve the speed of output results in furniture equipment with lower computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0098] It should be noted that after the deployment of the embedded system, it is not necessary to use the assistance of the host computer, unless the model needs to be upgraded and the host computer needs to be trained and deployed again, which is not limited by the embodiments of the present invention.
[0099] Among them, the host computer can refer to a personal computer or server for training the model. These host computers can have the functions of training models and deploying models. More complex operations can be processed in the host computer, and the processed data can be transmitted to the embedded system, so that some complex operations do not occupy the computing power of the embedded system.
[0100] In practical applications, the demand for time series prediction may refer to the demand for prediction of home data with time series characteristics such as temperature, current, and voltage. At this time, the time series data of home appliances may be obtained so as to obtain time series prediction data based on the time series data of home appliances. The time series prediction data may refer to the time series data at the next moment.
[0101] In one embodiment of the present invention, the acquired time series data of the home appliance may include current time series data and historical time series prediction data. Specifically, an input vector may be generated based on the current time series data and the historical time series prediction data, and the input vector may be used as the time series data of the home appliance.
[0102] For example, when the household appliance is an air-conditioning appliance, the current time series data can be used to indicate the air-conditioning temperature at the current moment, the historical time series prediction data can be used to indicate the air-conditioning temperature at the previous moment, and the time series prediction data calculated subsequently can be used to indicate the air-conditioning temperature at the next moment.
[0103] For example, you can collect data such as the indoor air-conditioning temperature, outdoor air-conditioning temperature, and air-conditioning power of an air-conditioning device at the time of use in a day, use the indoor air-conditioning temperature, outdoor air-conditioning temperature, and air-conditioning power at time t-1 as historical time series prediction data, and use the indoor air-conditioning temperature, outdoor air-conditioning temperature, and air-conditioning power at time t as current time series data, so as to obtain the indoor air-conditioning temperature at time t+1 when input into the model for training.
[0104] In the above example, assuming x t It represents the input data at time t, that is, the current time series data; h t-1 It represents the output data at time t-1, that is, the historical time series forecast data. At this time, the input vector x t and the output vector h at the previous moment t-1 Generate the input vector [h t-1 ,x t ].
[0105] Step 202: if there are floating point numbers in the time series data, convert the floating point numbers in the time series data into fixed point numbers to obtain the time series data to be processed;
[0106] There are a large number of floating-point operations in the original LSTM, such as floating-point matrix multiplication and floating-point activation functions, but they are inefficient in embedded systems with limited hardware resources, and the embedded system's calculation speed for integer data is much faster than that for floating-point numbers. Based on the strategy of replacing floating-point operations with fixed-point operations, the floating-point numbers of the calculation data can be converted into integer fixed-point numbers to improve the calculation speed of the embedded system.
[0107] In one embodiment of the present invention, floating point numbers in time series data may be converted into fixed point numbers.
[0108] Specifically, the floating-point numbers in the time series data can be normalized, and based on the normalization result and the preset conversion coefficient, the floating-point numbers can be converted into fixed-point numbers to obtain the time series data to be processed. The fixed-point number conversion method can be specifically expressed as multiplying the normalization result with the preset conversion coefficient to obtain the product, and retaining the integer part of the product.
[0109] A floating point number needs to be multiplied by a coefficient to get an integer, which is equivalent to proportionally expanding it by a coefficient K. The specific value of this K can usually be adjusted and determined when using the deployment model.
[0110] Optionally, the preset conversion coefficient K can be 2 Q K = 2 Q , involving computer principles. Direct multiplication / division processing in the computer takes a lot of time, while the computer is relatively simple and fast when performing shift operations. When K=Q, it is equivalent to shifting the floating point number to the left by Q bits, and dividing by K=2 Q This is equivalent to shifting the floating point number right by Q bits.
[0111] For example, assume that the input data is x i , we can use x i The process of converting floating-point numbers to fixed-point numbers can be expressed as normalizing the input data and then multiplying the normalized result by a 2. Q The coefficient of is realized by taking the integer part, and the calculation formula can be shown as follows:
[0112] x norm =round(norma(x i )×2 Q )
[0113] Among them, x norm It can refer to the time series data to be processed; norma(x i ) may refer to a normalization function, which may be specifically determined according to the normalization function used in training; round means taking an integer.
[0114] In the embodiment of the present invention, the output data h at time t-1 can also be processed by referring to the above method. t-1 Convert floating point numbers in to fixed point numbers.
[0115] Step 203, obtaining a bias result obtained by the host computer performing bias processing on the time series data to be processed;
[0116] The obtained time series data to be processed can be subjected to bias processing, and the bias processing is specifically manifested as matrix multiplication and bias addition operations to adjust the form of the time series data to be processed so that the bias result obtained after the bias processing can better reflect the characteristics of the data or facilitate subsequent analysis and processing.
[0117] Among them, matrix multiplication usually refers to multiplying the input data (time series data) by a weight matrix. The weight matrix is mainly the parameters learned during the model training process. The aforementioned weight matrix can be used to capture patterns and relationships in the input data; bias addition means that after matrix multiplication, a bias vector is usually added. The bias vector is also one of the model parameters. Its main function is to adjust the activation threshold of each neuron so that the model can better fit the data.
[0118] The bias result can indicate the time series data after the above processing. The result can be regarded as a transformation of the original data, including the model's understanding and prediction of the data. In practical applications, the bias result may be used for further analysis, such as feature extraction, pattern recognition, or directly used for the model's prediction output.
[0119] It can be understood that the bias result is the time series data processed by specific mathematical operations (matrix multiplication and bias addition), which can reflect the model's understanding and adjustment of the original data, and help improve the model's performance and prediction accuracy.
[0120] In order to avoid complex calculations occupying the computing power of the embedded system, bias processing is performed on the host computer.
[0121] In one embodiment of the present invention, the embedded system can directly obtain the bias result obtained by the host computer performing bias processing on the time series data to be processed, so as to directly use the bias result to obtain the prediction result.
[0122] Step 204, obtaining the activation function result comparison relationship from the host computer, and obtaining the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0123] In deep learning and neural networks, activation functions determine the output of a neuron.
[0124] The result comparison relationship of the activation function usually refers to the output value of the activation function under different input values. This comparison relationship can be used to indicate the behavior of the model under different inputs and can be used to explain the prediction results of the model.
[0125] In order to avoid complex calculations occupying the computing power of the embedded system, the output values of the activation function under different input values are processed on the host computer; the result comparison relationship of the activation function can be pre-constructed by the host computer based on the output values under different input values, and transmitted to the embedded system for storage.
[0126] In one embodiment of the present invention, the embedded system can directly obtain the time series prediction data corresponding to the bias result by looking up the table based on the activation function result comparison relationship, thereby accelerating the calculation speed of the activation function and improving the prediction speed of the home appliance for time series prediction and the processing speed of natural language.
[0127] In the embodiment of the present invention, the embedded system deployed in any home appliance can receive the operation data of the host computer based on the recurrent neural network structure. The embedded system can convert the floating point numbers in the time series data of the home appliance into fixed point data by responding to the time series prediction requirements to improve the calculation speed, and can directly obtain the bias result obtained by the host computer for bias processing of the time series data to be processed, and directly obtain the time series prediction data corresponding to the bias result based on the comparison relationship of the activation function result obtained by the host computer, and then accelerate the calculation speed of the activation function by looking up the table. By optimizing the calculation method of the LSTM network, it can effectively improve the speed of output results in furniture equipment with low computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0128] Reference Figure 3 , shows a flowchart of another embodiment of a computing method for an embedded system of the present invention, focusing on the processing of time series data by the host computer, which may specifically include the following steps:
[0129] Step 301, receiving time series data to be processed inputted by an embedded system deployed in any home device;
[0130] The embedded system can be deployed in any home device to realize the prediction of time series data, such as temperature, current, voltage and other data; as well as the processing of natural language, such as speech recognition.
[0131] Specifically, the prediction of time series data and the processing of natural language can be realized by calculation through the LSTM network in the embedded system, and the data prediction results and speech recognition results can be expressed as the calculation results of the LSTM network.
[0132] In an embodiment of the present invention, an embedded system deployed in any home appliance can receive operation data of a host computer based on a recurrent neural network structure, so that some complex operations do not occupy the computing power of the embedded system. The embedded system simply stores the operation data of the host computer and directly uses it, thereby enabling it to effectively improve the speed of output results in furniture equipment with lower computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0133] Among them, the host computer can refer to a personal computer or server for training the model. These host computers can have the functions of training models and deploying models. More complex operations can be processed in the host computer, and the processed data can be transmitted to the embedded system, so that some complex operations do not occupy the computing power of the embedded system.
[0134] Specifically, the host computer can receive the time series data to be processed input by the embedded system deployed in any home appliance, so that the host computer can perform bias processing on the time series data to be processed.
[0135] The time series data to be processed input by the embedded system can be obtained by converting floating point numbers in the current time series data into fixed point numbers based on the embedded system, and the current time series data can be obtained by the embedded system based on the time series prediction requirements. The specific process can refer to step 202, and the embodiment of the present invention is not limited here.
[0136] Step 302, performing bias processing on the time series data to be processed to obtain a bias result;
[0137] The bias processing is specifically manifested as matrix multiplication and bias addition operations to adjust the form of the time series data to be processed so that the bias result obtained after the bias processing can better reflect the characteristics of the data or facilitate subsequent analysis and processing.
[0138] In order to avoid complex calculations occupying the computing power of the embedded system, bias processing is performed on the host computer.
[0139] Specifically, the bias result can be obtained by obtaining the target weight data and bias item, using the weight data and bias item, and performing bias processing on the time series data to be processed. Among them, the weight data also needs to convert its floating point number into a fixed point number, which is specifically performed by obtaining the initial weight data. If the initial weight data contains floating point numbers, the floating point numbers in the initial weight data can be converted into fixed point numbers to obtain the target weight data.
[0140] Reference Figure 4 , shows a schematic diagram of the process of time series data processing provided by an embodiment of the present invention.
[0141] Optionally, in order to achieve full integer calculation, first, the floating point number of the trained weight data W can be converted to an integer fixed point number. This step is completed on the host computer of the training model and does not occupy the computing power of the embedded system. The target weight data after conversion can be transmitted to the embedded system, and the embedded system can store the target weight data for direct access during calculation.
[0142] The floating point numbers are uniformly converted to fixed point numbers. Specifically, the weight data W containing floating point numbers is multiplied by a preset conversion coefficient, such as 2 Q , and then take the integer part of the product to achieve, the calculation formula can be specifically shown as follows:
[0143] W q =round(W×2 Q )
[0144] In the above formula, W q Refers to the target weight data; round means taking an integer. It should be noted that if the Q15 format is used, Q=15.
[0145] For example, after collecting data such as the indoor air-conditioning temperature, outdoor air-conditioning temperature, and air-conditioning power of a certain air-conditioning device at the time of use in a day, these data can be used for training to obtain multiple weight data through back propagation, such as W f , W i , W C , W o The value of the weight matrix is equal to the value of the weight matrix. After the training is completed, the value of the weight matrix is a floating point number. After the training is completed, the floating point number can be multiplied by 2 Q , then remove the decimal places to obtain the integer target weight data, and deploy the integer target weight data into the embedded system, such as downloading it into the embedded system, so that the embedded system can directly use it later.
[0146] In an embodiment of the present invention, there are a large number of floating-point operations in the original LSTM, such as matrix multiplication of floating-point numbers, activation functions of floating-point numbers, etc., but the efficiency is low on embedded systems with limited hardware resources, and the embedded system's calculation speed for integer data is much faster than the calculation speed of floating-point numbers. Based on the strategy of replacing floating-point operations with fixed-point operations, the floating-point numbers of the calculation data can be converted into integer fixed-point numbers to improve the calculation speed of the embedded system.
[0147] Optionally, the input data x at time t can also be t , and the output data h at time t-1 t-1 Perform floating point conversion. It should be noted that x t ×2 Q and h t-1×2 Q The processing is processed in real time in the embedded system. The specific process can refer to step 202, and the embodiment of the present invention is not limited here.
[0148] like Figure 4 As shown, the bias processing is specifically performed as matrix multiplication and bias addition operations, that is, (W·[h t-1 ,x t ]+b), due to the weight data W in the matrix multiplication, and the input vector [h t-1 ,x t ] t-1 and x t Multiply by 2 Q The coefficient of , at this time, the bias term can be obtained.
[0149] Exemplarily, the specific transformation formula of the bias processing can be as follows:
[0150] (W×2 Q )·[(h t-1 ×2 Q ),(x t ×2 Q )]+b×2 2Q =(W·[h t-1 ,x t ]+b)×2 2Q
[0151] The above formula represents the relationship between the weight W and the input vector x in the LSTM network. t and the output vector h at the previous moment t-1 The concatenated point product operation is then added with the conversion method of bias b.
[0152] Optionally, the above formula can be used to deduce that the bias term b can be 2 2Q , that is, b = 2 2Q .
[0153] According to the formula f t =σ(W f ·[h t-1 ,x t ]+b f ) as an example, in this formula,
[0154] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0155] can be equivalent to:
[0156] f t =σ(Wf h t-1 +W f x t +b f )
[0157] To convert a floating point number to an integer, W f and h t-1 , and W f and x t is multiplied by 2 Q , that is, W f ×2 Q 、h t-1 ×2 Q 、x t ×2 Q The addition term is equivalent to 2 2 Q Multiply, which is 2 2Q , in order to add the term (W f h t-1 +W f x t +b f ) matches the common expansion factor, b f Need to multiply by 2 2Q , which can be understood as 2 2Q (W f h t-1 +W f x t +b f )=((W f 2 Q )·(h t- 12 Q )+(W f 2 Q )·(x t· 2 Q )+b f· 2 Q 2 Q ), so the bias term b can be 2 2Q .
[0158] For example, after collecting data such as the indoor air-conditioning temperature, outdoor air-conditioning temperature, and air-conditioning power of a certain air-conditioning device at the time of use in a day, these data can be used for training to obtain multiple bias terms through back propagation, such as b f 、b i 、b C 、b o The value of the bias matrix is equal to the value of the bias matrix. The value of the bias matrix obtained after training is a floating point number. After training is completed, the floating point number can be multiplied by 2 Q, then remove the decimal places to obtain the integer bias item, and deploy the integer bias item to the embedded system, such as downloading it to the embedded system, so that the embedded system can directly use it later.
[0159] Step 303, responding to the processing data download request of the embedded system, transmitting the comparison relationship between the bias result and the activation function result to the embedded system.
[0160] In deep learning and neural networks, activation functions determine the output of a neuron.
[0161] The result comparison relationship of the activation function usually refers to the output value of the activation function under different input values. This comparison relationship can be used to indicate the behavior of the model under different inputs and can be used to explain the prediction results of the model.
[0162] In one embodiment of the present invention, the host computer can respond to the processing data download request of the embedded system and transmit the above-mentioned bias result and activation function result comparison relationship to the embedded system, so that the embedded system can obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0163] The bias result may be obtained by real-time processing of the time series data to be processed input by the host computer from the embedded system; and the activation function result comparison relationship may be established in advance by the host computer.
[0164] In one embodiment of the present invention, the host computer can obtain the activation function for calculating any time series data of any home appliance, wherein any time series data may have interval values. In this case, the interval values can be discretized to obtain discrete data intervals. For multiple discrete points contained in the discrete data interval, each discrete point can be substituted into the activation function respectively to obtain initial time series prediction data composed of calculation results based on the discrete points, so as to obtain the output value of the activation function under different input values.
[0165] Since the host computer model is calculating W·[h t-1 ,x t ]+b, and then input the bias result into the activation function formula to calculate the activation function result. The above bias result is biased in the embedded system with b=2 2Q In order to ensure that the results of each discrete point are calculated when it is substituted into the activation function, the bias term b = 2 is also used. 2Q The bias processing can be performed by using a bias term to bias the interval values, and then discretizing the biased interval values to obtain discrete data intervals.
[0166] In an optional embodiment of the present invention, in order to ensure that the established activation function result comparison relationship has an accurate correspondence relationship, so that the bias result can be directly obtained to be the same as the result originally calculated on the embedded system, a preset conversion coefficient can also be used, for example, 2 Q The floating-point numbers in the initial time series prediction data are converted into fixed-point numbers to obtain the target time series prediction data, and then based on the discrete data interval and the target time series prediction data, a comparison relationship between the activation function results is established.
[0167] Optionally, the activation function calculation formula of the LSTM network is relatively complex. If it is directly calculated in an embedded system, it will take a lot of time. The embodiment of the present invention can pre-calculate and store the calculation results of the activation function, and use a table lookup method instead of real-time calculation of the activation function, thereby reducing the calculation complexity to O(1).
[0168] For example, after floating point to fixed point conversion, matrix multiplication and data processing with the addition of a bias vector, the output data range is [A max ×2 2Q ,A min ×2 2Q ], the method for determining the output data range can be shown as follows:
[0169] A max =max(W·[h t-1 ,x t ]+b)
[0170] A min =min(W·[h t-1 ,x t ]+b)
[0171] Among them, A max Refers to the maximum value of the interval, which can be determined by the maximum data obtained by inputting the bias result after matrix multiplication and adding the bias into the activation function; A min Refers to the minimum value of the interval, which can be determined by the minimum data obtained by inputting the bias result after matrix multiplication and adding the bias into the activation function.
[0172] The above output data refers to the calculation result after the activation function, which can be specifically referred to as (W f ·[h t-1 ,x t ]+b f )、(W i ·[h t-1 ,x t ]+b i )、(W C ·[h t-1 ,xt ]+b C ) and (W o ·[h t-1 ,x t ]+b o ).
[0173] Optional, W·[h t-1 ,x t ]+b may exist in the data range for calculation. In the embodiment of the present invention, this range may be segmented. Assuming that the data range is [A, B] and is segmented into many points, each discrete point obtained by the segmentation may be substituted into the activation function, for example , and then a table with a corresponding relationship is designed, for example, stored in an embedded system, so as to obtain a bias result based on the embedded system. For example, after X, there is no need to actually calculate σ(x), but the final time series prediction data can be directly obtained by looking up the table, thereby speeding up the calculation speed.
[0174] Specifically, the activation function can be input into the interval [A max ×2 2Q ,A min ×2 2Q ] for discrete processing, the discrete processing formula can be shown as follows:
[0175]
[0176] In the above formula, n represents the number of discrete points.
[0177] By transforming the discrete function converted into a fixed point, we can get the following formula:
[0178]
[0179] to A[i]=a[i]×2 2Q .
[0180] From the above, we can see that after Figure 4 The floating point calculation is converted to fixed point calculation, and the value after matrix multiplication and data processing with the bias vector is equivalent to the value directly multiplied by 2 after matrix multiplication and bias addition. 2Q In the embodiment of the present invention, for the host computer of model training, there is no need to change the training model, and only the maximum value A after matrix multiplication and bias addition operation needs to be found. max and minimum value A min , and then discretize it using the following formula:
[0181]
[0182] The definition of a[i] is mainly to convert (W·[h t-1 ,x t ]+b)(without multiplication by 2 2Q , that is, not converted to integer) calculation range [A max ,A min ] is divided into i points for discretization, and the discrete points can be A[1], A[2].....A[i].
[0183] In a feasible embodiment, a[i] can be calculated by passing the activation function to obtain b[i], and then multiplied by 2 Q , we can get the value after the floating point calculation is converted to fixed point calculation, as well as the value after matrix multiplication and bias addition operation. Then we can store these corresponding values in the table of the embedded system, so as to facilitate the correspondence between A[i] and B[i], and convert their calculation relationship into a table lookup relationship to improve the calculation speed.
[0184] Optionally, assume that W, h t-1 、x t When both b and b are floating point numbers, for the host computer, the calculation of W·[h t-1 ,x t ]+b This formula is simple, but it is directly applicable to the embedded system to calculate W·[h t-1 ,x t ]+b is slower, the embodiment of the present invention uses W, h t-1 、x t Multiply by 2 Q , and b is multiplied by 2 2Q , in order to convert it into integer calculation to speed up the calculation speed; but the host computer model is in the calculation of W·[h t-1 ,x t ] + b, and then substitute the result into the activation function formula to calculate the activation function result. This calculation is multiplied by 2 in the embedded system. 2Q At this time, we need to find W·[h t-1 ,x t ]+b The calculation result is converted into an integer by the embedded system, that is, multiplied by 2 2Q The corresponding relationship of the calculation results after .
[0185] The above correspondence can be expressed as the host computer calculating W·[h t-1 ,x t ]+b times 2 2Q The same result as the embedded system can be obtained. The host computer calculates W·[h t-1 ,x t ]+b is [A max ,A min ], the embedded system is (W·[ht-1 ,x t ]+b)2 2Q (The calculation has been multiplied by 2 Q , that is, it has been converted to integer), for the host computer, the calculated value range can be [A max ×2 2Q ,A min ×2 2Q ], so that the discrete value range [A max ,A min ], such as a[1], a[2], ... a[i], substitute the activation function σ(a[i]) or tan(a[i]) to obtain the value, and store these values as a table to achieve the same as multiplying by 2 in the embedded system. 2Q The calculation results form a corresponding relationship.
[0186] In the specific implementation, it is assumed that the discrete value range interval [A max ,A min ] are each discrete value a[1], a[2], ... a[i]. First, the host computer can calculate W·[h t-1 ,x t ]+b, multiply the result by 2 2Q as the index of the table; secondly, the host computer can calculate W·[h t-1 ,x t ] + b, substitute the result into the activation function and multiply by 2 Q (To convert to an integer in advance) Get the value used to build the table.
[0187] When the embedded system calculates (W·[h t-1 ,x t ]+b)2 2Q When the value of max ×2 2Q ,A min ×2 2Q ], at this time, we can use the calculated value as the index to look up the table and directly obtain the value that passes the activation function. In this process, the complex calculation process of the activation function can be replaced by a table lookup to speed up the calculation.
[0188] When mapping A[i] to B[i], b[i] can be defined as a discrete value range interval [A max ,A min], which is specifically expressed as the value of the discrete values of discrete points such as a[1], a[2]...a[i] after being substituted into the activation function, that is, b[i] = σ(a[i]) or b[i] = tan(a[i]); and the definition of B[i] can be B[i] = b[i]*2 Q .
[0189] Where A[i] is (W·[h t-1 ,x t ]+b)2 2Q , its calculation range [A max ×2 2Q ,A min ×2 2Q ] is evenly divided into i points for discretization. The discrete points are A[0], A[1], ... A[i]. These discrete points A[i] can be used as the index of the table B[i], which is tan(a[i])*2 Q The purpose of the table constructed above is mainly to find the result B[i]=tan(a[i])*2 through A[i] Q ;or B[i]=σ(a[i])*2 Q (Avoid directly calculating tan(a[i])*2 Q or σ(a[i])*2 Q ), and the calculation result is given to the next gate for use. The embodiment of the present invention does not impose any limitation on this.
[0190] In an embodiment of the present invention, the calculation speed is improved by converting the floating-point numbers of the calculation data into integer fixed-point numbers, and the calculation speed of the activation function is accelerated by table lookup, so as to optimize the calculation method of the LSTM network so that the speed of outputting results can be effectively improved in furniture equipment with lower computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0191] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0192] Reference Figure 5 , shows a structural block diagram of a computing device embodiment of an embedded system of the present invention, the embedded system is used to be deployed in any household device, the deployed embedded system can receive operation data based on the recurrent neural network structure of the host computer, and specifically may include the following modules:
[0193] The prediction demand response module 501 is used to predict demand through the embedded system response time series and obtain the time series data of the home equipment;
[0194] A data conversion module 502 is used to convert the floating point numbers in the time series data into fixed point numbers when there are floating point numbers in the time series data, so as to obtain the time series data to be processed;
[0195] The bias result acquisition module 503 is used to obtain the bias result obtained by the host computer performing bias processing on the time series data to be processed;
[0196] The prediction data search module 504 is used to obtain the activation function result comparison relationship from the host computer, and obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0197] In one embodiment of the present invention, the time series data of the household equipment includes current time series data and historical time series prediction data; the prediction demand response module 501 may include the following submodules:
[0198] The time series data acquisition submodule is used to generate an input vector based on the current time series data and the historical time series prediction data, and use the input vector as the time series data of the home appliance.
[0199] In one embodiment of the present invention, the data conversion module 502 may include the following submodules:
[0200] The data conversion submodule is used to normalize the floating point numbers in the time series data; based on the normalization processing result and the preset conversion coefficient, the time series data to be processed is obtained.
[0201] In one embodiment of the present invention, the data conversion submodule may include the following units:
[0202] The data conversion unit is used to multiply the normalization processing result with a preset conversion coefficient to obtain a product; retain the integer part of the product to obtain the time series data to be processed.
[0203] In one embodiment of the present invention, when the household appliance is an air-conditioning appliance, the current time series data is used to indicate the air-conditioning temperature at the current moment, and the historical time series prediction data is used to indicate the air-conditioning temperature at the previous moment.
[0204] In the embodiment of the present invention, the embedded system deployed in any home appliance can receive the operation data of the host computer based on the recurrent neural network structure. The embedded system can convert the floating point numbers in the time series data of the home appliance into fixed point data by responding to the time series prediction requirements to improve the calculation speed, and can directly obtain the bias result obtained by the host computer for bias processing of the time series data to be processed, and directly obtain the time series prediction data corresponding to the bias result based on the comparison relationship of the activation function result obtained by the host computer, and then accelerate the calculation speed of the activation function by looking up the table. By optimizing the calculation method of the LSTM network, it can effectively improve the speed of output results in furniture equipment with low computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0205] Reference Figure 6 , shows a structural block diagram of another embodiment of a computing device of an embedded system of the present invention, which is applied to a host computer, and the host computer has a recurrent neural network structure, and specifically may include the following modules:
[0206] The input data receiving module 601 is used to receive the time series data to be processed input by the embedded system deployed in any home device; the time series data to be processed is obtained by the embedded system converting the floating point numbers in the current time series data into fixed point numbers, wherein the current time series data is obtained by the embedded system based on the time series prediction demand;
[0207] The bias processing module 602 is used to perform bias processing on the time series data to be processed to obtain a bias result;
[0208] The processing data transmission module 603 is used to respond to the processing data download request of the embedded system and transmit the bias result and activation function result comparison relationship to the embedded system so that the embedded system can obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
[0209] In one embodiment of the present invention, the bias processing module 602 may include the following submodules:
[0210] The bias processing submodule is used to obtain target weight data and bias items; using the weight data and bias items, bias processing is performed on the time series data to be processed to obtain a bias result.
[0211] In one embodiment of the present invention, the bias processing submodule may include the following units:
[0212] The weight data processing unit is used to obtain initial weight data; if the initial weight data contains floating point numbers, the floating point numbers in the initial weight data are converted into fixed point numbers to obtain target weight data.
[0213] In an embodiment of the present invention, the device provided by the embodiment of the present invention may further include the following modules:
[0214] A time series data prediction module is used to obtain an activation function for calculating any time series data of any household device; wherein any time series data has interval values; the interval values are discretized to obtain a discrete data interval; the discrete data interval contains multiple discrete points; each discrete point is substituted into the activation function to obtain initial time series prediction data composed of calculation results based on the discrete points.
[0215] In one embodiment of the present invention, the time series data prediction module may include the following submodules:
[0216] The discrete processing submodule is used to use a bias term to perform bias processing on the interval values; and to perform discretization processing on the interval values after the bias processing to obtain the discrete data interval.
[0217] In an embodiment of the present invention, the device provided by the embodiment of the present invention may further include the following modules:
[0218] A control relationship establishment module is used to convert the floating-point numbers in the initial time series prediction data into fixed-point numbers using a preset conversion coefficient to obtain target time series prediction data; based on the discrete data interval and the target time series prediction data, an activation function result control relationship is established.
[0219] In an embodiment of the present invention, the calculation speed is improved by converting the floating-point numbers of the calculation data into integer fixed-point numbers, and the calculation speed of the activation function is accelerated by table lookup, so as to optimize the calculation method of the LSTM network so that the speed of outputting results can be effectively improved in furniture equipment with lower computing power, thereby improving the prediction speed of home appliances for time series prediction and the processing speed of natural language.
[0220] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0221] An embodiment of the present invention further provides an electronic device, including:
[0222] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the computing method embodiment of the above-mentioned embedded system is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0223] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the computing method embodiment of the above-mentioned embedded system is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0224] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0225] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0226] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0227] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0228] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0229] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0230] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0231] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0232] The above describes in detail a computing method for an embedded system, a computing device for an embedded system, a corresponding electronic device, and a corresponding computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A computing method for an embedded system, characterized in that: The embedded system is used to be deployed in any household device, and the embedded system after deployment receives operation data based on a recurrent neural network structure from a host computer. The method includes: Responding to time series prediction requirements through the embedded system, obtaining time series data of the home device; If the time series data contains floating point numbers, convert the floating point numbers in the time series data into fixed point numbers to obtain the time series data to be processed; Obtaining a bias result obtained by the host computer performing bias processing on the time series data to be processed; The activation function result comparison relationship is obtained from the host computer, and the time series prediction data corresponding to the bias result is obtained based on the activation function result comparison relationship.
2. The method according to claim 1, characterized in that: The time series data of the household device includes current time series data and historical time series prediction data; the step of obtaining the time series data of the household device includes: An input vector is generated based on the current time series data and the historical time series prediction data, and the input vector is used as the time series data of the home device.
3. The method according to claim 1, characterized in that: The converting the floating point numbers in the time series data into fixed point numbers to obtain the time series data to be processed includes: Normalizing the floating point numbers in the time series data; Based on the normalization processing results and the preset conversion coefficient, the time series data to be processed is obtained.
4. The method according to claim 3, characterized in that: The step of obtaining the time series data to be processed based on the normalization processing result and the preset conversion coefficient includes: Multiplying the normalization result by a preset conversion coefficient to obtain a product; The integer part of the product is retained to obtain the time series data to be processed.
5. The method according to claim 2, characterized in that: When the household appliance is an air-conditioning appliance, the current time series data is used to indicate the air-conditioning temperature at the current moment, and the historical time series prediction data is used to indicate the air-conditioning temperature at the previous moment.
6. A computing method for an embedded system, characterized in that: Applied to a host computer, the host computer has a recurrent neural network structure, and the method includes: Receiving the time series data to be processed input by the embedded system deployed in any home device; the time series data to be processed is obtained by the embedded system converting the floating point numbers in the current time series data into fixed point numbers, wherein the current time series data is obtained by the embedded system based on the time series prediction demand; Performing bias processing on the time series data to be processed to obtain a bias result; In response to the processing data download request of the embedded system, the bias result and the activation function result comparison relationship are transmitted to the embedded system so that the embedded system obtains the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
7. The method according to claim 6, characterized in that The biasing process is performed on the time series data to be processed to obtain a bias result, comprising: Get target weight data and bias items; The weight data and the bias item are used to perform bias processing on the time series data to be processed to obtain a bias result.
8. The method according to claim 7, characterized in that The obtaining of target weight data comprises: Get initial weight data; If the initial weight data contains floating point numbers, the floating point numbers in the initial weight data are converted into fixed point numbers to obtain target weight data.
9. The method according to any one of claims 6 to 8, characterized in that: The method further comprises: Obtain an activation function for calculating any time series data of any home appliance; wherein any time series data has interval values; Discretizing the interval values to obtain a discrete data interval; the discrete data interval includes a plurality of discrete points; Substitute each discrete point into the activation function to obtain the initial time series prediction data composed of the calculation results based on the discrete points.
10. The method according to claim 9, characterized in that The discretization process of the interval values to obtain discrete data intervals includes: Using a bias term to perform bias processing on the interval value; Discretization processing is performed on the interval values after the bias processing to obtain the discrete data interval.
11. The method according to claim 9, characterized in that The method further comprises: The floating point numbers in the initial time series prediction data are converted into fixed point numbers using a preset conversion coefficient to obtain target time series prediction data; Based on the discrete data interval and the target time series prediction data, a comparison relationship of activation function results is established.
12. A computing device for an embedded system, characterized in that: The embedded system is used to be deployed in any household device. The deployed embedded system receives operation data based on a recurrent neural network structure from a host computer. The device includes: A forecasting demand response module, used to forecast demand through the embedded system response time series and obtain time series data of the home appliance; A data conversion module, used for converting the floating point numbers in the time series data into fixed point numbers when there are floating point numbers in the time series data, so as to obtain the time series data to be processed; A bias result acquisition module, used for acquiring a bias result obtained by the host computer performing bias processing on the time series data to be processed; The prediction data search module is used to obtain the activation function result comparison relationship from the host computer, and obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
13. A computing device for an embedded system, characterized in that: Applied to a host computer, the host computer has a recurrent neural network structure, and the device includes: An input data receiving module is used to receive the time series data to be processed input by the embedded system deployed in any home device; the time series data to be processed is obtained by the embedded system converting the floating point numbers in the current time series data into fixed point numbers, wherein the current time series data is obtained by the embedded system based on the time series prediction demand; A bias processing module, used for performing bias processing on the time series data to be processed to obtain a bias result; A processing data transmission module is used to respond to the processing data download request of the embedded system and transmit the bias result and activation function result comparison relationship to the embedded system so that the embedded system can obtain the time series prediction data corresponding to the bias result based on the activation function result comparison relationship.
14. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the computing method of the embedded system as claimed in any one of claims 1 to 5 or claims 6 to 11 is implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computing method of the embedded system according to any one of claims 1 to 5 or claims 6 to 11 is implemented.
Citation Information
Cited By
Long and short time memory network computing chip and method for MIMO time sequence signals
CN121072631A