CN114781691A - Freight demand prediction method, system, device and storage medium - Google Patents

Freight demand prediction method, system, device and storage medium Download PDF

Info

Publication number
CN114781691A
CN114781691A CN202210298762.9A CN202210298762A CN114781691A CN 114781691 A CN114781691 A CN 114781691A CN 202210298762 A CN202210298762 A CN 202210298762A CN 114781691 A CN114781691 A CN 114781691A
Authority
CN
China
Prior art keywords
historical
freight
data
source data
goods source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210298762.9A
Other languages
Chinese (zh)
Inventor
方志龙
张先东
王超
范育峰
翟号
李佩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Manyun Software Technology Co Ltd
Original Assignee
Jiangsu Manyun Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Manyun Software Technology Co Ltd filed Critical Jiangsu Manyun Software Technology Co Ltd
Priority to CN202210298762.9A priority Critical patent/CN114781691A/en
Publication of CN114781691A publication Critical patent/CN114781691A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06315Needs-based resource requirements planning or analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping
    • G06Q10/0838Historical data

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Operations Research (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Educational Administration (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a freight demand prediction method, a system, equipment and a storage medium, wherein the method comprises the following steps: acquiring first historical source data of each region, wherein the first historical source data comprises the historical source quantity of each vehicle type in a first time range; training a freight demand prediction model based on the first historical freight source data; acquiring second historical goods source data of each region, wherein the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before a time period to be predicted; and inputting the second historical goods source data of each region into the trained freight demand prediction model, and determining the predicted goods source quantity of each vehicle type in each region according to the output of the model. According to the invention, through data analysis, the freight transportation demand of each vehicle type in each region of the city is effectively calculated, so that the efficiency of allocating logistics resources by the platform is greatly improved, the data processing capacity of the platform is reduced, and the data processing efficiency is higher.

Description

Freight demand prediction method, system, device and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a freight demand prediction method, a system, equipment and a storage medium.
Background
At present, the logistics cost accounts for more than 14% of the national GDP, and the efficient and intelligent logistics scheduling system plays a significant role in improving the logistics efficiency, reducing the logistics cost and reducing the carbon emission generated by logistics. An intelligent logistics scheduling system needs to have accurate information of the transportation capacity supply quantity and the freight transportation demand quantity in time and space when realizing normal and efficient operation, and then balances the supply and demand structure of the whole market through a series of scheduling operations, so that the overall operation efficiency of the logistics system is improved. When the freight demand prediction is inaccurate and not fine, the freight logistics platform is difficult to finish transport capacity scheduling efficiently, the data processing capacity of the platform is greatly increased, and the data processing efficiency is greatly reduced.
In the prior art, many methods for calculating the vehicle demand have appeared, such as patent applications CN112329962A, CN111801701A, CN111861175A, CN111626534A, and CN109673173A, etc., aiming at predicting the vehicle demand in a certain time period, so as to better perform the transportation capacity scheduling. However, the prior art is mainly directed at the supply and demand balance relationship between passengers and drivers in the internet taxi appointment field, so that the service experience of the passenger side is further improved, the order receiving rate of the driver side is improved, and the overall operation efficiency of the platform is improved. The method is mainly applied to the order dispatching application of the C-end user in the field of network taxi appointment. The demand of C-end users in the field of network appointment is relatively single, the demand is the service of getting to the car, and the situation is greatly different from the situation of order distribution and scheduling in the field of freight logistics. The problem of order distribution scheduling in the field of freight logistics mainly aims at a B-end freight owner user. The B-end goods owner user often has more diversified demands for taxi service than the C-end user in the field of taxi appointment due to factors such as the type, the volume and the weight of the supported goods. The demand of this variety requires that the platform need provide different freight transportation demand forecast values for different owner demands. This places higher demands on the platform to calculate shipping needs within each sub-region.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a freight demand prediction method, a system, equipment and a storage medium, and freight demand of each vehicle type in each region of a city is effectively calculated through data analysis, so that the efficiency of a platform for allocating logistics resources is greatly improved, the data processing capacity of the platform is reduced, and the data processing efficiency is higher.
The embodiment of the invention provides a freight demand prediction method, which comprises the following steps:
acquiring first historical source data of each region, wherein the first historical source data comprises the historical source quantity of each vehicle type in a first time range;
training a freight demand prediction model based on the first historical source data;
acquiring second historical goods source data of each region, wherein the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before a time period to be predicted;
and inputting the second historical goods source data of each region into the trained freight demand prediction model, and determining the predicted goods source quantity of each vehicle type in each region according to the output of the model.
In some embodiments, before obtaining the first historical sourcing data of each area, the method further includes the following steps:
obtaining map data of a target geographic range;
carrying out grid division on the target geographic range by adopting an H3 method to obtain a plurality of areas;
position information and H3 encoding of each region are determined.
In some embodiments, obtaining the first historical sourcing data for each area includes the steps of:
collecting historical freight order data of a target geographic range in a first time range at each time period, wherein the time duration of each time period is m hours, and m is greater than 1;
determining POI positions and vehicle types corresponding to the historical freight orders according to the historical freight order data;
calling an H3 interface algorithm package, mapping each POI position to each area, and establishing a mapping relation between each POI position and the H3 code of the corresponding area;
according to the mapping relation between the H3 codes of all the areas and the positions of the POIs, determining the historical goods source quantity of all the vehicle types in all the areas corresponding to all the time periods in the first time range as the historical goods source data of all the time periods, and taking the historical goods source data of all the time periods in the first time range as the first historical goods source data.
In some embodiments, determining POI locations and vehicle types corresponding to the historical shipping orders according to the historical shipping order data includes the following steps:
determining POI positions of goods source loading points corresponding to the historical freight orders according to the historical freight order data;
determining vehicle demand characteristics corresponding to each historical freight order according to the historical freight order data;
and determining the vehicle type corresponding to each historical freight order according to the vehicle demand characteristics corresponding to each historical freight order.
In some embodiments, training a freight demand prediction model based on the first historical freight source data includes the steps of:
selecting n time periods from the first historical source data as sample time periods, wherein n is greater than 1;
taking the historical goods source data of x time periods before each sample time period as sample input data corresponding to the sample time period, wherein x is larger than 1;
taking the historical goods source data of each sample time interval as a label corresponding to the sample time interval;
and inputting the sample input data into the freight demand prediction model, and iteratively training the freight demand prediction model according to the output of the freight demand prediction model and the corresponding label.
In some embodiments, before inputting each of the sample input data into the freight demand prediction model, the method further includes the following steps:
acquiring associated attribute data corresponding to each sample time interval;
and adding the associated attribute data corresponding to each sample time interval to the corresponding sample input data.
In some embodiments, obtaining second historical sourcing data for each of the regions comprises:
taking x time intervals before a time interval to be predicted as input reference time intervals;
determining a coincidence period of the input reference period with the first time range and a non-coincidence period not coinciding with the first time range;
acquiring historical cargo source data of the coincidence time period from the first historical cargo source data;
acquiring historical freight order data of a target geographic range in each non-coincident time period;
determining historical freight source data of each non-coincident time period according to the historical freight order data in the non-coincident time periods;
and taking the historical goods source data in the input reference time period as the second historical goods source data.
In some embodiments, the inputting the second historical source data of each area into the trained freight demand prediction model includes the following steps:
acquiring associated attribute data corresponding to each input reference time interval;
and inputting the second historical goods source data and the associated attribute data corresponding to each input reference time interval into a trained freight demand prediction model.
In some embodiments, the associated attribute data includes one or more of regional location attribute data, weather attribute data, date attribute data, and business turn attribute data.
In some embodiments, after determining the predicted cargo quantity of each vehicle type in each area according to the output of the model, the method further comprises the following steps:
acquiring real goods source data of a time period to be predicted, wherein the real goods source data comprises the real goods source quantity of each vehicle type of each region in the time period to be predicted;
and optimizing the freight demand prediction model based on the real freight source data and the predicted freight source quantity of the time period to be predicted.
In some embodiments, after determining the predicted cargo quantity of each vehicle type in each area according to the output of the model, the method further comprises the following steps:
determining the heat value of each vehicle type in each area according to the predicted freight quantity of each vehicle type in each area;
and generating a thermodynamic diagram comprising the areas according to the thermodynamic values.
The embodiment of the invention also provides a freight demand prediction system, which is used for realizing the freight demand prediction method, and the system comprises:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring first historical goods source data of each region, and the first historical goods source data comprises the historical goods source quantity of each vehicle type in a first time range;
the model training module is used for training a freight demand prediction model based on the first historical freight source data;
the second acquisition module is used for acquiring second historical goods source data of each region, and the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before the time period to be predicted;
and the demand prediction module is used for inputting the second historical goods source data of each region into the trained freight demand prediction model and determining the predicted goods source quantity of each vehicle type in each region according to the output of the model.
An embodiment of the present invention further provides a freight demand prediction device, including:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the steps of the freight requirement prediction method via execution of the executable instructions.
The embodiment of the invention also provides a computer-readable storage medium for storing a program, and the program realizes the steps of the freight requirement prediction method when being executed by a processor.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The freight demand prediction method, the freight demand prediction system, the freight demand prediction equipment and the freight demand prediction storage medium have the following beneficial effects:
the invention is suitable for the field of freight logistics, provides powerful support for optimizing the overall urban cargo transportation allocation efficiency of a freight logistics platform, and effectively calculates the freight demand of each vehicle type in each region of a city, thereby greatly improving the efficiency of allocating logistics resources by the platform, reducing the logistics cost, better scheduling the transport capacity for the freight logistics platform, greatly improving the efficiency of reasonably allocating and scheduling the platform, reducing the empty driving distance of a driver, reducing the waiting time of a cargo owner, reducing the data processing capacity of the platform, and having higher data processing efficiency.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments thereof, with reference to the following drawings.
FIG. 1 is a flow chart of a freight demand forecasting method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the demarcated regions according to one embodiment of the present invention;
FIG. 3 is a diagram illustrating correspondence between different resolutions and areas of H3 according to an embodiment of the present invention;
FIG. 4 is a flow chart of obtaining first historical sourcing data for various regions according to one embodiment of the invention;
FIG. 5 is a flow diagram of training a freight demand forecasting model according to one embodiment of the present invention;
FIG. 6 is a flow chart of obtaining second historical sourcing data for various regions in accordance with one embodiment of the present invention;
FIG. 7 is a schematic illustration of a thermodynamic diagram of an embodiment of the invention;
FIG. 8 is a schematic diagram of a freight demand forecasting system according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a freight requirement prediction apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all steps. For example, some steps may be decomposed, some steps may be combined or partially combined, and thus, the actual execution order may be changed according to the actual situation.
As shown in fig. 1, an embodiment of the present invention provides a freight demand prediction method, including the following steps:
s100: acquiring first historical goods source data of each region, wherein the first historical goods source data comprises the historical goods source quantity of each vehicle type in a first time range;
s200: training a freight demand prediction model based on the first historical source data;
s300: acquiring second historical goods source data of each region, wherein the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before a period to be predicted;
s400: and inputting the second historical goods source data of each region into the trained freight demand prediction model, and determining the predicted goods source quantity of each vehicle type in each region according to the output of the model.
The invention obtains a freight demand prediction model by training based on historical freight source data through steps S100 and S200, can predict the quantity of freight sources aiming at different areas and different vehicle types, and when the freight demand prediction is carried out, the prediction of the quantity of freight sources is realized based on the freight demand prediction model through steps S300 and S400, and the freight demand quantity of each vehicle type in each area of a city is effectively calculated, so that the efficiency of allocating logistics resources by a platform is greatly improved, the logistics cost is reduced, meanwhile, the freight logistics platform can better schedule the transportation capacity, the efficiency of reasonably allocating and scheduling by the platform is greatly improved, the empty driving distance of a driver is reduced, the waiting time of a shipper is reduced, the data processing quantity of the platform is reduced, and the data processing efficiency is higher.
In this embodiment, the step S100: before the first historical source data of each area is obtained, the method further comprises the following steps:
obtaining map data of a target geographic area, specifically, obtaining map data from a map data supplier, for example, obtaining map data by using open source library software of Python, where the target geographic area may be a city, or a range determined according to distribution of goods sources in a recent period of time;
on a map, carrying out grid division on a target geographic range by adopting a regular hexagon H3 method to obtain a plurality of areas;
the position information and the H3 codes of the regions are determined, namely unique H3 codes are assigned to each regular hexagon.
At present, H3 supports 16-level resolution splitting, each level of the resolution splitting is carried out in an equal area mode, a specific area is divided into a plurality of regular hexagonal grids, the resolution is different, and the area size of corresponding regular hexagons is also different. Fig. 2 is a schematic diagram of an exemplary region division. Where D100 represents the target geographical range, D200 represents the hexagonal grid divided according to the first resolution, and D300 represents the hexagonal grid divided according to the second resolution, it can be seen that the resolutions of D300 and D200 are different, and the area sizes of the regular hexagons are also different.
The different resolutions and the size of the area of the regular hexagon are shown in fig. 3. The method for dividing the grid area by adopting the method has the advantages that: (1) the adjacent units are equal in distance; (2) the self is approximate to a circle, and the concept of attaching density is very suitable for most of summary analysis scenes; (3) the periphery is close to a similar circle and is equidistant, so that the method is convenient for nearby search, step analysis and the like. In the embodiment, the H3 grid division adopts the 7-level resolution division standard of H3, and divides the target geographical range of the near 30-day goods source distribution into a plurality of regular hexagon grids according to the urban area. As can be seen in fig. 3, the area size of the mesh partition is about 5 square kilometers, and the side length of the regular hexagon is about 1.22 kilometers. However, the present invention is not limited to this, and other resolutions may be adopted in other embodiments.
As shown in fig. 4, in this embodiment, the step S100: the method for acquiring the first historical cargo source data of each area comprises the following steps:
s110: collecting historical freight order data of a target geographical range in each time period within a first time range, wherein the time duration of each time period is m hours, m is greater than 1, and the first time range comprises p time periods;
the historical freight order can be realized by SQL logic acquired by platform cargo owner delivery original data, the process is mainly realized by acquiring data from a cargo owner order Hive table, and is realized by a big data platform Hive timing task, the task is stored in the Hive table, and the task is updated every day;
in this embodiment, the duration of each period is taken as 24 hours, i.e., each period is 1 day. When the task is realized through a Hive timed task of a large data platform, the task is updated every day, the window of the sliding window is nearly 30 days, wherein the window of 30 days is mainly determined according to the characteristics of the same owner on the platform, and in other embodiments, the window size can be other days. In the Hive task execution process, logic comprises the steps of removing the air-controlled order data on the goods main side and the invalid goods source POI data, and limiting the order state to be delivery and to be short distance in the same city;
after obtaining the historical freight order data, desensitizing the historical freight order data to meet the requirement of information security. The specific content comprises the steps of encrypting and desensitizing information which possibly reveals personal characteristics and privacy of a shipper such as a shipper ID, a shipper mobile phone number and a shipper name, and ensuring that sensitive information of a user is not used in the subsequent algorithm calculation;
s120: determining the position and the vehicle type of POI (Point of Interest) corresponding to each historical freight order according to the historical freight order data;
in this embodiment, the step S120: determining POI positions and vehicle types corresponding to the historical freight orders according to the historical freight order data, and the method comprises the following steps:
determining POI positions of goods source loading points corresponding to the historical freight orders according to the historical freight order data;
and determining vehicle demand characteristics corresponding to each historical freight order according to the historical freight order data, namely determining the vehicle demand characteristics as characteristic engineering, specifically, in the embodiment, processing the desensitized historical freight order data to generate cargo source characteristic information in each partition area, wherein the cargo source characteristic information corresponds to the vehicle demand of the cargo source characteristic information, namely corresponds to the vehicle demand characteristics, takes the sky as a partition field, and is stored in the Hive table. The steps are Python tasks which are updated regularly every day, the generated characteristics comprise vehicle demand characteristics of nearly 1 day, 7 days, 14 days and 30 days, and information such as the total demand, freight charge and subsidy rate of various types of trucks in the area is formulated;
determining the vehicle type corresponding to each historical freight order according to the vehicle demand characteristics corresponding to each historical freight order;
s130: calling an H3 interface algorithm package, mapping each POI position to each area, and establishing a mapping relation between each POI position and the H3 code of the corresponding area;
specifically, deep processing is performed on the Hive table based on the historical freight order data acquired in step S110 through a timing Python task, POI position data of each desensitized freight source loading point is extracted from the deep processing, and the POI position data is stored in a new Hive table to obtain a POI position data table;
then, calling an H3 interface algorithm package to map each desensitized goods source POI information to each divided regular hexagonal area on a map, giving a unique code to the H3 of the regular hexagon, storing the unique code in a new Hive table to obtain a mapping relation table of the POI positions and the H3 codes of the corresponding areas, wherein the mapping relation table is realized by a timing Python task each time;
s140: determining the historical goods source quantity of each vehicle type in each region corresponding to each time interval in a first time range according to the mapping relation between the H3 code of each region and the POI position, taking the historical goods source quantity as the historical goods source data of each time interval, and taking the historical goods source data of all the time intervals in the first time range as the first historical goods source data;
specifically, based on the mapping relationship table of the POI locations obtained in step S130 and the H3 codes of the corresponding regions, the total freight demand amount, i.e., the historical source quantity, required by different truck models in each regular hexagon is calculated. By carrying out classification statistics according to accepted truck types, the exact requirements of the appointed truck type in the appointed area can be calculated. And outputting the calculation result to a Hive table. This operation has a daily timed Python task to complete.
As shown in fig. 5, in this embodiment, the step S200: training a freight demand prediction model based on the first historical freight source data, and comprising the following steps of:
s210: selecting n time intervals from the first historical goods source data as sample time intervals, wherein n is larger than 1, the numerical value of n can be selected according to needs, when n is set to be large, the sample size is large, and when n is set to be small, the sample size is small;
s220: taking the historical goods source data of x time periods before each sample time period as sample input data corresponding to the sample time period, wherein x is greater than 1 and smaller than the p; for example, in this embodiment, x is 30, historical shipment source data of 30 time periods before each sample time period is used as sample input data corresponding to the sample time period, and when a time period is equal to one day, historical shipment source data of 30 days before the sample day is used as sample input data;
s230: taking the historical goods source data of each sample time interval as a label corresponding to the sample time interval, namely adding the label to the sample time interval according to the historical goods source quantity of each vehicle type in each area in each sample time interval;
s240: and inputting the sample input data into the freight demand prediction model, and iteratively training the freight demand prediction model according to the output of the freight demand prediction model and the corresponding label.
Specifically, the output value of the freight demand prediction model is the predicted freight source quantity of each vehicle type in each area in the sample time period, the historical freight source quantity of each vehicle type in each area in each sample time period is used as a true value, a loss function value is calculated based on the predicted value and the true value, and the model parameters of the freight demand prediction model are optimized in a reverse iteration mode until the loss function value is smaller than a preset loss threshold value.
In this embodiment, the XGBoost model written in Python language is used for numerical modeling and simulation. The predictive model is updated daily through a daily timing task. The output result of step S240 is a Python model function that can be called and a model parameter file derived from training.
In this embodiment, the step S240: before each sample input data is input into the freight requirement prediction model, the method further comprises the following steps:
s231: acquiring associated attribute data corresponding to each sample time interval;
in this embodiment, the associated attribute data includes one or more of regional location attribute data, weather attribute data, date attribute data, and business turn attribute data;
s232: and adding the associated attribute data corresponding to each sample time interval to the corresponding sample input data.
For example, the sample input data for each sample period may include historical sourcing amounts for each area over the past x days, H3 codes and location information (e.g., latitude and longitude) for each area, weather conditions for the sample period, day of the sample period, whether the sample period is a holiday, whether a particular type of business establishment is included in each area, and the type of business establishment (e.g., a family business establishment, an appliance business establishment, etc.).
As shown in fig. 6, in this embodiment, the step S300: acquiring second historical source data of each area, wherein the method comprises the following steps:
s310: taking x time periods before the time period to be predicted as input reference time periods, wherein the x time periods before the time period to be predicted are the second time range, namely the second time range comprises the x time periods;
for example, the time interval to be predicted is the current day, and 30 days before the current day is selected as the input reference time interval;
s320: determining a coincidence period of the input reference period with the first time range and a non-coincidence period not coinciding with the first time range;
for example, the first time range is p days before yesterday, and the input reference period is a coincidence period from the previous day to 30 days before the current day, and yesterday is a non-coincidence period;
s330: acquiring historical cargo source data of the coincidence time period from the first historical cargo source data;
that is, the historical cargo source data of the coincidence period can be directly obtained from the result of step S140 without repeating the calculation process;
s340: acquiring historical freight order data of the target geographic range in each non-coincidence time period, taking the non-coincidence time period as the previous day as an example, and acquiring the historical freight order data of the previous day through a daily timing Python task;
s350: determining historical freight source data of each non-coincident time period according to the historical freight order data in the non-coincident time periods;
specifically, step S350 includes: determining POI positions and vehicle types corresponding to the historical freight orders according to the historical freight order data in the non-coincident time period;
calling an H3 interface algorithm package, mapping each POI position to each area, and establishing a mapping relation between each POI position and the H3 code of the corresponding area; the specific implementation method may refer to the step S130 to process the sample data;
determining the historical goods source quantity of each vehicle type in each region in a non-coincidence time period according to the mapping relation between the H3 codes and the POI positions of each region, and taking the historical goods source quantity as the historical goods source data in the non-coincidence time period; the specific implementation method may refer to the step S140 to process the sample data;
s360: and taking the historical goods source data in the input reference time period as the second historical goods source data.
In this embodiment, when the associated attribute data is used in the freight demand prediction model training, the associated attribute data is also used in the actual prediction. Specifically, the step S400: inputting the second historical freight source data of each area into a trained freight demand prediction model, and comprising the following steps of:
acquiring associated attribute data corresponding to each input reference time interval;
and inputting the second historical goods source data and the associated attribute data corresponding to each input reference time interval into a trained freight demand prediction model.
In this embodiment, the associated attribute data includes one or more of regional location attribute data, weather attribute data, date attribute data, and business turn attribute data.
For example, the sample input data for each sample period may include historical sourcing amounts for each area over the past x days, H3 codes and location information (e.g., latitude and longitude) for each area, weather conditions for the sample period, day of the sample period, whether the sample period is a holiday, whether a particular type of business establishment is included in each area, and the type of business establishment (e.g., a family business establishment, an appliance business establishment, etc.).
In this embodiment, the step S400: after the quantity of the predicted goods sources of each vehicle type in each area is determined according to the output of the model, the method further comprises the following steps:
determining the heat value of each vehicle type in each area according to the predicted freight quantity of each vehicle type in each area, wherein the predicted freight quantity can be used as the heat value, or the predicted freight quantity is combined with other data to obtain the heat value;
generating a thermodynamic diagram comprising various areas according to the thermodynamic values, wherein an exemplary thermodynamic diagram is shown in fig. 7, the grid areas provided with filling patterns in fig. 7 are hot areas, and the grid areas without filling patterns are cold areas;
specifically, a separation threshold value between the cold area and the hot area needs to be set, the area with the total single quantity smaller than the threshold value is determined as the cold area, the area with the total single quantity larger than the threshold value is determined as the hot area, and finally, the visualization effect of the cold area and the hot area is realized through Python television visualization open source software. The threshold setting of the cold and hot areas needs to be iteratively updated according to actual freight transportation requirements of different cities, and prior information provided by an operation department can be referred to.
In this embodiment, the step S400: after the predicted goods source quantity of each vehicle type in each area is determined according to the output of the model, the method further comprises the following steps:
acquiring real goods source data of a time period to be predicted, wherein the real goods source data comprises the real goods source quantity of each vehicle type of each region in the time period to be predicted;
and optimizing the freight demand prediction model based on the real freight source data and the predicted freight source quantity of the time period to be predicted.
Taking each time interval as one day as an example, namely, the embodiment can calculate the loss function value based on the final real source data (as a real label) and the previous forecast source quantity (as a forecast value) of each day through a daily timing task, and optimally train the freight requirement forecasting model. This can also be achieved by Python timing tasks.
As shown in fig. 8, an embodiment of the present invention further provides a freight demand prediction system, configured to implement the freight demand prediction method, where the system includes:
the system comprises a first acquisition module M100, a second acquisition module M and a third acquisition module M, wherein the first acquisition module M100 is used for acquiring first historical goods source data of each region, and the first historical goods source data comprises the historical goods source quantity of each vehicle type in a first time range;
a model training module M200, configured to train a freight demand prediction model based on the first historical freight source data;
the second acquisition module M300 is used for acquiring second historical goods source data of each region, wherein the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before the time period to be predicted;
and the demand forecasting module M400 is used for inputting the second historical cargo source data of each area into the trained freight demand forecasting model and determining the forecast cargo source quantity of each vehicle type in each area according to the output of the model.
According to the invention, the first acquisition module M100 and the model training module M200 are adopted to obtain the freight demand prediction model based on historical freight source data training, the freight demand prediction model can predict the quantity of freight sources according to different regions and different vehicle types, when the freight demand prediction is carried out, the second acquisition module M300 and the demand prediction module M400 are used to predict the quantity of freight sources based on the freight demand prediction model, and the freight demand of each vehicle type in each region of a city is effectively calculated, so that the efficiency of allocating logistics resources by a platform is greatly improved, the logistics cost is reduced, meanwhile, the freight logistics platform can better schedule the transportation capacity, the efficiency of reasonably allocating the platform by the platform is greatly improved, the empty driving distance of a driver is reduced, the waiting time of a shipper is reduced, the data processing capacity of the platform is reduced, and the data processing efficiency is higher.
In the freight demand prediction system of the present invention, the functions of each module may be implemented by using the specific implementation of the freight demand prediction method described above, which is not described herein again.
The embodiment of the invention also provides freight demand prediction equipment, which comprises a processor; a memory having stored therein executable instructions of the processor; wherein the processor is configured to perform the steps of the freight requirement prediction method via execution of the executable instructions.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Accordingly, various aspects of the present invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" platform.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 9. The electronic device 600 shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the electronic device 600 is in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 that couples various system components including the memory unit 620 and the processing unit 610, a display unit 640, and the like.
Wherein the storage unit stores program code executable by the processing unit 610 to cause the processing unit 610 to perform steps according to various exemplary embodiments of the present invention described in the freight requirement forecasting method section above. For example, the processing unit 610 may perform the steps as shown in fig. 1.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. The network adapter 660 may communicate with the other modules of the electronic device 600 via the bus 630. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
In the freight requirement prediction device, the program in the memory is executed by the processor to realize the steps of the freight requirement prediction method, so that the device can also obtain the technical effect of the freight requirement prediction method.
The embodiment of the invention also provides a computer-readable storage medium for storing a program, and the program realizes the steps of the freight requirement prediction method when being executed by a processor. In some possible embodiments, the aspects of the present invention may also be implemented in the form of a program product including program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present invention described in the freight demand forecasting method section above in this specification when the program product is executed on the terminal device.
Referring to fig. 10, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be executed on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The program in the computer storage medium is executed by a processor to implement the steps of the freight demand prediction method, and therefore, the computer storage medium can also achieve the technical effects of the freight demand prediction method.
The foregoing is a further detailed description of the invention in connection with specific preferred embodiments and it is not intended to limit the invention to the specific embodiments described. For those skilled in the art to which the invention pertains, numerous simple deductions or substitutions may be made without departing from the spirit of the invention, which shall be deemed to belong to the scope of the invention.

Claims (14)

1. A freight demand prediction method is characterized by comprising the following steps:
acquiring first historical source data of each region, wherein the first historical source data comprises the historical source quantity of each vehicle type in a first time range;
training a freight demand prediction model based on the first historical freight source data;
acquiring second historical goods source data of each region, wherein the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before a period to be predicted;
and inputting the second historical goods source data of each region into the trained freight demand prediction model, and determining the predicted goods source quantity of each vehicle type in each region according to the output of the model.
2. The freight demand forecasting method according to claim 1, wherein before the obtaining of the first historical source data of each area, the method further comprises the following steps:
obtaining map data of a target geographic range;
carrying out grid division on the target geographic range by adopting an H3 method to obtain a plurality of areas;
position information and H3 encoding of the respective areas are determined.
3. The freight demand prediction method according to claim 2, wherein the step of obtaining the first historical freight source data of each area comprises the steps of:
collecting historical freight order data of a target geographical range in each time period within a first time range, wherein the time of each time period is m hours, and m is greater than 1;
determining POI positions and vehicle types corresponding to the historical freight orders according to the historical freight order data;
calling an H3 interface algorithm package, mapping each POI position to each area, and establishing a mapping relation between each POI position and the H3 code of the corresponding area;
according to the mapping relation between the H3 codes of all the areas and the positions of the POIs, determining the historical goods source quantity of all the vehicle types in all the areas corresponding to all the time periods in the first time range as the historical goods source data of all the time periods, and taking the historical goods source data of all the time periods in the first time range as the first historical goods source data.
4. The freight demand prediction method according to claim 3, wherein the step of determining the POI positions and vehicle types corresponding to the historical freight orders according to the historical freight order data comprises the following steps:
determining POI positions of goods source loading points corresponding to the historical freight orders according to the historical freight order data;
determining vehicle demand characteristics corresponding to each historical freight order according to the historical freight order data;
and determining the vehicle type corresponding to each historical freight order according to the vehicle demand characteristics corresponding to each historical freight order.
5. The freight demand prediction method according to claim 3, wherein training a freight demand prediction model based on the first historical freight source data includes the steps of:
selecting n time periods from the first historical source data as sample time periods, wherein n is greater than 1;
taking the historical goods source data of x time periods before each sample time period as sample input data corresponding to the sample time period, wherein x is larger than 1;
taking the historical goods source data of each sample time interval as a label corresponding to the sample time interval;
and inputting the sample input data into the freight demand prediction model, and iteratively training the freight demand prediction model according to the output of the freight demand prediction model and the corresponding label.
6. The freight demand forecasting method according to claim 5, wherein before inputting each sample input data into the freight demand forecasting model, the method further comprises the following steps:
acquiring associated attribute data corresponding to each sample time interval;
and adding the associated attribute data corresponding to each sample time interval to the corresponding sample input data.
7. The freight demand forecasting method according to claim 5, wherein the step of obtaining second historical freight source data for each area includes the steps of:
taking x time intervals before a time interval to be predicted as input reference time intervals;
determining a coincidence period of the input reference period with the first time range and a non-coincidence period not coinciding with the first time range;
acquiring historical source data of the coincidence time period from the first historical source data;
acquiring historical freight order data of a target geographic range in each non-coincidence time period;
determining historical freight source data of each non-coincident time period according to the historical freight order data in the non-coincident time periods;
and taking the historical goods source data in the input reference time period as the second historical goods source data.
8. The freight demand forecasting method according to claim 7, wherein the step of inputting the second historical freight source data of each area into the trained freight demand forecasting model comprises the following steps:
acquiring associated attribute data corresponding to each input reference time interval;
and inputting the second historical freight source data and the associated attribute data corresponding to each input reference time interval into a trained freight demand prediction model.
9. The freight demand forecasting method according to claim 6 or 8, wherein the associated attribute data includes one or more of regional location attribute data, weather attribute data, date attribute data and business turn attribute data.
10. The freight demand prediction method according to claim 7, further comprising, after determining the predicted freight source quantity of each vehicle type in each area based on the output of the model, the steps of:
acquiring real goods source data of a time period to be predicted, wherein the real goods source data comprises the real goods source quantity of each vehicle type of each region in the time period to be predicted;
and optimizing the freight demand prediction model based on the real goods source data and the predicted goods source quantity of the time period to be predicted.
11. The freight demand prediction method according to claim 1, further comprising, after determining the predicted freight source quantity of each vehicle type in each area based on the output of the model, the steps of:
determining the heat value of each vehicle type in each area according to the predicted freight quantity of each vehicle type in each area;
and generating a thermodynamic diagram comprising the areas according to the thermodynamic values.
12. A freight demand forecasting system for implementing the freight demand forecasting method according to any one of claims 1 to 11, the system comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring first historical goods source data of each region, and the first historical goods source data comprises the historical goods source quantity of each vehicle type in a first time range;
the model training module is used for training a freight demand prediction model based on the first historical freight source data;
the second acquisition module is used for acquiring second historical goods source data of each region, and the second historical goods source data comprises the historical goods source quantity of each vehicle type in a second time range before the time period to be predicted;
and the demand prediction module is used for inputting the second historical goods source data of each region into the trained freight demand prediction model and determining the predicted goods source quantity of each vehicle type in each region according to the output of the model.
13. A freight demand prediction apparatus, characterized by comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the steps of the freight requirement prediction method of any one of claims 1 to 11 via execution of the executable instructions.
14. A computer-readable storage medium storing a program which when executed by a processor implements the steps of the freight requirement prediction method of any one of claims 1 to 11.
CN202210298762.9A 2022-03-23 2022-03-23 Freight demand prediction method, system, device and storage medium Pending CN114781691A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210298762.9A CN114781691A (en) 2022-03-23 2022-03-23 Freight demand prediction method, system, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210298762.9A CN114781691A (en) 2022-03-23 2022-03-23 Freight demand prediction method, system, device and storage medium

Publications (1)

Publication Number Publication Date
CN114781691A true CN114781691A (en) 2022-07-22

Family

ID=82425909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210298762.9A Pending CN114781691A (en) 2022-03-23 2022-03-23 Freight demand prediction method, system, device and storage medium

Country Status (1)

Country Link
CN (1) CN114781691A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115860645A (en) * 2023-02-23 2023-03-28 深圳市鸿鹭工业设备有限公司 Logistics storage management method and system based on big data
CN117972367A (en) * 2024-04-02 2024-05-03 广东琴智科技研究院有限公司 Data storage prediction method, data storage subsystem and intelligent computing platform

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115860645A (en) * 2023-02-23 2023-03-28 深圳市鸿鹭工业设备有限公司 Logistics storage management method and system based on big data
CN117972367A (en) * 2024-04-02 2024-05-03 广东琴智科技研究院有限公司 Data storage prediction method, data storage subsystem and intelligent computing platform
CN117972367B (en) * 2024-04-02 2024-06-18 广东琴智科技研究院有限公司 Data storage prediction method, data storage subsystem and intelligent computing platform

Similar Documents

Publication Publication Date Title
CN107437144B (en) Order scheduling method, system, computer equipment and storage medium
CN114781691A (en) Freight demand prediction method, system, device and storage medium
CN109543909B (en) Method and device for predicting number of vehicle cases and computer equipment
CN111476588A (en) Order demand prediction method and device, electronic equipment and readable storage medium
CN111950803A (en) Logistics object delivery time prediction method and device, electronic equipment and storage medium
US20180314998A1 (en) Resource Allocation in a Network System
CN110503528B (en) Line recommendation method, device, equipment and storage medium
CN116362431B (en) Scheduling method and device for shared vehicle, computer equipment and storage medium
Wei et al. Bi-level programming model for multi-modal regional bus timetable and vehicle dispatch with stochastic travel time
CN112001515A (en) Method, system, equipment and storage medium for on-line booking train ticket
CN110309974B (en) Logistics transportation destination prediction method and device, electronic equipment and storage medium
CN112184047A (en) Goods source matching recommendation method and device, electronic equipment and storage medium
CN114662804B (en) Resource configuration method, device, equipment and medium for power swapping station
CN115049158B (en) Method, system, storage medium and terminal for predicting running state of urban system
CN114626766B (en) Shared electric vehicle scheduling method, device, equipment and medium based on big data
CN110598989A (en) Goods source quality evaluation method, device, equipment and storage medium
JP7437358B2 (en) Information processing device, control method for information processing device, control program for information processing device, and delivery system
CN113011672A (en) Logistics timeliness prediction method and device, electronic equipment and storage medium
CN112561433A (en) Display method and device of goods source, electronic equipment and storage medium
CN114022006A (en) Freight platform carbon emission reduction estimation method and device, electronic equipment and storage medium
CN113033849B (en) Reserved vehicle matching method, reserved vehicle matching system, electronic equipment and storage medium
CN110796417B (en) Goods source value determination method, device, equipment and storage medium
CN116227889B (en) Vehicle moving method and device for sharing vehicle, computer equipment and storage medium
CN112488199B (en) Logistics distribution mode prediction method, system, equipment and storage medium
CN117933857B (en) Logistics order scheduling method and equipment for after-sales platform and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination