Meteorological data recommendation method, device, equipment and storage medium

By generating word segmentation and statement feature vectors for meteorological data query statements, the problems of low efficiency and poor user experience in traditional meteorological data query are solved, and more efficient and accurate data recommendation is achieved.

CN119248843BActive Publication Date: 2025-04-04河北省气象信息中心
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411730327.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-04
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

The traditional meteorological data query methods have problems such as inefficient query efficiency and poor user experience, which is difficult to quickly respond to user needs and improve the efficient, accurate and rapid use of meteorological data in business application scenarios.

Method used

By obtaining data query statements, perform word segmentation path analysis and word segmentation probability analysis, multiple first word segmentation are obtained, and input them into the statement analysis model, the statement feature vector is generated, and finally match and recommend the database meteorological data based on the feature vector.

Benefits of technology

This method improves the accuracy and efficiency of meteorological data query, reduces the amount of calculation, retains statement characteristics, provides more accurate data recommendations, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248843B_ABST
    Figure CN119248843B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of meteorological data matching technology, and in particular to a meteorological data recommendation method, device, equipment and storage medium. The method of the present invention first obtains a data query statement; then performs word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain multiple first word segmentations; then the multiple first word segmentations are sequentially input into a sentence analysis model to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on multiple word segmentation sample sets; finally, the meteorological data in the database is matched according to the sentence feature vector, and the meteorological data is recommended according to the matching result. The implementation method of the present invention performs word segmentation on the query statement, and extracts the sentence feature vector based on the word segmentation result. Since there is no need to extract semantics, the technical and development cost is small, and more sentence features can be retained, so the recommended data is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of meteorological data matching, and in particular to a meteorological data recommendation method, device, equipment and storage medium. Background Art

[0002] Meteorological data intelligent service refers to the intelligent processing and analysis of meteorological data through artificial intelligence technology, so as to provide more accurate, efficient and personalized meteorological services. In the future, meteorological data intelligent services will pay more attention to user experience and service quality, so as to improve user satisfaction.

[0003] However, traditional meteorological data query methods have problems such as low query efficiency and poor user experience. The rise of big data cloud platforms has made it possible to provide intelligent services for meteorological data.

[0004] How to quickly respond to these needs and improve the efficient, accurate and rapid use of meteorological data in business application scenarios has become an urgent problem to be solved.

[0005] Based on this, it is necessary to develop and design a meteorological data recommendation method. Summary of the invention

[0006] The embodiments of the present invention provide a meteorological data recommendation method, device, equipment and storage medium, which are used to solve the problem of poor accuracy of sentence-based meteorological data query in the prior art.

[0007] In a first aspect, an embodiment of the present invention provides a meteorological data recommendation method, comprising:

[0008] Get data query statement;

[0009] Performing word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain multiple first word segmentations;

[0010] Inputting the plurality of first word segmentations into a sentence analysis model in sequence to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on a plurality of word segmentation sample sets;

[0011] The meteorological data in the database is matched according to the sentence feature vector, and the meteorological data is recommended according to the matching result.

[0012] In a possible implementation, performing word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain a plurality of first word segmentations includes:

[0013] Get the first word segmentation queue;

[0014] Extracting a first number of characters from a first position of the data query statement as to-be-processed segmented words;

[0015] Matching the to-be-processed segmented words according to the vocabulary;

[0016] If the match is successful, a new word segmentation queue is created based on the first word segmentation queue, and the to-be-processed word segmentation is added to the newly created word segmentation queue;

[0017] If the first number of characters does not reach the character upper limit, the first number is incremented, and the process jumps to the step of extracting the first number of characters from the first position of the data query statement as the word segmentation to be processed;

[0018] If the first number of characters reaches the character upper limit and no new word segmentation queue is created based on the first word segmentation queue, the first word segmentation queue is deleted;

[0019] Otherwise, the obtained multiple newly created word segmentation queues are used as multiple first word segmentation queues;

[0020] For the first word segmentation queue that has not completed word segmentation of the data query statement, the first position is adjusted according to the end of the word segmentation at the end of the first word segmentation queue, the first number is initialized, and the step of jumping to extracting the first number of characters from the first position of the data query statement as the word segmentation to be processed is performed;

[0021] If all first word segmentation queues have completed word segmentation of the data query statement, a target word segmentation queue is selected from the multiple first word segmentation queues by word segmentation probability analysis;

