An automated ocean forecast information service method, product, medium and device

By building a fine-tuning training of self-built place name database and large language model, the problem that existing marine numerical forecast products cannot directly return accurate marine forecast information based on user questions is solved, and high-accurate marine forecast information services are achieved.

CN118708666BActive Publication Date: 2025-02-11NAT MARINE ENVIRONMENTAL FORECASTING CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410993981.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2025-02-11
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing ocean numerical forecast products cannot directly return accurate ocean forecast information based on user questions, and cannot meet users' inquiry needs for ocean forecasts at designated locations.

Method used

A self-built place name database for the target sea area is constructed, and a structured information extraction model is generated through fine-tuning training of the large language model. Structured information can be extracted from the user's natural language search request, determine the latitude and longitude of the target site, and generate marine forecast results.

Benefits of technology

It improves the accuracy and reliability of marine forecast results, realizes a self-service marine forecast information service based on human-computer interaction, which can accurately extract structured information input from users and generate marine forecast results for target locations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708666B_ABST
    Figure CN118708666B_ABST
Patent Text Reader

Abstract

The present invention discloses an automated ocean forecast information service method, product, medium and equipment, and relates to the field of ocean forecast services. The present invention first constructs a self-built place name database of a target sea area; collects user retrieval requests for ocean forecasts and constructs a professional field data set; imports the professional field data set into a large language model for fine-tuning training, and generates a structured information extraction model after the training is completed; uses the structured information extraction model to output the current structured information corresponding to the user's current retrieval request; determines whether the target location in the current structured information is in the self-built place name database or the target sea area; if so, generates an ocean forecast result for the target location based on the longitude and latitude corresponding to the target location. The present invention can provide a self-service ocean forecast information service based on human-computer interaction, and improve the accuracy and reliability of ocean forecast results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of ocean forecast services, and in particular to an automated ocean forecast information service method, product, medium and equipment. Background Art

[0002] Ocean forecasts are similar to weather forecasts and are widely used in different production or life scenarios, such as marine aquaculture, marine engineering, ship transportation, coastal tourism, etc. Different users have different focuses on the forecast needs of marine elements according to industry characteristics and their subdivided scenarios. For example, in the scenes of swimming and sightseeing in the bathing beach, tourists will pay more attention to elements such as tides, sea temperature, and waves; for marine aquaculture farmers, they pay more attention to dynamic elements such as seawater temperature and salinity, and biochemical elements such as chlorophyll and dissolved oxygen; for port managers, they pay more attention to elements such as waves, tides, and currents in ports and waterways; for coastal marine engineering construction, they pay great attention to elements such as waves, currents, and tides.

[0003] At present, ocean forecasts are mainly based on ocean numerical forecast products. However, current ocean numerical forecast products do not have the ability to directly return accurate ocean forecast information to users based on their questions. When users request ocean forecasts for a specific time and location, ocean forecasts for the wrong time and location are often given due to inadequate analysis of the user's search request. In addition, since ocean numerical forecasts only have forecast results at the forecast point, they often cannot meet users' query needs for ocean forecasts at specified locations. Summary of the invention

[0004] The purpose of the present invention is to provide an automated ocean forecast information service method, product, medium and equipment, which can provide a self-service ocean forecast information service with human-computer interaction and improve the accuracy and reliability of ocean forecast results.

[0005] To achieve the above object, the present invention provides the following solution.

[0006] On the one hand, the present invention provides an automated ocean forecast information service method, including: constructing a self-built place name database of a target sea area; storing location-related information of various locations within the target sea area in the self-built place name database; the location-related information includes place name, alias, longitude and latitude, continental code, location classification, country code, time zone and modification time; collecting user retrieval requests for ocean forecasts and constructing a professional field data set; importing the professional field data set into a large language model for fine-tuning training, and generating a structured information extraction model after the training is completed; obtaining a current retrieval request currently input by a user expressed in natural language, and using the structured information extraction model to output the current retrieval request response. The method comprises the following steps: obtaining the current structured information corresponding to the target location, the direction, the distance, the distance unit, the time and the forecast elements; determining whether the target location is in the self-built place name database or the target sea area; if the target location is in the self-built place name database, directly searching and returning the longitude and latitude corresponding to the target location from the self-built place name database; if the target location is not in the self-built place name database but is in the target sea area, outputting the longitude and latitude corresponding to the target location by using the geocoding service and updating the longitude and latitude corresponding to the target location to the self-built place name database; if the target location is neither in the self-built place name database nor in the target sea area, prompting the user to re-enter the information; and generating the ocean forecast result of the target location based on the longitude and latitude corresponding to the target location.

