Symbol sequence generation method and device for offshore wind power risk assessment
By adjusting the probability distribution of the generative language model so that the symbol sequence it generates conforms to the symbol rules, the problem of too many invalid tokens in the offshore wind power system is solved, and the accuracy of data monitoring and evaluation is improved.
Patent Information
- Application Number
- CN202411866111.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing generative language models tend to output a large number of invalid tokens when generating symbol sequences in offshore wind power systems, resulting in logical errors and low generation efficiency, affecting the accuracy of data monitoring and evaluation.
By obtaining the tokens in the symbol sequence generated by the symbol rule set and the generative language model, the probability distribution of the model is adjusted so that the generation probability of tokens outside the valid set is 0, thereby ensuring that the generated symbol sequence conforms to the symbol rule.
It effectively reduces the presence of invalid tokens in the generated symbol sequence, improves the generation efficiency and accuracy of the generative language model, ensures that the symbol sequence conforms to the symbol rules, and improves the accuracy of state prediction, abnormal data detection and missing value filling of offshore wind power systems.
Smart Images

Figure CN119903162B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of symbol sequence generation, and in particular to a method and device for generating a symbol sequence for offshore wind power risk assessment. Background Art
[0002] The offshore environment is complex, characterized by harsh conditions such as high humidity, strong winds, and salt spray. In practical applications, data in offshore wind turbine systems often suffers from missing or abnormal data due to sensor failures, communication interruptions, and other factors, severely impacting the monitoring and assessment of equipment operating status. This often requires state prediction, anomaly detection, and missing value filling for offshore wind turbine data.
[0003] In related technologies, state prediction, abnormal data detection and missing value filling of data in offshore wind power systems include: based on the data in the offshore wind power system, a generative language model is used to generate multiple symbol sequences, and different symbol sequences correspond to state prediction tasks, abnormal data detection tasks and missing value filling tasks respectively.
[0004] When generating a sequence of symbols, current generative language models typically output all possible symbols and select them based on their probabilities. However, in real-world scenarios, generative language models often generate a large number of invalid tokens, which not only leads to logical errors but also reduces generation efficiency and accuracy. Summary of the Invention
[0005] The present disclosure provides a method and apparatus for generating symbol sequences for offshore wind power risk assessment, which can ensure that the symbol sequences generated by a generative language model meet the symbol rules and effectively reduce the presence of invalid tokens in the generated symbol sequences. The technical solution includes at least the following solutions:
[0006] In a first aspect, a method for generating a symbol sequence for offshore wind power risk assessment is provided, comprising: obtaining multiple symbols for offshore wind power risk assessment, and a symbol rule set for the multiple symbols, the symbol rule set including multiple symbol rules, and the symbol rules being used to limit the context of the multiple symbols; obtaining the i-th token in a first symbol sequence generated by a generative language model; determining a valid set of the i+1-th token based on the i-th token and the symbol rule set; adjusting the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the i+1-th token, the adjusting the probability distribution of each token in the probability distribution of the generative language model including adjusting the generation probability of tokens outside the valid set in the probability distribution of the generative language model to 0; and obtaining the i+1-th token in the first symbol sequence generated by the adjusted generative language model.
[0007] Optionally, the multiple symbols used for offshore wind power risk assessment include: a task header symbol set, a task symbol set, a system symbol set and a data symbol set; the task header symbol set includes a state prediction task header symbol, an abnormal data detection task header symbol and a missing value filling task header symbol; the task symbol set includes a state prediction task symbol subset, an abnormal data detection task symbol subset and a missing value filling task symbol subset, and any task symbol subset in the task symbol set uniquely corresponds to a task header symbol in the task header symbol set; the system symbol set includes a start symbol and an end symbol; the data symbol set is used to indicate the data in the discretized offshore wind power system.
[0008] Optionally, the symbol rule set includes: the valid set of the i+1th token is determined by the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs; the first token in the symbol sequence is the start symbol; the next token of the start symbol is any task header symbol in the task header symbol set; the valid set of the next token of the first task header symbol is: the union of the data symbol set and the first task symbol subset, the first task header symbol is any symbol in the task header symbol set, the first task symbol subset corresponds to the first task header symbol, and the first task symbol subset is any task symbol subset in the task symbol set; when the i-th token is a symbol in the data symbol set, the valid set of the i+1th token is: the union of the data symbol set, the second task symbol subset, and the end symbol, the second task symbol subset is the task symbol subset corresponding to the task header symbol in the symbol sequence to which the i-th token belongs; when the i-th token is the end symbol, the generative language model stops generating the symbol sequence.
[0009] Optionally, adjusting the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the i+1th token includes: adjusting the probability distribution of each token in the probability distribution of the generative language model using the following formula:
[0010]
[0011] in, represents the probability distribution of the generative language model when generating the i+1th token, is a token in the probability distribution of the generative language model, is the i-th token of the first symbol sequence, express The probability of being output by the generative language model as the i+1th token of the first symbol sequence, is the valid set of the i+1th token.
[0012] In the second aspect, a symbol sequence generation device for offshore wind power risk assessment is also provided, including: a first acquisition module, used to obtain multiple symbols for offshore wind power risk assessment, and a symbol rule set of the multiple symbols, the symbol rule set including multiple symbol rules, and the symbol rules are used to limit the context of the multiple symbols; a second acquisition module, used to obtain the i-th token in the first symbol sequence generated by the generative language model; a valid set determination module, used to determine the valid set of the i+1-th token based on the i-th token and the symbol rule set; an adjustment module, used to adjust the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the i+1-th token, the adjusting the probability distribution of each token in the probability distribution of the generative language model including adjusting the generation probability of tokens outside the valid set in the probability distribution of the generative language model to 0; a third acquisition module, used to obtain the i+1-th token in the first symbol sequence generated by the adjusted generative language model.
[0013] Optionally, in the first acquisition module, the multiple symbols used for offshore wind power risk assessment include: a task header symbol set, a task symbol set, a system symbol set and a data symbol set; the task header symbol set includes a state prediction task header symbol, an abnormal data detection task header symbol and a missing value filling task header symbol; the task symbol set includes a state prediction task symbol subset, an abnormal data detection task symbol subset and a missing value filling task symbol subset, and any task symbol subset in the task symbol set uniquely corresponds to a task header symbol in the task header symbol set; the system symbol set includes a start symbol and an end symbol;
[0014] Optionally, in the first acquisition module, the symbol rule set includes: the valid set of the i+1th token is determined by the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs; the first token in the symbol sequence is the start symbol; the next token of the start symbol is any task header symbol in the task header symbol set; the valid set of the next token of the first task header symbol is: the union of the data symbol set and the first task symbol subset, the first task header symbol is any symbol in the task header symbol set, the first task symbol subset corresponds to the first task header symbol, and the first task symbol subset is any task symbol subset in the task symbol set; when the i-th token is a symbol in the data symbol set, the valid set of the i+1th token is: the union of the data symbol set, the second task symbol subset, and the end symbol, the second task symbol subset is the task symbol subset corresponding to the task header symbol in the symbol sequence to which the i-th token belongs; when the i-th token is the end symbol, the generative language model stops generating the symbol sequence.
[0015] Optionally, the adjustment module is further configured to adjust the probability distribution of each token in the probability distribution of the generative language model using the following formula:
[0016]
[0017] in, represents the probability distribution of the generative language model when generating the i+1th token, is a token in the probability distribution of the generative language model, is the i-th token of the first symbol sequence, express The probability of being output by the generative language model as the i+1th token of the first symbol sequence, is the valid set of the i+1th token.
[0018] In a third aspect, a computer device is also provided, comprising: a memory and a processor, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor, thereby executing the symbol sequence generation method for offshore wind power risk assessment described in the above embodiment.
[0019] In a fourth aspect, a computer-readable storage medium is also provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor, thereby executing the symbol sequence generation method for offshore wind power risk assessment described in the above embodiment.
[0020] In a fifth aspect, a computer program product is provided, comprising a computer program / instruction, which implements the method described in the first aspect when executed by a processor.
[0021] The beneficial effects of the technical solutions provided by the embodiments of the present disclosure include at least:
[0022] In the disclosed embodiment, by adjusting the probability distribution of each token in the probability distribution of the generative language model, the generation probability of tokens outside the valid set in the probability distribution of the generative language model is adjusted to 0, thereby making the probability of a token outside the valid set being generated as the i+1th token zero. In other words, the i+1th token generated by the generative language model is always in the valid set. This effectively reduces the presence of invalid tokens in the generated symbol sequence, ensuring that the symbol sequences generated by the generative language model all meet the symbol rule. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0024] Figure 1 A flowchart of a method for generating a symbol sequence for offshore wind power risk assessment provided by an exemplary embodiment of the present disclosure is shown;
[0025] Figure 2 A flowchart of a method for generating a symbol sequence for offshore wind power risk assessment provided by another exemplary embodiment of the present disclosure is shown;
[0026] Figure 3 A schematic structural diagram of a symbol sequence generating device for offshore wind power risk assessment provided by an exemplary embodiment of the present disclosure is shown;
[0027] Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Unless otherwise defined, the technical or scientific terms used herein shall have the usual meanings understood by persons of ordinary skill in the field to which the present disclosure belongs. The words “first”, “second”, “third” and similar terms used in the patent application specification and claims of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as “one” or “a” do not indicate a quantity limitation, but rather indicate the presence of at least one. Words such as “include” or “comprising” and similar terms mean that the elements or objects appearing before “include” or “comprising” cover the elements or objects listed after “include” or “comprising” and their equivalents, and do not exclude other elements or objects.
[0029] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0030] To facilitate understanding of the embodiments of the present disclosure, an example of generating multiple symbol sequences using a generative language model for data in an offshore wind power system in the related art is first described below.
[0031] For the state prediction task, the symbol sequence generated by the generative language model includes: state prediction task header symbol, start symbol, data symbol, and end symbol.
[0032] For example, the symbol sequence format of the state prediction task generated by the generative language model is as follows:
[0033] .in The part is multiple time series data, that is, multiple data symbols; Head symbol for state prediction task; Is the starting symbol, indicating the beginning of the time series data, is the end symbol, indicating the end of the time series data. The next symbol after the start symbol is a data symbol, and there is no symbol after the end symbol. In the symbol sequence of the state prediction task, the previous time series data is the question of the next time series data, and the next time series data is the answer to the previous time series data. For example, Belongs to a prediction problem, then the prediction answer generated by the generative language model is the sequence in The value of the next moment at the moment is .
[0034] For the abnormal data detection task, the symbol sequence generated by the generative language model includes: abnormal data detection task header symbol, start symbol, data symbol, segmentation symbol, abnormal value marking symbol, and end symbol.
[0035] For example, the symbol sequence format of the abnormal data detection task generated by the generative language model is as follows: .in The part is multiple time series data, that is, multiple data symbols; Head symbol for abnormal data detection task; It is a segmentation symbol used to separate questions and answers; Mark outliers with symbols; Is the starting symbol, indicating the beginning of the time series data, is the end symbol, indicating the end of the time series data. In the symbol sequence of the abnormal data detection task, the part before the segmentation symbol is equivalent to the question, that is, This part belongs to the question; the part after the separator belongs to the answer, that is, This section belongs in the answer.
[0036] For the missing value filling task, the symbol sequence generated by the generative language model includes: missing value filling task header symbol, start symbol, data symbol, segmentation symbol, missing value marker symbol, and end symbol.
[0037] For example, the format of the symbol sequence for the missing value filling task generated by the generative language model is as follows:
[0038] . in The part is multiple time series data, that is, multiple data symbols. Missing values filled in for the generative language model are also data symbols; Fill in the task header symbols for missing values; is the division symbol; Mark missing values with symbols; Is the starting symbol, indicating the beginning of the time series data, is the end symbol, indicating the end of the time series data. In the symbol sequence of the missing value filling task, the part before the split symbol is the missing value marked by the generative language model; the part after the split symbol is the missing value filled by the generative language model. For example, the question After inputting into the generative language model, the generative language model will identify the missing values in the question and fill in the corresponding missing values, and then output the symbol sequence of the missing value filling task: .
[0039] Figure 1 A flowchart of a method for generating a symbol sequence for offshore wind power risk assessment provided by an exemplary embodiment of the present disclosure is shown. The method can be executed by a computer device. Figure 1 , the method comprising:
[0040] In step 101 , a plurality of symbols for offshore wind power risk assessment and a set of symbol rules for the plurality of symbols are obtained.
[0041] The symbol rule set includes multiple symbol rules, and the symbol rules are used to limit the context of multiple symbols.
[0042] In step 102, the i-th token in the first symbol sequence generated by the generative language model is obtained.
[0043] Here, the i-th token is the latest token in the first symbol sequence generated by the generative language model.
[0044] In the process of the generative language model generating the first symbol sequence, the generative language model generates tokens one by one until the first symbol sequence is completely generated. The i-th token is the latest token generated in the process of the generative language model generating tokens one by one.
[0045] In step 103, based on the i-th token and the symbol rule set, a valid set of the i+1-th token is determined.
[0046] The i+1th token is the next token of the i-th token, which is the token that the generative language model is about to generate.
[0047] In step 104 , the probability distribution of each token in the probability distribution of the generative language model is adjusted based on the valid set of the i+1th token.
[0048] Adjusting the probability distribution of each token in the probability distribution of the generative language model includes adjusting the generation probability of the token outside the valid set in the probability distribution of the generative language model to 0.
[0049] When the generative language model generates the i+1th token, all possible tokens are distributed in a probability distribution, and each possible token has a probability in the probability distribution. The generative language model randomly samples from this probability distribution to generate the i+1th token. In the probability distribution, the higher the probability of a token, the greater the probability of it being generated as the i+1th token; the lower the probability of a token, the lower the probability of it being generated as the i+1th token.
[0050] In step 105, the i+1th token in the first symbol sequence generated by the adjusted generative language model is obtained.
[0051] In the disclosed embodiment, by adjusting the probability distribution of each token in the probability distribution of the generative language model, the generation probability of tokens outside the valid set in the probability distribution of the generative language model is adjusted to 0, thereby making the probability of a token outside the valid set being generated as the i+1th token zero. In other words, the i+1th token generated by the generative language model is always in the valid set. This effectively reduces the presence of invalid tokens in the generated symbol sequence, ensuring that the symbol sequences generated by the generative language model all meet the symbol rule.
[0052] Figure 2 A flowchart of a method for generating a symbol sequence for offshore wind power risk assessment provided by another exemplary embodiment of the present disclosure is shown. The method can be executed by a computer device. Figure 2 , the method comprising:
[0053] In step 201 , a plurality of symbols for offshore wind power risk assessment and a set of symbol rules for the plurality of symbols are obtained.
[0054] The symbol rule set includes multiple symbol rules, and the symbol rules are used to limit the context of multiple symbols.
[0055] Optionally, the multiple symbols used for offshore wind power risk assessment include: a task header symbol set, a task symbol set, a system symbol set, and a data symbol set.
[0056] The task header symbol set includes state prediction task header symbols, abnormal data detection task header symbols and missing value filling task header symbols. For example, the state prediction task header symbol is , used to indicate the execution state prediction task; the abnormal data detection task header symbol is , used to indicate the execution of the legacy beam angle detection task; the missing value filling task header symbol is , used to perform missing value filling tasks. Then the task header symbol set can be expressed as .
[0057] The task symbol set includes a state prediction task symbol subset, an abnormal data detection task symbol subset and a missing value filling task symbol subset. Any task symbol subset in the task symbol set uniquely corresponds to a task header symbol in the task header symbol set.
[0058] The task symbol subset is used to indicate a set of special symbols involved in the task indicated by the task header symbol. The special symbols here are other symbols except the data symbol set.
[0059] That is, the state prediction task symbol subset corresponds to the state prediction task header symbol, the abnormal data detection task symbol subset corresponds to the abnormal data detection task header symbol, and corresponds to the missing value filling task header symbol.
[0060] Here, according to the three symbol sequences in the related art, it can be determined that the state prediction task symbol subset is an empty set, because the symbol sequence corresponding to the state prediction task does not involve any special symbols. That is, .
[0061] The subset of symbols for the abnormal data detection task includes: segmentation symbols and outlier marking symbols. For example, the segmentation symbol is , the outlier marker symbol is , then the symbol subset of the abnormal data detection task can be expressed as .
[0062] The missing value filling task symbol subset includes: segmentation symbol and missing value marking symbol. For example, the segmentation symbol is , the outlier marker symbol is , then the missing value filling task symbol subset can be expressed as .
[0063] The system symbol set includes a start symbol and an end symbol. For example, the start symbol is , the end symbol is , then the system symbol set can be expressed as .
[0064] The data symbol set is used to indicate the discretized data in the offshore wind power system. For example, the data symbol set can be represented as .
[0065] Optionally, the symbol rule set includes the following 6 rules.
[0066] Rule 1: The valid set of the i+1th token is determined by the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs.
[0067] The i+1th token represents the token to be generated, the i-th token represents the latest token, and the next token of the i-th token is the i+1th token.
[0068] For a sequence of symbols being generated, there must be a task header symbol. When the task header symbol has not yet been generated (i is less than 2), the valid set of the i+1th token is determined solely by the i-th token. When the task header symbol has already been generated (i is greater than or equal to 2), the valid set of the i+1th token is determined by both the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs.
[0069] For example, the valid set of the i+1th token can be expressed as: Here, the brackets indicate the element that affects the effective set of the i+1th token, that is, the i-th token. For the sake of simplicity, another element that affects the effective set of the i+1th token, that is, the task header symbol in the symbol sequence to which the i-th token belongs, is abbreviated.
[0070] Rule 2: The first token in a symbol sequence is the starting symbol.
[0071] Here, when the first token of the symbol sequence is i equal to 0, there is no previous token for the first token, or the previous token of the first token is empty.
[0072] For example, Rule 2 can be expressed as , None means empty.
[0073] Rule 3: The next token of the start symbol is any task header symbol in the task header symbol set.
[0074] For example, Rule 3 can be expressed as , that is, when the i-th token is the starting symbol, the valid set of the i+1-th token is the task header symbol set.
[0075] Rule 4: The valid set of the next token of the first task header symbol is the union of the data symbol set and the first task symbol subset.
[0076] The first task header symbol is any symbol in the task header symbol set, the first task symbol subset corresponds to the first task header symbol, and the first task symbol subset is any task symbol subset in the task symbol set.
[0077] Exemplarily, according to different types of the first task header symbol, Rule 4 can be expressed in the following three different valid set forms.
[0078] When the first task header symbol is a state prediction task header symbol, the first task symbol subset is a state prediction task symbol subset.
[0079] Then Rule 4 can be expressed as: .
[0080] When the first task header symbol is an abnormal data detection task header symbol, the first task symbol subset is an abnormal data detection task symbol subset.
[0081] Then Rule 4 can be expressed as: .
[0082] When the first task header symbol is a missing value filling task header symbol, the first task symbol subset is a missing value filling task symbol subset.
[0083] Then Rule 4 can be expressed as: .
[0084] Rule 5: When the i-th token is a symbol in the data symbol set, the valid set for the i+1-th token is the union of the data symbol set, the second task symbol subset, and the end symbol. The second task symbol subset is the task symbol subset corresponding to the task header symbol in the symbol sequence to which the i-th token belongs.
[0085] After generating a symbol sequence using the valid set defined by Rules 1 through 4, the value of i in the i-th token in Rule 5 must be greater than 2, because the first and second tokens cannot be symbols in the data symbol set. Therefore, in Rule 5, the symbol sequence to which the i-th token belongs must already contain a task header symbol, and a unique second task symbol subset can be determined according to Rule 5.
[0086] For example, according to the different types of task header symbols in the symbol sequence to which the i-th token belongs, Rule 5 can be expressed in the following three different valid set forms.
[0087] When the task header symbol in the symbol sequence to which the i-th token belongs is the state prediction task header symbol, it means that the symbol sequence to which the i-th token belongs is used to perform the state prediction task. At this time, the second task symbol subset is the state prediction task symbol subset. Then Rule 5 can be expressed as:
[0088] .in Indicates that the i-th token is a symbol in the data symbol set.
[0089] When the task header symbol in the symbol sequence to which the i-th token belongs is the abnormal data detection task header symbol, it indicates that the symbol sequence to which the i-th token belongs is used to perform the abnormal data detection task, and the second task symbol subset is the abnormal data detection symbol subset.
[0090] Then Rule 5 can be expressed as: .
[0091] When the task header symbol in the symbol sequence to which the i-th token belongs is the abnormal data detection task header symbol, it indicates that the symbol sequence to which the i-th token belongs is used to perform the abnormal data detection task, and the second task symbol subset is the abnormal data detection symbol subset.
[0092] Then Rule 5 can be expressed as: .
[0093] Rule 6: When the i-th token is the end symbol, the generative language model stops generating the symbol sequence.
[0094] For example, Rule 6 can be expressed as , indicating that the valid set of the i+1th token is an empty set, and generation stops if it is an empty set.
[0095] In step 202, the i-th token in the first symbol sequence generated by the generative language model is obtained.
[0096] Regarding the implementation of the i-th token in the first symbol sequence, please refer to the aforementioned step 102, and detailed description is omitted here.
[0097] Exemplarily, the generative language model is an autoregressive generative language model, and the conditional probability of the generative language model generating the i+1th token in the symbol sequence can be defined using formula (1).
[0098] (1)
[0099] In formula (1), is the conditional probability, which is the probability distribution of the generative language model, Indicates the number of all possible tokens generated in the probability distribution. is a token in the probability distribution of the generative language model, and the token may be generated as the i+1th token of the first symbol sequence; is the i-th token of the first symbol sequence, Represents the probability distribution of the generative language model token is output by the generative language model as the conditional probability of the i+1th token. For example, Calculated using formula (2).
[0100] (2)
[0101] In formula (2), is the feature function of the generative language model, for example, a feature extraction module based on a Transformer encoder or an RNN (Recurrent Neural Network). The meanings of the other parameters in formula (2) are the same as those in formula (1) and are not described in detail here.
[0102] In step 203, based on the i-th token and the symbol rule set, a valid set of the i+1-th token is determined.
[0103] The symbol rule set defines the valid set of the next token of any token in the symbol sequence. Based on the i-th token and the symbol rule set, the valid set of the i+1-th token can be determined. .
[0104] In step 204 , the probability distribution of each token in the probability distribution of the generative language model is adjusted based on the valid set of the i+1th token.
[0105] Optionally, step 204 includes: adjusting the generation probability of tokens outside the valid set in the probability distribution of the generative language model to 0; and replanning the generation probability of tokens within the valid set in the probability distribution of the generative language model so that the sum of the generation probabilities of all tokens in the entire probability distribution is 1.
[0106] Here, after adjusting the generation probability of tokens outside the valid set in the probability distribution of the generative language model to 0, if the generation probability of tokens within the valid set in the probability distribution of the generative language model is not re-planned, the sum of the generation probabilities of all tokens in the probability distribution of the generative language model will not be 1, and a complete probability distribution cannot be formed at this time. Therefore, it is necessary to re-plan the generation probability of tokens within the valid set in the probability distribution of the generative language model so that the sum of the generation probabilities of all tokens in the entire probability distribution is 1.
[0107] Optionally, step 204 is expressed using formula (3).
[0108] (3)
[0109] In formula (3), represents the probability distribution of the generative language model when generating the i+1th token, is the valid set of the i+1th token. The meanings of other parameters in formula (3) are the same as those in formula (1), and their detailed description is omitted here.
[0110] In step 205, the i+1th token in the first symbol sequence generated by the adjusted generative language model is obtained.
[0111] After the probability distribution of the generative language model is adjusted, the generative language model can generate the i+1th token, and the i+1th token must comply with the usage rules of each symbol in the symbol sequence (if the i+1th token does not comply with the symbol usage rules, it means that the i+1th token is an invalid token).
[0112] Through the above steps 201 to 205, the presence of invalid tokens in the generated symbol sequence can be effectively reduced, so that the symbol sequences generated by the generative language model all meet the symbol rules.
[0113] Exemplarily, the first symbol sequence is , and the latest token in the first symbol sequence is the i-th token , then by executing the above steps 201 to 205, the i+1th token can be generated , then the first symbol sequence becomes In the above manner, new tokens in the first symbol sequence can be continuously generated until an end symbol is generated or other termination conditions are met, at which point token generation can be stopped.
[0114] After applying the above steps 201 to 205 to the method of using a generative language model to generate a symbol sequence to perform state prediction, abnormal data detection and missing value filling for data in an offshore wind power system, the adjusted generative language model can more accurately predict the operating status of the wind power equipment and effectively distinguish between abnormal and normal data.
[0115] By adjusting the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the i+1th token, the probability that the symbol sequence output by the generative language model is erroneous data or invalid tokens is significantly reduced, thereby improving the rationality of data filling and the reliability of the prediction results.
[0116] Optionally, the method in the embodiment of the present disclosure may also be verified. For example, the finally generated first symbol sequence may be compared with the operating data of the offshore wind power system to quantify the accuracy improvement of the generative language model in risk assessment.
[0117] The related art method for adjusting the tokens output by a generative language model only allows for screening and filtering of tokens after they have already been generated. This process results in a significant waste of resources. This is because the generative language model in the related art only outputs data (equivalent to the data symbols in the data symbol set in the disclosed embodiments) and does not involve adjusting the symbol sequence. As a result, the latest token in the sequence contains no valid information, making it impossible to adjust the probability distribution of the next token based on the latest token.
[0118] The symbol sequence used for offshore wind power risk assessment in the embodiment of the present disclosure can filter invalid tokens before the generative language model generates tokens, so that the tokens generated by the generative language model are all tokens in the valid set, and no invalid tokens will appear. This is because the generative language model in the embodiment of the present disclosure outputs a symbol sequence, and there are multiple types of symbols, and each type of symbol can only be combined according to the symbols in the symbol rule set. This is equivalent to different types of symbols pre-defining the context of the symbol sequence, so that the possible valid set of the next token can be determined based on the latest token in the first symbol sequence, and then invalid tokens can be filtered according to the valid set before the generative language model generates tokens.
[0119] The following are device embodiments of the present application. For details not described in detail in the device embodiments, reference may be made to the above method embodiments.
[0120] Figure 3 FIG2 shows a schematic diagram of a symbol sequence generating device for offshore wind power risk assessment provided by an exemplary embodiment of the present disclosure. Figure 3 The symbol sequence generating device 300 for offshore wind power risk assessment includes: a first acquisition module 301 , a second acquisition module 302 , a valid set determination module 303 , an adjustment module 304 and a third acquisition module 305 .
[0121] The first acquisition module 301 is used to acquire multiple symbols for offshore wind power risk assessment and a symbol rule set of the multiple symbols, where the symbol rule set includes multiple symbol rules, and the symbol rules are used to define the context of the multiple symbols.
[0122] The second acquisition module 302 is used to obtain the i-th token in the first symbol sequence generated by the generative language model.
[0123] The valid set determination module 303 is configured to determine the valid set of the (i+1)th token based on the (i)th token and the symbol rule set.
[0124] The adjustment module 304 is configured to adjust the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the i+1th token, wherein the adjusting the probability distribution of each token in the probability distribution of the generative language model includes adjusting the generation probability of a token outside the valid set in the probability distribution of the generative language model to 0;
[0125] The third acquisition module 305 is used to obtain the (i+1)th token in the first symbol sequence generated by the adjusted generative language model.
[0126] Optionally, in the first acquisition module 301, the multiple symbols used for offshore wind power risk assessment include: a task header symbol set, a task symbol set, a system symbol set, and a data symbol set; the task header symbol set includes a state prediction task header symbol, an abnormal data detection task header symbol, and a missing value filling task header symbol; the task symbol set includes a state prediction task symbol subset, an abnormal data detection task symbol subset, and a missing value filling task symbol subset, and any task symbol subset in the task symbol set uniquely corresponds to a task header symbol in the task header symbol set; the system symbol set includes a start symbol and an end symbol;
[0127] Optionally, in the first acquisition module 301, the symbol rule set includes: the valid set of the i+1th token is determined by the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs; the first token in the symbol sequence is the start symbol; the next token of the start symbol is any task header symbol in the task header symbol set; the valid set of the next token of the first task header symbol is: the union of the data symbol set and the first task symbol subset, the first task header symbol is any symbol in the task header symbol set, the first task symbol subset corresponds to the first task header symbol, and the first task symbol subset is any task symbol subset in the task symbol set; in the case where the i-th token is a symbol in the data symbol set, the valid set of the i+1th token is: the union of the data symbol set, the second task symbol subset, and the end symbol, the second task symbol subset is the task symbol subset corresponding to the task header symbol in the symbol sequence to which the i-th token belongs; in the case where the i-th token is the end symbol, the generative language model stops generating the symbol sequence.
[0128] Optionally, the adjustment module 304 is further configured to adjust the probability distribution of each token in the probability distribution of the generative language model using the following formula:
[0129]
[0130] in, represents the probability distribution of the generative language model when generating the i+1th token, is a token in the probability distribution of the generative language model, is the i-th token of the first symbol sequence, express The probability of the i+1th token being output by the generative language model as the first symbol sequence, is the valid set of the i+1th token.
[0131] It should be noted that the symbol sequence device for offshore wind power risk assessment provided in the above embodiment only uses the division of the above functional modules as an example to illustrate the generation of symbol sequences. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the symbol sequence device for offshore wind power risk assessment provided in the above embodiment and the symbol sequence method embodiment for offshore wind power risk assessment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0132] The division of modules in the embodiments of the present disclosure is illustrative and represents only a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the present disclosure may be integrated into a single processor, exist physically as separate modules, or be integrated into a single module. The integrated modules may be implemented in either hardware or software functional modules.
[0133] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a terminal device (which can be a personal computer, mobile phone, or communication device, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.
[0134] Figure 4 Schematic diagram of the structure of the computer device provided by the embodiment of the present disclosure. Figure 4 As shown, the computer device 400 includes a processor 401 and a memory 402 .
[0135] Processor 401 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 401 may be implemented in hardware using at least one of the following: a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), or a PLA (Programmable Logic Array). Processor 401 may also include a main processor and a coprocessor. The main processor is used to process data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing content displayed on the display screen. In some embodiments, processor 401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0136] Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 402 is used to store at least one instruction, which is executed by processor 401 to implement the symbol sequence method for offshore wind power risk assessment provided in the embodiments of the present disclosure.
[0137] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the computer device 400, and the computer device 400 may include more or fewer components than shown in the figure, or combine some components, or adopt a different component arrangement.
[0138] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of a computer device, the computer device is able to execute the symbol sequence method for offshore wind power risk assessment provided in the embodiments of the present disclosure.
[0139] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the symbol sequence method for offshore wind power risk assessment provided in the embodiments of the present disclosure.
[0140] The above description is merely an optional embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.
Claims
1. A symbol sequence generation method for offshore wind power risk assessment, characterized in that: The method comprises: Acquire multiple symbols for offshore wind power risk assessment and a symbol rule set for the multiple symbols, wherein the symbol rule set includes multiple symbol rules, and the symbol rules are used to define contexts of the multiple symbols; Get the i-th token in the first symbol sequence generated by the generative language model; Determine a valid set of an i+1th token based on the i-th token and the set of symbol rules; Adjusting the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the (i+1)th token, wherein adjusting the probability distribution of each token in the probability distribution of the generative language model comprises adjusting the generation probability of a token outside the valid set in the probability distribution of the generative language model to 0; Obtain the (i+1)th token in the first symbol sequence generated by the adjusted generative language model.
2. The method according to claim 1, characterized in that The multiple symbols used for offshore wind power risk assessment include: a task header symbol set, a task symbol set, a system symbol set, and a data symbol set; The task header symbol set includes a state prediction task header symbol, an abnormal data detection task header symbol and a missing value filling task header symbol; The task symbol set includes a state prediction task symbol subset, an abnormal data detection task symbol subset and a missing value filling task symbol subset, and any task symbol subset in the task symbol set uniquely corresponds to a task header symbol in the task header symbol set; The system symbol set includes a start symbol and an end symbol; The data symbol set is used to indicate discretized data in the offshore wind power system.
3. The method according to claim 2, characterized in that The symbol rule set includes: The valid set of the i+1th token is determined by the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs; The first token of the symbol sequence is the starting symbol; The next token of the starting symbol is any task header symbol in the task header symbol set; The valid set of the next token of the first task header symbol is: the union of the data symbol set and the first task symbol subset, the first task header symbol is any symbol in the task header symbol set, the first task symbol subset corresponds to the first task header symbol, and the first task symbol subset is any task symbol subset in the task symbol set; In the case where the i-th token is a symbol in the data symbol set, the valid set of the i+1-th token is: the union of the data symbol set, the second task symbol subset, and the end symbol, where the second task symbol subset is the task symbol subset corresponding to the task header symbol in the symbol sequence to which the i-th token belongs; When the i-th token is the end symbol, the generative language model stops generating a symbol sequence.
4. The method according to any one of claims 1 to 3, characterized in that The adjusting, based on the valid set of the i+1th token, the probability distribution of each token in the probability distribution of the generative language model includes: The following formula is used to adjust the probability distribution of each token in the probability distribution of the generative language model: in, represents the probability distribution of the generative language model when generating the i+1th token, is a token in the probability distribution of the generative language model, is the i-th token of the first symbol sequence, express The probability of being output by the generative language model as the i+1th token of the first symbol sequence, is the valid set of the i+1th token.
5. A symbol sequence generation device for offshore wind power risk assessment, characterized in that: The device comprises: A first acquisition module is configured to acquire a plurality of symbols for offshore wind power risk assessment and a symbol rule set of the plurality of symbols, wherein the symbol rule set includes a plurality of symbol rules, and the symbol rules are configured to define contexts of the plurality of symbols; A second acquisition module is used to obtain the i-th token in the first symbol sequence generated by the generative language model; a valid set determination module, configured to determine a valid set of an i+1th token based on the i-th token and the symbol rule set; an adjustment module, configured to adjust the probability distribution of each token in the probability distribution of the generative language model based on the valid set of the (i+1)th token, wherein the adjusting the probability distribution of each token in the probability distribution of the generative language model comprises adjusting the generation probability of a token outside the valid set in the probability distribution of the generative language model to 0; The third acquisition module is used to obtain the (i+1)th token in the first symbol sequence generated by the adjusted generative language model.
6. The device according to claim 5, characterized in that In the first acquisition module, the plurality of symbols used for offshore wind power risk assessment include: a task header symbol set, a task symbol set, a system symbol set, and a data symbol set; The task header symbol set includes a state prediction task header symbol, an abnormal data detection task header symbol and a missing value filling task header symbol; The task symbol set includes a state prediction task symbol subset, an abnormal data detection task symbol subset and a missing value filling task symbol subset, and any task symbol subset in the task symbol set uniquely corresponds to a task header symbol in the task header symbol set; The system symbol set includes a start symbol and an end symbol; The data symbol set is used to indicate discretized data in the offshore wind power system.
7. The device according to claim 6, characterized in that In the first acquisition module, the symbol rule set includes: The valid set of the i+1th token is determined by the i-th token and the task header symbol in the symbol sequence to which the i-th token belongs; The first token of the symbol sequence is the starting symbol; The next token of the starting symbol is any task header symbol in the task header symbol set; The valid set of the next token of the first task header symbol is: the union of the data symbol set and the first task symbol subset, the first task header symbol is any symbol in the task header symbol set, the first task symbol subset corresponds to the first task header symbol, and the first task symbol subset is any task symbol subset in the task symbol set; In the case where the i-th token is a symbol in the data symbol set, the valid set of the i+1-th token is: the union of the data symbol set, the second task symbol subset, and the end symbol, where the second task symbol subset is the task symbol subset corresponding to the task header symbol in the symbol sequence to which the i-th token belongs; When the i-th token is the end symbol, the generative language model stops generating a symbol sequence.
8. A computer device, characterized in that: The computer device includes: a memory and a processor, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the method according to any one of claims 1 to 4.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to implement the method according to any one of claims 1 to 4.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Replay method, device and system based on generative language model
CN118012999A
Large language model reasoning acceleration method and related device
CN118333172A