[0022] The multiple word segments in the target word segmentation queue are used as the multiple first word segmentations.

[0023] In a possible implementation, the step of selecting a target word segmentation queue from a plurality of first word segmentation queues through word segmentation probability analysis includes:

[0024] Selecting, from the plurality of first word segmentation queues, a plurality of word segmentation queues with the least word segmentation as a plurality of candidate queues;

[0025] The probability coefficient of each candidate queue is calculated according to the first formula, thereby obtaining multiple probability coefficients, wherein the first formula is:

[0026]

[0027] In the formula, is the probability coefficient of the alternative queue, is the total number of elements in the candidate queue, For the candidate queue elements;

[0028] A target word segmentation queue is selected from a plurality of first word segmentation queues according to the plurality of probability coefficients.

[0029] In a possible implementation, the process of constructing the sentence analysis model includes:

[0030] Obtain a basic relationship model, a plurality of coefficient arrays, and a plurality of word segmentation sample sets, wherein the word segmentation sample set includes a sample word segmentation queue and sample meteorological data, the basic relationship model includes a plurality of undetermined coefficients, and the number of data in the coefficient array is the same as the number of undetermined coefficients in the basic relationship model;

[0031] Substituting the multiple coefficient arrays into the basic relationship model respectively to obtain multiple first models;

[0032] Extracting sample sets from the multiple word segmentation sample sets in sequence as sample sets to be processed;

[0033] Inputting the sample word segmentation queues of the sample set to be processed into each first model respectively to obtain a plurality of first sentence feature vectors, wherein each first sentence feature vector corresponds to a first model;

[0034] Calculate the fitness of each first model according to the first sentence feature vector, and add the obtained first fitness value to the fitness queue of the corresponding first model;

[0035] Determining whether there is a model that meets the target among the multiple first models according to the fitness queue;

[0036] If there is a model that meets the goal, the model that meets the goal is used as the statement analysis model;

[0037] Otherwise, adjust each coefficient array according to the multiple first fitnesses and the fitness queues, and jump to the step of substituting the multiple coefficient arrays into the basic relationship model respectively to obtain multiple first models.

[0038] In a possible implementation, the basic relationship model is:

[0039]

[0040] In the formula, is the sentence feature vector elements, is the total number of rows of intermediate nodes, For the The output node coefficients, For the Line The first column node coefficients, For the Line The output of the middle node of the column, For the input input variables, is the total number of input variables, is the total number of columns of intermediate nodes, is a natural constant, is the bias coefficient, is the column number where the feeding node is located, is the total number of elements in the sentence feature vector.

[0041] In a possible implementation, calculating the fitness of each first model according to the first sentence feature vector includes:

[0042] For each first model, perform the following steps respectively:

[0043] Acquire multiple first attribute vectors, wherein each attribute vector corresponds to a sample meteorological data, and the first attribute vector represents multiple dimensional attributes of the sample meteorological data;

[0044] respectively calculating the dot product of the first sentence feature vector and each first attribute vector to obtain a plurality of first dot product results;

[0045] sorting the plurality of sample meteorological data according to the plurality of first dot product results;

[0046] The ratio of the ranking of the reference sample meteorological data in the multiple sample meteorological data to the total number of the multiple sample meteorological data is used as the fitness of the first model, wherein the reference sample meteorological data is the sample meteorological data in the sample set to be processed.

[0047] In a possible implementation, matching the meteorological data in the database according to the sentence feature vector and recommending the meteorological data according to the matching result includes:

[0048] Constructing a second attribute vector according to multiple attributes of each meteorological data in the database, thereby obtaining multiple second attribute vectors;

[0049] respectively calculating the dot product of the sentence feature vector and each second attribute vector to obtain a plurality of second dot product results;

[0050] sorting the plurality of meteorological data according to the plurality of second dot product results;

[0051] Recommend meteorological data according to the meteorological data sorting.

[0052] In a second aspect, an embodiment of the present invention provides a meteorological data recommendation device, which is used to implement the meteorological data recommendation method described in the first aspect or any possible implementation of the first aspect, wherein the meteorological data recommendation device includes:

[0053] A query statement acquisition module is used to acquire data query statements;

[0054] A word segmentation module, used to perform word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain multiple first word segments;

[0055] A sentence analysis module, used for sequentially inputting the plurality of first word segmentations into a sentence analysis model to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on a plurality of word segmentation sample sets;

[0056] as well as,