[0007] Optionally, constructing a self-built place name database of the target sea area specifically includes: obtaining coastline vector data and sea area vector data of the target sea area; making a buffer for the coastline vector data to generate coastal zone vector data; spatially fusing the coastal zone vector data and the sea area vector data to obtain complete vector data of the target sea area; downloading the global place name data set, and based on the complete vector data of the target sea area, storing places within the target sea area and place-related information corresponding to the places into the self-built place name database.

[0008] Optionally, the construction of the self-built place name database of the target sea area also includes: if the target sea area also includes islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes or estuaries, the islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes or estuaries and the corresponding location-related information are also stored in the self-built place name database.

[0009] Optionally, the collecting of user retrieval requests for ocean forecasts and constructing a professional field data set specifically includes: collecting user retrieval requests expressed in natural language from websites or external search engines to construct a user retrieval request data set; performing word segmentation and grammatical structure analysis on each retrieval request in the user retrieval request data set, and summarizing a grammatical structure table, a directional vocabulary table, a time expression table, a forecast element table, and a distance unit table; constructing a professional field data set based on the grammatical structure table, the directional vocabulary table, the time expression table, the forecast element table, and the distance unit table; the professional field data set includes user retrieval requests expressed in natural language and corresponding tags; the tags are structured information extracted from the retrieval requests.

[0010] Optionally, the large language model adopts Tongyi Qianwen 1_8B-Chat-Int4.

[0011] Optionally, the determining whether the target location is in the self-built place name database or the target sea area specifically includes: preferentially querying the target location in the self-built place name database, if the corresponding place name is queried, it means that the target location is in the self-built place name database; if the target location cannot be found in the self-built place name database, calling the online geocoding WebAPI interface service to query and return the longitude and latitude of the target location; according to the longitude and latitude of the target location, using a ray crossing algorithm to determine whether the target location is located in the target sea area.

[0012] Optionally, generating the ocean forecast result of the target location based on the longitude and latitude corresponding to the target location specifically includes: extracting the locations of forecast points at surrounding locations based on the longitude and latitude corresponding to the target location; performing spatial interpolation processing on the ocean forecast results at the locations of the forecast points to generate the ocean forecast result of the target location.

[0013] On the other hand, the present invention provides a computer program product, comprising a computer program, which implements the automated ocean forecast information service method when executed by a processor.

[0014] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the automated ocean forecast information service method when executed by a processor.

[0015] On the other hand, the present invention provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the automated ocean forecast information service method.

[0016] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects.

[0017] At present, when querying ocean forecast information, entity information is usually extracted from user input information based on the NER method, which has a high chance of inaccuracy, resulting in low accuracy of information extraction and inability to achieve engineering application; in this regard, the present invention constructs a professional field data set based on the user's search request for ocean forecast, fine-tunes the large language model, and generates a structured information extraction model to achieve engineering application, which is used to extract structured information in user input, and can effectively solve the technical defects of incomplete and inaccurate information extraction. On the other hand, after using the model to extract structured information, it is further determined whether the target location is in the self-built place name database or the target sea area, and the sea area location is verified, which can effectively ensure that the user's query location is located in the coastal zone or sea area of ​​the target sea area, thereby improving the reliability of ocean forecast information extraction. In addition, there is currently no commercial system for automated ocean forecasting services, and the application of the structured information extraction model of the present invention can accurately extract the location to be queried from the search request expressed by the user in natural language. Even if there is no ready-made ocean numerical forecast product at the target location, the present invention can also generate an ocean forecast result for the longitude and latitude of the target location, providing a self-service ocean forecast information service based on human-computer interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flow chart of the automated ocean forecast information service method provided by the present invention.

