System
The system addresses inefficiencies in logistics by automating data processing and incorporating real-time traffic data to enhance demand forecasting and route planning, thereby improving efficiency and reducing costs.
Patent Information
- Application Number
- JP2024138189
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2026-03-04
AI Technical Summary
The logistics industry faces inefficiencies due to reliance on manual data analysis for sales data and route planning, which is time-consuming and costly, and is further complicated by external factors like seasons and weather, leading to reduced efficiency and increased operational costs.
A system that collects and preprocesses sales and weather data, generates a demand forecasting model using LSTM networks, predicts future demand, and calculates optimal delivery routes based on real-time traffic information, integrating third-party data services for accuracy.
This system enables advanced demand forecasting and optimal route calculation, improving logistics efficiency and reducing operational costs by automating data processing and incorporating real-time traffic data.
Smart Images

Figure 2026035346000001_ABST
Abstract
Description
[Technical Field]
[0001] The technology of the present disclosure relates to a system. [Background technology]
[0002] Patent document 1 discloses a persona chatbot control method performed by at least one processor, the method including the steps of receiving a user utterance, adding the user utterance to a prompt including an instruction sentence related to a description of the chatbot character, encoding the prompt, and inputting the encoded prompt into a language model to generate a chatbot utterance in response to the user utterance. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Publication No. 2022-180282 Summary of the Invention [Problem to be solved by the invention]
[0004] The current logistics industry is often inefficient because it relies on human labor to analyze sales data and determine optimal delivery routes. Furthermore, manual data analysis and route planning is time-consuming and costly, making it difficult to quickly determine optimal routes. This becomes even more complicated when external factors such as seasons and weather must be considered as factors that affect demand. This current situation leads to reduced efficiency throughout the logistics process and increased operational costs. [Means for solving the problem]
[0005] This invention provides a system that includes means for collecting and preprocessing past sales data, means for generating a demand forecasting model based on the preprocessed sales data, means for predicting future demand using the generated demand forecasting model, and means for calculating an optimal delivery route based on the predicted demand data and real-time traffic information. This allows for advanced demand forecasting based on past sales data and external factors such as season and weather, and automatically determines an optimal delivery route based on the results and taking into account the latest traffic information. Furthermore, by adding means for updating the forecasting model using verification results and means for obtaining real-time traffic information from a third-party data provider, more accurate demand forecasting and optimal route calculation are possible, significantly improving the efficiency of the logistics process.
[0006] "Sales data" refers to data that includes numerical information and text information related to past sales, and includes items such as product name, quantity, price, sales date and time, and sales location.
[0007] "Preprocessing" refers to the process carried out to improve the quality of data prior to data analysis and model creation, and specifically includes tasks such as filling in missing values, correcting outliers, and normalizing data.
[0008] A "demand forecasting model" is a mathematical model constructed using machine learning algorithms to predict future demand based on past sales data, and also takes into account external factors such as season and weather to improve prediction accuracy.
[0009] "Real-time traffic information" refers to data showing current traffic conditions, including the latest information on traffic congestion, road congestion, accident information, and so on.
[0010] An "optimal delivery route" is the most efficient and cost-effective delivery route calculated based on predicted demand and real-time traffic information, minimizing factors such as time, distance, and transportation costs.
[0011] A "third-party data service" is a data service provided by an external data provider that is not directly managed by the logistics company, and obtains traffic information, weather information, etc. in real time through a specific API.
[0012] "Verification results" are the results of tests conducted to evaluate the performance and accuracy of a predictive model, and include numerical values and graphs showing the difference between actual sales data and predicted data. [Brief explanation of the drawings]
[0013] [Figure 1] 1 is a conceptual diagram showing an example of the configuration of a data processing system according to a first embodiment. [Figure 2] 1 is a conceptual diagram showing an example of main functions of a data processing device and a smart device according to a first embodiment. [Figure 3] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a second embodiment. [Figure 4] FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and smart glasses according to a second embodiment. [Figure 5] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a third embodiment. [Figure 6] FIG. 11 is a conceptual diagram showing an example of main functions of a data processing device and a headset-type terminal according to a third embodiment. [Figure 7] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a fourth embodiment. [Figure 8] FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and a robot according to a fourth embodiment. [Figure 9] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 10] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 11] FIG. 3 is a sequence diagram showing a processing flow of the data processing system according to the first embodiment. [Figure 12]FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 1. [Figure 13] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system according to the second embodiment when an emotion engine is combined. [Figure 14] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 2 when an emotion engine is combined. DETAILED DESCRIPTION OF THE INVENTION
[0014] An example of an embodiment of a system according to the technology of the present disclosure will be described below with reference to the accompanying drawings.
[0015] First, the terms used in the following description will be explained.
[0016] In the following embodiments, a coded processor (hereinafter simply referred to as a "processor") may be a single arithmetic device or a combination of multiple arithmetic devices. Furthermore, a processor may be a single type of arithmetic device or a combination of multiple types of arithmetic devices. Examples of arithmetic devices include a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a GPGPU (General-Purpose computing on Graphics Processing Units), and an APU (Accelerated Processing Unit).
[0017] In the following embodiments, a coded RAM (Random Access Memory) is a memory in which information is temporarily stored and is used as a working memory by a processor.
[0018] In the following embodiments, the coded storage is one or more non-volatile storage devices that store various programs, various parameters, etc. Examples of non-volatile storage devices include flash memory (SSD (Solid State Drive)), magnetic disks (e.g., hard disks), and magnetic tapes.
[0019] In the following embodiments, a communication I / F (Interface) with a symbol is an interface including a communication processor, an antenna, etc. The communication I / F controls communication between multiple computers. Examples of communication standards applied to the communication I / F include wireless communication standards including 5G (5th Generation Mobile Communication System), Wi-Fi (registered trademark), Bluetooth (registered trademark), etc.
[0020] In the following embodiments, "A and / or B" is synonymous with "at least one of A and B." In other words, "A and / or B" means that it may be only A, only B, or a combination of A and B. Furthermore, in this specification, the same concept as "A and / or B" is also applied when three or more things are expressed connected by "and / or."
[0021] [First embodiment]
[0022] FIG. 1 shows an example of the configuration of a data processing system 10 according to the first embodiment.
[0023] 1, a data processing system 10 includes a data processing device 12 and a smart device 14. An example of the data processing device 12 is a server.
[0024] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0025] The smart device 14 includes a computer 36, a reception device 38, an output device 40, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The reception device 38, the output device 40, and the camera 42 are also connected to the bus 52.
[0026] The reception device 38 includes a touch panel 38A, a microphone 38B, and the like, and receives user input. The touch panel 38A detects contact with an indicator (for example, a pen or a finger) to receive user input by the touch of the indicator. The microphone 38B detects the user's voice to receive user input by voice. The control unit 46A transmits data indicating the user input received by the touch panel 38A and the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the data indicating the user input.
[0027] The output device 40 includes a display 40A and a speaker 40B, and presents data to the user 20 by outputting the data in a form of expression that the user 20 can perceive (for example, audio and / or text). The display 40A displays visible information such as text and images in accordance with instructions from the processor 46. The speaker 40B outputs audio in accordance with instructions from the processor 46. The camera 42 is a compact digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor.
[0028] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54.
[0029] FIG. 2 shows an example of the main functions of the data processing device 12 and the smart device 14.
[0030] 2, in the data processing device 12, a specific process is performed by the processor 28. A specific processing program 56 is stored in the storage 32. The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific process is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0031] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0032] In the smart device 14, the processor 46 performs the reception output process. The storage 50 stores a reception output program 60. The reception output program 60 is used in conjunction with the specific processing program 56 by the data processing system 10. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0033] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0034] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and AI model, and the terminal and user function as interfaces with the system.
[0035] Sales data collection and preprocessing
[0036] 1. Data Collection
[0037] The server periodically collects historical sales and weather data from a database, including using SQL queries and API requests to retrieve data from databases and external data providers.
[0038] 2. Data Cleaning
[0039] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values using the median or mean, and corrects outliers using statistical methods.
[0040] 3. Data Combination and Normalization
[0041] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[0042] Generate a demand forecast model
[0043] 1. Preparing training data
[0044] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data.
[0045] 2. Training the model
[0046] The server splits the data into a training set and a test set and trains a demand forecasting model using a long short-term memory (LSTM) network. The model learns the relationship between features and a target variable to predict future demand.
[0047] Proposing optimal delivery routes based on prediction results
[0048] 1. Demand forecast
[0049] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[0050] 2. Obtaining real-time traffic information
[0051] The server obtains real-time traffic information from external services such as Google® Maps API, by collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[0052] 3. Calculating the optimal delivery route
[0053] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This determines the optimal route that minimizes delivery costs and time.
[0054] 4. Delivery route presentation
[0055] The server provides the calculated optimal delivery route to the user's terminal, allowing the user to create an actual delivery plan based on this.
[0056] Specific examples
[0057] Example 1: Collecting and Preprocessing Sales Data
[0058] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0059] Example 2: Training a demand forecasting model
[0060] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[0061] Example 3: Calculating the optimal delivery route
[0062] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0063] According to the above-described embodiment, the present invention can realize an efficient logistics process, reduce operational costs, and improve service quality.
[0064] The processing flow will be explained below.
[0065] Step 1:
[0066] The server collects historical sales and weather data from a database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[0067] Step 2:
[0068] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[0069] Step 3:
[0070] The server joins the sales data with the weather data. The join is performed using the date as the key. After joining, the data is normalized using a min-max scaler, converting all values to the range of 0 to 1. The normalized data obtained from this step is used for subsequent model training.
[0071] Step 4:
[0072] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[0073] Step 5:
[0074] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[0075] Step 6:
[0076] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[0077] Step 7:
[0078] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[0079] Step 8:
[0080] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[0081] Step 9:
[0082] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0083] Step 10:
[0084] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0085] Example 1
[0086] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0087] In the logistics industry, calculating efficient delivery routes and accurate demand forecasting are essential for reducing operational costs and improving service quality. However, conventional systems have problems such as manual data collection, inaccurate forecasting models, and a lack of integration of real-time traffic information, making it difficult to calculate optimal delivery routes. This has led to issues such as reduced delivery efficiency and increased costs.
[0088] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0089] In this invention, the server includes means for periodically collecting past sales data and weather data from a sales database and a weather database, means for cleaning the collected data and combining the data using a date key, means for normalizing the data to a range of 0 to 1, means for separating features and a target variable based on the preprocessed sales data and weather data, means for generating a demand forecasting model using an LSTM network, means for predicting future demand using the generated LSTM demand forecasting model, and means for acquiring traffic information based on the demand forecasting data and calculating an optimal delivery route using the A algorithm. This makes it possible to accurately collect and preprocess sales data and weather data, generate a highly accurate demand forecasting model, and calculate an optimal delivery route by integrating real-time traffic information.
[0090] "Sales Data" refers to information about sales of goods or services made within a specific period of time, and typically includes the sales quantity, sales price, and sales date and time of each product.
[0091] "Weather Data" refers to information relating to the weather, temperature, precipitation, wind speed, and other climate information for a particular region or period.
[0092] An "LSTM network" is a type of recurrent neural network (RNN) used to learn long-term and short-term dependencies, and is a model suitable for time-series data analysis such as demand forecasting.
[0093] "Demand forecasting model" refers to a statistical or machine learning model used to predict future demand based on past data.
[0094] "Traffic information" refers to information on real-time traffic conditions such as road congestion, traffic jam information, traffic accidents, and road construction.
[0095] The "A algorithm" is a type of graph search algorithm and refers to a computational technique used to efficiently find the shortest path from a start node to a goal node.
[0096] "Data cleaning" refers to the part of data preprocessing that deals with missing values and outliers and formats data accurately and consistently.
[0097] "Normalization" refers to a data preprocessing technique that makes it easier to compare data of different scales by scaling the data values to a specific range (usually 0 to 1).
[0098] "Features" are the parts of the data that are input into a predictive model, and refer to the independent variables and explanatory variables used in the prediction.
[0099] A "target variable" is the part of the data that is predicted by a predictive model, and refers to the dependent variable or response variable.
[0100] "Third-party data provision services" generally refer to services provided by companies or organizations that provide external data, and data is generally obtained through APIs.
[0101] An "inner partial join" is a database operation that joins two tables and selects only rows with matching keys.
[0102] The present invention is embodied in a form that specifically explains the roles of the server, the terminal, and the user. Each part of the system and the processing flow will be explained in detail below.
[0103] Server Roles
[0104] Data collection:
[0105] The server periodically collects past sales data and weather data from the sales database and weather database. This data is obtained using SQL queries and API requests. As a specific example of operation, the following query is executed against the sales database: "SELECT FROM sales_data WHERE date BETWEEN (registered trademark) '2021-01-01' AND '2021-12-31'". Also, a query such as "SELECT FROM weather_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" is executed against the weather database.
[0106] Data cleaning and preprocessing:
[0107] The server cleans the collected data and imputes missing and outlier values. This process uses libraries such as Pandas, and missing values are imputed using the median or mean. Outliers are also detected and statistically corrected using the interquartile range method. Next, the sales data and weather data are internally joined by date key, and the data is normalized to a range of 0 to 1 using a min-max scaler.
[0108] Feature and target variable selection:
[0109] The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). The features are used as input data, and the target variables are used as training data for the prediction model.
[0110] Generate a demand forecast model:
[0111] The server generates a demand forecasting model using a long short-term memory (LSTM) network. Using libraries such as TENSORFLOW (registered trademark) and Keras, the data is divided into a training set (80%) and a test set (20%), and the LSTM network is trained.
[0112] Demand forecast:
[0113] When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict demand for new data points, and the forecast results are provided to the user as numerical data.
[0114] Get real-time traffic information and calculate delivery routes:
[0115] The server obtains real-time traffic information using Google Maps API, etc. Based on this information, it calculates the optimal delivery route using the A algorithm. The calculated route is sent to the user's device and used as the basis for delivery planning.
[0116] Device Role
[0117] Data display:
[0118] The terminal displays the demand forecast results and optimal delivery routes sent from the server on its interface, which the user can refer to to create a delivery plan.
[0119] User Roles
[0120] Demand forecast request:
[0121] A user requests a demand forecast for a specific period from the system, and the request is sent to the server via a terminal.
[0122] Delivery planning:
[0123] The user creates and implements an actual delivery plan based on the optimal delivery route provided by the server.
[0124] Specific prompt examples
[0125] Below are some examples of prompt sentences.
[0126] Please forecast demand for the next month.
[0127]
[0128] Get real-time traffic information.
[0129] In this way, the present invention can accurately collect sales data and weather data, perform demand forecasts with high accuracy, and calculate optimal delivery routes, thereby realizing efficient logistics processes and reducing operational costs.
[0130] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0131] Step 1: Collect data
[0132] Input: Database connection information and API key.
[0133] How it works: The server periodically collects historical sales and weather data from the sales and weather databases using SQL queries and API requests, such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'".
[0134] Output: Get sales data (e.g. "sales_data.csv") and weather data (e.g. "weather_data.csv").
[0135] Step 2: Clean and preprocess the data
[0136] Inputs: Sales and weather data collected in step 1.
[0137] How it works: The server uses the Pandas library to read the data, impute missing values with the median or mean, correct outliers using the interquartile range method, and perform an inner join between the sales data and the weather data on the date key.
[0138] Output: Cleaned and combined data.
[0139] Step 3: Normalize the data
[0140] Input: The cleaned and combined data from step 2.
[0141] How it works: The server applies a Min-Max scaler to scale the data to the range 0 to 1. Specifically, it runs the code "scaler = MinMaxScaler()" and scales it as follows: "scaled_data = scaler.fit_transform(data)".
[0142] Output: Normalized data.
[0143] Step 4: Selecting features and target variables
[0144] Input: The normalized data from step 3.
[0145] Operation: The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). Specifically, it performs a process of cutting out columns in the data frame and separating them into input data and output data.
[0146] Output: Feature data and target variable data.
[0147] Step 5: Train the demand forecasting model
[0148] Input: Feature data and target variable data obtained in step 4.
[0149] How it works: The server splits the data into a training set (80%) and a test set (20%), and trains an LSTM network using TensorFlow or Keras. For example, run the code "model.fit(X_train, y_train, epochs=50, batch_size=32)".
[0150] Output: A trained LSTM demand forecasting model.
[0151] Step 6: Run a demand forecast
[0152] Input: User forecast request and new data points.
[0153] How it works: When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict the demand, e.g., "model.predict(new_data)".
[0154] Output: Future demand forecast results.
[0155] Step 7: Obtaining real-time traffic information
[0156] Input: Demand forecast results and Google Maps API key.
[0157] How it works: The server sends a request to the Google Maps API to get real-time traffic information. Specifically, it executes an API request like "requests.get(URL)" and parses the JSON response.
[0158] Output: Real-time traffic information.
[0159] Step 8: Calculate the optimal delivery route
[0160] Inputs: Demand forecast results from Step 6 and real-time traffic information from Step 7.
[0161] How it works: The server uses the A algorithm to calculate the optimal delivery route based on predicted demand data and real-time traffic information. For example, it executes code like "astar_algorithm(start_node, end_node, graph)".
[0162] Output: Optimal delivery route.
[0163] Step 9: Present delivery route
[0164] Input: The optimal delivery route calculated in step 8.
[0165] Operation: The server sends the calculated optimal delivery route to the user's terminal, which displays it on its interface.
[0166] Output: The optimal delivery route presented to the user.
[0167] Through these steps, the system can efficiently and accurately forecast demand and provide optimal delivery routes.
[0168] (Application example 1)
[0169] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0170] In logistics processes, it is necessary to effectively utilize sales data and weather data to forecast demand and calculate optimal delivery routes based on real-time traffic information. However, it is technically difficult to process and analyze this data in real time, resulting in an inefficient logistics process. Furthermore, current systems have limitations in the accuracy of their predictive models and the scenarios they can apply, meaning their effectiveness in actual operations cannot be guaranteed.
[0171] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0172] In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed sales data and weather data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal delivery route based on the predicted demand data and real-time traffic information, means for acquiring real-time traffic information from an external service, and means for displaying the optimal delivery route. This makes it possible to perform highly accurate demand forecasts based on the collected data and propose optimal delivery routes.
[0173] "Past sales data" refers to information about sales of products or services in previous periods, and includes specific data such as sales quantity, sales amount, and product category.
[0174] "Weather Data" means information regarding weather conditions, such as temperature, precipitation, wind speed, and humidity, for a particular region and time period.
[0175] "Preprocessing" refers to the procedure of preparing collected data in a format suitable for data analysis and model training by filling in missing values, correcting outliers, and normalizing the data.
[0176] A "demand forecasting model" refers to a machine learning model for predicting future demand based on past sales data and weather data, and in particular uses algorithms such as long short-term memory (LSTM) networks.
[0177] "Real-time traffic information" refers to data that reflects current traffic conditions, including information on traffic congestion, road closures, and travel speeds.
[0178] "External Services" refers to services such as web APIs and data feeds provided by external data providers, which typically operate independently of a company's applications.
[0179] "Optimal delivery route" refers to a method of calculating a route that minimizes delivery costs and time based on demand forecast results and real-time traffic information.
[0180] "Display" refers to presenting the calculated optimal delivery route and prediction results on the user interface of a smart device, robot, etc.
[0181] MODE FOR CARRYING OUT THE INVENTION
[0182] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and machine learning model, and the terminal and user function as interfaces with the system.
[0183] Sales and weather data collection and preprocessing
[0184] 1. Data Collection
[0185] The server periodically collects historical sales and weather data from the database, which involves using SQL queries and API requests to retrieve data from the database and external data providers.
[0186] 2. Data Cleaning
[0187] The server processes the collected data, imputes missing values, and corrects outliers. This process includes imputing missing values using medians and means, and correcting outliers using statistical methods.
[0188] 3. Data Combination and Normalization
[0189] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[0190] Generate a demand forecast model
[0191] 1. Preparing training data
[0192] The server separates features (e.g., date, temperature, etc.) and target variables (e.g., sales volume) from the preprocessed data.
[0193] 2. Training the model
[0194] The server divides the data into a training set and a test set, and trains a demand forecasting model using a long short-term memory (LSTM) network or similar. This model learns the relationship between features and a target variable to predict future demand.
[0195] Proposing optimal delivery routes based on prediction results
[0196] 1. Demand forecast
[0197] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[0198] 2. Obtaining real-time traffic information
[0199] The server obtains real-time traffic information from external services (e.g., APIs of map services) by collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[0200] 3. Calculating the optimal delivery route
[0201] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A.
[0202] 4. Delivery route presentation
[0203] The server provides the calculated optimum delivery route to the user's terminal and displays it.
[0204] Specific examples
[0205] Sales data collection and pre-processing:
[0206] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0207] Train the demand forecasting model:
[0208] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using a long short-term memory (LSTM) network.
[0209] Calculating the best delivery route:
[0210] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the map service's API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0211] Example prompt sentence:
[0212] Create a Python program for an application that uses sales data and weather data for fiscal year 2021 to forecast sales demand for the next month and suggests the optimal delivery route using a map service API.
[0213] This embodiment makes it possible to realize an efficient logistics process, reduce operational costs, and improve service quality.
[0214] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0215] Step 1:
[0216] Data collection
[0217] The server collects historical sales and weather data from a sales database and an external weather data service. Specifically, the server retrieves this data from the database and external data provider using SQL queries and API requests. The inputs for this step are the database and API endpoints, and the output is the raw sales and weather data.
[0218] Step 2:
[0219] Data Cleaning
[0220] The server performs missing value imputation and outlier processing on the collected sales and weather data. Specifically, the server imputes missing values with the median or mean and corrects outliers using statistical methods. The input for this step is raw data, and the output is cleaned sales and weather data.
[0221] Step 3:
[0222] Data Combining and Normalization
[0223] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. Specifically, the server merges the data based on the date and uses a scaler to convert all values to the range of 0 to 1. The input of this step is the cleaned data, and the output is the normalized data.
[0224] Step 4:
[0225] Preparing the training data
[0226] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. Specifically, the server extracts the necessary columns and creates a training set and a test set. The input of this step is the normalized data, and the output is a training set and a test set.
[0227] Step 5:
[0228] Training the model
[0229] The server trains a long short-term memory (LSTM) network using the training set. Specifically, the server inputs the training set into the LSTM model and trains it epoch by epoch. The input of this step is the training set, and the output is a trained demand forecasting model.
[0230] Step 6:
[0231] Demand forecasting
[0232] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. Specifically, the user submits a request, and the server inputs the necessary data into the model to perform the forecast. The inputs for this step are the user's request and the new data points, and the output is the demand forecast result.
[0233] Step 7:
[0234] Obtaining real-time traffic information
[0235] The server obtains real-time traffic information from an external traffic information service. Specifically, the server sends an API request to obtain traffic conditions and congestion information. The input of this step is the API endpoint of the traffic information service, and the output is the obtained real-time traffic information.
[0236] Step 8:
[0237] Calculating the optimal delivery route
[0238] The server uses algorithm A to calculate the optimal delivery route based on the demand forecast results and real-time traffic information. Specifically, the server inputs the necessary data into algorithm A and calculates the optimal route. The inputs for this step are the demand forecast results and real-time traffic information, and the output is the optimal delivery route.
[0239] Step 9:
[0240] Delivery route presentation
[0241] The server provides the calculated optimal delivery route to the user's terminal and displays it. Specifically, the server sends the calculation result to the user's smart device and displays the route on the user interface. The input of this step is the optimal delivery route, and the output is the delivery route displayed on the terminal.
[0242] Furthermore, an emotion engine that estimates the user's emotion may be combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59 and perform identification processing using the user's emotion.
[0243] The following describes in detail the roles of the server, terminal, and user in the embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. In addition, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[0244] Sales data collection and preprocessing
[0245] 1. Data Collection
[0246] The server periodically collects historical sales and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[0247] 2. Data Cleaning
[0248] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[0249] 3. Data Combination and Normalization
[0250] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the range 0 to 1. This normalized data is used for subsequent model training.
[0251] Generate a demand forecast model
[0252] 1. Preparing training data
[0253] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[0254] 2. Training the model
[0255] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[0256] 3. Building and training the model
[0257] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[0258] Proposing optimal delivery routes based on prediction results
[0259] 1. Demand forecast
[0260] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[0261] 2. Obtaining real-time traffic information
[0262] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[0263] 3. Calculating the optimal delivery route
[0264] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0265] 4. Delivery route presentation
[0266] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0267] Implementing the Emotion Engine
[0268] 1. Emotion Engine Data Collection
[0269] As users interact with the system, the device collects their speech and text inputs, which builds a dataset for analyzing their emotional state.
[0270] 2. Emotion analysis
[0271] The server analyzes the collected user input data and determines the emotional state. The emotion engine uses machine learning algorithms to estimate multiple emotional states (e.g., joy, anger, sadness) from the user input.
[0272] 3. Emotional Feedback
[0273] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is stressed, the system will add some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[0274] 4. Emotional display
[0275] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[0276] Specific examples
[0277] Example 1: Collecting and Preprocessing Sales Data
[0278] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0279] Example 2: Training a demand forecasting model
[0280] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[0281] Example 3: Calculating the optimal delivery route
[0282] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0283] Example 4: Using the Emotion Engine
[0284] When a user interacts with the system, the device collects the user's voice input. The server analyzes this voice data and determines whether the user is feeling stressed. Based on this, the server makes adjustments such as adding leeway to the delivery route provided and reducing the frequency of notifications.
[0285] According to the above-described embodiments, the present invention can realize an efficient and emotionally-conscious logistics process, thereby reducing operational costs and improving service quality.
[0286] The processing flow will be explained below.
[0287] Step 1:
[0288] The server collects past sales data and weather data from the database. Specifically, it uses SQL queries and API requests to retrieve sales information (e.g., product name, number of sales, and sales date and time) and weather information (e.g., temperature and precipitation amount by date) in the files "sales_data.csv" and "weather_data.csv."
[0289] Step 2:
[0290] The server cleans the collected data. Missing values are filled in with the mean or median of the middle range, and outliers are detected and corrected using statistical methods. For example, if an abnormally high sales figure is found, it is compared with surrounding data and corrected to a reasonable value.
[0291] Step 3:
[0292] The server joins the sales data and weather data using the date as a key. This results in a single data frame containing the weather information corresponding to each sales data. After joining, a min-max scaler is used to normalize all values to the range 0 to 1.
[0293] Step 4:
[0294] The server separates the features and target variables from the preprocessed data. The features include information such as date, temperature, and weather, and the target variable is sales volume. This formats the data so that the model can predict the target variable from the features.
[0295] Step 5:
[0296] The server splits the data into a training set and a test set, typically 80% for the training set and 20% for the test set, allowing a portion of the dataset to be used to evaluate the generality of the model.
[0297] Step 6:
[0298] The server trains a demand forecasting model using a long short-term memory (LSTM) network. It uses the training set to learn the relationship between features and the target variable, and optimizes the model by setting hyperparameters such as 50 epochs and a batch size of 32.
[0299] Step 7:
[0300] The device collects the user's voice input and text data. For example, it records the user's voice and messages when they make inquiries to the system. It may also collect the user's facial expression data and use it for emotion analysis.
[0301] Step 8:
[0302] The server analyzes the collected user voice and text data to determine the user's emotional state. Using an emotion engine, it assigns emotion tags (e.g., joy, anger, sadness) based on the user's voice tone, speed, and text content.
[0303] Step 9:
[0304] The server adjusts demand forecasts and delivery routes based on the results of emotion analysis. For example, if the user is feeling stressed, it will allow some leeway in the delivery plan. It also adjusts notification methods and timing to optimize the system to reduce the user's mental burden.
[0305] Step 10:
[0306] The server calculates the optimal delivery route according to the user's emotional state. Based on the latest demand forecast results and real-time traffic information, it uses the A algorithm to determine an efficient delivery route and provides it to the user.
[0307] Step 11:
[0308] The server then displays the calculated optimal delivery route on the user's device. The route information displayed includes the route on a map, highways and intersections to avoid, and estimated travel time. Users can use this information to quickly and effectively plan their delivery.
[0309] Based on the above steps, the present invention provides a system that integrates sales data and user emotion data to forecast demand and propose optimal delivery routes. By using this system, it is possible to improve the efficiency of logistics processes and increase user satisfaction.
[0310] Example 2
[0311] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0312] Conventional demand forecasting systems were able to predict demand based on past data and calculate optimal delivery routes. However, these systems did not take into account the user's emotional state and were unable to withstand the effects of user stress and emotional fluctuations. This resulted in a decrease in the accuracy of efficient route calculations and demand forecasts. Furthermore, there was a need for a flexible system that could take real-time information into account.
[0313] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[0314] In this invention, the server includes means for collecting and preprocessing past data, means for generating a prediction model based on the preprocessed data, means for predicting future demand using the generated prediction model, means for calculating an optimal route based on the predicted demand data and real-time information, and means for analyzing the emotional state of the user and adjusting the system operation based on the analysis results, thereby optimizing the system operation based on the emotional state of the user, enabling efficient and flexible demand forecasting and delivery route proposals.
[0315] "Historical data" is previously collected information, such as sales history or weather information, that is used to train a predictive model.
[0316] "Collection and preprocessing means" refers to a series of processes that retrieve data using database queries or API requests, and then perform preprocessing such as missing value imputation, outlier correction, and normalization.
[0317] "Means for generating a predictive model" refers to a method of using preprocessed data to build and train a demand forecasting model using a machine learning algorithm (e.g., an LSTM network).
[0318] "Means for forecasting demand" refers to the process of forecasting future sales and demand volumes using the generated demand forecasting model.
[0319] "Real-time information" refers to the latest data that changes depending on the time of day, such as current traffic information and weather data.
[0320] "Means for calculating optimal routes" refers to the process of integrating predicted demand data with real-time information and using an algorithm (e.g., A algorithm) to determine the most efficient delivery route.
[0321] "User emotional state" refers to the psychological state, such as stress, joy, or sadness, that a user exhibits while interacting with a system.
[0322] "Means for analyzing emotional state" refers to the process of analyzing a user's voice or text input and using machine learning or natural language processing techniques to identify emotions.
[0323] "Means for adjusting system operation" refers to the process of changing the method of demand forecasting and delivery route suggestions based on the analyzed emotional state of the user, thereby providing the user with the optimal service.
[0324] This section describes the roles of the server, terminal, and user in an embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. Furthermore, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[0325] Sales data collection and preprocessing
[0326] Data collection
[0327] The server periodically collects past sales data and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the form of "sales_data.csv" and "weather_data.csv." Specifically, the required data is collected using SQL queries and API requests.
[0328] Data Cleaning
[0329] The server processes the collected sales data, imputes missing values, and handles outliers. Specifically, it uses Python's Pandas library to impute missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is treated as an outlier and corrected.
[0330] Data Combining and Normalization
[0331] The server joins the clean sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. This normalized data is then used for subsequent model training, specifically using Pandas' merge function or Scikit-learn's MinMaxScaler.
[0332] Generate a demand forecast model
[0333] Preparing the training data
[0334] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data and converts them into an appropriate format.
[0335] Splitting the model's training and test sets
[0336] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. Specifically, it uses the train_test_split function in Scikit-learn.
[0337] Building and training the model
[0338] The server uses the Keras library to build a long short-term memory (LSTM) network and trains the demand forecasting model using the training set. It sets hyperparameters such as the number of epochs, batch size, and learning rate to train the model.
[0339] Proposing optimal delivery routes based on prediction results
[0340] Demand forecasting
[0341] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for new data points. For example, when a user requests "next month's demand forecast," the server inputs the necessary data points and generates a demand forecast.
[0342] Obtaining real-time traffic information
[0343] The server retrieves real-time traffic information from external services such as Google Maps API, collects the latest traffic information through API requests, and calculates routes based on predicted demand.
[0344] Calculating the optimal delivery route
[0345] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This determines the most efficient route, taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0346] Delivery route presentation
[0347] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0348] Implementing the Emotion Engine
[0349] Emotion Engine Data Collection
[0350] As the user interacts with the system, the device collects the user's voice and text input, which builds a dataset for analyzing the emotional state.
[0351] Emotion analysis
[0352] The server analyzes the collected user input data and uses a machine learning algorithm to determine the emotional state, which infers multiple emotional states (e.g., joy, anger, sadness) from the user's input.
[0353] Emotional Feedback
[0354] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is under stress, it adds some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[0355] emotional display
[0356] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[0357] Examples and prompts
[0358] Example 1: Collecting and Preprocessing Sales Data
[0359] The server collects the sales data for fiscal year 2021 "sales_data.csv" and weather data "weather_data.csv" from the database, fills in missing values and removes outliers, then combines the data using the date as a key and performs normalization processing.
[0360] Example 2: Training a demand forecasting model
[0361] The server extracts a dataset with date and temperature as features and sales volume as the target variable, divides 80% of the data into a training set and 20% into a test set, and performs training using an LSTM model.
[0362] Example 3: Calculating the optimal delivery route
[0363] When a user requests a demand forecast for the next month, the server uses the LSTM model to predict demand, then obtains real-time traffic information using the Google Maps API and calculates the optimal delivery route using the A algorithm. The calculated route is displayed on the user's device.
[0364] Example 4: Using the Emotion Engine
[0365] When a user voice-inputs "I'm tired, I can't do this anymore," the server analyzes this and determines that the user is feeling stressed. As a result, the server makes adjustments such as adding leeway to the delivery route it provides and reducing the frequency of notifications.
[0366] Prompt Sentence Examples
[0367] "Predict next month's demand and calculate the optimal delivery route."
[0368] "Adjust routes and notifications to take into account the user's emotional state."
[0369] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0370] Step 1: Collect data
[0371] The server periodically collects past sales data (sales_data.csv) and weather data (weather_data.csv) from the database using SQL queries and API requests. The specific input is the SQL query "SELECT FROM sales WHERE year = 2021", and the output is the collected raw data.
[0372] Step 2: Preprocessing the data
[0373] The server preprocesses the collected data. Specifically, it uses the Python Pandas library to read "sales_data.csv" and "weather_data.csv," fills missing values with the median, and removes outliers. For example, it performs the operation df.fillna(df.median(), inplace=True), and the input is raw data and the output is clean data.
[0374] Step 3: Combining and normalizing the data
[0375] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. Specifically, it executes merged_data = pd.merge(sales_data, weather_data, on='date') and then uses scaler = MinMaxScaler(). The input is the cleaned individual data, and the output is the normalized merged data.
[0376] Step 4: Separation of features and target variable
[0377] The server separates the features (e.g., date, temperature) and the target variable (e.g., sales volume) from the normalized data. Specifically, it uses Pandas' iloc method to convert the data into an appropriate format. The input is the normalized data, and the output is a dataset containing the features and the target variable.
[0378] Step 5: Split the training and test sets
[0379] The server splits the dataset into an 80% training set and a 20% test set. It does this using Scikit-learn's train_test_split function, which takes as input a dataset containing features and a goal variable, and outputs a training set and a test set.
[0380] Step 6: Building and training the model
[0381] The server uses the Keras library to build an LSTM network and trains the model using the training set. Set the number of epochs to 50, the batch size to 32, and the learning rate to 0.001, and run model.fit(X_train, y_train, epochs=50, batch_size=32, validation_split=0.2). The input is the training set, and the output is the trained model.
[0382] Step 7: Demand forecasting
[0383] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for a new data point. It executes model.predict(new_data) with the new data point as input, and the output is the demand forecast result.
[0384] Step 8: Obtaining real-time traffic information
[0385] The server retrieves real-time traffic information using an external API (e.g., Google Maps API). It executes requests.get("https: / / maps.googleapis.com / maps / api / ..."), where the input is the API request parameters and the output is the real-time traffic information.
[0386] Step 9: Calculate the optimal delivery route
[0387] The server calculates the optimal delivery route using the A algorithm based on the predicted demand data and the acquired real-time traffic information. Using the pathfinding library, astar_algorithm(start_point, end_point, traffic_data) is executed, and the input is the demand data and traffic information, and the output is the optimal delivery route.
[0388] Step 10: Present delivery route
[0389] The server sends the calculated optimal delivery route to the user's device, which displays it in map or list format. The user can then create a delivery plan based on the route information provided. The input is the optimal delivery route data, and the output is the display information on the user's device.
[0390] Step 11: Collect emotion data
[0391] When a user interacts with the system, the device collects the user's input voice or text. It uses a speech recognition API to convert the voice data into text, which is then sent to a server for sentiment analysis. The input is voice or text data, and the output is text data sent to the server.
[0392] Step 12: Sentiment Analysis and Feedback
[0393] The server analyzes voice and text data to determine the user's emotional state. It uses machine learning algorithms to identify emotions and executes, for example, sentiment_analysis(input_text). If the user is in a stressful state, it adjusts the system's behavior and notification frequency. The input is the user's voice and text data, and the output is the analyzed emotional state and the adjustment of behavior based on that.
[0394] (Application example 2)
[0395] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0396] Conventional demand forecasting and delivery route calculation systems can propose optimal routes based on past sales data and real-time traffic information, but they cannot take the user's emotional state into account, making it difficult to build an efficient logistics process that adapts to the user's stress and emotional state.
[0397] The identification processing by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal transportation route based on the predicted demand data and real-time road information, means for analyzing user input data to determine the user's emotional state, and means for adjusting the demand forecast and transportation route based on the determined emotional state. This makes it possible to build an efficient and adaptive logistics process that takes the user's emotional state into consideration.
[0398] "Past sales data" refers to product sales records collected over a certain period of time.
[0399] "Weather Data" means meteorological information relating to a specific region and time, such as temperature, precipitation, and humidity.
[0400] "Preprocessing means" refers to a method or device that processes collected data, such as filling in missing values or correcting outliers, before analysis.
[0401] A "demand forecasting model" is an algorithm or machine learning model that predicts future demand based on past data.
[0402] "Real-time road information" refers to the latest information about roads, such as current traffic conditions, congestion information, and accident information.
[0403] An "optimal transportation route" is the most suitable route to reach a destination efficiently and quickly.
[0404] "User Input Data" means information provided by a user to a system, whether in speech, text, or other form.
[0405] An "emotional state" refers to a psychological state such as joy, anger, or sadness that a user feels.
[0406] "Means of discrimination" refers to methods or devices that analyze and identify specific information from collected data.
[0407] "Adjusting means" refers to a method or device that modifies the system's operation or plan based on the analysis results.
[0408] This section explains in detail the roles of the server, terminal, and user in the embodiment of the present invention. This system incorporates an emotion engine into demand forecasting and delivery route optimization, and realizes an efficient logistics process by taking into account the emotional state of the user.
[0409] Sales data collection and preprocessing
[0410] Data collection:
[0411] The server periodically collects historical sales and weather data from the sales database. The data is retrieved using SQL queries and API requests and stored in the local database as "sales_data.csv" and "weather_data.csv".
[0412] Data Cleaning:
[0413] The server performs data cleaning on the collected data, such as imputing missing values and correcting outliers. Here, Pandas is used to perform data frame operations, and SciPy is used to detect and correct outliers.
[0414] Data Combining and Normalization:
[0415] The server joins the sales data and weather data by date and normalizes them using a min-max scaler. This normalized data is used to train the demand forecasting model.
[0416] Generate a demand forecast model
[0417] Prepare the training data:
[0418] The server separates features such as date and temperature from target variables such as sales volume from the preprocessed data. The dataset is divided into an 80% training set and a 20% test set.
[0419] Building and training the model:
[0420] The server uses TensorFlow to build and train a LSTM (long short-term memory) network, which learns the relationship between features and the goal variable.
[0421] Proposing optimal delivery routes based on prediction results
[0422] Demand forecast:
[0423] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points.
[0424] Get real-time traffic information:
[0425] The server uses the Google Maps API to get real-time traffic information, including traffic conditions, congestion information, and accident information.
[0426] Calculating the optimal delivery route:
[0427] The server uses algorithm A to calculate the optimal delivery route based on predicted demand data and real-time traffic information.
[0428] Delivery route suggestions:
[0429] The device calculates the optimal delivery route and provides it to the user, who can then display the route information in map or list format on their smartphone or head-mounted display.
[0430] Implementing the Emotion Engine
[0431] Emotion Engine Data Collection:
[0432] As the user interacts with the system, the device collects the user's voice and text data.
[0433] Emotion analysis:
[0434] The server analyzes the collected data using the BERT model to determine the user's emotional state, and outputs the result as a rating such as "high stress."
[0435] Emotional Feedback:
[0436] The server adjusts demand forecasts and transportation routes based on the user's emotional state. For users in a stressed state, the server provides route planning with more leeway and adjusts notification frequency.
[0437] Specific examples
[0438] Example 1: Collecting and Preprocessing Sales Data
[0439] The server periodically collects the past year's worth of sales data ("sales_data.csv") and monthly weather data ("weather_data.csv") from the sales database, and performs data cleaning and normalization.
[0440] Example 2: Training a demand forecasting model
[0441] The server trains a demand forecasting model using an LSTM network from the preprocessed dataset, using date and temperature as features and sales volume as the target variable.
[0442] Example 3: Calculating the optimal delivery route
[0443] When a user requests a demand forecast for the next month, the server uses the trained model to predict demand and obtains real-time traffic information through the Google Maps API, then calculates the optimal delivery route using the A algorithm.
[0444] Example 4: Using the Emotion Engine
[0445] When a user interacts with the system, the device collects the user's voice data. The server analyzes this data using the BERT model and determines whether the user is stressed. As a result, the server provides more leeway in the delivery route and reduces the frequency of notifications.
[0446] Examples of prompt statements
[0447] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[0448] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[0449] Step 1: Data collection
[0450] The server collects data from the sales database and an external weather data provider. Input data includes past sales records and weather information. This data is retrieved through SQL queries and API requests and saved as "sales_data.csv" and "weather_data.csv." A regularly scheduled job automatically retrieves the data and saves it in local storage.
[0451] Step 2: Data cleaning
[0452] The server reads the saved sales data and weather data and performs missing value imputation and outlier processing. The input data includes "sales_data.csv" and "weather_data.csv" collected in Step 1. Specifically, it uses the Pandas library to perform data frame operations, imputes missing values with the median, and uses SciPy to detect and correct outliers. The output is a clean dataset.
[0453] Step 3: Data joining and normalization
[0454] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. The input data includes the data cleaned in Step 2. Specifically, it performs data joining using Pandas and converts the data to the range of 0 to 1 using a min-max scaler in scikit-learn. The output is a normalized dataset.
[0455] Step 4: Separating features and target variables and preparing a training set
[0456] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. The input data includes the data normalized in Step 3. Specifically, it uses Pandas to extract the necessary columns and uses scikit-learn to split the dataset into an 80% training set and a 20% test set. The output is a training set and a test set.
[0457] Step 5: Build and train your demand forecasting model
[0458] The server uses TensorFlow to build and train an LSTM network. The input data includes the training set prepared in Step 4. Specifically, it defines an LSTM model and sets hyperparameters such as the number of epochs and batch size to train the model. The output is a trained demand forecasting model.
[0459] Step 6: Demand forecasting
[0460] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. The input data includes the new data points provided by the user at the time of the request. Specifically, the server inputs the new data into the LSTM model to obtain the demand forecast result. The output is the predicted demand data.
[0461] Step 7: Obtaining real-time traffic information
[0462] The server uses the Google Maps API to obtain real-time traffic information. The input data includes delivery destination information. Specifically, it sends an API request to the Google Maps API to obtain real-time data such as traffic conditions, congestion information, and accident information. The output is real-time traffic information.
[0463] Step 8: Calculate the optimal delivery route
[0464] The server uses algorithm A to calculate the optimal delivery route based on the predicted demand data and real-time traffic information. The input data includes the demand forecast data from Step 6 and the traffic information from Step 7. Specifically, it runs algorithm A to calculate the shortest route. The output is the optimal delivery route.
[0465] Step 9: Present delivery route
[0466] The terminal provides the calculated optimal delivery route to the user. The input data includes the delivery route calculated in Step 8. Specific operations include displaying the route in map or list format on a smartphone or head-mounted display. The output is the presentation of route information to the user.
[0467] Step 10: Collecting Data for the Emotion Engine
[0468] When a user interacts with the system, the device collects the user's voice and text data. The input data includes the user's voice and text. Specifically, the device records and transmits data through a microphone or input field. The output is the collected user data.
[0469] Step 11: Sentiment Analysis
[0470] The server analyzes the collected data using the BERT model and determines the user's emotional state. The input data includes the speech and text data collected in Step 10. Specifically, it performs emotion analysis using the BERT model and quantifies the emotional state. The output is the determined emotional state.
[0471] Step 12: Emotional Feedback
[0472] The server adjusts demand forecasts and transportation routes based on the user's emotional state. The input data includes the emotional state determined in Step 11. Specific operations include generating and adjusting route plans and notification methods adapted to the emotional state. The output is the adjusted demand forecast and transportation route.
[0473] Examples of prompt statements
[0474] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[0475] The specific processing unit 290 transmits the result of the specific processing to the smart device 14. In the smart device 14, the control unit 46A causes the output device 40 to output the result of the specific processing. The microphone 38B acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[0476] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (registered trademark) (Internet search engine).<URL: https: / / openai.com / blog / chatgpt> ), Gemini (registered trademark) (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[0477] In the above embodiment, an example in which the specific process is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific process may be performed by the smart device 14.
[0478] [Second embodiment]
[0479] FIG. 3 shows an example of the configuration of a data processing system 210 according to the second embodiment.
[0480] 3, the data processing system 210 includes the data processing device 12 and smart glasses 214. An example of the data processing device 12 is a server.
[0481] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0482] The smart glasses 214 include a computer 36, a microphone 238, a speaker 240, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, and the camera 42 are also connected to the bus 52.
[0483] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[0484] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[0485] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[0486] Fig. 4 shows an example of the main functions of the data processing device 12 and the smart glasses 214. As shown in Fig. 4, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[0487] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0488] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0489] In the smart glasses 214, the reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0490] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the smart glasses 214 will be referred to as the "terminal."
[0491] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and AI model, and the terminal and user function as interfaces with the system.
[0492] Sales data collection and preprocessing
[0493] 1. Data Collection
[0494] The server periodically collects historical sales and weather data from a database, including using SQL queries and API requests to retrieve data from databases and external data providers.
[0495] 2. Data Cleaning
[0496] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values using the median or mean, and corrects outliers using statistical methods.
[0497] 3. Data Combination and Normalization
[0498] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[0499] Generate a demand forecast model
[0500] 1. Preparing training data
[0501] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data.
[0502] 2. Training the model
[0503] The server splits the data into a training set and a test set and trains a demand forecasting model using a long short-term memory (LSTM) network. The model learns the relationship between features and a target variable to predict future demand.
[0504] Proposing optimal delivery routes based on prediction results
[0505] 1. Demand forecast
[0506] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[0507] 2. Obtaining real-time traffic information
[0508] The server retrieves real-time traffic information from external services such as Google Maps API, collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[0509] 3. Calculating the optimal delivery route
[0510] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This determines the optimal route that minimizes delivery costs and time.
[0511] 4. Delivery route presentation
[0512] The server provides the calculated optimal delivery route to the user's terminal, allowing the user to create an actual delivery plan based on this.
[0513] Specific examples
[0514] Example 1: Collecting and Preprocessing Sales Data
[0515] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0516] Example 2: Training a demand forecasting model
[0517] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[0518] Example 3: Calculating the optimal delivery route
[0519] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0520] According to the above-described embodiment, the present invention can realize an efficient logistics process, reduce operational costs, and improve service quality.
[0521] The processing flow will be explained below.
[0522] Step 1:
[0523] The server collects historical sales and weather data from a database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[0524] Step 2:
[0525] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[0526] Step 3:
[0527] The server joins the sales data with the weather data. The join is performed using the date as the key. After joining, the data is normalized using a min-max scaler, converting all values to the range of 0 to 1. The normalized data obtained from this step is used for subsequent model training.
[0528] Step 4:
[0529] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[0530] Step 5:
[0531] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[0532] Step 6:
[0533] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[0534] Step 7:
[0535] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[0536] Step 8:
[0537] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[0538] Step 9:
[0539] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0540] Step 10:
[0541] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0542] Example 1
[0543] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0544] In the logistics industry, calculating efficient delivery routes and accurate demand forecasting are essential for reducing operational costs and improving service quality. However, conventional systems have problems such as manual data collection, inaccurate forecasting models, and a lack of integration of real-time traffic information, making it difficult to calculate optimal delivery routes. This has led to issues such as reduced delivery efficiency and increased costs.
[0545] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0546] In this invention, the server includes means for periodically collecting past sales data and weather data from a sales database and a weather database, means for cleaning the collected data and combining the data using a date key, means for normalizing the data to a range of 0 to 1, means for separating features and a target variable based on the preprocessed sales data and weather data, means for generating a demand forecasting model using an LSTM network, means for predicting future demand using the generated LSTM demand forecasting model, and means for acquiring traffic information based on the demand forecasting data and calculating an optimal delivery route using the A algorithm. This makes it possible to accurately collect and preprocess sales data and weather data, generate a highly accurate demand forecasting model, and calculate an optimal delivery route by integrating real-time traffic information.
[0547] "Sales Data" refers to information about sales of goods or services made within a specific period of time, and typically includes the sales quantity, sales price, and sales date and time of each product.
[0548] "Weather Data" refers to information relating to the weather, temperature, precipitation, wind speed, and other climate information for a particular region or period.
[0549] An "LSTM network" is a type of recurrent neural network (RNN) used to learn long-term and short-term dependencies, and is a model suitable for time-series data analysis such as demand forecasting.
[0550] "Demand forecasting model" refers to a statistical or machine learning model used to predict future demand based on past data.
[0551] "Traffic information" refers to information on real-time traffic conditions such as road congestion, traffic jam information, traffic accidents, and road construction.
[0552] The "A algorithm" is a type of graph search algorithm and refers to a computational technique used to efficiently find the shortest path from a start node to a goal node.
[0553] "Data cleaning" refers to the part of data preprocessing that deals with missing values and outliers and formats data accurately and consistently.
[0554] "Normalization" refers to a data preprocessing technique that makes it easier to compare data of different scales by scaling the data values to a specific range (usually 0 to 1).
[0555] "Features" are the parts of the data that are input into a predictive model, and refer to the independent variables and explanatory variables used in the prediction.
[0556] A "target variable" is the part of the data that is predicted by a predictive model, and refers to the dependent variable or response variable.
[0557] "Third-party data provision services" generally refer to services provided by companies or organizations that provide external data, and data is generally obtained through APIs.
[0558] An "inner partial join" is a database operation that joins two tables and selects only rows with matching keys.
[0559] The present invention is embodied in a form that specifically explains the roles of the server, the terminal, and the user. Each part of the system and the processing flow will be explained in detail below.
[0560] Server Roles
[0561] Data collection:
[0562] The server periodically collects past sales and weather data from the sales and weather databases. This data is obtained using SQL queries and API requests. As a specific example, the server executes a query such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" on the sales database. Similarly, the server executes a query such as "SELECT FROM weather_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" on the weather database.
[0563] Data cleaning and preprocessing:
[0564] The server cleans the collected data and imputes missing and outlier values. This process uses libraries such as Pandas, and missing values are imputed using the median or mean. Outliers are also detected and statistically corrected using the interquartile range method. Next, the sales data and weather data are internally joined by date key, and the data is normalized to a range of 0 to 1 using a min-max scaler.
[0565] Feature and target variable selection:
[0566] The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). The features are used as input data, and the target variables are used as training data for the prediction model.
[0567] Generate a demand forecast model:
[0568] The server generates a demand forecasting model using a long short-term memory (LSTM) network. Using libraries such as TensorFlow or Keras, the data is divided into a training set (80%) and a test set (20%), and the LSTM network is trained.
[0569] Demand forecast:
[0570] When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict demand for new data points, and the forecast results are provided to the user as numerical data.
[0571] Get real-time traffic information and calculate delivery routes:
[0572] The server obtains real-time traffic information using Google Maps API, etc. Based on this information, it calculates the optimal delivery route using the A algorithm. The calculated route is sent to the user's device and used as the basis for delivery planning.
[0573] Device Role
[0574] Data display:
[0575] The terminal displays the demand forecast results and optimal delivery routes sent from the server on its interface, which the user can refer to to create a delivery plan.
[0576] User Roles
[0577] Demand forecast request:
[0578] A user requests a demand forecast for a specific period from the system, and the request is sent to the server via a terminal.
[0579] Delivery planning:
[0580] The user creates and implements an actual delivery plan based on the optimal delivery route provided by the server.
[0581] Specific prompt examples
[0582] Below are some examples of prompt sentences.
[0583] Please forecast demand for the next month.
[0584]
[0585] Get real-time traffic information.
[0586] In this way, the present invention can accurately collect sales data and weather data, perform demand forecasts with high accuracy, and calculate optimal delivery routes, thereby realizing efficient logistics processes and reducing operational costs.
[0587] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0588] Step 1: Collect data
[0589] Input: Database connection information and API key.
[0590] How it works: The server periodically collects historical sales and weather data from the sales and weather databases using SQL queries and API requests, such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'".
[0591] Output: Get sales data (e.g. "sales_data.csv") and weather data (e.g. "weather_data.csv").
[0592] Step 2: Clean and preprocess the data
[0593] Inputs: Sales and weather data collected in step 1.
[0594] How it works: The server uses the Pandas library to read the data, impute missing values with the median or mean, correct outliers using the interquartile range method, and perform an inner join between the sales data and the weather data on the date key.
[0595] Output: Cleaned and combined data.
[0596] Step 3: Normalize the data
[0597] Input: The cleaned and combined data from step 2.
[0598] How it works: The server applies a Min-Max scaler to scale the data to the range 0 to 1. Specifically, it runs the code "scaler = MinMaxScaler()" and scales it as follows: "scaled_data = scaler.fit_transform(data)".
[0599] Output: Normalized data.
[0600] Step 4: Selecting features and target variables
[0601] Input: The normalized data from step 3.
[0602] Operation: The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). Specifically, it performs a process of cutting out columns in the data frame and separating them into input data and output data.
[0603] Output: Feature data and target variable data.
[0604] Step 5: Train the demand forecasting model
[0605] Input: Feature data and target variable data obtained in step 4.
[0606] How it works: The server splits the data into a training set (80%) and a test set (20%), and trains an LSTM network using TensorFlow or Keras. For example, run the code "model.fit(X_train, y_train, epochs=50, batch_size=32)".
[0607] Output: A trained LSTM demand forecasting model.
[0608] Step 6: Run a demand forecast
[0609] Input: User forecast request and new data points.
[0610] How it works: When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict the demand, e.g., "model.predict(new_data)".
[0611] Output: Future demand forecast results.
[0612] Step 7: Obtaining real-time traffic information
[0613] Input: Demand forecast results and Google Maps API key.
[0614] How it works: The server sends a request to the Google Maps API to get real-time traffic information. Specifically, it executes an API request like "requests.get(URL)" and parses the JSON response.
[0615] Output: Real-time traffic information.
[0616] Step 8: Calculate the optimal delivery route
[0617] Inputs: Demand forecast results from Step 6 and real-time traffic information from Step 7.
[0618] How it works: The server uses the A algorithm to calculate the optimal delivery route based on predicted demand data and real-time traffic information. For example, it executes code like "astar_algorithm(start_node, end_node, graph)".
[0619] Output: Optimal delivery route.
[0620] Step 9: Present delivery route
[0621] Input: The optimal delivery route calculated in step 8.
[0622] Operation: The server sends the calculated optimal delivery route to the user's terminal, which displays it on its interface.
[0623] Output: The optimal delivery route presented to the user.
[0624] Through these steps, the system can efficiently and accurately forecast demand and provide optimal delivery routes.
[0625] (Application example 1)
[0626] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0627] In logistics processes, it is necessary to effectively utilize sales data and weather data to forecast demand and calculate optimal delivery routes based on real-time traffic information. However, it is technically difficult to process and analyze this data in real time, resulting in an inefficient logistics process. Furthermore, current systems have limitations in the accuracy of their predictive models and the scenarios they can apply, meaning their effectiveness in actual operations cannot be guaranteed.
[0628] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0629] In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed sales data and weather data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal delivery route based on the predicted demand data and real-time traffic information, means for acquiring real-time traffic information from an external service, and means for displaying the optimal delivery route. This makes it possible to perform highly accurate demand forecasts based on the collected data and propose optimal delivery routes.
[0630] "Past sales data" refers to information about sales of products or services in previous periods, and includes specific data such as sales quantity, sales amount, and product category.
[0631] "Weather Data" means information regarding weather conditions, such as temperature, precipitation, wind speed, and humidity, for a particular region and time period.
[0632] "Preprocessing" refers to the procedure of preparing collected data in a format suitable for data analysis and model training by filling in missing values, correcting outliers, and normalizing the data.
[0633] A "demand forecasting model" refers to a machine learning model for predicting future demand based on past sales data and weather data, and in particular uses algorithms such as long short-term memory (LSTM) networks.
[0634] "Real-time traffic information" refers to data that reflects current traffic conditions, including information on traffic congestion, road closures, and travel speeds.
[0635] "External Services" refers to services such as web APIs and data feeds provided by external data providers, which typically operate independently of a company's applications.
[0636] "Optimal delivery route" refers to a method of calculating a route that minimizes delivery costs and time based on demand forecast results and real-time traffic information.
[0637] "Display" refers to presenting the calculated optimal delivery route and prediction results on the user interface of a smart device, robot, etc.
[0638] MODE FOR CARRYING OUT THE INVENTION
[0639] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and machine learning model, and the terminal and user function as interfaces with the system.
[0640] Sales and weather data collection and preprocessing
[0641] 1. Data Collection
[0642] The server periodically collects historical sales and weather data from the database, which involves using SQL queries and API requests to retrieve data from the database and external data providers.
[0643] 2. Data Cleaning
[0644] The server processes the collected data, imputes missing values, and corrects outliers. This process includes imputing missing values using medians and means, and correcting outliers using statistical methods.
[0645] 3. Data Combination and Normalization
[0646] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[0647] Generate a demand forecast model
[0648] 1. Preparing training data
[0649] The server separates features (e.g., date, temperature, etc.) and target variables (e.g., sales volume) from the preprocessed data.
[0650] 2. Training the model
[0651] The server divides the data into a training set and a test set, and trains a demand forecasting model using a long short-term memory (LSTM) network or similar. This model learns the relationship between features and a target variable to predict future demand.
[0652] Proposing optimal delivery routes based on prediction results
[0653] 1. Demand forecast
[0654] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[0655] 2. Obtaining real-time traffic information
[0656] The server obtains real-time traffic information from external services (e.g., APIs of map services) by collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[0657] 3. Calculating the optimal delivery route
[0658] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A.
[0659] 4. Delivery route presentation
[0660] The server provides the calculated optimum delivery route to the user's terminal and displays it.
[0661] Specific examples
[0662] Sales data collection and pre-processing:
[0663] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0664] Train the demand forecasting model:
[0665] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using a long short-term memory (LSTM) network.
[0666] Calculating the best delivery route:
[0667] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the map service's API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0668] Example prompt sentence:
[0669] Create a Python program for an application that uses sales data and weather data for fiscal year 2021 to forecast sales demand for the next month and suggests the optimal delivery route using a map service API.
[0670] This embodiment makes it possible to realize an efficient logistics process, reduce operational costs, and improve service quality.
[0671] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0672] Step 1:
[0673] Data collection
[0674] The server collects historical sales and weather data from a sales database and an external weather data service. Specifically, the server retrieves this data from the database and external data provider using SQL queries and API requests. The inputs for this step are the database and API endpoints, and the output is the raw sales and weather data.
[0675] Step 2:
[0676] Data Cleaning
[0677] The server performs missing value imputation and outlier processing on the collected sales and weather data. Specifically, the server imputes missing values with the median or mean and corrects outliers using statistical methods. The input for this step is raw data, and the output is cleaned sales and weather data.
[0678] Step 3:
[0679] Data Combining and Normalization
[0680] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. Specifically, the server merges the data based on the date and uses a scaler to convert all values to the range of 0 to 1. The input of this step is the cleaned data, and the output is the normalized data.
[0681] Step 4:
[0682] Preparing the training data
[0683] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. Specifically, the server extracts the necessary columns and creates a training set and a test set. The input of this step is the normalized data, and the output is a training set and a test set.
[0684] Step 5:
[0685] Training the model
[0686] The server trains a long short-term memory (LSTM) network using the training set. Specifically, the server inputs the training set into the LSTM model and trains it epoch by epoch. The input of this step is the training set, and the output is a trained demand forecasting model.
[0687] Step 6:
[0688] Demand forecasting
[0689] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. Specifically, the user submits a request, and the server inputs the necessary data into the model to perform the forecast. The inputs for this step are the user's request and the new data points, and the output is the demand forecast result.
[0690] Step 7:
[0691] Obtaining real-time traffic information
[0692] The server obtains real-time traffic information from an external traffic information service. Specifically, the server sends an API request to obtain traffic conditions and congestion information. The input of this step is the API endpoint of the traffic information service, and the output is the obtained real-time traffic information.
[0693] Step 8:
[0694] Calculating the optimal delivery route
[0695] The server uses algorithm A to calculate the optimal delivery route based on the demand forecast results and real-time traffic information. Specifically, the server inputs the necessary data into algorithm A and calculates the optimal route. The inputs for this step are the demand forecast results and real-time traffic information, and the output is the optimal delivery route.
[0696] Step 9:
[0697] Delivery route presentation
[0698] The server provides the calculated optimal delivery route to the user's terminal and displays it. Specifically, the server sends the calculation result to the user's smart device and displays the route on the user interface. The input of this step is the optimal delivery route, and the output is the delivery route displayed on the terminal.
[0699] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[0700] The following describes in detail the roles of the server, terminal, and user in the embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. In addition, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[0701] Sales data collection and preprocessing
[0702] 1. Data Collection
[0703] The server periodically collects historical sales and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[0704] 2. Data Cleaning
[0705] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[0706] 3. Data Combination and Normalization
[0707] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the range 0 to 1. This normalized data is used for subsequent model training.
[0708] Generate a demand forecast model
[0709] 1. Preparing training data
[0710] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[0711] 2. Training the model
[0712] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[0713] 3. Building and training the model
[0714] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[0715] Proposing optimal delivery routes based on prediction results
[0716] 1. Demand forecast
[0717] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[0718] 2. Obtaining real-time traffic information
[0719] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[0720] 3. Calculating the optimal delivery route
[0721] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0722] 4. Delivery route presentation
[0723] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0724] Implementing the Emotion Engine
[0725] 1. Emotion Engine Data Collection
[0726] As users interact with the system, the device collects their speech and text inputs, which builds a dataset for analyzing their emotional state.
[0727] 2. Emotion analysis
[0728] The server analyzes the collected user input data and determines the emotional state. The emotion engine uses machine learning algorithms to estimate multiple emotional states (e.g., joy, anger, sadness) from the user input.
[0729] 3. Emotional Feedback
[0730] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is stressed, the system will add some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[0731] 4. Emotional display
[0732] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[0733] Specific examples
[0734] Example 1: Collecting and Preprocessing Sales Data
[0735] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0736] Example 2: Training a demand forecasting model
[0737] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[0738] Example 3: Calculating the optimal delivery route
[0739] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0740] Example 4: Using the Emotion Engine
[0741] When a user interacts with the system, the device collects the user's voice input. The server analyzes this voice data and determines whether the user is feeling stressed. Based on this, the server makes adjustments such as adding leeway to the delivery route provided and reducing the frequency of notifications.
[0742] According to the above-described embodiments, the present invention can realize an efficient and emotionally-conscious logistics process, thereby reducing operational costs and improving service quality.
[0743] The processing flow will be explained below.
[0744] Step 1:
[0745] The server collects past sales data and weather data from the database. Specifically, it uses SQL queries and API requests to retrieve sales information (e.g., product name, number of sales, and sales date and time) and weather information (e.g., temperature and precipitation amount by date) in the files "sales_data.csv" and "weather_data.csv."
[0746] Step 2:
[0747] The server cleans the collected data. Missing values are filled in with the mean or median of the middle range, and outliers are detected and corrected using statistical methods. For example, if an abnormally high sales figure is found, it is compared with surrounding data and corrected to a reasonable value.
[0748] Step 3:
[0749] The server joins the sales data and weather data using the date as a key. This results in a single data frame containing the weather information corresponding to each sales data. After joining, a min-max scaler is used to normalize all values to the range 0 to 1.
[0750] Step 4:
[0751] The server separates the features and target variables from the preprocessed data. The features include information such as date, temperature, and weather, and the target variable is sales volume. This formats the data so that the model can predict the target variable from the features.
[0752] Step 5:
[0753] The server splits the data into a training set and a test set, typically 80% for the training set and 20% for the test set, allowing a portion of the dataset to be used to evaluate the generality of the model.
[0754] Step 6:
[0755] The server trains a demand forecasting model using a long short-term memory (LSTM) network. It uses the training set to learn the relationship between features and the target variable, and optimizes the model by setting hyperparameters such as 50 epochs and a batch size of 32.
[0756] Step 7:
[0757] The device collects the user's voice input and text data. For example, it records the user's voice and messages when they make inquiries to the system. It may also collect the user's facial expression data and use it for emotion analysis.
[0758] Step 8:
[0759] The server analyzes the collected user voice and text data to determine the user's emotional state. Using an emotion engine, it assigns emotion tags (e.g., joy, anger, sadness) based on the user's voice tone, speed, and text content.
[0760] Step 9:
[0761] The server adjusts demand forecasts and delivery routes based on the results of emotion analysis. For example, if the user is feeling stressed, it will allow some leeway in the delivery plan. It also adjusts notification methods and timing to optimize the system to reduce the user's mental burden.
[0762] Step 10:
[0763] The server calculates the optimal delivery route according to the user's emotional state. Based on the latest demand forecast results and real-time traffic information, it uses the A algorithm to determine an efficient delivery route and provides it to the user.
[0764] Step 11:
[0765] The server then displays the calculated optimal delivery route on the user's device. The route information displayed includes the route on a map, highways and intersections to avoid, and estimated travel time. Users can use this information to quickly and effectively plan their delivery.
[0766] Based on the above steps, the present invention provides a system that integrates sales data and user emotion data to forecast demand and propose optimal delivery routes. By using this system, it is possible to improve the efficiency of logistics processes and increase user satisfaction.
[0767] Example 2
[0768] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0769] Conventional demand forecasting systems were able to predict demand based on past data and calculate optimal delivery routes. However, these systems did not take into account the user's emotional state and were unable to withstand the effects of user stress and emotional fluctuations. This resulted in a decrease in the accuracy of efficient route calculations and demand forecasts. Furthermore, there was a need for a flexible system that could take real-time information into account.
[0770] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[0771] In this invention, the server includes means for collecting and preprocessing past data, means for generating a prediction model based on the preprocessed data, means for predicting future demand using the generated prediction model, means for calculating an optimal route based on the predicted demand data and real-time information, and means for analyzing the emotional state of the user and adjusting the system operation based on the analysis results, thereby optimizing the system operation based on the emotional state of the user, enabling efficient and flexible demand forecasting and delivery route proposals.
[0772] "Historical data" is previously collected information, such as sales history or weather information, that is used to train a predictive model.
[0773] "Collection and preprocessing means" refers to a series of processes that retrieve data using database queries or API requests, and then perform preprocessing such as missing value imputation, outlier correction, and normalization.
[0774] "Means for generating a predictive model" refers to a method of using preprocessed data to build and train a demand forecasting model using a machine learning algorithm (e.g., an LSTM network).
[0775] "Means for forecasting demand" refers to the process of forecasting future sales and demand volumes using the generated demand forecasting model.
[0776] "Real-time information" refers to the latest data that changes depending on the time of day, such as current traffic information and weather data.
[0777] "Means for calculating optimal routes" refers to the process of integrating predicted demand data with real-time information and using an algorithm (e.g., A algorithm) to determine the most efficient delivery route.
[0778] "User emotional state" refers to the psychological state, such as stress, joy, or sadness, that a user exhibits while interacting with a system.
[0779] "Means for analyzing emotional state" refers to the process of analyzing a user's voice or text input and using machine learning or natural language processing techniques to identify emotions.
[0780] "Means for adjusting system operation" refers to the process of changing the method of demand forecasting and delivery route suggestions based on the analyzed emotional state of the user, thereby providing the user with the optimal service.
[0781] This section describes the roles of the server, terminal, and user in an embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. Furthermore, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[0782] Sales data collection and preprocessing
[0783] Data collection
[0784] The server periodically collects past sales data and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the form of "sales_data.csv" and "weather_data.csv." Specifically, the required data is collected using SQL queries and API requests.
[0785] Data Cleaning
[0786] The server processes the collected sales data, imputes missing values, and handles outliers. Specifically, it uses Python's Pandas library to impute missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is treated as an outlier and corrected.
[0787] Data Combining and Normalization
[0788] The server joins the clean sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. This normalized data is then used for subsequent model training, specifically using Pandas' merge function or Scikit-learn's MinMaxScaler.
[0789] Generate a demand forecast model
[0790] Preparing the training data
[0791] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data and converts them into an appropriate format.
[0792] Splitting the model's training and test sets
[0793] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. Specifically, it uses the train_test_split function in Scikit-learn.
[0794] Building and training the model
[0795] The server uses the Keras library to build a long short-term memory (LSTM) network and trains the demand forecasting model using the training set. It sets hyperparameters such as the number of epochs, batch size, and learning rate to train the model.
[0796] Proposing optimal delivery routes based on prediction results
[0797] Demand forecasting
[0798] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for new data points. For example, when a user requests "next month's demand forecast," the server inputs the necessary data points and generates a demand forecast.
[0799] Obtaining real-time traffic information
[0800] The server retrieves real-time traffic information from external services such as Google Maps API, collects the latest traffic information through API requests, and calculates routes based on predicted demand.
[0801] Calculating the optimal delivery route
[0802] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This determines the most efficient route, taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0803] Delivery route presentation
[0804] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0805] Implementing the Emotion Engine
[0806] Emotion Engine Data Collection
[0807] As the user interacts with the system, the device collects the user's voice and text input, which builds a dataset for analyzing the emotional state.
[0808] Emotion analysis
[0809] The server analyzes the collected user input data and uses a machine learning algorithm to determine the emotional state, which infers multiple emotional states (e.g., joy, anger, sadness) from the user's input.
[0810] Emotional Feedback
[0811] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is under stress, it adds some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[0812] emotional display
[0813] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[0814] Examples and prompts
[0815] Example 1: Collecting and Preprocessing Sales Data
[0816] The server collects the sales data for fiscal year 2021 "sales_data.csv" and weather data "weather_data.csv" from the database, fills in missing values and removes outliers, then combines the data using the date as a key and performs normalization processing.
[0817] Example 2: Training a demand forecasting model
[0818] The server extracts a dataset with date and temperature as features and sales volume as the target variable, divides 80% of the data into a training set and 20% into a test set, and performs training using an LSTM model.
[0819] Example 3: Calculating the optimal delivery route
[0820] When a user requests a demand forecast for the next month, the server uses the LSTM model to predict demand, then obtains real-time traffic information using the Google Maps API and calculates the optimal delivery route using the A algorithm. The calculated route is displayed on the user's device.
[0821] Example 4: Using the Emotion Engine
[0822] When a user voice-inputs "I'm tired, I can't do this anymore," the server analyzes this and determines that the user is feeling stressed. As a result, the server makes adjustments such as adding leeway to the delivery route it provides and reducing the frequency of notifications.
[0823] Prompt Sentence Examples
[0824] "Predict next month's demand and calculate the optimal delivery route."
[0825] "Adjust routes and notifications to take into account the user's emotional state."
[0826] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0827] Step 1: Collect data
[0828] The server periodically collects past sales data (sales_data.csv) and weather data (weather_data.csv) from the database using SQL queries and API requests. The specific input is the SQL query "SELECT FROM sales WHERE year = 2021", and the output is the collected raw data.
[0829] Step 2: Preprocessing the data
[0830] The server preprocesses the collected data. Specifically, it uses the Python Pandas library to read "sales_data.csv" and "weather_data.csv," fills missing values with the median, and removes outliers. For example, it performs the operation df.fillna(df.median(), inplace=True), and the input is raw data and the output is clean data.
[0831] Step 3: Combining and normalizing the data
[0832] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. Specifically, it executes merged_data = pd.merge(sales_data, weather_data, on='date') and then uses scaler = MinMaxScaler(). The input is the cleaned individual data, and the output is the normalized merged data.
[0833] Step 4: Separation of features and target variable
[0834] The server separates the features (e.g., date, temperature) and the target variable (e.g., sales volume) from the normalized data. Specifically, it uses Pandas' iloc method to convert the data into an appropriate format. The input is the normalized data, and the output is a dataset containing the features and the target variable.
[0835] Step 5: Split the training and test sets
[0836] The server splits the dataset into an 80% training set and a 20% test set. It does this using Scikit-learn's train_test_split function, which takes as input a dataset containing features and a goal variable, and outputs a training set and a test set.
[0837] Step 6: Building and training the model
[0838] The server uses the Keras library to build an LSTM network and trains the model using the training set. Set the number of epochs to 50, the batch size to 32, and the learning rate to 0.001, and run model.fit(X_train, y_train, epochs=50, batch_size=32, validation_split=0.2). The input is the training set, and the output is the trained model.
[0839] Step 7: Demand forecasting
[0840] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for a new data point. It executes model.predict(new_data) with the new data point as input, and the output is the demand forecast result.
[0841] Step 8: Obtaining real-time traffic information
[0842] The server retrieves real-time traffic information using an external API (e.g., Google Maps API). It executes requests.get("https: / / maps.googleapis.com / maps / api / ..."), where the input is the API request parameters and the output is the real-time traffic information.
[0843] Step 9: Calculate the optimal delivery route
[0844] The server calculates the optimal delivery route using the A algorithm based on the predicted demand data and the acquired real-time traffic information. Using the pathfinding library, astar_algorithm(start_point, end_point, traffic_data) is executed, and the input is the demand data and traffic information, and the output is the optimal delivery route.
[0845] Step 10: Present delivery route
[0846] The server sends the calculated optimal delivery route to the user's device, which displays it in map or list format. The user can then create a delivery plan based on the route information provided. The input is the optimal delivery route data, and the output is the display information on the user's device.
[0847] Step 11: Collect emotion data
[0848] When a user interacts with the system, the device collects the user's input voice or text. It uses a speech recognition API to convert the voice data into text, which is then sent to a server for sentiment analysis. The input is voice or text data, and the output is text data sent to the server.
[0849] Step 12: Sentiment Analysis and Feedback
[0850] The server analyzes voice and text data to determine the user's emotional state. It uses machine learning algorithms to identify emotions and executes, for example, sentiment_analysis(input_text). If the user is in a stressful state, it adjusts the system's behavior and notification frequency. The input is the user's voice and text data, and the output is the analyzed emotional state and the adjustment of behavior based on that.
[0851] (Application example 2)
[0852] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0853] Conventional demand forecasting and delivery route calculation systems can propose optimal routes based on past sales data and real-time traffic information, but they cannot take the user's emotional state into account, making it difficult to build an efficient logistics process that adapts to the user's stress and emotional state.
[0854] The identification processing by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal transportation route based on the predicted demand data and real-time road information, means for analyzing user input data to determine the user's emotional state, and means for adjusting the demand forecast and transportation route based on the determined emotional state. This makes it possible to build an efficient and adaptive logistics process that takes the user's emotional state into consideration.
[0855] "Past sales data" refers to product sales records collected over a certain period of time.
[0856] "Weather Data" means meteorological information relating to a specific region and time, such as temperature, precipitation, and humidity.
[0857] "Preprocessing means" refers to a method or device that processes collected data, such as filling in missing values or correcting outliers, before analysis.
[0858] A "demand forecasting model" is an algorithm or machine learning model that predicts future demand based on past data.
[0859] "Real-time road information" refers to the latest information about roads, such as current traffic conditions, congestion information, and accident information.
[0860] An "optimal transportation route" is the most suitable route to reach a destination efficiently and quickly.
[0861] "User Input Data" means information provided by a user to a system, whether in speech, text, or other form.
[0862] An "emotional state" refers to a psychological state such as joy, anger, or sadness that a user feels.
[0863] "Means of discrimination" refers to methods or devices that analyze and identify specific information from collected data.
[0864] "Adjusting means" refers to a method or device that modifies the system's operation or plan based on the analysis results.
[0865] This section explains in detail the roles of the server, terminal, and user in the embodiment of the present invention. This system incorporates an emotion engine into demand forecasting and delivery route optimization, and realizes an efficient logistics process by taking into account the emotional state of the user.
[0866] Sales data collection and preprocessing
[0867] Data collection:
[0868] The server periodically collects historical sales and weather data from the sales database. The data is retrieved using SQL queries and API requests and stored in the local database as "sales_data.csv" and "weather_data.csv".
[0869] Data Cleaning:
[0870] The server performs data cleaning on the collected data, such as imputing missing values and correcting outliers. Here, Pandas is used to perform data frame operations, and SciPy is used to detect and correct outliers.
[0871] Data Combining and Normalization:
[0872] The server joins the sales data and weather data by date and normalizes them using a min-max scaler. This normalized data is used to train the demand forecasting model.
[0873] Generate a demand forecast model
[0874] Prepare the training data:
[0875] The server separates features such as date and temperature from target variables such as sales volume from the preprocessed data. The dataset is divided into an 80% training set and a 20% test set.
[0876] Building and training the model:
[0877] The server uses TensorFlow to build and train a LSTM (long short-term memory) network, which learns the relationship between features and the goal variable.
[0878] Proposing optimal delivery routes based on prediction results
[0879] Demand forecast:
[0880] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points.
[0881] Get real-time traffic information:
[0882] The server uses the Google Maps API to get real-time traffic information, including traffic conditions, congestion information, and accident information.
[0883] Calculating the optimal delivery route:
[0884] The server uses algorithm A to calculate the optimal delivery route based on predicted demand data and real-time traffic information.
[0885] Delivery route suggestions:
[0886] The device calculates the optimal delivery route and provides it to the user, who can then display the route information in map or list format on their smartphone or head-mounted display.
[0887] Implementing the Emotion Engine
[0888] Emotion Engine Data Collection:
[0889] As the user interacts with the system, the device collects the user's voice and text data.
[0890] Emotion analysis:
[0891] The server analyzes the collected data using the BERT model to determine the user's emotional state, and outputs the result as a rating such as "high stress."
[0892] Emotional Feedback:
[0893] The server adjusts demand forecasts and transportation routes based on the user's emotional state. For users in a stressed state, the server provides route planning with more leeway and adjusts notification frequency.
[0894] Specific examples
[0895] Example 1: Collecting and Preprocessing Sales Data
[0896] The server periodically collects the past year's worth of sales data ("sales_data.csv") and monthly weather data ("weather_data.csv") from the sales database, and performs data cleaning and normalization.
[0897] Example 2: Training a demand forecasting model
[0898] The server trains a demand forecasting model using an LSTM network from the preprocessed dataset, using date and temperature as features and sales volume as the target variable.
[0899] Example 3: Calculating the optimal delivery route
[0900] When a user requests a demand forecast for the next month, the server uses the trained model to predict demand and obtains real-time traffic information through the Google Maps API, then calculates the optimal delivery route using the A algorithm.
[0901] Example 4: Using the Emotion Engine
[0902] When a user interacts with the system, the device collects the user's voice data. The server analyzes this data using the BERT model and determines whether the user is stressed. As a result, the server provides more leeway in the delivery route and reduces the frequency of notifications.
[0903] Examples of prompt statements
[0904] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[0905] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[0906] Step 1: Data collection
[0907] The server collects data from the sales database and an external weather data provider. Input data includes past sales records and weather information. This data is retrieved through SQL queries and API requests and saved as "sales_data.csv" and "weather_data.csv." A regularly scheduled job automatically retrieves the data and saves it in local storage.
[0908] Step 2: Data cleaning
[0909] The server reads the saved sales data and weather data and performs missing value imputation and outlier processing. The input data includes "sales_data.csv" and "weather_data.csv" collected in Step 1. Specifically, it uses the Pandas library to perform data frame operations, imputes missing values with the median, and uses SciPy to detect and correct outliers. The output is a clean dataset.
[0910] Step 3: Data joining and normalization
[0911] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. The input data includes the data cleaned in Step 2. Specifically, it performs data joining using Pandas and converts the data to the range of 0 to 1 using a min-max scaler in scikit-learn. The output is a normalized dataset.
[0912] Step 4: Separating features and target variables and preparing a training set
[0913] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. The input data includes the data normalized in Step 3. Specifically, it uses Pandas to extract the necessary columns and uses scikit-learn to split the dataset into an 80% training set and a 20% test set. The output is a training set and a test set.
[0914] Step 5: Build and train your demand forecasting model
[0915] The server uses TensorFlow to build and train an LSTM network. The input data includes the training set prepared in Step 4. Specifically, it defines an LSTM model and sets hyperparameters such as the number of epochs and batch size to train the model. The output is a trained demand forecasting model.
[0916] Step 6: Demand forecasting
[0917] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. The input data includes the new data points provided by the user at the time of the request. Specifically, the server inputs the new data into the LSTM model to obtain the demand forecast result. The output is the predicted demand data.
[0918] Step 7: Obtaining real-time traffic information
[0919] The server uses the Google Maps API to obtain real-time traffic information. The input data includes delivery destination information. Specifically, it sends an API request to the Google Maps API to obtain real-time data such as traffic conditions, congestion information, and accident information. The output is real-time traffic information.
[0920] Step 8: Calculate the optimal delivery route
[0921] The server uses algorithm A to calculate the optimal delivery route based on the predicted demand data and real-time traffic information. The input data includes the demand forecast data from Step 6 and the traffic information from Step 7. Specifically, it runs algorithm A to calculate the shortest route. The output is the optimal delivery route.
[0922] Step 9: Present delivery route
[0923] The terminal provides the calculated optimal delivery route to the user. The input data includes the delivery route calculated in Step 8. Specific operations include displaying the route in map or list format on a smartphone or head-mounted display. The output is the presentation of route information to the user.
[0924] Step 10: Collecting Data for the Emotion Engine
[0925] When a user interacts with the system, the device collects the user's voice and text data. The input data includes the user's voice and text. Specifically, the device records and transmits data through a microphone or input field. The output is the collected user data.
[0926] Step 11: Sentiment Analysis
[0927] The server analyzes the collected data using the BERT model and determines the user's emotional state. The input data includes the speech and text data collected in Step 10. Specifically, it performs emotion analysis using the BERT model and quantifies the emotional state. The output is the determined emotional state.
[0928] Step 12: Emotional Feedback
[0929] The server adjusts demand forecasts and transportation routes based on the user's emotional state. The input data includes the emotional state determined in Step 11. Specific operations include generating and adjusting route plans and notification methods adapted to the emotional state. The output is the adjusted demand forecast and transportation route.
[0930] Examples of prompt statements
[0931] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[0932] The specific processing unit 290 transmits the result of the specific processing to the smart glasses 214. In the smart glasses 214, the control unit 46A causes the speaker 240 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[0933] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[0934] In the above embodiment, an example in which the specific processing is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the smart glasses 214.
[0935] [Third embodiment]
[0936] FIG. 5 shows an example of the configuration of a data processing system 310 according to the third embodiment.
[0937] 5, the data processing system 310 includes the data processing device 12 and a headset type terminal 314. An example of the data processing device 12 is a server.
[0938] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0939] The headset type terminal 314 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a display 343. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the display 343 are also connected to the bus 52.
[0940] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[0941] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[0942] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[0943] Fig. 6 shows an example of the main functions of the data processing device 12 and the headset type terminal 314. As shown in Fig. 6, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[0944] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0945] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0946] In the headset type terminal 314, a reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0947] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the headset type terminal 314 will be referred to as the "terminal."
[0948] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and AI model, and the terminal and user function as interfaces with the system.
[0949] Sales data collection and preprocessing
[0950] 1. Data Collection
[0951] The server periodically collects historical sales and weather data from a database, including using SQL queries and API requests to retrieve data from databases and external data providers.
[0952] 2. Data Cleaning
[0953] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values using the median or mean, and corrects outliers using statistical methods.
[0954] 3. Data Combination and Normalization
[0955] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[0956] Generate a demand forecast model
[0957] 1. Preparing training data
[0958] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data.
[0959] 2. Training the model
[0960] The server splits the data into a training set and a test set and trains a demand forecasting model using a long short-term memory (LSTM) network. The model learns the relationship between features and a target variable to predict future demand.
[0961] Proposing optimal delivery routes based on prediction results
[0962] 1. Demand forecast
[0963] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[0964] 2. Obtaining real-time traffic information
[0965] The server retrieves real-time traffic information from external services such as Google Maps API, collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[0966] 3. Calculating the optimal delivery route
[0967] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This determines the optimal route that minimizes delivery costs and time.
[0968] 4. Delivery route presentation
[0969] The server provides the calculated optimal delivery route to the user's terminal, allowing the user to create an actual delivery plan based on this.
[0970] Specific examples
[0971] Example 1: Collecting and Preprocessing Sales Data
[0972] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[0973] Example 2: Training a demand forecasting model
[0974] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[0975] Example 3: Calculating the optimal delivery route
[0976] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[0977] According to the above-described embodiment, the present invention can realize an efficient logistics process, reduce operational costs, and improve service quality.
[0978] The processing flow will be explained below.
[0979] Step 1:
[0980] The server collects historical sales and weather data from a database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[0981] Step 2:
[0982] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[0983] Step 3:
[0984] The server joins the sales data with the weather data. The join is performed using the date as the key. After joining, the data is normalized using a min-max scaler, converting all values to the range of 0 to 1. The normalized data obtained from this step is used for subsequent model training.
[0985] Step 4:
[0986] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[0987] Step 5:
[0988] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[0989] Step 6:
[0990] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[0991] Step 7:
[0992] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[0993] Step 8:
[0994] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[0995] Step 9:
[0996] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[0997] Step 10:
[0998] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[0999] Example 1
[1000] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1001] In the logistics industry, calculating efficient delivery routes and accurate demand forecasting are essential for reducing operational costs and improving service quality. However, conventional systems have problems such as manual data collection, inaccurate forecasting models, and a lack of integration of real-time traffic information, making it difficult to calculate optimal delivery routes. This has led to issues such as reduced delivery efficiency and increased costs.
[1002] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[1003] In this invention, the server includes means for periodically collecting past sales data and weather data from a sales database and a weather database, means for cleaning the collected data and combining the data using a date key, means for normalizing the data to a range of 0 to 1, means for separating features and a target variable based on the preprocessed sales data and weather data, means for generating a demand forecasting model using an LSTM network, means for predicting future demand using the generated LSTM demand forecasting model, and means for acquiring traffic information based on the demand forecasting data and calculating an optimal delivery route using the A algorithm. This makes it possible to accurately collect and preprocess sales data and weather data, generate a highly accurate demand forecasting model, and calculate an optimal delivery route by integrating real-time traffic information.
[1004] "Sales Data" refers to information about sales of goods or services made within a specific period of time, and typically includes the sales quantity, sales price, and sales date and time of each product.
[1005] "Weather Data" refers to information relating to the weather, temperature, precipitation, wind speed, and other climate information for a particular region or period.
[1006] An "LSTM network" is a type of recurrent neural network (RNN) used to learn long-term and short-term dependencies, and is a model suitable for time-series data analysis such as demand forecasting.
[1007] "Demand forecasting model" refers to a statistical or machine learning model used to predict future demand based on past data.
[1008] "Traffic information" refers to information on real-time traffic conditions such as road congestion, traffic jam information, traffic accidents, and road construction.
[1009] The "A algorithm" is a type of graph search algorithm and refers to a computational technique used to efficiently find the shortest path from a start node to a goal node.
[1010] "Data cleaning" refers to the part of data preprocessing that deals with missing values and outliers and formats data accurately and consistently.
[1011] "Normalization" refers to a data preprocessing technique that makes it easier to compare data of different scales by scaling the data values to a specific range (usually 0 to 1).
[1012] "Features" are the parts of the data that are input into a predictive model, and refer to the independent variables and explanatory variables used in the prediction.
[1013] A "target variable" is the part of the data that is predicted by a predictive model, and refers to the dependent variable or response variable.
[1014] "Third-party data provision services" generally refer to services provided by companies or organizations that provide external data, and data is generally obtained through APIs.
[1015] An "inner partial join" is a database operation that joins two tables and selects only rows with matching keys.
[1016] The present invention is embodied in a form that specifically explains the roles of the server, the terminal, and the user. Each part of the system and the processing flow will be explained in detail below.
[1017] Server Roles
[1018] Data collection:
[1019] The server periodically collects past sales and weather data from the sales and weather databases. This data is obtained using SQL queries and API requests. As a specific example, the server executes a query such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" on the sales database. Similarly, the server executes a query such as "SELECT FROM weather_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" on the weather database.
[1020] Data cleaning and preprocessing:
[1021] The server cleans the collected data and imputes missing and outlier values. This process uses libraries such as Pandas, and missing values are imputed using the median or mean. Outliers are also detected and statistically corrected using the interquartile range method. Next, the sales data and weather data are internally joined by date key, and the data is normalized to a range of 0 to 1 using a min-max scaler.
[1022] Feature and target variable selection:
[1023] The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). The features are used as input data, and the target variables are used as training data for the prediction model.
[1024] Generate a demand forecast model:
[1025] The server generates a demand forecasting model using a long short-term memory (LSTM) network. Using libraries such as TensorFlow or Keras, the data is divided into a training set (80%) and a test set (20%), and the LSTM network is trained.
[1026] Demand forecast:
[1027] When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict demand for new data points, and the forecast results are provided to the user as numerical data.
[1028] Get real-time traffic information and calculate delivery routes:
[1029] The server obtains real-time traffic information using Google Maps API, etc. Based on this information, it calculates the optimal delivery route using the A algorithm. The calculated route is sent to the user's device and used as the basis for delivery planning.
[1030] Device Role
[1031] Data display:
[1032] The terminal displays the demand forecast results and optimal delivery routes sent from the server on its interface, which the user can refer to to create a delivery plan.
[1033] User Roles
[1034] Demand forecast request:
[1035] A user requests a demand forecast for a specific period from the system, and the request is sent to the server via a terminal.
[1036] Delivery planning:
[1037] The user creates and implements an actual delivery plan based on the optimal delivery route provided by the server.
[1038] Specific prompt examples
[1039] Below are some examples of prompt sentences.
[1040] Please forecast demand for the next month.
[1041]
[1042] Get real-time traffic information.
[1043] In this way, the present invention can accurately collect sales data and weather data, perform demand forecasts with high accuracy, and calculate optimal delivery routes, thereby realizing efficient logistics processes and reducing operational costs.
[1044] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1045] Step 1: Collect data
[1046] Input: Database connection information and API key.
[1047] How it works: The server periodically collects historical sales and weather data from the sales and weather databases using SQL queries and API requests, such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'".
[1048] Output: Get sales data (e.g. "sales_data.csv") and weather data (e.g. "weather_data.csv").
[1049] Step 2: Clean and preprocess the data
[1050] Inputs: Sales and weather data collected in step 1.
[1051] How it works: The server uses the Pandas library to read the data, impute missing values with the median or mean, correct outliers using the interquartile range method, and perform an inner join between the sales data and the weather data on the date key.
[1052] Output: Cleaned and combined data.
[1053] Step 3: Normalize the data
[1054] Input: The cleaned and combined data from step 2.
[1055] How it works: The server applies a Min-Max scaler to scale the data to the range 0 to 1. Specifically, it runs the code "scaler = MinMaxScaler()" and scales it as follows: "scaled_data = scaler.fit_transform(data)".
[1056] Output: Normalized data.
[1057] Step 4: Selecting features and target variables
[1058] Input: The normalized data from step 3.
[1059] Operation: The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). Specifically, it performs a process of cutting out columns in the data frame and separating them into input data and output data.
[1060] Output: Feature data and target variable data.
[1061] Step 5: Train the demand forecasting model
[1062] Input: Feature data and target variable data obtained in step 4.
[1063] How it works: The server splits the data into a training set (80%) and a test set (20%), and trains an LSTM network using TensorFlow or Keras. For example, run the code "model.fit(X_train, y_train, epochs=50, batch_size=32)".
[1064] Output: A trained LSTM demand forecasting model.
[1065] Step 6: Run a demand forecast
[1066] Input: User forecast request and new data points.
[1067] How it works: When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict the demand, e.g., "model.predict(new_data)".
[1068] Output: Future demand forecast results.
[1069] Step 7: Obtaining real-time traffic information
[1070] Input: Demand forecast results and Google Maps API key.
[1071] How it works: The server sends a request to the Google Maps API to get real-time traffic information. Specifically, it executes an API request like "requests.get(URL)" and parses the JSON response.
[1072] Output: Real-time traffic information.
[1073] Step 8: Calculate the optimal delivery route
[1074] Inputs: Demand forecast results from Step 6 and real-time traffic information from Step 7.
[1075] How it works: The server uses the A algorithm to calculate the optimal delivery route based on predicted demand data and real-time traffic information. For example, it executes code like "astar_algorithm(start_node, end_node, graph)".
[1076] Output: Optimal delivery route.
[1077] Step 9: Present delivery route
[1078] Input: The optimal delivery route calculated in step 8.
[1079] Operation: The server sends the calculated optimal delivery route to the user's terminal, which displays it on its interface.
[1080] Output: The optimal delivery route presented to the user.
[1081] Through these steps, the system can efficiently and accurately forecast demand and provide optimal delivery routes.
[1082] (Application example 1)
[1083] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1084] In logistics processes, it is necessary to effectively utilize sales data and weather data to forecast demand and calculate optimal delivery routes based on real-time traffic information. However, it is technically difficult to process and analyze this data in real time, resulting in an inefficient logistics process. Furthermore, current systems have limitations in the accuracy of their predictive models and the scenarios they can apply, meaning their effectiveness in actual operations cannot be guaranteed.
[1085] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[1086] In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed sales data and weather data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal delivery route based on the predicted demand data and real-time traffic information, means for acquiring real-time traffic information from an external service, and means for displaying the optimal delivery route. This makes it possible to perform highly accurate demand forecasts based on the collected data and propose optimal delivery routes.
[1087] "Past sales data" refers to information about sales of products or services in previous periods, and includes specific data such as sales quantity, sales amount, and product category.
[1088] "Weather Data" means information regarding weather conditions, such as temperature, precipitation, wind speed, and humidity, for a particular region and time period.
[1089] "Preprocessing" refers to the procedure of preparing collected data in a format suitable for data analysis and model training by filling in missing values, correcting outliers, and normalizing the data.
[1090] A "demand forecasting model" refers to a machine learning model for predicting future demand based on past sales data and weather data, and in particular uses algorithms such as long short-term memory (LSTM) networks.
[1091] "Real-time traffic information" refers to data that reflects current traffic conditions, including information on traffic congestion, road closures, and travel speeds.
[1092] "External Services" refers to services such as web APIs and data feeds provided by external data providers, which typically operate independently of a company's applications.
[1093] "Optimal delivery route" refers to a method of calculating a route that minimizes delivery costs and time based on demand forecast results and real-time traffic information.
[1094] "Display" refers to presenting the calculated optimal delivery route and prediction results on the user interface of a smart device, robot, etc.
[1095] MODE FOR CARRYING OUT THE INVENTION
[1096] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and machine learning model, and the terminal and user function as interfaces with the system.
[1097] Sales and weather data collection and preprocessing
[1098] 1. Data Collection
[1099] The server periodically collects historical sales and weather data from the database, which involves using SQL queries and API requests to retrieve data from the database and external data providers.
[1100] 2. Data Cleaning
[1101] The server processes the collected data, imputes missing values, and corrects outliers. This process includes imputing missing values using medians and means, and correcting outliers using statistical methods.
[1102] 3. Data Combination and Normalization
[1103] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[1104] Generate a demand forecast model
[1105] 1. Preparing training data
[1106] The server separates features (e.g., date, temperature, etc.) and target variables (e.g., sales volume) from the preprocessed data.
[1107] 2. Training the model
[1108] The server divides the data into a training set and a test set, and trains a demand forecasting model using a long short-term memory (LSTM) network or similar. This model learns the relationship between features and a target variable to predict future demand.
[1109] Proposing optimal delivery routes based on prediction results
[1110] 1. Demand forecast
[1111] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[1112] 2. Obtaining real-time traffic information
[1113] The server obtains real-time traffic information from external services (e.g., APIs of map services) by collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[1114] 3. Calculating the optimal delivery route
[1115] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A.
[1116] 4. Delivery route presentation
[1117] The server provides the calculated optimum delivery route to the user's terminal and displays it.
[1118] Specific examples
[1119] Sales data collection and pre-processing:
[1120] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[1121] Train the demand forecasting model:
[1122] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using a long short-term memory (LSTM) network.
[1123] Calculating the best delivery route:
[1124] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the map service's API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[1125] Example prompt sentence:
[1126] Create a Python program for an application that uses sales data and weather data for fiscal year 2021 to forecast sales demand for the next month and suggests the optimal delivery route using a map service API.
[1127] This embodiment makes it possible to realize an efficient logistics process, reduce operational costs, and improve service quality.
[1128] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1129] Step 1:
[1130] Data collection
[1131] The server collects historical sales and weather data from a sales database and an external weather data service. Specifically, the server retrieves this data from the database and external data provider using SQL queries and API requests. The inputs for this step are the database and API endpoints, and the output is the raw sales and weather data.
[1132] Step 2:
[1133] Data Cleaning
[1134] The server performs missing value imputation and outlier processing on the collected sales and weather data. Specifically, the server imputes missing values with the median or mean and corrects outliers using statistical methods. The input for this step is raw data, and the output is cleaned sales and weather data.
[1135] Step 3:
[1136] Data Combining and Normalization
[1137] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. Specifically, the server merges the data based on the date and uses a scaler to convert all values to the range of 0 to 1. The input of this step is the cleaned data, and the output is the normalized data.
[1138] Step 4:
[1139] Preparing the training data
[1140] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. Specifically, the server extracts the necessary columns and creates a training set and a test set. The input of this step is the normalized data, and the output is a training set and a test set.
[1141] Step 5:
[1142] Training the model
[1143] The server trains a long short-term memory (LSTM) network using the training set. Specifically, the server inputs the training set into the LSTM model and trains it epoch by epoch. The input of this step is the training set, and the output is a trained demand forecasting model.
[1144] Step 6:
[1145] Demand forecasting
[1146] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. Specifically, the user submits a request, and the server inputs the necessary data into the model to perform the forecast. The inputs for this step are the user's request and the new data points, and the output is the demand forecast result.
[1147] Step 7:
[1148] Obtaining real-time traffic information
[1149] The server obtains real-time traffic information from an external traffic information service. Specifically, the server sends an API request to obtain traffic conditions and congestion information. The input of this step is the API endpoint of the traffic information service, and the output is the obtained real-time traffic information.
[1150] Step 8:
[1151] Calculating the optimal delivery route
[1152] The server uses algorithm A to calculate the optimal delivery route based on the demand forecast results and real-time traffic information. Specifically, the server inputs the necessary data into algorithm A and calculates the optimal route. The inputs for this step are the demand forecast results and real-time traffic information, and the output is the optimal delivery route.
[1153] Step 9:
[1154] Delivery route presentation
[1155] The server provides the calculated optimal delivery route to the user's terminal and displays it. Specifically, the server sends the calculation result to the user's smart device and displays the route on the user interface. The input of this step is the optimal delivery route, and the output is the delivery route displayed on the terminal.
[1156] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[1157] The following describes in detail the roles of the server, terminal, and user in the embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. In addition, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[1158] Sales data collection and preprocessing
[1159] 1. Data Collection
[1160] The server periodically collects historical sales and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[1161] 2. Data Cleaning
[1162] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[1163] 3. Data Combination and Normalization
[1164] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the range 0 to 1. This normalized data is used for subsequent model training.
[1165] Generate a demand forecast model
[1166] 1. Preparing training data
[1167] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[1168] 2. Training the model
[1169] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[1170] 3. Building and training the model
[1171] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[1172] Proposing optimal delivery routes based on prediction results
[1173] 1. Demand forecast
[1174] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[1175] 2. Obtaining real-time traffic information
[1176] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[1177] 3. Calculating the optimal delivery route
[1178] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[1179] 4. Delivery route presentation
[1180] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[1181] Implementing the Emotion Engine
[1182] 1. Emotion Engine Data Collection
[1183] As users interact with the system, the device collects their speech and text inputs, which builds a dataset for analyzing their emotional state.
[1184] 2. Emotion analysis
[1185] The server analyzes the collected user input data and determines the emotional state. The emotion engine uses machine learning algorithms to estimate multiple emotional states (e.g., joy, anger, sadness) from the user input.
[1186] 3. Emotional Feedback
[1187] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is stressed, the system will add some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[1188] 4. Emotional display
[1189] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[1190] Specific examples
[1191] Example 1: Collecting and Preprocessing Sales Data
[1192] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[1193] Example 2: Training a demand forecasting model
[1194] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[1195] Example 3: Calculating the optimal delivery route
[1196] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[1197] Example 4: Using the Emotion Engine
[1198] When a user interacts with the system, the device collects the user's voice input. The server analyzes this voice data and determines whether the user is feeling stressed. Based on this, the server makes adjustments such as adding leeway to the delivery route provided and reducing the frequency of notifications.
[1199] According to the above-described embodiments, the present invention can realize an efficient and emotionally-conscious logistics process, thereby reducing operational costs and improving service quality.
[1200] The processing flow will be explained below.
[1201] Step 1:
[1202] The server collects past sales data and weather data from the database. Specifically, it uses SQL queries and API requests to retrieve sales information (e.g., product name, number of sales, and sales date and time) and weather information (e.g., temperature and precipitation amount by date) in the files "sales_data.csv" and "weather_data.csv."
[1203] Step 2:
[1204] The server cleans the collected data. Missing values are filled in with the mean or median of the middle range, and outliers are detected and corrected using statistical methods. For example, if an abnormally high sales figure is found, it is compared with surrounding data and corrected to a reasonable value.
[1205] Step 3:
[1206] The server joins the sales data and weather data using the date as a key. This results in a single data frame containing the weather information corresponding to each sales data. After joining, a min-max scaler is used to normalize all values to the range 0 to 1.
[1207] Step 4:
[1208] The server separates the features and target variables from the preprocessed data. The features include information such as date, temperature, and weather, and the target variable is sales volume. This formats the data so that the model can predict the target variable from the features.
[1209] Step 5:
[1210] The server splits the data into a training set and a test set, typically 80% for the training set and 20% for the test set, allowing a portion of the dataset to be used to evaluate the generality of the model.
[1211] Step 6:
[1212] The server trains a demand forecasting model using a long short-term memory (LSTM) network. It uses the training set to learn the relationship between features and the target variable, and optimizes the model by setting hyperparameters such as 50 epochs and a batch size of 32.
[1213] Step 7:
[1214] The device collects the user's voice input and text data. For example, it records the user's voice and messages when they make inquiries to the system. It may also collect the user's facial expression data and use it for emotion analysis.
[1215] Step 8:
[1216] The server analyzes the collected user voice and text data to determine the user's emotional state. Using an emotion engine, it assigns emotion tags (e.g., joy, anger, sadness) based on the user's voice tone, speed, and text content.
[1217] Step 9:
[1218] The server adjusts demand forecasts and delivery routes based on the results of emotion analysis. For example, if the user is feeling stressed, it will allow some leeway in the delivery plan. It also adjusts notification methods and timing to optimize the system to reduce the user's mental burden.
[1219] Step 10:
[1220] The server calculates the optimal delivery route according to the user's emotional state. Based on the latest demand forecast results and real-time traffic information, it uses the A algorithm to determine an efficient delivery route and provides it to the user.
[1221] Step 11:
[1222] The server then displays the calculated optimal delivery route on the user's device. The route information displayed includes the route on a map, highways and intersections to avoid, and estimated travel time. Users can use this information to quickly and effectively plan their delivery.
[1223] Based on the above steps, the present invention provides a system that integrates sales data and user emotion data to forecast demand and propose optimal delivery routes. By using this system, it is possible to improve the efficiency of logistics processes and increase user satisfaction.
[1224] Example 2
[1225] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1226] Conventional demand forecasting systems were able to predict demand based on past data and calculate optimal delivery routes. However, these systems did not take into account the user's emotional state and were unable to withstand the effects of user stress and emotional fluctuations. This resulted in a decrease in the accuracy of efficient route calculations and demand forecasts. Furthermore, there was a need for a flexible system that could take real-time information into account.
[1227] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[1228] In this invention, the server includes means for collecting and preprocessing past data, means for generating a prediction model based on the preprocessed data, means for predicting future demand using the generated prediction model, means for calculating an optimal route based on the predicted demand data and real-time information, and means for analyzing the emotional state of the user and adjusting the system operation based on the analysis results, thereby optimizing the system operation based on the emotional state of the user, enabling efficient and flexible demand forecasting and delivery route proposals.
[1229] "Historical data" is previously collected information, such as sales history or weather information, that is used to train a predictive model.
[1230] "Collection and preprocessing means" refers to a series of processes that retrieve data using database queries or API requests, and then perform preprocessing such as missing value imputation, outlier correction, and normalization.
[1231] "Means for generating a predictive model" refers to a method of using preprocessed data to build and train a demand forecasting model using a machine learning algorithm (e.g., an LSTM network).
[1232] "Means for forecasting demand" refers to the process of forecasting future sales and demand volumes using the generated demand forecasting model.
[1233] "Real-time information" refers to the latest data that changes depending on the time of day, such as current traffic information and weather data.
[1234] "Means for calculating optimal routes" refers to the process of integrating predicted demand data with real-time information and using an algorithm (e.g., A algorithm) to determine the most efficient delivery route.
[1235] "User emotional state" refers to the psychological state, such as stress, joy, or sadness, that a user exhibits while interacting with a system.
[1236] "Means for analyzing emotional state" refers to the process of analyzing a user's voice or text input and using machine learning or natural language processing techniques to identify emotions.
[1237] "Means for adjusting system operation" refers to the process of changing the method of demand forecasting and delivery route suggestions based on the analyzed emotional state of the user, thereby providing the user with the optimal service.
[1238] This section describes the roles of the server, terminal, and user in an embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. Furthermore, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[1239] Sales data collection and preprocessing
[1240] Data collection
[1241] The server periodically collects past sales data and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the form of "sales_data.csv" and "weather_data.csv." Specifically, the required data is collected using SQL queries and API requests.
[1242] Data Cleaning
[1243] The server processes the collected sales data, imputes missing values, and handles outliers. Specifically, it uses Python's Pandas library to impute missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is treated as an outlier and corrected.
[1244] Data Combining and Normalization
[1245] The server joins the clean sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. This normalized data is then used for subsequent model training, specifically using Pandas' merge function or Scikit-learn's MinMaxScaler.
[1246] Generate a demand forecast model
[1247] Preparing the training data
[1248] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data and converts them into an appropriate format.
[1249] Splitting the model's training and test sets
[1250] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. Specifically, it uses the train_test_split function in Scikit-learn.
[1251] Building and training the model
[1252] The server uses the Keras library to build a long short-term memory (LSTM) network and trains the demand forecasting model using the training set. It sets hyperparameters such as the number of epochs, batch size, and learning rate to train the model.
[1253] Proposing optimal delivery routes based on prediction results
[1254] Demand forecasting
[1255] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for new data points. For example, when a user requests "next month's demand forecast," the server inputs the necessary data points and generates a demand forecast.
[1256] Obtaining real-time traffic information
[1257] The server retrieves real-time traffic information from external services such as Google Maps API, collects the latest traffic information through API requests, and calculates routes based on predicted demand.
[1258] Calculating the optimal delivery route
[1259] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This determines the most efficient route, taking into account the priority, delivery cost, and time for multiple delivery destinations.
[1260] Delivery route presentation
[1261] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[1262] Implementing the Emotion Engine
[1263] Emotion Engine Data Collection
[1264] As the user interacts with the system, the device collects the user's voice and text input, which builds a dataset for analyzing the emotional state.
[1265] Emotion analysis
[1266] The server analyzes the collected user input data and uses a machine learning algorithm to determine the emotional state, which infers multiple emotional states (e.g., joy, anger, sadness) from the user's input.
[1267] Emotional Feedback
[1268] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is under stress, it adds some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[1269] emotional display
[1270] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[1271] Examples and prompts
[1272] Example 1: Collecting and Preprocessing Sales Data
[1273] The server collects the sales data for fiscal year 2021 "sales_data.csv" and weather data "weather_data.csv" from the database, fills in missing values and removes outliers, then combines the data using the date as a key and performs normalization processing.
[1274] Example 2: Training a demand forecasting model
[1275] The server extracts a dataset with date and temperature as features and sales volume as the target variable, divides 80% of the data into a training set and 20% into a test set, and performs training using an LSTM model.
[1276] Example 3: Calculating the optimal delivery route
[1277] When a user requests a demand forecast for the next month, the server uses the LSTM model to predict demand, then obtains real-time traffic information using the Google Maps API and calculates the optimal delivery route using the A algorithm. The calculated route is displayed on the user's device.
[1278] Example 4: Using the Emotion Engine
[1279] When a user voice-inputs "I'm tired, I can't do this anymore," the server analyzes this and determines that the user is feeling stressed. As a result, the server makes adjustments such as adding leeway to the delivery route it provides and reducing the frequency of notifications.
[1280] Prompt Sentence Examples
[1281] "Predict next month's demand and calculate the optimal delivery route."
[1282] "Adjust routes and notifications to take into account the user's emotional state."
[1283] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1284] Step 1: Collect data
[1285] The server periodically collects past sales data (sales_data.csv) and weather data (weather_data.csv) from the database using SQL queries and API requests. The specific input is the SQL query "SELECT FROM sales WHERE year = 2021", and the output is the collected raw data.
[1286] Step 2: Preprocessing the data
[1287] The server preprocesses the collected data. Specifically, it uses the Python Pandas library to read "sales_data.csv" and "weather_data.csv," fills missing values with the median, and removes outliers. For example, it performs the operation df.fillna(df.median(), inplace=True), and the input is raw data and the output is clean data.
[1288] Step 3: Combining and normalizing the data
[1289] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. Specifically, it executes merged_data = pd.merge(sales_data, weather_data, on='date') and then uses scaler = MinMaxScaler(). The input is the cleaned individual data, and the output is the normalized merged data.
[1290] Step 4: Separation of features and target variable
[1291] The server separates the features (e.g., date, temperature) and the target variable (e.g., sales volume) from the normalized data. Specifically, it uses Pandas' iloc method to convert the data into an appropriate format. The input is the normalized data, and the output is a dataset containing the features and the target variable.
[1292] Step 5: Split the training and test sets
[1293] The server splits the dataset into an 80% training set and a 20% test set. It does this using Scikit-learn's train_test_split function, which takes as input a dataset containing features and a goal variable, and outputs a training set and a test set.
[1294] Step 6: Building and training the model
[1295] The server uses the Keras library to build an LSTM network and trains the model using the training set. Set the number of epochs to 50, the batch size to 32, and the learning rate to 0.001, and run model.fit(X_train, y_train, epochs=50, batch_size=32, validation_split=0.2). The input is the training set, and the output is the trained model.
[1296] Step 7: Demand forecasting
[1297] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for a new data point. It executes model.predict(new_data) with the new data point as input, and the output is the demand forecast result.
[1298] Step 8: Obtaining real-time traffic information
[1299] The server retrieves real-time traffic information using an external API (e.g., Google Maps API). It executes requests.get("https: / / maps.googleapis.com / maps / api / ..."), where the input is the API request parameters and the output is the real-time traffic information.
[1300] Step 9: Calculate the optimal delivery route
[1301] The server calculates the optimal delivery route using the A algorithm based on the predicted demand data and the acquired real-time traffic information. Using the pathfinding library, astar_algorithm(start_point, end_point, traffic_data) is executed, and the input is the demand data and traffic information, and the output is the optimal delivery route.
[1302] Step 10: Present delivery route
[1303] The server sends the calculated optimal delivery route to the user's device, which displays it in map or list format. The user can then create a delivery plan based on the route information provided. The input is the optimal delivery route data, and the output is the display information on the user's device.
[1304] Step 11: Collect emotion data
[1305] When a user interacts with the system, the device collects the user's input voice or text. It uses a speech recognition API to convert the voice data into text, which is then sent to a server for sentiment analysis. The input is voice or text data, and the output is text data sent to the server.
[1306] Step 12: Sentiment Analysis and Feedback
[1307] The server analyzes voice and text data to determine the user's emotional state. It uses machine learning algorithms to identify emotions and executes, for example, sentiment_analysis(input_text). If the user is in a stressful state, it adjusts the system's behavior and notification frequency. The input is the user's voice and text data, and the output is the analyzed emotional state and the adjustment of behavior based on that.
[1308] (Application example 2)
[1309] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1310] Conventional demand forecasting and delivery route calculation systems can propose optimal routes based on past sales data and real-time traffic information, but they cannot take the user's emotional state into account, making it difficult to build an efficient logistics process that adapts to the user's stress and emotional state.
[1311] The identification processing by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal transportation route based on the predicted demand data and real-time road information, means for analyzing user input data to determine the user's emotional state, and means for adjusting the demand forecast and transportation route based on the determined emotional state. This makes it possible to build an efficient and adaptive logistics process that takes the user's emotional state into consideration.
[1312] "Past sales data" refers to product sales records collected over a certain period of time.
[1313] "Weather Data" means meteorological information relating to a specific region and time, such as temperature, precipitation, and humidity.
[1314] "Preprocessing means" refers to a method or device that processes collected data, such as filling in missing values or correcting outliers, before analysis.
[1315] A "demand forecasting model" is an algorithm or machine learning model that predicts future demand based on past data.
[1316] "Real-time road information" refers to the latest information about roads, such as current traffic conditions, congestion information, and accident information.
[1317] An "optimal transportation route" is the most suitable route to reach a destination efficiently and quickly.
[1318] "User Input Data" means information provided by a user to a system, whether in speech, text, or other form.
[1319] An "emotional state" refers to a psychological state such as joy, anger, or sadness that a user feels.
[1320] "Means of discrimination" refers to methods or devices that analyze and identify specific information from collected data.
[1321] "Adjusting means" refers to a method or device that modifies the system's operation or plan based on the analysis results.
[1322] This section explains in detail the roles of the server, terminal, and user in the embodiment of the present invention. This system incorporates an emotion engine into demand forecasting and delivery route optimization, and realizes an efficient logistics process by taking into account the emotional state of the user.
[1323] Sales data collection and preprocessing
[1324] Data collection:
[1325] The server periodically collects historical sales and weather data from the sales database. The data is retrieved using SQL queries and API requests and stored in the local database as "sales_data.csv" and "weather_data.csv".
[1326] Data Cleaning:
[1327] The server performs data cleaning on the collected data, such as imputing missing values and correcting outliers. Here, Pandas is used to perform data frame operations, and SciPy is used to detect and correct outliers.
[1328] Data Combining and Normalization:
[1329] The server joins the sales data and weather data by date and normalizes them using a min-max scaler. This normalized data is used to train the demand forecasting model.
[1330] Generate a demand forecast model
[1331] Prepare the training data:
[1332] The server separates features such as date and temperature from target variables such as sales volume from the preprocessed data. The dataset is divided into an 80% training set and a 20% test set.
[1333] Building and training the model:
[1334] The server uses TensorFlow to build and train a LSTM (long short-term memory) network, which learns the relationship between features and the goal variable.
[1335] Proposing optimal delivery routes based on prediction results
[1336] Demand forecast:
[1337] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points.
[1338] Get real-time traffic information:
[1339] The server uses the Google Maps API to get real-time traffic information, including traffic conditions, congestion information, and accident information.
[1340] Calculating the optimal delivery route:
[1341] The server uses algorithm A to calculate the optimal delivery route based on predicted demand data and real-time traffic information.
[1342] Delivery route suggestions:
[1343] The device calculates the optimal delivery route and provides it to the user, who can then display the route information in map or list format on their smartphone or head-mounted display.
[1344] Implementing the Emotion Engine
[1345] Emotion Engine Data Collection:
[1346] As the user interacts with the system, the device collects the user's voice and text data.
[1347] Emotion analysis:
[1348] The server analyzes the collected data using the BERT model to determine the user's emotional state, and outputs the result as a rating such as "high stress."
[1349] Emotional Feedback:
[1350] The server adjusts demand forecasts and transportation routes based on the user's emotional state. For users in a stressed state, the server provides route planning with more leeway and adjusts notification frequency.
[1351] Specific examples
[1352] Example 1: Collecting and Preprocessing Sales Data
[1353] The server periodically collects the past year's worth of sales data ("sales_data.csv") and monthly weather data ("weather_data.csv") from the sales database, and performs data cleaning and normalization.
[1354] Example 2: Training a demand forecasting model
[1355] The server trains a demand forecasting model using an LSTM network from the preprocessed dataset, using date and temperature as features and sales volume as the target variable.
[1356] Example 3: Calculating the optimal delivery route
[1357] When a user requests a demand forecast for the next month, the server uses the trained model to predict demand and obtains real-time traffic information through the Google Maps API, then calculates the optimal delivery route using the A algorithm.
[1358] Example 4: Using the Emotion Engine
[1359] When a user interacts with the system, the device collects the user's voice data. The server analyzes this data using the BERT model and determines whether the user is stressed. As a result, the server provides more leeway in the delivery route and reduces the frequency of notifications.
[1360] Examples of prompt statements
[1361] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[1362] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1363] Step 1: Data collection
[1364] The server collects data from the sales database and an external weather data provider. Input data includes past sales records and weather information. This data is retrieved through SQL queries and API requests and saved as "sales_data.csv" and "weather_data.csv." A regularly scheduled job automatically retrieves the data and saves it in local storage.
[1365] Step 2: Data cleaning
[1366] The server reads the saved sales data and weather data and performs missing value imputation and outlier processing. The input data includes "sales_data.csv" and "weather_data.csv" collected in Step 1. Specifically, it uses the Pandas library to perform data frame operations, imputes missing values with the median, and uses SciPy to detect and correct outliers. The output is a clean dataset.
[1367] Step 3: Data joining and normalization
[1368] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. The input data includes the data cleaned in Step 2. Specifically, it performs data joining using Pandas and converts the data to the range of 0 to 1 using a min-max scaler in scikit-learn. The output is a normalized dataset.
[1369] Step 4: Separating features and target variables and preparing a training set
[1370] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. The input data includes the data normalized in Step 3. Specifically, it uses Pandas to extract the necessary columns and uses scikit-learn to split the dataset into an 80% training set and a 20% test set. The output is a training set and a test set.
[1371] Step 5: Build and train your demand forecasting model
[1372] The server uses TensorFlow to build and train an LSTM network. The input data includes the training set prepared in Step 4. Specifically, it defines an LSTM model and sets hyperparameters such as the number of epochs and batch size to train the model. The output is a trained demand forecasting model.
[1373] Step 6: Demand forecasting
[1374] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. The input data includes the new data points provided by the user at the time of the request. Specifically, the server inputs the new data into the LSTM model to obtain the demand forecast result. The output is the predicted demand data.
[1375] Step 7: Obtaining real-time traffic information
[1376] The server uses the Google Maps API to obtain real-time traffic information. The input data includes delivery destination information. Specifically, it sends an API request to the Google Maps API to obtain real-time data such as traffic conditions, congestion information, and accident information. The output is real-time traffic information.
[1377] Step 8: Calculate the optimal delivery route
[1378] The server uses algorithm A to calculate the optimal delivery route based on the predicted demand data and real-time traffic information. The input data includes the demand forecast data from Step 6 and the traffic information from Step 7. Specifically, it runs algorithm A to calculate the shortest route. The output is the optimal delivery route.
[1379] Step 9: Present delivery route
[1380] The terminal provides the calculated optimal delivery route to the user. The input data includes the delivery route calculated in Step 8. Specific operations include displaying the route in map or list format on a smartphone or head-mounted display. The output is the presentation of route information to the user.
[1381] Step 10: Collecting Data for the Emotion Engine
[1382] When a user interacts with the system, the device collects the user's voice and text data. The input data includes the user's voice and text. Specifically, the device records and transmits data through a microphone or input field. The output is the collected user data.
[1383] Step 11: Sentiment Analysis
[1384] The server analyzes the collected data using the BERT model and determines the user's emotional state. The input data includes the speech and text data collected in Step 10. Specifically, it performs emotion analysis using the BERT model and quantifies the emotional state. The output is the determined emotional state.
[1385] Step 12: Emotional Feedback
[1386] The server adjusts demand forecasts and transportation routes based on the user's emotional state. The input data includes the emotional state determined in Step 11. Specific operations include generating and adjusting route plans and notification methods adapted to the emotional state. The output is the adjusted demand forecast and transportation route.
[1387] Examples of prompt statements
[1388] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[1389] The specific processing unit 290 transmits the result of the specific processing to the headset type terminal 314. In the headset type terminal 314, the control unit 46A causes the speaker 240 and the display 343 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[1390] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[1391] In the above embodiment, an example was given in which the specific processing is performed by the data processing device 12, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the headset type terminal 314.
[1392] [Fourth embodiment]
[1393] FIG. 7 shows an example of the configuration of a data processing system 410 according to the fourth embodiment.
[1394] 7, a data processing system 410 includes a data processing device 12 and a robot 414. An example of the data processing device 12 is a server.
[1395] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[1396] The robot 414 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a control target 443. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the control target 443 are also connected to the bus 52.
[1397] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[1398] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[1399] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[1400] The control object 443 includes a display device, LEDs in the eyes, and motors for driving the arms, hands, and feet. The posture and gestures of the robot 414 are controlled by controlling the motors of the arms, hands, and feet. Some of the emotions of the robot 414 can be expressed by controlling these motors. In addition, the facial expressions of the robot 414 can also be expressed by controlling the light emission state of the LEDs in the eyes of the robot 414.
[1401] Fig. 8 shows an example of the main functions of the data processing device 12 and the robot 414. As shown in Fig. 8, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[1402] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[1403] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[1404] In the robot 414, the processor 46 performs the reception output process. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[1405] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1406] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and AI model, and the terminal and user function as interfaces with the system.
[1407] Sales data collection and preprocessing
[1408] 1. Data Collection
[1409] The server periodically collects historical sales and weather data from a database, including using SQL queries and API requests to retrieve data from databases and external data providers.
[1410] 2. Data Cleaning
[1411] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values using the median or mean, and corrects outliers using statistical methods.
[1412] 3. Data Combination and Normalization
[1413] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[1414] Generate a demand forecast model
[1415] 1. Preparing training data
[1416] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data.
[1417] 2. Training the model
[1418] The server splits the data into a training set and a test set and trains a demand forecasting model using a long short-term memory (LSTM) network. The model learns the relationship between features and a target variable to predict future demand.
[1419] Proposing optimal delivery routes based on prediction results
[1420] 1. Demand forecast
[1421] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[1422] 2. Obtaining real-time traffic information
[1423] The server retrieves real-time traffic information from external services such as Google Maps API, collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[1424] 3. Calculating the optimal delivery route
[1425] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This determines the optimal route that minimizes delivery costs and time.
[1426] 4. Delivery route presentation
[1427] The server provides the calculated optimal delivery route to the user's terminal, allowing the user to create an actual delivery plan based on this.
[1428] Specific examples
[1429] Example 1: Collecting and Preprocessing Sales Data
[1430] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[1431] Example 2: Training a demand forecasting model
[1432] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[1433] Example 3: Calculating the optimal delivery route
[1434] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[1435] According to the above-described embodiment, the present invention can realize an efficient logistics process, reduce operational costs, and improve service quality.
[1436] The processing flow will be explained below.
[1437] Step 1:
[1438] The server collects historical sales and weather data from a database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[1439] Step 2:
[1440] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[1441] Step 3:
[1442] The server joins the sales data with the weather data. The join is performed using the date as the key. After joining, the data is normalized using a min-max scaler, converting all values to the range of 0 to 1. The normalized data obtained from this step is used for subsequent model training.
[1443] Step 4:
[1444] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[1445] Step 5:
[1446] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[1447] Step 6:
[1448] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[1449] Step 7:
[1450] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[1451] Step 8:
[1452] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[1453] Step 9:
[1454] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[1455] Step 10:
[1456] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[1457] Example 1
[1458] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1459] In the logistics industry, calculating efficient delivery routes and accurate demand forecasting are essential for reducing operational costs and improving service quality. However, conventional systems have problems such as manual data collection, inaccurate forecasting models, and a lack of integration of real-time traffic information, making it difficult to calculate optimal delivery routes. This has led to issues such as reduced delivery efficiency and increased costs.
[1460] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[1461] In this invention, the server includes means for periodically collecting past sales data and weather data from a sales database and a weather database, means for cleaning the collected data and combining the data using a date key, means for normalizing the data to a range of 0 to 1, means for separating features and a target variable based on the preprocessed sales data and weather data, means for generating a demand forecasting model using an LSTM network, means for predicting future demand using the generated LSTM demand forecasting model, and means for acquiring traffic information based on the demand forecasting data and calculating an optimal delivery route using the A algorithm. This makes it possible to accurately collect and preprocess sales data and weather data, generate a highly accurate demand forecasting model, and calculate an optimal delivery route by integrating real-time traffic information.
[1462] "Sales Data" refers to information about sales of goods or services made within a specific period of time, and typically includes the sales quantity, sales price, and sales date and time of each product.
[1463] "Weather Data" refers to information relating to the weather, temperature, precipitation, wind speed, and other climate information for a particular region or period.
[1464] An "LSTM network" is a type of recurrent neural network (RNN) used to learn long-term and short-term dependencies, and is a model suitable for time-series data analysis such as demand forecasting.
[1465] "Demand forecasting model" refers to a statistical or machine learning model used to predict future demand based on past data.
[1466] "Traffic information" refers to information on real-time traffic conditions such as road congestion, traffic jam information, traffic accidents, and road construction.
[1467] The "A algorithm" is a type of graph search algorithm and refers to a computational technique used to efficiently find the shortest path from a start node to a goal node.
[1468] "Data cleaning" refers to the part of data preprocessing that deals with missing values and outliers and formats data accurately and consistently.
[1469] "Normalization" refers to a data preprocessing technique that makes it easier to compare data of different scales by scaling the data values to a specific range (usually 0 to 1).
[1470] "Features" are the parts of the data that are input into a predictive model, and refer to the independent variables and explanatory variables used in the prediction.
[1471] A "target variable" is the part of the data that is predicted by a predictive model, and refers to the dependent variable or response variable.
[1472] "Third-party data provision services" generally refer to services provided by companies or organizations that provide external data, and data is generally obtained through APIs.
[1473] An "inner partial join" is a database operation that joins two tables and selects only rows with matching keys.
[1474] The present invention is embodied in a form that specifically explains the roles of the server, the terminal, and the user. Each part of the system and the processing flow will be explained in detail below.
[1475] Server Roles
[1476] Data collection:
[1477] The server periodically collects past sales and weather data from the sales and weather databases. This data is obtained using SQL queries and API requests. As a specific example, the server executes a query such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" on the sales database. Similarly, the server executes a query such as "SELECT FROM weather_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'" on the weather database.
[1478] Data cleaning and preprocessing:
[1479] The server cleans the collected data and imputes missing and outlier values. This process uses libraries such as Pandas, and missing values are imputed using the median or mean. Outliers are also detected and statistically corrected using the interquartile range method. Next, the sales data and weather data are internally joined by date key, and the data is normalized to a range of 0 to 1 using a min-max scaler.
[1480] Feature and target variable selection:
[1481] The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). The features are used as input data, and the target variables are used as training data for the prediction model.
[1482] Generate a demand forecast model:
[1483] The server generates a demand forecasting model using a long short-term memory (LSTM) network. Using libraries such as TensorFlow or Keras, the data is divided into a training set (80%) and a test set (20%), and the LSTM network is trained.
[1484] Demand forecast:
[1485] When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict demand for new data points, and the forecast results are provided to the user as numerical data.
[1486] Get real-time traffic information and calculate delivery routes:
[1487] The server obtains real-time traffic information using Google Maps API, etc. Based on this information, it calculates the optimal delivery route using the A algorithm. The calculated route is sent to the user's device and used as the basis for delivery planning.
[1488] Device Role
[1489] Data display:
[1490] The terminal displays the demand forecast results and optimal delivery routes sent from the server on its interface, which the user can refer to to create a delivery plan.
[1491] User Roles
[1492] Demand forecast request:
[1493] A user requests a demand forecast for a specific period from the system, and the request is sent to the server via a terminal.
[1494] Delivery planning:
[1495] The user creates and implements an actual delivery plan based on the optimal delivery route provided by the server.
[1496] Specific prompt examples
[1497] Below are some examples of prompt sentences.
[1498] Please forecast demand for the next month.
[1499]
[1500] Get real-time traffic information.
[1501] In this way, the present invention can accurately collect sales data and weather data, perform demand forecasts with high accuracy, and calculate optimal delivery routes, thereby realizing efficient logistics processes and reducing operational costs.
[1502] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1503] Step 1: Collect data
[1504] Input: Database connection information and API key.
[1505] How it works: The server periodically collects historical sales and weather data from the sales and weather databases using SQL queries and API requests, such as "SELECT FROM sales_data WHERE date BETWEEN '2021-01-01' AND '2021-12-31'".
[1506] Output: Get sales data (e.g. "sales_data.csv") and weather data (e.g. "weather_data.csv").
[1507] Step 2: Clean and preprocess the data
[1508] Inputs: Sales and weather data collected in step 1.
[1509] How it works: The server uses the Pandas library to read the data, impute missing values with the median or mean, correct outliers using the interquartile range method, and perform an inner join between the sales data and the weather data on the date key.
[1510] Output: Cleaned and combined data.
[1511] Step 3: Normalize the data
[1512] Input: The cleaned and combined data from step 2.
[1513] How it works: The server applies a Min-Max scaler to scale the data to the range 0 to 1. Specifically, it runs the code "scaler = MinMaxScaler()" and scales it as follows: "scaled_data = scaler.fit_transform(data)".
[1514] Output: Normalized data.
[1515] Step 4: Selecting features and target variables
[1516] Input: The normalized data from step 3.
[1517] Operation: The server uses the preprocessed data to separate features (e.g., date, temperature) and target variables (e.g., sales volume). Specifically, it performs a process of cutting out columns in the data frame and separating them into input data and output data.
[1518] Output: Feature data and target variable data.
[1519] Step 5: Train the demand forecasting model
[1520] Input: Feature data and target variable data obtained in step 4.
[1521] How it works: The server splits the data into a training set (80%) and a test set (20%), and trains an LSTM network using TensorFlow or Keras. For example, run the code "model.fit(X_train, y_train, epochs=50, batch_size=32)".
[1522] Output: A trained LSTM demand forecasting model.
[1523] Step 6: Run a demand forecast
[1524] Input: User forecast request and new data points.
[1525] How it works: When a user requests a demand forecast for a specific time period, the server uses the trained LSTM model to predict the demand, e.g., "model.predict(new_data)".
[1526] Output: Future demand forecast results.
[1527] Step 7: Obtaining real-time traffic information
[1528] Input: Demand forecast results and Google Maps API key.
[1529] How it works: The server sends a request to the Google Maps API to get real-time traffic information. Specifically, it executes an API request like "requests.get(URL)" and parses the JSON response.
[1530] Output: Real-time traffic information.
[1531] Step 8: Calculate the optimal delivery route
[1532] Inputs: Demand forecast results from Step 6 and real-time traffic information from Step 7.
[1533] How it works: The server uses the A algorithm to calculate the optimal delivery route based on predicted demand data and real-time traffic information. For example, it executes code like "astar_algorithm(start_node, end_node, graph)".
[1534] Output: Optimal delivery route.
[1535] Step 9: Present delivery route
[1536] Input: The optimal delivery route calculated in step 8.
[1537] Operation: The server sends the calculated optimal delivery route to the user's terminal, which displays it on its interface.
[1538] Output: The optimal delivery route presented to the user.
[1539] Through these steps, the system can efficiently and accurately forecast demand and provide optimal delivery routes.
[1540] (Application example 1)
[1541] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1542] In logistics processes, it is necessary to effectively utilize sales data and weather data to forecast demand and calculate optimal delivery routes based on real-time traffic information. However, it is technically difficult to process and analyze this data in real time, resulting in an inefficient logistics process. Furthermore, current systems have limitations in the accuracy of their predictive models and the scenarios they can apply, meaning their effectiveness in actual operations cannot be guaranteed.
[1543] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[1544] In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed sales data and weather data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal delivery route based on the predicted demand data and real-time traffic information, means for acquiring real-time traffic information from an external service, and means for displaying the optimal delivery route. This makes it possible to perform highly accurate demand forecasts based on the collected data and propose optimal delivery routes.
[1545] "Past sales data" refers to information about sales of products or services in previous periods, and includes specific data such as sales quantity, sales amount, and product category.
[1546] "Weather Data" means information regarding weather conditions, such as temperature, precipitation, wind speed, and humidity, for a particular region and time period.
[1547] "Preprocessing" refers to the procedure of preparing collected data in a format suitable for data analysis and model training by filling in missing values, correcting outliers, and normalizing the data.
[1548] A "demand forecasting model" refers to a machine learning model for predicting future demand based on past sales data and weather data, and in particular uses algorithms such as long short-term memory (LSTM) networks.
[1549] "Real-time traffic information" refers to data that reflects current traffic conditions, including information on traffic congestion, road closures, and travel speeds.
[1550] "External Services" refers to services such as web APIs and data feeds provided by external data providers, which typically operate independently of a company's applications.
[1551] "Optimal delivery route" refers to a method of calculating a route that minimizes delivery costs and time based on demand forecast results and real-time traffic information.
[1552] "Display" refers to presenting the calculated optimal delivery route and prediction results on the user interface of a smart device, robot, etc.
[1553] MODE FOR CARRYING OUT THE INVENTION
[1554] As an embodiment of the present invention, the roles of the server, terminal, and user will be specifically described. In the following system, the server hosts the central database and machine learning model, and the terminal and user function as interfaces with the system.
[1555] Sales and weather data collection and preprocessing
[1556] 1. Data Collection
[1557] The server periodically collects historical sales and weather data from the database, which involves using SQL queries and API requests to retrieve data from the database and external data providers.
[1558] 2. Data Cleaning
[1559] The server processes the collected data, imputes missing values, and corrects outliers. This process includes imputing missing values using medians and means, and correcting outliers using statistical methods.
[1560] 3. Data Combination and Normalization
[1561] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the 0 to 1 range.
[1562] Generate a demand forecast model
[1563] 1. Preparing training data
[1564] The server separates features (e.g., date, temperature, etc.) and target variables (e.g., sales volume) from the preprocessed data.
[1565] 2. Training the model
[1566] The server divides the data into a training set and a test set, and trains a demand forecasting model using a long short-term memory (LSTM) network or similar. This model learns the relationship between features and a target variable to predict future demand.
[1567] Proposing optimal delivery routes based on prediction results
[1568] 1. Demand forecast
[1569] When a user requests a demand forecast for a specific time period, the server uses the trained model to predict demand for new data points.
[1570] 2. Obtaining real-time traffic information
[1571] The server obtains real-time traffic information from external services (e.g., APIs of map services) by collecting information such as traffic conditions, congestion information, and optimal routes through API requests.
[1572] 3. Calculating the optimal delivery route
[1573] The server calculates the optimal delivery route based on the demand forecast results and real-time traffic information using algorithms such as A.
[1574] 4. Delivery route presentation
[1575] The server provides the calculated optimum delivery route to the user's terminal and displays it.
[1576] Specific examples
[1577] Sales data collection and pre-processing:
[1578] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[1579] Train the demand forecasting model:
[1580] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using a long short-term memory (LSTM) network.
[1581] Calculating the best delivery route:
[1582] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the map service's API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[1583] Example prompt sentence:
[1584] Create a Python program for an application that uses sales data and weather data for fiscal year 2021 to forecast sales demand for the next month and suggests the optimal delivery route using a map service API.
[1585] This embodiment makes it possible to realize an efficient logistics process, reduce operational costs, and improve service quality.
[1586] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1587] Step 1:
[1588] Data collection
[1589] The server collects historical sales and weather data from a sales database and an external weather data service. Specifically, the server retrieves this data from the database and external data provider using SQL queries and API requests. The inputs for this step are the database and API endpoints, and the output is the raw sales and weather data.
[1590] Step 2:
[1591] Data Cleaning
[1592] The server performs missing value imputation and outlier processing on the collected sales and weather data. Specifically, the server imputes missing values with the median or mean and corrects outliers using statistical methods. The input for this step is raw data, and the output is cleaned sales and weather data.
[1593] Step 3:
[1594] Data Combining and Normalization
[1595] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data using a min-max scaler. Specifically, the server merges the data based on the date and uses a scaler to convert all values to the range of 0 to 1. The input of this step is the cleaned data, and the output is the normalized data.
[1596] Step 4:
[1597] Preparing the training data
[1598] The server separates features (e.g., date, temperature) and target variables (e.g., sales volume) from the normalized data. Specifically, the server extracts the necessary columns and creates a training set and a test set. The input of this step is the normalized data, and the output is a training set and a test set.
[1599] Step 5:
[1600] Training the model
[1601] The server trains a long short-term memory (LSTM) network using the training set. Specifically, the server inputs the training set into the LSTM model and trains it epoch by epoch. The input of this step is the training set, and the output is a trained demand forecasting model.
[1602] Step 6:
[1603] Demand forecasting
[1604] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. Specifically, the user submits a request, and the server inputs the necessary data into the model to perform the forecast. The inputs for this step are the user's request and the new data points, and the output is the demand forecast result.
[1605] Step 7:
[1606] Obtaining real-time traffic information
[1607] The server obtains real-time traffic information from an external traffic information service. Specifically, the server sends an API request to obtain traffic conditions and congestion information. The input of this step is the API endpoint of the traffic information service, and the output is the obtained real-time traffic information.
[1608] Step 8:
[1609] Calculating the optimal delivery route
[1610] The server uses algorithm A to calculate the optimal delivery route based on the demand forecast results and real-time traffic information. Specifically, the server inputs the necessary data into algorithm A and calculates the optimal route. The inputs for this step are the demand forecast results and real-time traffic information, and the output is the optimal delivery route.
[1611] Step 9:
[1612] Delivery route presentation
[1613] The server provides the calculated optimal delivery route to the user's terminal and displays it. Specifically, the server sends the calculation result to the user's smart device and displays the route on the user interface. The input of this step is the optimal delivery route, and the output is the delivery route displayed on the terminal.
[1614] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[1615] The following describes in detail the roles of the server, terminal, and user in the embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. In addition, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[1616] Sales data collection and preprocessing
[1617] 1. Data Collection
[1618] The server periodically collects historical sales and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the files "sales_data.csv" and "weather_data.csv."
[1619] 2. Data Cleaning
[1620] The server processes the collected sales data, imputes missing values, and processes outliers. Specifically, it imputes missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is detected as an outlier and corrected.
[1621] 3. Data Combination and Normalization
[1622] The server joins the clean sales data and weather data by date, then normalizes the data using a min-max scaler to convert all values to the range 0 to 1. This normalized data is used for subsequent model training.
[1623] Generate a demand forecast model
[1624] 1. Preparing training data
[1625] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data, converting the data into a specified format so that the features and target variables can be properly extracted.
[1626] 2. Training the model
[1627] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. This ensures that there is enough data to evaluate the generality of the model.
[1628] 3. Building and training the model
[1629] The server trains a demand forecasting model using a long short-term memory (LSTM) network. The model is trained using a training set to learn the relationship between features and the target variable. Hyperparameters such as the number of epochs, batch size, and learning rate are set during model training.
[1630] Proposing optimal delivery routes based on prediction results
[1631] 1. Demand forecast
[1632] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points. For example, if a user requests "demand forecast for next month," the server inputs the necessary data points and generates a demand forecast.
[1633] 2. Obtaining real-time traffic information
[1634] The server obtains real-time traffic information from external services such as Google Maps API, collecting the latest information on traffic conditions, congestion, accidents, etc. through API requests. The obtained traffic information is used to calculate routes based on predicted demand.
[1635] 3. Calculating the optimal delivery route
[1636] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This calculation determines the most efficient route by taking into account the priority, delivery cost, and time for multiple delivery destinations.
[1637] 4. Delivery route presentation
[1638] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[1639] Implementing the Emotion Engine
[1640] 1. Emotion Engine Data Collection
[1641] As users interact with the system, the device collects their speech and text inputs, which builds a dataset for analyzing their emotional state.
[1642] 2. Emotion analysis
[1643] The server analyzes the collected user input data and determines the emotional state. The emotion engine uses machine learning algorithms to estimate multiple emotional states (e.g., joy, anger, sadness) from the user input.
[1644] 3. Emotional Feedback
[1645] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is stressed, the system will add some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[1646] 4. Emotional display
[1647] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[1648] Specific examples
[1649] Example 1: Collecting and Preprocessing Sales Data
[1650] The server collects sales data for fiscal year 2021 (sales_data.csv) and weather data (weather_data.csv) from the sales database. After the collected data undergoes missing value imputation and outlier processing, it is combined using the date as a key and normalized.
[1651] Example 2: Training a demand forecasting model
[1652] The server uses the date and temperature from the preprocessed dataset as features and the sales volume as the target variable. The dataset is divided into an 80% training set and a 20% test set, and trained using an LSTM network.
[1653] Example 3: Calculating the optimal delivery route
[1654] When a user requests a demand forecast for the following month, the server uses the trained model to predict demand. It then obtains real-time traffic information through the Google Maps API and calculates the optimal delivery route using algorithm A. The calculated route is displayed on the user's device, and the user can then use it to plan their delivery.
[1655] Example 4: Using the Emotion Engine
[1656] When a user interacts with the system, the device collects the user's voice input. The server analyzes this voice data and determines whether the user is feeling stressed. Based on this, the server makes adjustments such as adding leeway to the delivery route provided and reducing the frequency of notifications.
[1657] According to the above-described embodiments, the present invention can realize an efficient and emotionally-conscious logistics process, thereby reducing operational costs and improving service quality.
[1658] The processing flow will be explained below.
[1659] Step 1:
[1660] The server collects past sales data and weather data from the database. Specifically, it uses SQL queries and API requests to retrieve sales information (e.g., product name, number of sales, and sales date and time) and weather information (e.g., temperature and precipitation amount by date) in the files "sales_data.csv" and "weather_data.csv."
[1661] Step 2:
[1662] The server cleans the collected data. Missing values are filled in with the mean or median of the middle range, and outliers are detected and corrected using statistical methods. For example, if an abnormally high sales figure is found, it is compared with surrounding data and corrected to a reasonable value.
[1663] Step 3:
[1664] The server joins the sales data and weather data using the date as a key. This results in a single data frame containing the weather information corresponding to each sales data. After joining, a min-max scaler is used to normalize all values to the range 0 to 1.
[1665] Step 4:
[1666] The server separates the features and target variables from the preprocessed data. The features include information such as date, temperature, and weather, and the target variable is sales volume. This formats the data so that the model can predict the target variable from the features.
[1667] Step 5:
[1668] The server splits the data into a training set and a test set, typically 80% for the training set and 20% for the test set, allowing a portion of the dataset to be used to evaluate the generality of the model.
[1669] Step 6:
[1670] The server trains a demand forecasting model using a long short-term memory (LSTM) network. It uses the training set to learn the relationship between features and the target variable, and optimizes the model by setting hyperparameters such as 50 epochs and a batch size of 32.
[1671] Step 7:
[1672] The device collects the user's voice input and text data. For example, it records the user's voice and messages when they make inquiries to the system. It may also collect the user's facial expression data and use it for emotion analysis.
[1673] Step 8:
[1674] The server analyzes the collected user voice and text data to determine the user's emotional state. Using an emotion engine, it assigns emotion tags (e.g., joy, anger, sadness) based on the user's voice tone, speed, and text content.
[1675] Step 9:
[1676] The server adjusts demand forecasts and delivery routes based on the results of emotion analysis. For example, if the user is feeling stressed, it will allow some leeway in the delivery plan. It also adjusts notification methods and timing to optimize the system to reduce the user's mental burden.
[1677] Step 10:
[1678] The server calculates the optimal delivery route according to the user's emotional state. Based on the latest demand forecast results and real-time traffic information, it uses the A algorithm to determine an efficient delivery route and provides it to the user.
[1679] Step 11:
[1680] The server then displays the calculated optimal delivery route on the user's device. The route information displayed includes the route on a map, highways and intersections to avoid, and estimated travel time. Users can use this information to quickly and effectively plan their delivery.
[1681] Based on the above steps, the present invention provides a system that integrates sales data and user emotion data to forecast demand and propose optimal delivery routes. By using this system, it is possible to improve the efficiency of logistics processes and increase user satisfaction.
[1682] Example 2
[1683] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1684] Conventional demand forecasting systems were able to predict demand based on past data and calculate optimal delivery routes. However, these systems did not take into account the user's emotional state and were unable to withstand the effects of user stress and emotional fluctuations. This resulted in a decrease in the accuracy of efficient route calculations and demand forecasts. Furthermore, there was a need for a flexible system that could take real-time information into account.
[1685] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[1686] In this invention, the server includes means for collecting and preprocessing past data, means for generating a prediction model based on the preprocessed data, means for predicting future demand using the generated prediction model, means for calculating an optimal route based on the predicted demand data and real-time information, and means for analyzing the emotional state of the user and adjusting the system operation based on the analysis results, thereby optimizing the system operation based on the emotional state of the user, enabling efficient and flexible demand forecasting and delivery route proposals.
[1687] "Historical data" is previously collected information, such as sales history or weather information, that is used to train a predictive model.
[1688] "Collection and preprocessing means" refers to a series of processes that retrieve data using database queries or API requests, and then perform preprocessing such as missing value imputation, outlier correction, and normalization.
[1689] "Means for generating a predictive model" refers to a method of using preprocessed data to build and train a demand forecasting model using a machine learning algorithm (e.g., an LSTM network).
[1690] "Means for forecasting demand" refers to the process of forecasting future sales and demand volumes using the generated demand forecasting model.
[1691] "Real-time information" refers to the latest data that changes depending on the time of day, such as current traffic information and weather data.
[1692] "Means for calculating optimal routes" refers to the process of integrating predicted demand data with real-time information and using an algorithm (e.g., A algorithm) to determine the most efficient delivery route.
[1693] "User emotional state" refers to the psychological state, such as stress, joy, or sadness, that a user exhibits while interacting with a system.
[1694] "Means for analyzing emotional state" refers to the process of analyzing a user's voice or text input and using machine learning or natural language processing techniques to identify emotions.
[1695] "Means for adjusting system operation" refers to the process of changing the method of demand forecasting and delivery route suggestions based on the analyzed emotional state of the user, thereby providing the user with the optimal service.
[1696] This section describes the roles of the server, terminal, and user in an embodiment of the present invention. In the following system, the server hosts the central database and AI model, while the terminal and user function as interfaces with the system. Furthermore, by combining it with an emotion engine, it is possible to propose optimal demand forecasts and delivery routes that take into account the user's emotional state.
[1697] Sales data collection and preprocessing
[1698] Data collection
[1699] The server periodically collects past sales data and weather data from the database. This involves using SQL queries and API requests to retrieve data from databases and external data providers. The collected data is saved in the form of "sales_data.csv" and "weather_data.csv." Specifically, the required data is collected using SQL queries and API requests.
[1700] Data Cleaning
[1701] The server processes the collected sales data, imputes missing values, and handles outliers. Specifically, it uses Python's Pandas library to impute missing values with the median and corrects outliers using statistical methods. For example, if the sales volume of a particular product is extremely high, it is treated as an outlier and corrected.
[1702] Data Combining and Normalization
[1703] The server joins the clean sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. This normalized data is then used for subsequent model training, specifically using Pandas' merge function or Scikit-learn's MinMaxScaler.
[1704] Generate a demand forecast model
[1705] Preparing the training data
[1706] The server separates the features (e.g., date, temperature) and target variables (e.g., sales volume) from the preprocessed data and converts them into an appropriate format.
[1707] Splitting the model's training and test sets
[1708] The server splits the data into a training set and a test set. Typically, 80% of the data is used as the training set and 20% as the test set. Specifically, it uses the train_test_split function in Scikit-learn.
[1709] Building and training the model
[1710] The server uses the Keras library to build a long short-term memory (LSTM) network and trains the demand forecasting model using the training set. It sets hyperparameters such as the number of epochs, batch size, and learning rate to train the model.
[1711] Proposing optimal delivery routes based on prediction results
[1712] Demand forecasting
[1713] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for new data points. For example, when a user requests "next month's demand forecast," the server inputs the necessary data points and generates a demand forecast.
[1714] Obtaining real-time traffic information
[1715] The server retrieves real-time traffic information from external services such as Google Maps API, collects the latest traffic information through API requests, and calculates routes based on predicted demand.
[1716] Calculating the optimal delivery route
[1717] The server calculates the optimal delivery route based on the prediction results and real-time traffic information using algorithms such as A. This determines the most efficient route, taking into account the priority, delivery cost, and time for multiple delivery destinations.
[1718] Delivery route presentation
[1719] The server then provides the calculated optimal delivery route to the user's device, allowing the user to plan the actual delivery based on the route information provided. The route information is displayed in map or list format, and includes detailed instructions and time estimates.
[1720] Implementing the Emotion Engine
[1721] Emotion Engine Data Collection
[1722] As the user interacts with the system, the device collects the user's voice and text input, which builds a dataset for analyzing the emotional state.
[1723] Emotion analysis
[1724] The server analyzes the collected user input data and uses a machine learning algorithm to determine the emotional state, which infers multiple emotional states (e.g., joy, anger, sadness) from the user's input.
[1725] Emotional Feedback
[1726] The server adjusts demand forecasts and delivery routes based on the user's emotional state. For example, if the user is under stress, it adds some leeway to the route plan. It also optimizes the notification method and timing for the user based on the user's emotional state.
[1727] emotional display
[1728] The device displays the user's emotional state in real time and adapts the system's behavior and presentation accordingly. Based on the displayed emotional information, the user is more likely to accept the system's suggestions.
[1729] Examples and prompts
[1730] Example 1: Collecting and Preprocessing Sales Data
[1731] The server collects the sales data for fiscal year 2021 "sales_data.csv" and weather data "weather_data.csv" from the database, fills in missing values and removes outliers, then combines the data using the date as a key and performs normalization processing.
[1732] Example 2: Training a demand forecasting model
[1733] The server extracts a dataset with date and temperature as features and sales volume as the target variable, divides 80% of the data into a training set and 20% into a test set, and performs training using an LSTM model.
[1734] Example 3: Calculating the optimal delivery route
[1735] When a user requests a demand forecast for the next month, the server uses the LSTM model to predict demand, then obtains real-time traffic information using the Google Maps API and calculates the optimal delivery route using the A algorithm. The calculated route is displayed on the user's device.
[1736] Example 4: Using the Emotion Engine
[1737] When a user voice-inputs "I'm tired, I can't do this anymore," the server analyzes this and determines that the user is feeling stressed. As a result, the server makes adjustments such as adding leeway to the delivery route it provides and reducing the frequency of notifications.
[1738] Prompt Sentence Examples
[1739] "Predict next month's demand and calculate the optimal delivery route."
[1740] "Adjust routes and notifications to take into account the user's emotional state."
[1741] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1742] Step 1: Collect data
[1743] The server periodically collects past sales data (sales_data.csv) and weather data (weather_data.csv) from the database using SQL queries and API requests. The specific input is the SQL query "SELECT FROM sales WHERE year = 2021", and the output is the collected raw data.
[1744] Step 2: Preprocessing the data
[1745] The server preprocesses the collected data. Specifically, it uses the Python Pandas library to read "sales_data.csv" and "weather_data.csv," fills missing values with the median, and removes outliers. For example, it performs the operation df.fillna(df.median(), inplace=True), and the input is raw data and the output is clean data.
[1746] Step 3: Combining and normalizing the data
[1747] The server joins the cleaned sales data and weather data using the date as a key and normalizes the data to the range of 0 to 1 using a min-max scaler. Specifically, it executes merged_data = pd.merge(sales_data, weather_data, on='date') and then uses scaler = MinMaxScaler(). The input is the cleaned individual data, and the output is the normalized merged data.
[1748] Step 4: Separation of features and target variable
[1749] The server separates the features (e.g., date, temperature) and the target variable (e.g., sales volume) from the normalized data. Specifically, it uses Pandas' iloc method to convert the data into an appropriate format. The input is the normalized data, and the output is a dataset containing the features and the target variable.
[1750] Step 5: Split the training and test sets
[1751] The server splits the dataset into an 80% training set and a 20% test set. It does this using Scikit-learn's train_test_split function, which takes as input a dataset containing features and a goal variable, and outputs a training set and a test set.
[1752] Step 6: Building and training the model
[1753] The server uses the Keras library to build an LSTM network and trains the model using the training set. Set the number of epochs to 50, the batch size to 32, and the learning rate to 0.001, and run model.fit(X_train, y_train, epochs=50, batch_size=32, validation_split=0.2). The input is the training set, and the output is the trained model.
[1754] Step 7: Demand forecasting
[1755] When a user requests "next month's demand forecast" from a terminal, the server uses the trained model to predict demand for a new data point. It executes model.predict(new_data) with the new data point as input, and the output is the demand forecast result.
[1756] Step 8: Obtaining real-time traffic information
[1757] The server retrieves real-time traffic information using an external API (e.g., Google Maps API). It executes requests.get("https: / / maps.googleapis.com / maps / api / ..."), where the input is the API request parameters and the output is the real-time traffic information.
[1758] Step 9: Calculate the optimal delivery route
[1759] The server calculates the optimal delivery route using the A algorithm based on the predicted demand data and the acquired real-time traffic information. Using the pathfinding library, astar_algorithm(start_point, end_point, traffic_data) is executed, and the input is the demand data and traffic information, and the output is the optimal delivery route.
[1760] Step 10: Present delivery route
[1761] The server sends the calculated optimal delivery route to the user's device, which displays it in map or list format. The user can then create a delivery plan based on the route information provided. The input is the optimal delivery route data, and the output is the display information on the user's device.
[1762] Step 11: Collect emotion data
[1763] When a user interacts with the system, the device collects the user's input voice or text. It uses a speech recognition API to convert the voice data into text, which is then sent to a server for sentiment analysis. The input is voice or text data, and the output is text data sent to the server.
[1764] Step 12: Sentiment Analysis and Feedback
[1765] The server analyzes voice and text data to determine the user's emotional state. It uses machine learning algorithms to identify emotions and executes, for example, sentiment_analysis(input_text). If the user is in a stressful state, it adjusts the system's behavior and notification frequency. The input is the user's voice and text data, and the output is the analyzed emotional state and the adjustment of behavior based on that.
[1766] (Application example 2)
[1767] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1768] Conventional demand forecasting and delivery route calculation systems can propose optimal routes based on past sales data and real-time traffic information, but they cannot take the user's emotional state into account, making it difficult to build an efficient logistics process that adapts to the user's stress and emotional state.
[1769] The identification processing by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for collecting and preprocessing past sales data and weather data, means for generating a demand forecasting model based on the preprocessed data, means for predicting future demand using the generated demand forecasting model, means for calculating an optimal transportation route based on the predicted demand data and real-time road information, means for analyzing user input data to determine the user's emotional state, and means for adjusting the demand forecast and transportation route based on the determined emotional state. This makes it possible to build an efficient and adaptive logistics process that takes the user's emotional state into consideration.
[1770] "Past sales data" refers to product sales records collected over a certain period of time.
[1771] "Weather Data" means meteorological information relating to a specific region and time, such as temperature, precipitation, and humidity.
[1772] "Preprocessing means" refers to a method or device that processes collected data, such as filling in missing values or correcting outliers, before analysis.
[1773] A "demand forecasting model" is an algorithm or machine learning model that predicts future demand based on past data.
[1774] "Real-time road information" refers to the latest information about roads, such as current traffic conditions, congestion information, and accident information.
[1775] An "optimal transportation route" is the most suitable route to reach a destination efficiently and quickly.
[1776] "User Input Data" means information provided by a user to a system, whether in speech, text, or other form.
[1777] An "emotional state" refers to a psychological state such as joy, anger, or sadness that a user feels.
[1778] "Means of discrimination" refers to methods or devices that analyze and identify specific information from collected data.
[1779] "Adjusting means" refers to a method or device that modifies the system's operation or plan based on the analysis results.
[1780] This section explains in detail the roles of the server, terminal, and user in the embodiment of the present invention. This system incorporates an emotion engine into demand forecasting and delivery route optimization, and realizes an efficient logistics process by taking into account the emotional state of the user.
[1781] Sales data collection and preprocessing
[1782] Data collection:
[1783] The server periodically collects historical sales and weather data from the sales database. The data is retrieved using SQL queries and API requests and stored in the local database as "sales_data.csv" and "weather_data.csv".
[1784] Data Cleaning:
[1785] The server performs data cleaning on the collected data, such as imputing missing values and correcting outliers. Here, Pandas is used to perform data frame operations, and SciPy is used to detect and correct outliers.
[1786] Data Combining and Normalization:
[1787] The server joins the sales data and weather data by date and normalizes them using a min-max scaler. This normalized data is used to train the demand forecasting model.
[1788] Generate a demand forecast model
[1789] Prepare the training data:
[1790] The server separates features such as date and temperature from target variables such as sales volume from the preprocessed data. The dataset is divided into an 80% training set and a 20% test set.
[1791] Building and training the model:
[1792] The server uses TensorFlow to build and train a LSTM (long short-term memory) network, which learns the relationship between features and the goal variable.
[1793] Proposing optimal delivery routes based on prediction results
[1794] Demand forecast:
[1795] When a user requests a demand forecast for a specific period, the server uses the trained model to predict demand for new data points.
[1796] Get real-time traffic information:
[1797] The server uses the Google Maps API to get real-time traffic information, including traffic conditions, congestion information, and accident information.
[1798] Calculating the optimal delivery route:
[1799] The server uses algorithm A to calculate the optimal delivery route based on predicted demand data and real-time traffic information.
[1800] Delivery route suggestions:
[1801] The device calculates the optimal delivery route and provides it to the user, who can then display the route information in map or list format on their smartphone or head-mounted display.
[1802] Implementing the Emotion Engine
[1803] Emotion Engine Data Collection:
[1804] As the user interacts with the system, the device collects the user's voice and text data.
[1805] Emotion analysis:
[1806] The server analyzes the collected data using the BERT model to determine the user's emotional state, and outputs the result as a rating such as "high stress."
[1807] Emotional Feedback:
[1808] The server adjusts demand forecasts and transportation routes based on the user's emotional state. For users in a stressed state, the server provides route planning with more leeway and adjusts notification frequency.
[1809] Specific examples
[1810] Example 1: Collecting and Preprocessing Sales Data
[1811] The server periodically collects the past year's worth of sales data ("sales_data.csv") and monthly weather data ("weather_data.csv") from the sales database, and performs data cleaning and normalization.
[1812] Example 2: Training a demand forecasting model
[1813] The server trains a demand forecasting model using an LSTM network from the preprocessed dataset, using date and temperature as features and sales volume as the target variable.
[1814] Example 3: Calculating the optimal delivery route
[1815] When a user requests a demand forecast for the next month, the server uses the trained model to predict demand and obtains real-time traffic information through the Google Maps API, then calculates the optimal delivery route using the A algorithm.
[1816] Example 4: Using the Emotion Engine
[1817] When a user interacts with the system, the device collects the user's voice data. The server analyzes this data using the BERT model and determines whether the user is stressed. As a result, the server provides more leeway in the delivery route and reduces the frequency of notifications.
[1818] Examples of prompt statements
[1819] Analyze the sentiment of the following text: "Working in the warehouse today was very tiring and my efficiency was quite low."
[1820] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1821] Step 1: Data collection
[1822] The server collects data from the sales database and an external weather data provider. Input data includes past sales records and weather information. This data is retrieved through SQL queries and API requests and saved as "sales_data.csv" and "weather_data.csv." A regularly scheduled job automatically retrieves the data and saves it in local storage.
[1823] Step 2: Data cleaning
[1824] The server reads the saved sales data and weather data and performs missing value imputation and outlier processing. The input data includes "sales_data.csv" and "weather_data.csv" collected in Step 1. Specifically, it uses the Panda...
Claims
1. a means of collecting and pre-processing historical sales data; a means for generating a demand forecasting model based on the preprocessed sales data; a means for predicting future demand using the generated demand forecasting model; A means of calculating optimal delivery routes based on predicted demand data and real-time traffic information; A system including:
2. The system according to claim 1 , further comprising means for performing condition validation on the forecasted demand data and updating the forecast model using the obtained validation results.
3. 10. The system of claim 1, further comprising means for obtaining data through an interface from a third party data providing service to obtain real-time traffic information.
Citation Information
Patent Citations
Persona chatbot control method and system
JP2022180282A