[0057] The data recommendation module is used to match the meteorological data in the database according to the sentence feature vector and recommend the meteorological data according to the matching result.

[0058] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, it implements the steps of the method described in the first aspect or any possible implementation method of the first aspect.

[0059] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.

[0060] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0061] The embodiment of the present invention discloses a method for recommending meteorological data, which first obtains a data query statement; then performs segmentation path analysis and segmentation probability analysis on the data query statement to obtain multiple first segmentations; then sequentially inputs the multiple first segmentations into a statement analysis model to obtain a statement feature vector, wherein the statement analysis model is constructed based on multiple segmentation sample sets; finally, matches the meteorological data in the database according to the statement feature vector, and recommends the meteorological data according to the matching result. The embodiment of the present invention performs segmentation on the query statement, and extracts the statement feature vector based on the segmentation result. Since there is no need to extract semantics, the technical and development costs are small, and more statement features can be retained, so the recommended data is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art 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 labor.

[0063] Figure 1 is a flow chart of a meteorological data recommendation method provided by an embodiment of the present invention;

[0064] Figure 2 It is a principle diagram of the construction process of the sentence analysis model provided by the embodiment of the present invention;

[0065] Figure 3 It is a functional block diagram of a meteorological data recommendation device provided by an embodiment of the present invention;

[0066] Figure 4 is a functional block diagram of an electronic device provided by an embodiment of the present invention;

[0067] Figure 5 It is a flow chart of constructing a word segmentation queue provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0068] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary details.

[0069] In order to make the purpose, technical solutions and advantages of the present invention more clear, a specific implementation method will be described below in conjunction with the accompanying drawings.

[0070] The following is a detailed description of an embodiment of the present invention. This example is implemented based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0071] Figure 1 A flowchart of a meteorological data recommendation method provided in an embodiment of the present invention.

[0072] like Figure 1 As shown, it shows a flow chart of the implementation of the meteorological data recommendation method provided by the embodiment of the present invention, which is described in detail as follows:

[0073] In step 101, a data query statement is obtained.

[0074] In step 102, the data query statement is subjected to word segmentation path analysis and word segmentation probability analysis to obtain a plurality of first word segments.

[0075] In some implementations, step 102 includes:

[0076] Get the first word segmentation queue;

[0077] Extracting a first number of characters from a first position of the data query statement as to-be-processed segmented words;

[0078] Matching the to-be-processed segmented words according to the vocabulary;

[0079] If the match is successful, a new word segmentation queue is created based on the first word segmentation queue, and the to-be-processed word segmentation is added to the newly created word segmentation queue;

[0080] If the first number of characters does not reach the character upper limit, the first number is incremented, and the process jumps to the step of extracting the first number of characters from the first position of the data query statement as the word segmentation to be processed;

[0081] If the first number of characters reaches the character upper limit and no new word segmentation queue is created based on the first word segmentation queue, the first word segmentation queue is deleted;

[0082] Otherwise, the obtained multiple newly created word segmentation queues are used as multiple first word segmentation queues;

[0083] For the first word segmentation queue that has not completed word segmentation of the data query statement, the first position is adjusted according to the end of the word segmentation at the end of the first word segmentation queue, the first number is initialized, and the step of jumping to extracting the first number of characters from the first position of the data query statement as the word segmentation to be processed is performed;

[0084] If all first word segmentation queues have completed word segmentation of the data query statement, a target word segmentation queue is selected from the multiple first word segmentation queues by word segmentation probability analysis;

[0085] The multiple word segments in the target word segmentation queue are used as the multiple first word segmentations.

[0086] In some implementations, the step of selecting a target word segmentation queue from a plurality of first word segmentation queues through word segmentation probability analysis includes:

[0087] Selecting, from the plurality of first word segmentation queues, a plurality of word segmentation queues with the least word segmentation as a plurality of candidate queues;

[0088] The probability coefficient of each candidate queue is calculated according to the first formula, thereby obtaining multiple probability coefficients, wherein the first formula is:

[0089]

[0090] In the formula, is the probability coefficient of the alternative queue, is the total number of elements in the candidate queue, For the candidate queue elements;

[0091] A target word segmentation queue is selected from a plurality of first word segmentation queues according to the plurality of probability coefficients.

[0092] For example, currently, in terms of data query technology, the mainstream technology is that the query party enters multiple keywords and searches based on the keywords. However, there may be multiple combinations of keywords, each with different meanings. Users need to further filter out data that they are satisfied with based on the search results. The query results have poor accuracy and speed, which affects the user experience.