[0020] Figure 2 A schematic diagram of the time series of forecast elements provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] The purpose of the present invention is to provide an automated ocean forecast information service method, product, medium and equipment to provide a self-service ocean forecast information service based on human-computer interaction and improve the accuracy and reliability of ocean forecast results.

[0023] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] like Figure 1 As shown, an automated ocean forecast information service method provided by the present invention includes the following steps 1 to 9.

[0025] Step 1: construct a self-built place name database of the target sea area; the self-built place name database stores location-related information of various locations within the target sea area.

[0026] The present invention constructs a self-built place name database for storing location-related information of various locations within the target sea area and location-related information of user historical query locations. The field information included in the location-related information is shown in Table 1 below.

[0027] Table 1 Field information in the self-built place name database

[0028] Serial number Field Name meaning 1 geonameid Database record id 2 name Place name (place name) 3 asciiname Place name in ASCII format 4 alternatenames Chinese name, alias, etc. 5 latitude latitude 6 longitude longitude 7 continent_codes Continental Code 8 feature_codes Location Classification 9 country_code Country Code 10 time_zone Time Zone 11 modification_date Modification time

[0029] From the field information stored in Table 1, it can be seen that the place-related information includes place names and place names in Asc code format, Chinese names or aliases, longitude and latitude, continental codes, place classifications, country codes, time zones, and modification times. The necessary place-related information is the place names and longitude and latitude mentioned. The use of other information such as continental codes, place classifications, country classifications, time zones, etc. can speed up data retrieval and improve retrieval efficiency at the engineering software implementation level. The method for constructing a self-built place name database mainly includes two parts: one is database initialization generation, which relies on the global place name dataset GeoNamesData; the other is that after the user successfully queries and retrieves, the user's historical query locations and their location-related information are also stored in the self-built place name database.

[0030] The step 1 constructs a self-built place name database of the target sea area, specifically including the following steps 1.1 to 1.5.

[0031] Step 1.1: Obtain the coastline vector data and sea area vector data of the target sea area.

[0032] Collect the coastline vector data of the target sea area and the sea area vector data as the data source, usually in the shapefile file, a common geographic information data file format. The coastline vector data type is line, and the sea area vector data type is polygon.

[0033] Step 1.2: Create a buffer for the coastline vector data and generate coastal zone vector data.

[0034] A buffer zone is created based on the coastline vector data of the target sea area with a range of 20km. Coastal zone vector data of polygon type is generated.

[0035] Step 1.3: Perform spatial fusion processing on the coastal zone vector data and the sea area vector data to obtain the complete vector data of the target sea area.

[0036] The coastal zone vector data and the sea area vector data are spatially fused (Dissolve), and the two polygon type vector data are merged into a complete vector data (polygon type). The complete vector data will be used as the basis for judging whether a certain location is within the target sea area.

[0037] Step 1.4: Download the global place name dataset, and store the places within the target sea area and the corresponding place-related information into the self-built place name database based on the complete vector data of the target sea area.

[0038] Download GeoNames Data, which is in the format of txt text. Write a program to parse the file and extract text records line by line. Preprocess the GeoNames Data text records to filter out the records far away from the target sea area. The processing method is as follows: process the records in GeoNames Data line by line, extract the longitude and latitude corresponding to the place name, and calculate the relationship between it and the polygon corresponding to the complete vector data through the ray casting algorithm. The specific technical implementation uses the Shapely library (Shapely is a Python library for geometric operations that can process geometric objects such as points, lines, polygons, etc.), save the places within the target sea area, and store them together with the corresponding place-related information in the self-built place name database.

[0039] The self-built place name database will regularly update GeoNames Data records. The current data update interval is 6 months.

[0040] Step 1.5: If the target sea area also includes islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes or estuaries, the islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes or estuaries and the corresponding location-related information are also stored in the self-built place name database.

[0041] If there are documents that publish the standard names of islands in the target sea area and provide specific island information, then based on the information provided about islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes, estuaries, etc., the location-related information is extracted through a parsing program and stored in a self-built place name database. Missing fields are uniformly automated or manually processed. For example, information such as continental codes, country codes, and time zones are automatically updated during program processing, and location classifications are manually sorted and updated.

[0042] Usually, the standard names of islands published in documents are presented in the form of PDF tables, which include serial number, standard name, Chinese name, Pinyin, administrative area, geographical location (north latitude, east longitude) and other information. When processing the data involved in the table by program parsing, a third-party library based on Python can be used to extract the information in the PDF table. Furthermore, for the longitude and latitude information in the table, the present invention extracts it based on a predefined regular expression, and converts the original longitude and latitude in degree, minute and second format into decimal longitude and latitude and stores it in the self-built place name database.

[0043] Regular expression is a technical means for extracting specific information from text. Regular expression is a logical formula for operating character strings and special characters. It uses some pre-defined specific characters and the combination of these specific characters to form a "regular string". This "regular string" is used to express a filtering logic for the string. Regular expression is a text pattern, and the pattern describes one or more strings to be matched when searching for text. Specifically for the present invention, the so-called predefined regular expression is the expression method for extracting longitude and latitude information pre-defined in the method of the present invention. Most programming languages ​​support regular expressions. For example, for the longitude and latitude "40°26'47"N79°58'36"W" stored in the format of degrees, minutes and seconds in the table, it can be expressed with the predefined regular expression \d+°\d+'\d+"[N|S]\s+\d+°\d+'\d+"[E|W], and the relevant longitude and latitude information can be extracted; where \d+ can match more than one value; \d+° means extracting the value represented by the ° (degree) symbol; \d+' means extracting the value represented by the ' (minute) symbol; \d+" means extracting the value represented by the (second) symbol; \s+ means matching more than one blank character; [N|S] is used to match the character N or the character S, and the characters N and S correspond to the identifiers of the north latitude and the south latitude respectively; [W|E] is used to match the character W or the character E, and the characters W and E correspond to the identifiers of the west longitude and the east longitude respectively. Using regular expressions, you can extract and verify data in batches, process data automatically, and improve efficiency.

[0044] Step 2: Collect users’ retrieval requests for ocean forecasts and construct professional domain datasets.

[0045] When directly using a large language model to automatically extract information, the results obtained are unstable (the same input may not always produce the same results each time, and sometimes incomprehensible results may occur). Therefore, it is necessary to fine-tune the large language model through a customized professional domain dataset in the field of ocean forecasting, and train it so that it can obtain stable structured information output. Therefore, the main purpose of collecting user search requests in step 2 is to build a professional domain dataset for fine-tuning the large language model. The following is an example of Chinese search requests.

[0046] The step 2 collects user retrieval requests for ocean forecasts and constructs a professional field data set, which specifically includes the following steps 2.1 to 2.3.

[0047] Step 2.1: Collect users’ retrieval requests expressed in natural language from websites or external search engines to build a user retrieval request dataset.

[0048] The Chinese data sources can be obtained through the Baidu statistics of the China Marine Forecast Network, which provides historical search requests, such as "Huangyan Island marine forecast", "Sanya Yalong Bay wave forecast", "Sanduoao tidal forecast", "Mindong fishing ground one-week wind force", "Sanya wave height forecast", "Jiangsu Jingjiang tidal forecast", "Wanning wave height forecast", "Today's Dalian waters sea temperature" and other search terms.

[0049] Using external search engines to collect user search requests requires obtaining search records that meet specific keyword requirements from commercial companies.

[0050] A user search request data table is constructed to store data records in the user search request data set. The field information included in the user search request data table is shown in Table 2 below.

[0051] Table 2 Field information in the user search request data table

[0052] Serial number Field Name meaning 1 id Database record id 2 Query Search text 3 Request time Request time 4 QuerySources Search Source 5 modificationdate Modification time

[0053] Step 2.2: Perform word segmentation and grammatical structure analysis on each search request in the user search request data set, and summarize the grammatical structure table, directional word table, time expression table, forecast element table and distance unit table.

[0054] For the collected historical user search requests, we first use the NER tool to extract information from the user search request dataset, mark the parts of speech in the search requests one by one, and use the python Jieba word segmentation toolkit to further analyze the grammatical structure of the search request, that is, to analyze the characteristics of the expressions of place names, directions, and time.

[0055] Based on the word segmentation results, the grammatical structure of each search request is analyzed and the following grammatical structure table can be summarized.

[0056] Table 3 Syntax structure table