[0093] As an improvement, some technical solutions accept user query statements. Since the statements are less ambiguous than keyword searches, the results are relatively more accurate. However, the current mainstream statement query method is to convert the statement into the meaning of the statement, and then query based on the meaning. This brings a larger amount of calculation, and there is a possibility of losing some minor features when understanding the meaning of the statement (for example, some emphatic participles such as very, very, usually, and often will be weakened or ignored). In addition, compared with general data query systems, dedicated data query systems (for example, only for meteorological data) convert statements into semantics for querying. The initial technical resource investment and subsequent hardware investment make the meaning of semantic query very small compared to the query effect obtained.

[0094] The purpose of this application is to generate a feature vector based on the user's query statement, and then perform data matching based on the feature vector. In this way, feature calculation replaces semantic analysis, and both the amount of calculation and accuracy will be optimized.

[0095] To achieve the above purpose, after obtaining the data query sentence, the embodiment of the present invention performs word segmentation on the query sentence, inputs the word segmentation into the sentence analysis model, obtains the sentence characteristics, and finally gives the data query result according to the sentence characteristics.

[0096] In terms of word segmentation, the implementation method of the present invention is to extract a certain number of characters from a predetermined position, analyze whether the characters have corresponding word segmentations, and if so, add the word segmentations based on the existing word segmentation queue to construct a new queue, and repeat this process to obtain a word segmentation queue.

[0097] like Figure 5As shown, in terms of word segmentation, in step 501, an embodiment of the present invention takes out a first number of characters from a predetermined position in a data query statement. When taking words from the position for the first time, the first number is generally set to the minimum number of words in the vocabulary, for example, 1.

[0098] Then, in step 502, the taken word is matched in the word library. If the match is successful, a new word segmentation queue is created for the word on the original word segmentation queue in step 503, and then the first number is incremented in step 504 (for example, 1 word is adjusted to 2 words). If the match is unsuccessful, but the number of word segmentation characters has not reached the upper limit of the characters (the upper limit can be the length of the longest word in the word library, or the length that has reached the end of the data query statement), the increment operation is also performed (step 504). After the increment is completed, the first number of characters are taken out from the first position.

[0099] However, in some cases, new segmentation words cannot be generated based on the original segmentation queue. For example, for the sentence "What he said is indeed very reasonable", the correct segmentation queue is "What he said is indeed very reasonable". If the segmentation is into a queue like "He said it is indeed", the subsequent segmentation will not be possible. At this time, the segmentation queue needs to be deleted. That is to say, when the match is unsuccessful, the extracted text reaches the upper limit of the number of texts, and no reliable segmentation words are generated based on the existing position, step 505 is executed to delete the original segmentation queue.

[0100] In some cases, a sentence may have multiple word segmentation methods, all of which can complete the word segmentation. Therefore, for sentences that can complete the sentence segmentation, the embodiment of the present invention first retains the short queue (reserves the word segmentation queue with fewer word segmentations), and then obtains the probability of each word segmentation queue according to the probability coefficient of the word segmentation queue. The embodiment of the present invention applies the first formula for calculation, and the first formula is:

[0101]

[0102] In the formula, is the probability coefficient of the alternative queue, is the total number of elements in the candidate queue, For the candidate queue elements.

[0103] After the calculation is completed, the embodiment of the present invention selects the word segmentation queue with the highest probability from the candidate queues as the final word segmentation queue.

[0104] In step 103, the multiple first word segmentations are sequentially input into a sentence analysis model to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on multiple word segmentation sample sets.

[0105] In some implementations, the process of constructing the sentence analysis model includes:

[0106] Obtain a basic relationship model, a plurality of coefficient arrays, and a plurality of word segmentation sample sets, wherein the word segmentation sample set includes a sample word segmentation queue and sample meteorological data, the basic relationship model includes a plurality of undetermined coefficients, and the number of data in the coefficient array is the same as the number of undetermined coefficients in the basic relationship model;

[0107] Substituting the multiple coefficient arrays into the basic relationship model respectively to obtain multiple first models;

[0108] Extracting sample sets from the multiple word segmentation sample sets in sequence as sample sets to be processed;

[0109] Inputting the sample word segmentation queues of the sample set to be processed into each first model respectively to obtain a plurality of first sentence feature vectors, wherein each first sentence feature vector corresponds to a first model;