[0057]

[0058] Furthermore, based on the word segmentation results and some manual identification of commonly used expressions of direction and time, the following direction vocabulary table, time expression table, forecast element table and distance unit table can be summarized.

[0059] Table 4 Direction vocabulary

[0060]

[0061]

[0062] Table 5 Time expression table

[0063] Serial number Time expression 1 today 2 tomorrow 3 Next week, next two weeks 4 XX to XX 5 From XX / XX / XX to XX / XX 6 …

[0064] Table 6 Forecast elements

[0065] Serial number Forecast elements 1 Waves 2 SST 3 tidal 4 ocean current 5 salinity 6 Wind 7 Chlorophyll 8 Dissolved oxygen 9 …

[0066] Table 7 Distance units table

[0067] Serial number Time expression 1 kilometer 2 Nautical Mile 3 rice 4 …

[0068] The summary of the direction vocabulary, time expression table and distance unit table is used for the subsequent construction of professional field data sets. It is also used for the subsequent construction of corresponding mapping relationships, and calculates the specific location (latitude and longitude) according to the expression of location + direction + distance.

[0069] Step 2.3: Construct a professional field data set based on the grammatical structure table, the direction vocabulary table, the time expression table, the forecast element table and the distance unit table; the professional field data set includes the user's search request expressed in natural language and the corresponding label; the label is structured information extracted from the search request.

[0070] According to the grammatical structures summarized in Table 3, the retrieval request training data sets expressed in natural language are constructed respectively. The specific method is to take the grammatical structure in Table 3 as the basis, add , blank characters, etc. in the specific natural language expression, enrich the syntactic structure, and generate no less than 300 retrieval request training data as training samples for each grammatical structure. For complex grammatical structures such as the fifth and sixth rows in Table 3, an additional 100 retrieval request training data are added. Each retrieval request training data is a training sample expressed in natural language as user input. The place names in each retrieval request training data come from the place names in the self-built place name database in Table 1, the forecast elements come from Table 6, the time comes from Table 5, the direction comes from Table 4, and the distance unit comes from Table 7.

[0071] It should be noted that special processing is required for time samples that need to be organized. In terms of time, users often do not enter it explicitly. When the user does not specify the time, the time is completed as today in the format of year, month, and day; when processing expressions such as "tomorrow", "next week", and "next 15 days", the corresponding completion is the time in the format of year, month, and day of tomorrow, the next week, and the next 15 days.

[0072] Corresponding to the user's input, a "standard answer" needs to be given as the label of the training sample. Its basic structure is as follows, which is a formatted structure:

[0073] Location: Near the Yangtze River Estuary

[0074] Direction: East

[0075] Distance: 10

[0076] Distance unit: nautical miles

[0077] Time: year / month / day or year / month / day-year / month / day

[0078] Forecast elements: waves.

[0079] If a certain content does not exist in the label corresponding to a training sample, such as direction, distance, etc., it is marked with " / ". In this way, each training sample in the retrieval request training data set and its corresponding label together constitute a professional field data set.

[0080] The present invention constructs a professional field data set to train a large language model in order to convert user input into structured information. The three essential elements of structured information are time, forecast elements, and location. Azimuth, distance, and distance units are used to further describe the location. After the search request input by the user is structured and extracted, it is convenient to further carry out engineering (automatic) forecasting work, that is, to confirm which ocean numerical forecast product to retrieve according to the three major elements, and to extract ocean forecast results from the ocean numerical forecast products according to time and location.

[0081] Step 3: Import the professional domain dataset into the large language model for fine-tuning training. After the training is completed, a structured information extraction model is generated.

[0082] Select a suitable large language model as the model base, input a professional field data set into the model through the fine-tuning function provided by the model, and achieve the expected goal through the training process. The expected goal of the present invention is to use the large language model to conduct regular analysis of the location, time, and forecast elements of the search request input by the user, and extract the corresponding structured information.

[0083] The large language model of the present invention adopts Tongyi Qianwen 1_8B-Chat-Int4. Among them, the most critical and core part is to create a professional field data set for the large language model to learn. The training samples in the professional field data set are organized into json format according to the examples given by Tongyi Qianwen, and organized in a single-round dialogue mode. The single-round dialogue is realized by programming scripts, and the format is as follows.