[0110] Calculate the fitness of each first model according to the first sentence feature vector, and add the obtained first fitness value to the fitness queue of the corresponding first model;

[0111] Determining whether there is a model that meets the target among the multiple first models according to the fitness queue;

[0112] If there is a model that meets the goal, the model that meets the goal is used as the statement analysis model;

[0113] Otherwise, adjust each coefficient array according to the multiple first fitnesses and the fitness queues, and jump to the step of substituting the multiple coefficient arrays into the basic relationship model respectively to obtain multiple first models.

[0114] In some implementations, the basic relationship model is:

[0115]

[0116] In the formula, is the sentence feature vector elements, is the total number of rows of intermediate nodes, For the The output node coefficients, For the Line The first column node coefficients, For the Line The output of the middle node of the column, For the input input variables, is the total number of input variables, is the total number of columns of intermediate nodes, is a natural constant, is the bias coefficient, is the column number where the feeding node is located, is the total number of elements in the sentence feature vector.

[0117] In some implementations, calculating the fitness of each first model according to the first sentence feature vector includes:

[0118] For each first model, perform the following steps respectively:

[0119] Acquire multiple first attribute vectors, wherein each attribute vector corresponds to a sample meteorological data, and the first attribute vector represents multiple dimensional attributes of the sample meteorological data;

[0120] respectively calculating the dot product of the first sentence feature vector and each first attribute vector to obtain a plurality of first dot product results;

[0121] sorting the plurality of sample meteorological data according to the plurality of first dot product results;

[0122] The ratio of the ranking of the reference sample meteorological data in the multiple sample meteorological data to the total number of the multiple sample meteorological data is used as the fitness of the first model, wherein the reference sample meteorological data is the sample meteorological data in the sample set to be processed.

[0123] Exemplarily, in terms of the statement analysis model, the embodiment of the present invention is obtained by optimizing the basic relational model, and the basic relational model is:

[0124]

[0125] In the formula, is the sentence feature vector elements, is the total number of rows of intermediate nodes, For the The output node coefficients, For the Line The first column node coefficients, For the Line The output of the middle node of the column, For the input input variables, is the total number of input variables, is the total number of columns of intermediate nodes, is a natural constant, is the bias coefficient, is the column number where the feeding node is located, is the total number of elements in the sentence feature vector.

[0126] like Figure 2 As shown, in terms of model optimization, the embodiment of the present invention obtains multiple coefficient arrays 201 and multiple word segmentation sample sets, and the word segmentation sample sets include sample word segmentation queues 204 and sample meteorological data 205.

[0127] After we input the coefficient array 201 into the basic relational model 202, we will get the first model 203 with preset coefficients. That is to say, after multiple coefficient arrays 201 are respectively input into the basic relational model 202, multiple first models 203 with preset coefficients will be obtained. After the sample word segmentation queue 204 is input into the first model 203, each first model 203 will output a first eigenvector 206, and the first eigenvector 206 and the dimensional data of each sample meteorological data 205 are dot-producted. According to the calculation results, multiple sample meteorological data 207 are ranked. Obviously, the ranking of sample meteorological data 205 at the front is the result we want. If there is a deviation, it means that the model needs to be corrected. We use the ratio of this ranking difference to the total amount of sample meteorological data 205 as the fitness of the evaluation model and add it to the fitness queue of the model.

[0128] In this way, we get multiple fitness queues. If the last few digits in the fitness queue are all less than the threshold (for example, the last 5 digits are all less than 0.03, 3%), then the model of this queue can be used as the optimized model, that is, the sentence analysis model. Otherwise, an optimization algorithm (for example, a particle swarm algorithm) is used to adjust multiple coefficient arrays 201 according to these queues and the current optimal model.

[0129] We input the multiple first participles obtained in the previous steps into the optimized sentence analysis model in sequence to obtain the sentence feature vector.

[0130] In step 104, the meteorological data in the database is matched according to the sentence feature vector, and the meteorological data is recommended according to the matching result.

[0131] In some implementations, step 104 includes:

[0132] Constructing a second attribute vector according to multiple attributes of each meteorological data in the database, thereby obtaining multiple second attribute vectors;

[0133] respectively calculating the dot product of the sentence feature vector and each second attribute vector to obtain a plurality of second dot product results;

[0134] sorting the plurality of meteorological data according to the plurality of second dot product results;

[0135] Recommend meteorological data according to the meteorological data sorting.

[0136] Exemplarily, a dot product operation is performed on the sentence feature vector obtained in the above steps and the attribute vector constructed based on the attributes of the meteorological data, and then the meteorological data is sorted according to the result of the dot product operation, and the meteorological data from the top position is selected for recommendation.

[0137] The implementation method of the meteorological data recommendation method of the present invention first obtains a data query statement; then performs a segmentation path analysis and a segmentation probability analysis on the data query statement to obtain multiple first segmentations; then the multiple first segmentations are sequentially input into a sentence analysis model to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on multiple segmentation sample sets; finally, the meteorological data in the database is matched according to the sentence feature vector, and the meteorological data is recommended according to the matching result. The implementation method of the present invention performs segmentation on the query statement, and extracts the sentence feature vector based on the segmentation result. Since there is no need to extract semantics, the technical and development costs are small, and more sentence features can be retained, so the recommended data is more accurate.

[0138] It should be understood that the size of the serial numbers of the steps in the above implementation does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation method of the present invention.

[0139] The following is an implementation of the device of the present invention. For details not described in detail, reference may be made to the corresponding method implementation described above.

[0140] Figure 3 is a functional block diagram of a meteorological data recommendation device provided by an embodiment of the present invention, referring to Figure 3 The meteorological data recommendation device includes: a query statement acquisition module 301, a word segmentation module 302, a statement analysis module 303 and a data recommendation module 304, wherein:

[0141] A query statement acquisition module 301 is used to acquire a data query statement;

[0142] A word segmentation module 302, configured to perform word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain a plurality of first word segments;

[0143] A sentence analysis module 303, used to sequentially input the plurality of first word segmentations into a sentence analysis model to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on a plurality of word segmentation sample sets;

[0144] The data recommendation module 304 is used to match the meteorological data in the database according to the sentence feature vector and recommend the meteorological data according to the matching result.

[0145] Figure 4 is a functional block diagram of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can be run on the processor 400. When the processor 400 executes the computer program 402, the steps in the above-mentioned meteorological data recommendation method and the embodiment are implemented, for example Figure 1 Steps 101 to 104 are shown.

[0146] Exemplarily, the computer program 402 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 401 and executed by the processor 400 to implement the present invention.

[0147] The electronic device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 4 may also include input and output devices, network access devices, buses, etc.

[0148] The processor 400 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0149] The memory 401 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. The memory 401 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 401 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 401 is used to store the computer program 402 and other programs and data required by the electronic device 4. The memory 401 may also be used to temporarily store data that has been output or is to be output.

[0150] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the implementation method can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method implementation method, which will not be repeated here.

[0151] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0152] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0153] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0154] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0155] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0156] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various methods and device implementation methods can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.

[0157] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A meteorological data recommendation method, characterized in that: include: Get data query statement; Performing word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain multiple first word segmentations; Inputting the plurality of first word segmentations into a sentence analysis model in sequence to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on a plurality of word segmentation sample sets; Matching the meteorological data in the database according to the sentence feature vector, and recommending the meteorological data according to the matching result; in, The construction process of the sentence analysis model includes: Obtain a basic relationship model, a plurality of coefficient arrays, and a plurality of word segmentation sample sets, wherein the word segmentation sample set includes a sample word segmentation queue and sample meteorological data, the basic relationship model includes a plurality of undetermined coefficients, and the number of data in the coefficient array is the same as the number of undetermined coefficients in the basic relationship model; Substituting the multiple coefficient arrays into the basic relationship model respectively to obtain multiple first models; Extracting sample sets from the multiple word segmentation sample sets in sequence as sample sets to be processed; Inputting the sample word segmentation queues of the sample set to be processed into each first model respectively to obtain a plurality of first sentence feature vectors, wherein each first sentence feature vector corresponds to a first model; Calculate the fitness of each first model according to the first sentence feature vector, and add the obtained first fitness value to the fitness queue of the corresponding first model; Determining whether there is a model that meets the target among the multiple first models according to the fitness queue; If there is a model that meets the goal, the model that meets the goal is used as the statement analysis model; Otherwise, adjusting each coefficient array according to the multiple first fitnesses and the fitness queues, and jumping to the step of respectively substituting the multiple coefficient arrays into the basic relationship model to obtain multiple first models; in, The basic relationship model is: In the formula, is the sentence feature vector elements, is the total number of rows of intermediate nodes, For the The output node coefficients, For the Line The first column node coefficients, For the Line The output of the middle node of the column, For the input input variables, is the total number of input variables, is the total number of columns of intermediate nodes, is a natural constant, is the bias coefficient, is the column number where the feeding node is located, is the total number of elements in the sentence feature vector, For the Line The first column node The feed-in coefficient, For the The row and column 1 node Weight coefficients; in, The step of calculating the fitness of each first model according to the first sentence feature vector comprises: For each first model, perform the following steps respectively: Acquire multiple first attribute vectors, wherein each attribute vector corresponds to a sample meteorological data, and the first attribute vector represents multiple dimensional attributes of the sample meteorological data; respectively calculating the dot product of the first sentence feature vector and each first attribute vector to obtain a plurality of first dot product results; sorting the plurality of sample meteorological data according to the plurality of first dot product results; The ratio of the ranking of the reference sample meteorological data in the multiple sample meteorological data to the total number of the multiple sample meteorological data is used as the fitness of the first model, wherein the reference sample meteorological data is the sample meteorological data in the sample set to be processed.