[0084] Single-turn conversation: [

[0086]

[0087] Import professional field datasets into the large language model for fine-tuning training, hoping to achieve stable structured information extraction, that is, to be able to stably extract location, direction, distance, distance unit, time, and forecast elements. The fine-tuning steps and parameter settings all adopt the recommended configuration of Tongyi Qianwen, with 2 training rounds. Use actual user search requests to test whether the trained large language model can correctly extract the corresponding structured information, and it is required to achieve a relatively stable accuracy rate (more than 85%). The trained large language model is put into use as a structured information extraction model.

[0088] Since the construction of professional field data sets has a great influence on the fine-tuning effect of the large language model, if the accuracy of structured information extraction is less than 85%, it is necessary to further supplement training samples and re-train the model. The professional field data set construction method described in the present invention is the result of multiple tests. The accuracy of the large language model obtained through its training is above 85%, and it can be put into use as a structured information extraction model. The structured information extraction model outputs the corresponding structured information. The input is a retrieval request expressed in natural language, and the output is the extracted structured information, including location, direction, distance, distance unit, time and forecast elements.

[0089] Step 4: Obtain the current search request currently input by the user expressed in natural language, and use the structured information extraction model to output the current structured information corresponding to the current search request.

[0090] The user can make a search request for ocean forecast information through human-computer dialogue interaction, such as asking questions by voice or inputting by keyboard. The structured information extraction model is used to output the current structured information corresponding to the user's current search request; the current structured information includes the target location, direction, distance, distance unit, time and forecast elements. The forecast elements include sea waves, sea temperature, tides, currents, salinity, wind, chlorophyll, dissolved oxygen and other elements.

[0091] Step 5: Determine whether the target location is in the self-built place name database or the target sea area.

[0092] Step 5 is used to spatially verify the target location extracted by the structured information extraction model to determine whether it is within the coastal zone or ocean area of ​​the target sea area.

[0093] The step 5 determines whether the target location is in the self-built place name database or the target sea area, and specifically includes the following steps 5.1 to 5.3.

[0094] Step 5.1: Query the target location in the self-built place name database first. If the corresponding place name is found, it means that the target location is in the self-built place name database. Locations in the self-built place name database do not need to be verified in the coastal zone or ocean area. If the target location is found in the self-built place name database, the latitude and longitude of the target location are directly returned.

[0095] Step 5.2: If the target location cannot be found in the self-built place name database, call the online geocoding WebAPI interface service to query and return the latitude and longitude of the target location.

[0096] Register a commercial map development platform, such as Baidu / AutoNavi / Tiandi Map, and obtain its geocoding service (Geocoder), which is a type of WebAPI interface service. This type of geocoding service can resolve structured addresses (province / city / district / street / house number) into corresponding location coordinates. The more complete the address structure, the more accurate the address content, and the higher the coordinate accuracy of the parsing conversion processing. Input the place name and output the coordinate longitude and latitude.

[0097] If the target location cannot be found in the self-built place name database, the online geocoding WebAPI interface service is called to query and return the spatial location coordinates of the target location. If the spatial location (expressed by lat and lon) is queried, and the target location also includes direction and distance information, it is necessary to further calculate the latitude and longitude increments (expressed by Δlat and Δlon). The geopy library is used directly to calculate, and the increment is added to the spatial position to obtain the final position as the longitude and latitude of the target location (expressed by lat1 and lon1).

[0098] Step 5.3: Based on the latitude and longitude of the target location, use the ray traversal algorithm to determine whether the target location is located in the target sea area.

[0099] Perform coordinate verification to verify whether the longitude and latitude of the target location are located in the target sea area. Specifically, a ray crossing algorithm is used to detect the relationship between the target location and the target sea area polygon, and determine whether the longitude and latitude of the target location are within the target sea area. If it is within the target sea area, the place name, longitude and latitude corresponding to the target location and other location-related information are stored in a self-built place name database for the next information extraction. If there is only a location without direction and distance segmentation, the target location is used as the center point, and the neighborhood parameters are preset to generate a buffer zone. It is determined whether the buffer zone and the target sea area polygon have an intersection. If so, it is considered to be within the range. If not, it is returned as not within the range. If the WebAPI cannot directly query the longitude and latitude coordinates of the target location, a failure indicator is returned to prompt the user to re-enter.

[0100] Step 6: If the target location is in the self-built place name database, directly search and return the longitude and latitude corresponding to the target location from the self-built place name database.

[0101] Step 7: If the target location is not in the self-built place name database but is located in the target sea area, use the geocoding service to output the longitude and latitude corresponding to the target location and update it to the self-built place name database.

[0102] The most ideal way to express a location is to clearly specify the detailed location, such as No. xx, xx Street, xx District, xx City. This location expression is most conducive to geocoding queries (mapping place names to longitude and latitude). According to the collected corpus, users often do not input so carefully, and the usual expressions are shown in Table 3. If the target location in the structured information extracted by the model also has direction and distance segmentation, the location + direction + distance method is used to calculate the specific longitude and latitude, which more accurately captures the longitude and latitude pointed by the user. Specifically, the geopy library can be used for calculation, so as to prepare for the subsequent acquisition of ocean forecast information of the target sea area pointed to according to the longitude and latitude of the target location.

[0103] If the latitude and longitude of the target location is not in the self-built place name database but is located within the target sea area, the place name, longitude and latitude and other location-related information corresponding to the target location will be stored in the self-built place name database to complete the update of the self-built place name database.

[0104] Step 8: If the target location is neither in the self-built place name database nor in the target sea area, the user is prompted to re-enter the location.

[0105] The purpose of coordinate verification is to verify whether the location entered by the user (the target location extracted by the large language model) is located in the coastal zone or sea area of ​​the target sea area. Because the ocean numerical forecast product does not have forecast results in the land area. If the target location given by the user is far away from the coast or directly inland, the intelligent customer service needs to return the location entered by the customer as invalid and prompt the user to re-enter.

[0106] Step 9: Generate ocean forecast results for the target location based on the latitude and longitude corresponding to the target location.

[0107] Spatially, the locations of the forecast points of the surrounding locations are extracted based on the latitude and longitude of the target location, and the inverse distance weighted method is used for interpolation processing to generate the ocean forecast results of the target location. For example, the information service grid of a certain target sea area is produced at a spatial resolution of 0.1°, involving coastal zones, sea areas, islands and coastal buffer zones. The forecast points of the surrounding locations of the target location are the locations where the numerical forecast model outputs ocean forecast results, but there are no direct ocean forecast results at the target location. Therefore, it is necessary to interpolate the target location to the forecast points of the surrounding locations in space. The common method is the inverse distance weighted interpolation method.

[0108] In terms of time, forecast values ​​are extracted at each forecast moment and spatial interpolation is performed to generate time series values ​​at the latitude and longitude. The time series refers to the ocean forecast results at a spatial location for a period of time in the future. Figure 2 Taking ocean wave forecasting as an example, the time series values ​​of forecast elements are displayed, and the forecast results of ocean wave significant wave height are generated as required.

[0109] The present invention provides users with self-service ocean forecast information services through human-computer interaction, that is, the user inputs the forecast elements, target address, and time to be queried, and the method of the present invention provides the ocean forecast results of any target location within the target sea area. Fine-tuning the large language model is an important step to accurately extract structured information from the user input, that is, forecast elements, target location, and time.

[0110] In some embodiments, the present invention further provides a computer program product, including a computer program, which implements the automated ocean forecast information service method when executed by a processor.

[0111] The computer program product can be understood as intelligent customer service. Users can ask questions to it through interactive questioning (voice). Intelligent customer service will feedback the ocean forecast results that the user wants based on the search request entered by the user (generally composed of time, place, and forecast elements). At present, the existing large language model does not have the ability to return ocean forecast information to the user directly through questions. The intelligent customer service product formed based on the automated ocean forecast information service method of the present invention has the function of returning ocean forecast information, which is the result of integrating multiple technical means, not just relying on a large language model. Compared with the prior art, due to the narrow field of ocean forecasting, no similar products or technical methods have been found for the time being. In the present invention, the large language model is mainly used to process the search request entered by the user (natural language consisting of time, place, and forecast elements). Compared with the traditional NER (named entity recognition) method, this part uses a fine-tuning method to better identify user input and extract structured information, which is convenient for further processing based on the structured information.

[0112] In some embodiments, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the automated ocean forecast information service method when executed by a processor.

[0113] In some embodiments, the present invention also provides a computer device, which includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the automated ocean forecast information service method can be implemented.

[0114] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An automated ocean forecast information service method, characterized in that: include: Construct a self-built place name database of the target sea area; The self-built place name database stores location-related information of various locations within the target sea area; The location-related information includes the location name, alias, longitude and latitude, continental code, location category, country code, time zone and modification time; Collect users' retrieval requests for ocean forecasts and build professional field datasets; The collecting of users' search requests for ocean forecasts and the construction of professional field data sets specifically include: Collect users' search requests expressed in natural language from websites or external search engines to build a user search request dataset; Perform word segmentation and grammatical structure analysis on each search request in the user search request data set, and summarize the grammatical structure table, directional word table, time expression table, forecast element table and distance unit table; A professional field data set is constructed based on a grammatical structure table, a direction word table, a time expression table, a forecast element table, and a distance unit table; the professional field data set includes a search request expressed by a user in natural language and a corresponding label; the label is structured information extracted from the search request, including location, direction, distance, distance unit, time, and forecast element; Import professional field datasets into the large language model for fine-tuning training, and generate a structured information extraction model after training is completed; Obtaining a current search request currently input by a user expressed in natural language, and outputting current structured information corresponding to the current search request using a structured information extraction model; the current structured information includes a target location, direction, distance, distance unit, time, and forecast elements; Determine whether the target location is in the self-built place name database or the target sea area; If the target location is in the self-built place name database, directly search and return the latitude and longitude corresponding to the target location from the self-built place name database; If the target location is not in the self-built place name database but is located in the target sea area, use the geocoding service to output the latitude and longitude corresponding to the target location and update it to the self-built place name database; If the target location is neither in the self-built place name database nor in the target sea area, the user is prompted to re-enter; Generate ocean forecast results for the target location based on the longitude and latitude corresponding to the target location.

2. The automated ocean forecast information service method according to claim 1, characterized in that: The self-built place name database of the target sea area specifically includes: Obtain the coastline vector data and sea area vector data of the target sea area; Make a buffer for the coastline vector data and generate coastal zone vector data; Perform spatial fusion processing on the coastal zone vector data and the sea area vector data to obtain the complete vector data of the target sea area; Download the global place name dataset, and store the places within the target sea area and the corresponding place-related information into the self-built place name database based on the complete vector data of the target sea area.

3. The automated ocean forecast information service method according to claim 2, characterized in that: The self-built place name database of the target sea area is constructed, and further includes: If the target sea area also includes islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes or estuaries, the islands, archipelagos, peninsulas, bays, straits, waterways, beaches, capes or estuaries and the corresponding location-related information will also be stored in the self-built place name database.

4. The automated ocean forecast information service method according to claim 3, characterized in that: The large language model adopts Tongyi Qianwen 1_8B-Chat-Int4.

5. The automated ocean forecast information service method according to claim 3, characterized in that: The step of determining whether the target location is in the self-built place name database or the target sea area specifically includes: The target location is searched in the self-built place name database first. If the corresponding place name is found, it means that the target location is in the self-built place name database; If the target location cannot be found in the self-built place name database, call the online geocoding WebAPI interface service to query and return the latitude and longitude of the target location; According to the latitude and longitude of the target location, a ray crossing algorithm is used to determine whether the target location is located in the target sea area.

6. The automated ocean forecast information service method according to claim 5, characterized in that: The generating of the ocean forecast result of the target location based on the latitude and longitude corresponding to the target location specifically includes: Extract the location of the forecast point of the surrounding location based on the latitude and longitude corresponding to the target location; The ocean forecast results at the forecast point are spatially interpolated to generate the ocean forecast results for the target location.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the automated ocean forecast information service method described in any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automated ocean forecast information service method described in any one of claims 1 to 6 is implemented.

9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the automated ocean forecast information service method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Marine forecast information service method based on user interest points and storage medium

    CN112579885A

  • Geographic entity space-time knowledge graph ontology library construction method

    CN115269751A