2. The meteorological data recommendation method according to claim 1, characterized in that: The performing word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain a plurality of first word segmentations includes: Get the first word segmentation queue; Extracting a first number of characters from a first position of the data query statement as to-be-processed segmented words; Matching the to-be-processed segmented words according to the vocabulary; If the match is successful, a new word segmentation queue is created based on the first word segmentation queue, and the to-be-processed word segmentation is added to the newly created word segmentation queue; If the first number of characters does not reach the character upper limit, the first number is incremented, and the process jumps to the step of extracting the first number of characters from the first position of the data query statement as the word segmentation to be processed; If the first number of characters reaches the character upper limit and no new word segmentation queue is created based on the first word segmentation queue, the first word segmentation queue is deleted; Otherwise, the obtained multiple newly created word segmentation queues are used as multiple first word segmentation queues; For the first word segmentation queue that has not completed word segmentation of the data query statement, the first position is adjusted according to the end of the word segmentation at the end of the first word segmentation queue, the first number is initialized, and the step of jumping to extracting the first number of characters from the first position of the data query statement as the word segmentation to be processed is performed; If all first word segmentation queues have completed word segmentation of the data query statement, a target word segmentation queue is selected from the multiple first word segmentation queues by word segmentation probability analysis; The multiple word segments in the target word segmentation queue are used as the multiple first word segmentations.

3. The meteorological data recommendation method according to claim 2, characterized in that: The step of selecting a target word segmentation queue from a plurality of first word segmentation queues through word segmentation probability analysis includes: Selecting, from the plurality of first word segmentation queues, a plurality of word segmentation queues with the least word segmentation as a plurality of candidate queues; The probability coefficient of each candidate queue is calculated according to the first formula, thereby obtaining multiple probability coefficients, wherein the first formula is: In the formula, is the probability coefficient of the alternative queue, is the total number of elements in the candidate queue, For the candidate queue elements; A target word segmentation queue is selected from a plurality of first word segmentation queues according to the plurality of probability coefficients.

4. The meteorological data recommendation method according to any one of claims 1 to 3, characterized in that: The step of matching the meteorological data in the database according to the sentence feature vector and recommending the meteorological data according to the matching result includes: Constructing a second attribute vector according to multiple attributes of each meteorological data in the database, thereby obtaining multiple second attribute vectors; respectively calculating the dot product of the sentence feature vector and each second attribute vector to obtain a plurality of second dot product results; sorting the plurality of meteorological data according to the plurality of second dot product results; Recommend meteorological data according to the meteorological data sorting.

5. A meteorological data recommendation device, characterized in that: Used to implement the meteorological data recommendation method according to any one of claims 1 to 4, the meteorological data recommendation device comprises: A query statement acquisition module is used to acquire data query statements; A word segmentation module, used to perform word segmentation path analysis and word segmentation probability analysis on the data query statement to obtain multiple first word segments; A sentence analysis module, used for sequentially inputting the plurality of first word segmentations into a sentence analysis model to obtain a sentence feature vector, wherein the sentence analysis model is constructed based on a plurality of word segmentation sample sets; as well as, The data recommendation module is used to match the meteorological data in the database according to the sentence feature vector and recommend the meteorological data according to the matching result.

6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Data processing method and device

    CN112052395A

  • Webpage information extraction method and system based on semantics

    CN114528459A