Gas network supply end initial value assignment method, device, equipment and medium

By selecting appropriate methods to filter out the target supply data from the historical data based on the accumulation time of the natural gas pipeline network, and assigning the current initial value to the supply end of the natural gas pipeline network, solving the unreasonable initial value assignment of the supply end in the existing technology. The problem has improved the accuracy and reliability of pipeline scheduling.

CN119151257BActive Publication Date: 2025-02-07SHANGHAI THREE ZERO FOUR ZERO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing technology lacks rationality in the initial value assignment of natural gas pipeline supply side, especially when the daily demand changes significantly, there is a large gap between the initial value assignment and the ideal initial value assignment, resulting in the failure of the pipeline network simulation and affecting the scheduling effect. .

Method used

By obtaining the current predicted gas volume and the accumulation time of historical data at the demand end of the gas pipeline network, according to the accumulation time belongs to different preset time intervals, the comprehensive similarity, characterization extractor or supply data prediction model are used to filter from historical data, etc. The target historical supply data is output and assigned to the current initial value of the supply side.

Benefits of technology

The reasonable initial value assignment at the supply end of the natural gas pipeline network is achieved, the accuracy and reliability of pipeline network scheduling is improved, and the risk of pipeline network simulation failure is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151257B_ABST
    Figure CN119151257B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for assigning initial values ​​to the supply side of a gas network, which relates to the field of smart city operation technology, including: obtaining the current predicted gas consumption and the accumulated duration of historical data on the demand side of the gas network; if the accumulated duration belongs to the first preset duration interval, the current supply data of the supply side is filtered out from the historical data using comprehensive similarity; if the accumulated duration belongs to the second preset duration interval, the current supply data of the supply side is obtained based on the predicted characterization information of the current predicted gas consumption obtained using the target characterization extractor; if the accumulated duration belongs to the third preset duration interval, the current supply data of the supply side is obtained using the target supply data prediction model, the current predicted gas consumption and the predicted characterization information; the duration of the first preset duration interval is less than the duration of the second preset duration interval, which is less than the duration of the third preset duration interval. The above scheme is used to reasonably determine the data on the supply side of the gas network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart city operation technology, and in particular to a method, device, equipment and medium for assigning initial values ​​to a supply end of a gas network. Background Art

[0002] In recent years, the demand for clean energy natural gas has been increasing day by day. The rapid growth of high demand has increased the test of the supply and regulation capabilities of the natural gas pipeline network. In order to better cope with the pipeline supply scheduling, researchers have tried to predict and evaluate the demand through algorithms such as big data modeling, and then use experience, historical data filling and other methods to assign initial values ​​to the pressure or flow on the supply side. Based on the complete demand and supply data, the pipeline network simulation technology is used to simulate the operation status of the pipeline network, and the initial value assignment is adjusted according to the quality of the status to ensure that the pipeline network status achieves the expected goal.

[0003] The existing operating conditions usually determine the current supply-side data based on the monitoring data of the pressure sensors and flow sensors of the previous day, which lacks rationality. When the daily demand changes significantly, there will be a large gap between this initial value assignment method and the ideal initial value assignment, and the pipeline network simulation will fail, which will affect the pipeline network scheduling effect.

[0004] From the above, it can be seen that how to achieve reasonable initial value assignment on the supply side of the natural gas pipeline network is an important issue that needs to be urgently solved in this field. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for assigning initial values ​​to the supply end of a gas pipeline network, so as to achieve reasonable initial value assignment to the supply end of a natural gas pipeline network. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a method for assigning initial values ​​to a supply end of a gas network, comprising:

[0007] Obtain the current predicted gas consumption at the demand side in the gas pipeline network, and determine the cumulative duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption at the demand side at different historical times and the corresponding historical supply data at the supply side in the gas pipeline network;

[0008] If the accumulated duration belongs to the first preset duration interval, the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions is determined, so as to select the target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply end; wherein the comprehensive similarity is the similarity obtained by integrating the cosine similarity in length and the element similarity in direction;

[0009] If the accumulated duration belongs to the second preset duration interval, the target representation extractor trained based on the historical gas consumption is used to obtain the predicted representation information of the current predicted gas consumption, and the target historical supply data filtered from the historical data based on the predicted representation information is assigned to the current initial value of the supply end; wherein the duration of the second preset duration interval is greater than the duration of the first preset duration interval;

[0010] If the accumulated duration belongs to a third preset duration interval, the current predicted gas consumption and the predicted characterization information are input into the target supply data prediction model trained using the historical characterization information of the historical data, and the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; wherein the duration of the third preset duration interval is greater than the duration of the second preset duration interval.

[0011] Optionally, determining the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions, so as to filter out target historical supply data from each of the historical supply data based on the comprehensive similarity, includes:

[0012] sequentially determining each of the historical gas consumptions as the current gas consumption to be screened;

[0013] Obtaining the dimensionless cosine similarity between the current predicted gas consumption and the dimensionless current gas consumption to be screened, and determining the element similarity between the current predicted gas consumption and the current gas consumption to be screened;

[0014] Determine the product of the cosine similarity and the element similarity as the comprehensive similarity between the current predicted gas consumption and the current gas consumption to be screened, so as to obtain a first comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions;

[0015] The target historical gas consumption with the largest first comprehensive similarity is selected from each of the historical gas consumptions in the historical data, and the historical supply data corresponding to the target historical gas consumption in the historical data is determined as the target historical supply data.

[0016] Optionally, the obtaining of the dimensionless cosine similarity between the current predicted gas consumption and the dimensionless current gas consumption to be screened, and determining the element similarity between the current predicted gas consumption and the current gas consumption to be screened, includes:

[0017] Performing dimensionless processing on the current predicted gas consumption and the current gas consumption to be screened to obtain a first processed vector and a second processed vector, and calculating the cosine similarity between the first processed vector and the second processed vector in sequence;

[0018] The minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened is determined, and the product between the minimum multiple relationships of each element group is determined as the element similarity.

[0019] Optionally, the determining of the minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened includes:

[0020] Determine each element group including a first element and a second element respectively; wherein the first element is any element of the current predicted gas consumption, and the second element is an element in the current gas consumption to be screened corresponding to the first element;

[0021] Determine each of the element groups as a current element group in sequence, and determine a first multiple relationship and a second multiple relationship of the current element group; wherein the first multiple relationship is a first ratio between the first element and the second element, and the second multiple relationship is a ratio between the second element and the first element;

[0022] The minimum multiple relationship of the current element group is determined from the first multiple relationship and the second multiple relationship to obtain the minimum multiple relationship of each element group.

[0023] Optionally, the process of acquiring the target representation extractor includes:

[0024] Constructing an initial reconstruction model including a representation extractor, a feature recovery layer and a reconstruction layer; wherein the representation extractor includes an input layer, a feature extraction layer and a representation layer;

[0025] Using the initial reconstruction model as the current reconstruction model, and inputting the historical gas consumption into the input layer of the current reconstruction model, so that the reconstruction layer of the current reconstruction model outputs the reconstructed gas consumption;

[0026] Calculating a first loss function value between the historical gas consumption and the reconstructed gas consumption;

[0027] If the first loss function value is not less than a first preset threshold, the first loss function value is used to update the parameters of the characterization extractor in the current reconstruction model to obtain a new current reconstruction model, and then the process jumps back to the step of inputting the historical gas consumption into the input layer of the current reconstruction model;

[0028] If the first loss function value is less than a first preset threshold, the representation extractor in the current reconstruction model is determined as the target representation extractor.

[0029] Optionally, assigning the target historical supply data filtered from the historical data based on the prediction representation information to the current initial value of the supply end includes:

[0030] Using the target representation extractor to obtain the historical representation information of the historical gas consumption in the historical data, and respectively determining the second comprehensive similarity between the predicted representation information and each of the historical representation information;

[0031] The target historical gas consumption with the largest second comprehensive similarity is selected from each of the historical gas consumptions in the historical data, and the historical supply data corresponding to the target historical gas consumption in the historical data is determined as the target historical supply data, and the target historical supply data is assigned to the current initial value of the supply end.

[0032] Optionally, the process of acquiring the target supply data prediction model includes:

[0033] Using the target representation extractor to obtain historical representation information of the historical gas consumption, and concatenating the historical gas consumption with the historical representation information to obtain new vector data;

[0034] Construct an initial prediction model including input layer, feature extraction layer and output layer;

[0035] Using the initial prediction model as the current prediction model, inputting the new vector data into the current prediction model, and calculating a second loss function value between the prediction supply data generated by the current prediction model and the new vector data;

[0036] If the second loss function value is not less than a second preset threshold, the parameters of the current prediction model are updated using the second loss function value to obtain a new current prediction model, and the process jumps back to the step of inputting the new vector data into the current prediction model;

[0037] If the second loss function value is less than a second preset threshold, the current prediction model is determined as the target supply data prediction model.

[0038] In a second aspect, the present application discloses a gas network supply end initial value assignment device, comprising:

[0039] An information acquisition module, used to obtain the current predicted gas consumption of the demand side in the gas pipeline network, and determine the cumulative duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption of the demand side at different historical times and the corresponding historical supply data of the supply side in the gas pipeline network;

[0040] A first assignment module, for determining the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions if the accumulated time duration belongs to a first preset time duration interval, so as to select target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply end; wherein the comprehensive similarity is the similarity obtained by integrating the cosine similarity in length and the element similarity in direction;

[0041] A second assignment module is used for, if the accumulated duration belongs to a second preset duration interval, obtaining the predicted representation information of the current predicted gas consumption by using the target representation extractor trained based on the historical gas consumption, and assigning the target historical supply data screened from the historical data based on the predicted representation information to the current initial value of the supply end; wherein the duration of the second preset duration interval is greater than the duration of the first preset duration interval;

[0042] A third assignment module is used to input the current predicted gas consumption and the predicted characterization information into a target supply data prediction model trained using the historical characterization information of the historical data if the accumulated duration belongs to a third preset duration interval, and assign the predicted supply data output by the target supply data prediction model to the current initial value of the supply end; wherein the duration of the third preset duration interval is greater than the duration of the second preset duration interval.

[0043] In a third aspect, the present application discloses an electronic device, comprising:

[0044] Memory, used to store computer programs;

[0045] A processor is used to execute the computer program to implement the steps of the aforementioned method for assigning initial values ​​to the supply end of the gas network.

[0046] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned method for assigning initial values ​​to the supply end of a gas network are implemented.

[0047] The beneficial effects of the present application are as follows: the present application obtains the current predicted gas consumption at the demand side in the gas pipeline network, and determines the accumulated duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption at the demand side at different historical times and the historical supply data corresponding to the supply side in the gas pipeline network; if the accumulated duration belongs to the first preset duration interval, then the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions is determined, so as to filter out the target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply side; wherein the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction; if the accumulated duration belongs to the second preset duration interval, then The target representation extractor trained based on the historical gas consumption is used to obtain the predicted representation information of the current predicted gas consumption, and the target historical supply data screened from the historical data based on the predicted representation information is assigned to the current initial value of the supply end; wherein, the duration of the second preset time interval is greater than the duration of the first preset time interval; if the cumulative duration belongs to the third preset time interval, the current predicted gas consumption and the predicted representation information are input into the target supply data prediction model trained using the historical representation information of the historical data, and the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; wherein, the duration of the third preset time interval is greater than the duration of the second preset time interval.It can be seen that the present application selects different supply data determination mechanisms according to the cumulative duration of historical data, specifically: when the cumulative duration is short, that is, the cumulative duration belongs to the first preset duration interval, the similarity matching mechanism is selected to determine the comprehensive similarity between the current predicted gas consumption and each historical gas consumption. Because the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction, the comprehensive similarity is more accurate, that is, it can more accurately filter out the target historical supply data corresponding to the current predicted gas consumption from the historical data, and assign the target historical supply data to the current initial value of the supply end; when the cumulative duration is not short, that is, the cumulative duration belongs to the second preset duration interval, then the target representation extractor has been fully trained because of the large amount of historical gas consumption data, so the accuracy of the target representation extractor is higher, so the representation matching mechanism can be selected, and the target representation extractor is used to obtain the predicted representation information of the current predicted gas consumption, and then the target historical supply data filtered out from the historical data based on the predicted representation information is assigned to the current initial value of the supply end. The supply data is determined as the current supply data of the supply end, that is, the similarity between the predicted characterization information and the characterization information of the historical data is calculated to determine the target historical supply data, and the target historical supply data is assigned to the current initial value of the supply end; when the cumulative time is long, that is, the cumulative time belongs to the third preset time interval, the target supply data prediction model can be fully trained because the data volume of the historical gas consumption and the historical characterization information are large, so the target supply data prediction model has a higher reliability in this case, and the supply-side generation mechanism can be selected, that is, the target supply data prediction model can directly output the predicted supply data according to the current predicted gas consumption and the predicted characterization information, and then the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; in this way, the present application effectively solves the problem of determining the current supply data under different historical data under different cumulative time conditions, and in the process of gradual accumulation of historical data, the accuracy and reliability of the current supply data assignment will be greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0049] Figure 1 This is a flow chart of a method for assigning initial values ​​to a gas network supply end disclosed in this application;

[0050] Figure 2 A specific gas network supply and demand relationship diagram disclosed in this application;

[0051] Figure 3 A specific cosine similarity effect comparison diagram disclosed in this application;

[0052] Figure 4 A schematic diagram of a specific reconstruction model disclosed in this application;

[0053] Figure 5 A specific reconstruction model training error curve change diagram disclosed in this application;

[0054] Figure 6 A schematic diagram of a specific supply data prediction model disclosed in this application;

[0055] Figure 7 A graph showing a change in a training error curve of a specific supply data prediction model disclosed in this application;

[0056] Figure 8 A specific similarity matching mechanism flow chart disclosed in this application;

[0057] Fig. 9 A specific characterization matching mechanism flow chart disclosed in this application;

[0058] Fig.10 A specific supply-side generation mechanism flow chart disclosed in this application;

[0059] Fig.11 This is a schematic diagram of the structure of an initial value assignment device at the supply end of a gas network disclosed in this application;

[0060] Fig.12 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

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

[0062] In recent years, the demand for clean energy natural gas has been increasing day by day. The rapid growth of high demand has increased the test of the supply and regulation capabilities of the natural gas pipeline network. In order to better cope with the pipeline supply scheduling, researchers have tried to predict and evaluate the demand through algorithms such as big data modeling, and then use experience, historical data filling and other methods to assign initial values ​​to the pressure or flow on the supply side. Based on the complete demand and supply data, the pipeline network simulation technology is used to simulate the operation status of the pipeline network, and the initial value assignment is adjusted according to the quality of the status to ensure that the pipeline network status achieves the expected goal.

[0063] The existing operating conditions usually determine the current supply-side data based on the monitoring data of the pressure sensors and flow sensors of the previous day, which lacks rationality. When the daily demand changes significantly, there will be a large gap between this initial value assignment method and the ideal initial value assignment, and the pipeline network simulation will fail, which will affect the pipeline network scheduling effect.

[0064] To this end, this application correspondingly provides a gas pipeline network supply-side initial value assignment scheme to achieve reasonable initial value assignment on the supply side of the natural gas pipeline network.

[0065] See also Figure 1 As shown, the embodiment of the present application discloses a method for assigning initial values ​​to a gas network supply end, including:

[0066] Step S11: Obtain the current predicted gas consumption on the demand side in the gas pipeline network, and determine the cumulative duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption on the demand side at different historical times and the corresponding historical supply data on the supply side in the gas pipeline network.

[0067] For example Figure 2 A specific gas pipeline supply and demand relationship diagram is shown. The pipeline system consists of a demand side, an intermediate node and a supply side. The demand side is a user node, the intermediate node is a common node, and the supply side is a gas source or a pressure regulating station node. The demand side is an independent variable, and the supply side is a dependent variable. The supply side changes with changes in the demand side. If the current supply data of the supply side is determined only based on yesterday's monitoring data, the initial value assignment error will be large due to the sudden change in demand caused by seasonal changes, extreme weather, holidays, etc., which will seriously affect the pipeline network simulation results and subsequent gas source scheduling; if only based on historical monitoring data for the same period, that is, using historical statistical data over a period of time as the initial value, the initial value reflects the general level of supply-side pressure and flow in each specific period of time, but the same initial value assignment is used within the same period, ignoring the volatility of daily demand, and there is room for continuous optimization; if based on supply-side pressure and supply-side flow forecast data, that is, according to the change law of historical pressure and flow on the supply side, the predicted value of future supply-side pressure and flow is obtained, only based on the change characteristics of supply-side data, without considering the change law of demand side, and thus deviates from the original intention of future demand affecting supply-side assignment, the forecast result is flexible but not very reliable.

[0068] Obtain the current predicted gas consumption on the demand side of the gas pipeline network, and collect the historical gas consumption on the demand side of the gas pipeline network at different historical times and the corresponding historical supply data on the supply side to obtain historical data. The corresponding historical supply data on the supply side includes the gas source pressure and natural gas flow, and determine the cumulative duration of these historical data.

[0069] Step S12: If the accumulated duration belongs to the first preset duration interval, the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions is determined, so as to filter out the target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply end; wherein the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction.

[0070] If the cumulative duration belongs to the first preset duration interval, the target cosine similarity algorithm is used to determine the current supply data of the supply side, that is, to determine the comprehensive similarity between the current predicted gas consumption and the historical gas consumption, so as to screen out the target historical supply data from the historical supply data based on the comprehensive similarity. Among them, the first preset duration interval can be specifically 3 months. That is to say, when the cumulative duration of historical data is less than 3 months, the historical data inventory is small, and it is suitable to directly perform similarity matching between the demand forecast value and the historical value, that is, to select the similarity matching mechanism.

[0071] In this embodiment, the method of determining the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions to filter out target historical supply data from each of the historical supply data based on the comprehensive similarity includes: determining each of the historical gas consumptions as the current gas consumption to be filtered out in turn; obtaining the cosine similarity between the dimensionless current predicted gas consumption and the dimensionless current gas consumption to be filtered out, and determining the element similarity between the current predicted gas consumption and the current gas consumption to be filtered out; determining the product of the cosine similarity and the element similarity as the comprehensive similarity between the current predicted gas consumption and the current gas consumption to be filtered out, so as to obtain the first comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions; filtering out the target historical gas consumption with the largest first comprehensive similarity from each of the historical gas consumptions in the historical data, and determining the historical supply data corresponding to the target historical gas consumption in the historical data as the target historical supply data. The historical gas consumption is determined as the current gas consumption to be screened in turn. The specific process of the similarity matching mechanism between the current gas consumption to be screened and the current predicted gas consumption is as follows:

[0072] 1) Obtain the dimensionless current predicted gas consumption The dimensionless current gas consumption to be screened The cosine similarity between ;

[0073] 2) Determine the current predicted gas consumption The current gas consumption to be screened The similarity of elements between ;

[0074] 3) The product of cosine similarity and element similarity is determined as the comprehensive similarity between the current predicted gas consumption and the current gas consumption to be screened ;

[0075] In this way, the first comprehensive similarity between the current predicted gas consumption and the historical gas consumption can be obtained, and then the target historical gas consumption with the largest first comprehensive similarity can be selected from the historical gas consumption in the historical data, and the historical supply data corresponding to the target historical gas consumption in the historical data can be determined as the target historical supply data.

[0076] In this embodiment, the cosine similarity between the dimensionless current predicted gas consumption and the dimensionless current gas consumption to be screened, and determining the element similarity between the current predicted gas consumption and the current gas consumption to be screened, includes: dimensionless processing the current predicted gas consumption and the current gas consumption to be screened to obtain a first processed vector and a second processed vector, and sequentially calculating the cosine similarity between the first processed vector and the second processed vector; determining the minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened, and determining the product between the minimum multiple relationships of each element group as the element similarity. The process of obtaining the cosine similarity is as follows:

[0077] 1.1) Forecast of current gas consumption 、Current gas consumption to be screened Perform dimensionless processing to obtain the first processed vector , the second processed vector ; The dimensionless processing formula is as follows:

[0078] ;

[0079] ;

[0080] In the formula, Indicates the current predicted gas consumption The first element of each Indicates the current gas consumption to be screened Each second element in represents the first element after dimensionless transformation, represents the dimensionless second element;

[0081] 1.2) Calculate the cosine similarity between the first processed vector and the second processed vector in sequence. The cosine similarity calculation formula is as follows:

[0082] ;

[0083] It can be understood that the original vector is transformed in a dimensionless manner in order to better measure the directional difference between the vectors, that is, calculating the cosine similarity can reflect the directional similarity between the vectors;

[0084] In the process of obtaining element similarity, the minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened is first determined, and the product of the minimum multiple relationship of each element group is determined as the element similarity. The specific element similarity acquisition formula is as follows:

[0085] ;

[0086] In the formula, Indicates the current predicted gas consumption The first element of each Indicates the current gas consumption to be screened For each second element in , in terms of length, according to the element similarity acquisition formula, the multiple relationship between the corresponding elements is calculated, and the minimum value is taken as their similarity result, and then all the multiple values ​​are multiplied to obtain the final element similarity.

[0087] Furthermore, according to the cosine similarity calculation formula and the element similarity acquisition formula, the comprehensive similarity calculation formula is as follows:

[0088] ;

[0089] The traditional cosine similarity calculation formula only considers the directional similarity, but does not consider the similarity of vector length. Therefore, vectors with large length differences but close directions will also be judged as similar. According to the comprehensive similarity calculation formula, this implementation improves the traditional cosine similarity calculation formula. In this way, the calculated comprehensive similarity combines the directional angle and the length angle. For example Figure 3A specific cosine similarity effect comparison diagram is shown, using the root mean square error (Root Mean Square Error) as the most intuitive indicator (y-axis) for comparing the gap between two vectors, and observing the change in the similarity (x-axis) as the error decreases. In the traditional cosine similarity calculation formula, the scatter point distribution is relatively loose, without obvious distribution rules. When the similarity is high, there will be small errors and large errors. In this case, cosine similarity is difficult to be used as an effective way to judge the similarity of two vectors. However, in the improved cosine similarity calculation formula of this embodiment, the scatter point distribution has a regularity to follow, and the large error must have a low degree of similarity, and the small error must have a high degree of similarity. In the whole process of reducing the error, the similarity degree is also gradually approaching a high level, and the whole change process is stable. Therefore, the improved similarity has better performance than the original cosine similarity. It is feasible and reliable to use the comprehensive similarity calculation formula to filter out the target historical supply data corresponding to the current predicted gas consumption from the historical data.

[0090] In this embodiment, determining the minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened includes: determining each element group containing a first element and a second element respectively; wherein the first element is any element of the current predicted gas consumption, and the second element is an element in the current gas consumption to be screened corresponding to the first element; determining each of the element groups as the current element group in turn, and determining a first multiple relationship and a second multiple relationship of the current element group; wherein the first multiple relationship is a first ratio between the first element and the second element, and the second multiple relationship is a ratio between the second element and the first element; determining the minimum multiple relationship of the current element group from the first multiple relationship and the second multiple relationship to obtain the minimum multiple relationship of each of the element groups.

[0091] For example, the first elements of the current predicted gas consumption are A1, A2, A3, A4, and the second elements of the current gas consumption to be screened are B1, B2, B3, B4, then the element groups are the first element group {A1, B1}, the second element group {A2, B2}, the third element group {A3, B3}, and the fourth element group {A4, B4}; each element group is determined as the current element group in turn, and the first multiple relationship and the second multiple relationship of the current element group are determined. The first multiple relationship is the relationship between the first element and the second element. The first ratio between the two elements, the second multiple relationship is the ratio between the second element and the first element, so that the ratio of the first element group is (A1 / B1, B1 / A1), the ratio of the second element group is (A2 / B2, B2 / A2), the ratio of the third element group is (A3 / B3, B3 / A3), and the ratio of the fourth element group is (A4 / B4, B4 / A4); determine the minimum multiple relationship of the current element group from the first multiple relationship and the second multiple relationship to obtain the minimum multiple relationship of each element group, that is, .

[0092] Step S13: If the accumulated duration belongs to a second preset duration interval, the target representation extractor trained based on the historical gas consumption is used to obtain the predicted representation information of the current predicted gas consumption, and the target historical supply data screened from the historical data based on the predicted representation information is assigned to the current initial value of the supply end; wherein the duration of the second preset duration interval is greater than the duration of the first preset duration interval.

[0093] If the cumulative duration belongs to the second preset duration interval, the current supply data of the supply side is determined based on the predicted representation information output by the target representation extractor, that is, the target historical supply data screened out from the historical data based on the predicted representation information is assigned to the current initial value of the supply side, wherein the second preset duration interval can be specifically 3 months to 6 months. That is to say, when the cumulative duration of historical data is greater than 3 months but not more than 6 months, the amount of historical data accumulated is considerable, and the simple surface numerical matching method has the possibility of conducting deeper matching exploration and improvement due to the increase in data volume, that is, the representation matching mechanism is selected.

[0094] In this embodiment, the process of acquiring the target representation extractor includes: constructing an initial reconstruction model including a representation extractor, a feature recovery layer and a reconstruction layer; wherein the representation extractor includes an input layer, a feature extraction layer and a representation layer; using the initial reconstruction model as the current reconstruction model, and inputting the historical gas usage into the input layer of the current reconstruction model, so that the reconstruction layer of the current reconstruction model outputs the reconstructed gas usage; calculating the first loss function value between the historical gas usage and the reconstructed gas usage; if the first loss function value is not less than a first preset threshold, using the first loss function value to update the parameters of the representation extractor in the current reconstruction model to obtain a new current reconstruction model, and then jumping back to the step of inputting the historical gas usage into the input layer of the current reconstruction model; if the first loss function value is less than a first preset threshold, determining the representation extractor in the current reconstruction model as the target representation extractor. The specific process of acquiring the target representation extractor is as follows:

[0095] 1) For example Figure 4 A specific schematic diagram of a reconstruction model is shown, constructing an initial reconstruction model including a representation extractor, a feature recovery layer and a reconstruction layer, wherein the representation extractor includes an input layer, a feature extraction layer and a representation layer;

[0096] 2) The initial reconstruction model is used as the current reconstruction model, and the historical gas consumption is input into the input layer of the current reconstruction model, so that the reconstruction layer of the current reconstruction model outputs the reconstructed gas consumption. In other words, the training set, test set, and validation set of the reconstruction model are the historical gas consumption, and data standardization is performed. The training set is used to automatically adjust the model parameters, the test set is used to detect the results of each round of training, and the validation set is used to assist in parameter adjustment. In the whole process, the model input and label are the demand-side gas consumption, and the model output is the reconstructed demand gas consumption;

[0097] 3) Calculate the first loss function value between the historical gas consumption and the reconstructed gas consumption; if the first loss function value is not less than the first preset threshold, use the first loss function value to update the parameters of the characterization extractor in the current reconstruction model to obtain a new current reconstruction model, and then jump back to the step of inputting the historical gas consumption into the input layer of the current reconstruction model; if the first loss function value is less than the first preset threshold, determine the characterization extractor in the current reconstruction model as the target characterization extractor; use the mean square error (MSE) as the loss function and evaluation index to compare the gap between the reconstructed gas consumption output by the model and the input historical gas consumption, which intuitively reflects the quality of the model's reconstruction of the demand data. An excellent reconstruction effect represents that the key features of the demand data are successfully extracted in the characterization layer, and vice versa.

[0098] For example Figure 5The graph of the error curve of the reconstruction model training is shown, which shows the change of the mean square error of the three types of data sets in the model training as the number of training rounds increases. The error of the training set is stable at around 0.0003, and the error of the test set and the validation set is stable at around 0.0006, which shows that the model training has converged and achieved a small error on the three data sets. Based on such model training results, the input layer, feature extraction layer, and representation layer are selected as the target representation extractor.

[0099] In this embodiment, the target historical supply data filtered out from the historical data based on the predicted characterization information is assigned to the current initial value of the supply end, including: using the target characterization extractor to obtain the historical characterization information of the historical gas consumption in the historical data, and respectively determining the second comprehensive similarity between the predicted characterization information and each of the historical characterization information; filtering out the target historical gas consumption with the largest second comprehensive similarity from each of the historical gas consumptions in the historical data, and determining the historical supply data corresponding to the target historical gas consumption in the historical data as the target historical supply data, and assigning the target historical supply data to the current initial value of the supply end.

[0100] The target representation extractor can be used to obtain the historical representation information of each group of demand data after abstract features. For future demand forecasting, after obtaining the future forecast representation in the same way, the improved cosine similarity algorithm mentioned in the similarity matching mechanism is used to calculate the similarity between the forecast representation and the historical representation, that is, the second comprehensive similarity between the forecast representation information and each historical representation information is calculated using the comprehensive similarity algorithm. Finally, a group of historical data with the highest similarity is selected, and the supply-side pressure and flow monitoring values ​​corresponding to this group of data are used as the supply-side initial values ​​in the future pipeline network simulation calculation scenario. In other words, the target historical gas consumption with the largest second comprehensive similarity is selected from the historical gas consumption of the historical data, and the historical supply data corresponding to the target historical gas consumption in the historical data is determined as the target historical supply data.

[0101] Step S14: If the accumulated duration belongs to a third preset duration interval, the current predicted gas consumption and the predicted characterization information are input into a target supply data prediction model trained using the historical characterization information of the historical data, and the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; wherein the duration of the third preset duration interval is greater than the duration of the second preset duration interval.

[0102] If the cumulative duration belongs to the third preset duration interval, the target supply data prediction model uses the current predicted gas consumption and the predicted characterization information output by the target characterization extractor to determine the current supply data of the supply end, wherein the third preset duration interval can be specifically more than 6 months. That is to say, when the cumulative duration of historical data is greater than 6 months, the data accumulates steadily and takes shape. The target supply data prediction model can be fully trained because of the large amount of data of historical gas consumption and historical characterization information, that is, the supply-side generation mechanism is selected.

[0103] In this embodiment, the process of acquiring the target supply data prediction model includes: using the target characterization extractor to acquire the historical characterization information of the historical gas consumption, and splicing the historical gas consumption and the historical characterization information to obtain new vector data; constructing an initial prediction model including an input layer, a feature extraction layer, and an output layer; using the initial prediction model as the current prediction model, and inputting the new vector data into the current prediction model, and calculating the second loss function value between the predicted supply data generated by the current prediction model and the new vector data; if the second loss function value is not less than the second preset threshold, then using the second loss function value to update the parameters of the current prediction model to obtain a new current prediction model, and re-jumping to the step of inputting the new vector data into the current prediction model; if the second loss function value is less than the second preset threshold, then determining the current prediction model as the target supply data prediction model. The target supply data prediction model acquisition process is as follows:

[0104] 1) Use the target representation extractor to obtain historical representation information of historical gas consumption, and concatenate the historical gas consumption and historical representation information to obtain new vector data; concatenate the historical gas consumption and historical representation information as input to the model to maximize the use of existing demand feature resources;

[0105] 2) For example Figure 6 A specific schematic diagram of a supply data prediction model is shown, and an initial prediction model including an input layer, several feature extraction layers and an output layer is constructed;

[0106] 3) The initial prediction model is used as the current prediction model, and the new vector data is input into the current prediction model, and the second loss function value between the predicted supply data generated by the current prediction model and the new vector data is calculated; if the second loss function value is not less than the second preset threshold, the parameters of the current prediction model are updated using the second loss function value to obtain a new current prediction model, and the step of inputting the new vector data into the current prediction model is jumped again; if the second loss function value is less than the second preset threshold, the current prediction model is determined as the target supply data prediction model; the new vector data is divided into training set, test set and validation set in a ratio of 8:1:1, and the data is standardized, the training set is used to automatically adjust the model parameters, the test set is used to detect the results of each round of training, and the validation set is used to assist in parameter adjustment; in the whole process, the model input is the demand-side data, the model output is the predicted supply data, the label data is the supply-side pressure and flow monitoring data under the corresponding working conditions, and the mean square error is used as the loss function and evaluation index to compare the gap between the model output and the standard. The smaller the root mean square error, the more effective the relationship between the extracted input data and the label data is in improving the model performance, and vice versa.

[0107] For example Figure 7 The graph of the training error curve of a specific supply data prediction model is shown, which shows the change of the mean square error of the three types of data sets in the model training as the number of training rounds increases. The training set error is stable at around 0.00006, and the test set and validation set are stable at around 0.0001, which shows that the model training has converged and a small error has been achieved on the three data sets. Based on such model training results, a set of future demand forecast data, that is, the current forecast gas consumption and forecast characterization information, is input to obtain the supply side pressure and flow data in this scenario, that is, the current supply data on the supply side, and finally the generated results are used as the initial value data of the demand side pressure and flow to simulate future working conditions.

[0108] The beneficial effects of the present application are as follows: the present application obtains the current predicted gas consumption at the demand side in the gas pipeline network, and determines the accumulated duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption at the demand side at different historical times and the historical supply data corresponding to the supply side in the gas pipeline network; if the accumulated duration belongs to the first preset duration interval, then the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions is determined, so as to filter out the target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply side; wherein the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction; if the accumulated duration belongs to the second preset duration interval, then The target representation extractor trained based on the historical gas consumption is used to obtain the predicted representation information of the current predicted gas consumption, and the target historical supply data screened from the historical data based on the predicted representation information is assigned to the current initial value of the supply end; wherein, the duration of the second preset time interval is greater than the duration of the first preset time interval; if the cumulative duration belongs to the third preset time interval, the current predicted gas consumption and the predicted representation information are input into the target supply data prediction model trained using the historical representation information of the historical data, and the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; wherein, the duration of the third preset time interval is greater than the duration of the second preset time interval.It can be seen that the present application selects different supply data determination mechanisms according to the cumulative duration of historical data, specifically: when the cumulative duration is short, that is, the cumulative duration belongs to the first preset duration interval, the similarity matching mechanism is selected to determine the comprehensive similarity between the current predicted gas consumption and each historical gas consumption. Because the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction, the comprehensive similarity is more accurate, that is, it can more accurately filter out the target historical supply data corresponding to the current predicted gas consumption from the historical data, and assign the target historical supply data to the current initial value of the supply end; when the cumulative duration is not short, that is, the cumulative duration belongs to the second preset duration interval, then the target representation extractor has been fully trained because of the large amount of historical gas consumption data, so the accuracy of the target representation extractor is higher, so the representation matching mechanism can be selected, and the target representation extractor is used to obtain the predicted representation information of the current predicted gas consumption, and then the target historical supply data filtered out from the historical data based on the predicted representation information is assigned to the current initial value of the supply end. The supply data is determined as the current supply data of the supply end, that is, the similarity between the predicted characterization information and the characterization information of the historical data is calculated to determine the target historical supply data, and the target historical supply data is assigned to the current initial value of the supply end; when the cumulative time is long, that is, the cumulative time belongs to the third preset time interval, the target supply data prediction model can be fully trained because the data volume of the historical gas consumption and the historical characterization information are large, so the target supply data prediction model has a higher reliability in this case, and the supply-side generation mechanism can be selected, that is, the target supply data prediction model can directly output the predicted supply data according to the current predicted gas consumption and the predicted characterization information, and then the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; in this way, the present application effectively solves the problem of determining the current supply data under different historical data under different cumulative time conditions, and in the process of gradual accumulation of historical data, the accuracy and reliability of the current supply data assignment will be greatly improved.

[0109] The following is an explanation of the division of the cumulative duration interval and the selection of the mechanism. The relationship between the first preset duration interval, the second preset duration interval and the third preset duration interval can be determined according to the set time threshold factor T, as shown in Table 1:

[0110] Table 1

[0111] Serial number Time interval Selected Mechanism 1 t≤3T Similarity matching mechanism 2 3T <t≤6T Characterization matching mechanism 3 t>6T Supply-side generation mechanism

[0112] Let \(t\) represent the cumulative duration of historical data, and \(T\) be the time threshold factor. Assuming \(T\) is one month, when the cumulative duration \(t\) of historical data is less than three months, the similarity matching mechanism is selected; when the cumulative duration \(t\) of historical data is between three months and six months, the feature matching mechanism is selected; when the cumulative duration \(t\) of historical data is greater than six months, the supply - side generation mechanism is selected, as follows:

[0113] 1) When \(t\leq3T\), the historical data stock is small, and it is suitable to directly match the demand forecast value with the historical value. For example Figure 8 As shown in a specific flowchart of the similarity matching mechanism, first, the comprehensive similarity between the current predicted gas consumption at the demand side and the historical gas consumption at the demand side needs to be calculated. Then, select the group of historical data with the highest similarity. Next, use the corresponding supply - side pressure and flow monitoring values of this group of data as the initial values of the supply side in the future pipe network simulation calculation scenario, that is, the historical supply data corresponding to the supply side is determined as the current supply data of the supply side; the improved cosine similarity calculation method proposed makes up for the deficiencies in the calculation of direction and length in the original cosine similarity calculation method, and is improved from two angles respectively, effectively ensuring the relationship between the numerical difference and similarity degree of the two groups of data, and improving the reliability of similarity matching;

[0114] 2) When \(3T\lt t\leq6T\), the accumulated data volume is considerable, and the simple surface - level numerical matching method has the possibility of deeper - level matching exploration and improvement due to the increase in data volume. The initial value assignment method is switched from the similarity matching mechanism to the feature matching mechanism. Fig. 9 As shown in a specific flowchart of the feature matching mechanism, first, reconstruct the demand model, then extract the deep - level feature information of the demand through the model. Next, calculate the comprehensive similarity between the predicted feature information and the historical feature information, select the group of historical data with the highest similarity, and finally use the corresponding supply - side pressure and flow monitoring values of this group of data as the initial values of the supply side in the future pipe network simulation calculation scenario. The matching process in this part is basically the same as that of the similarity matching mechanism. The difference is that the similarity matching mechanism directly matches the original data, which belongs to the most superficial numerical matching, while the feature matching mechanism matches the feature information abstracted from the original data, which belongs to deep - level feature matching. In the case of complex and variable demand - side data, this feature matching mechanism makes the subsequent matching results more adaptable by extracting deeper - level demand features;

[0115] 3) When \(t\gt6T\), the data accumulates stably and has begun to take shape. The initial value assignment method is switched from the feature matching mechanism to the supply - side generation mechanism. Fig.10The flowchart of a specific supply-side generation mechanism shown in the figure first uses the representation extractor constructed in the representation matching mechanism to complete the representation extraction of the original demand data, then splices the original demand data and the representation data to form the demand data, and then establishes a generation model for the relationship between the demand data and the supply data. After the model training is completed, the current predicted gas consumption and the predicted representation information are input, and the corresponding supply data can be quickly generated according to the mapping relationship between the historical demand and the historical supply. Finally, the generated reorganized data is used as the initial value assignment data of the supply side in the future prediction scenario. Unlike the previous two mechanisms, this supply-side generation mechanism no longer uses matching as an implementation method, but relies on neural networks to maximize the mining of the relationship between the scaled demand-side and supply-side data, and generates the initial value of the supply side in a more direct and flexible way. The solution result is more adaptable than the matching method. The end generation mechanism provided makes reasonable use of the historical demand and supply data, abstracts them into a deep data relationship between the two, and directly generates the initial value assignment data of the supply side corresponding to the future predicted demand. It is more flexible than the existing simple historical numerical assignment and more reliable than the supply-side prediction method.

[0116] The proposed fusion framework dynamically selects initial value assignment methods of different mechanisms according to the accumulation time of different historical data, which effectively solves the problem of initial value assignment on the supply side under different historical data amounts. In the process of gradual accumulation of data volume, the accuracy and reliability of initial value assignment on the supply side will make great progress.

[0117] See also Fig.11 As shown, the embodiment of the present application discloses a gas network supply end initial value assignment device, comprising:

[0118] The information acquisition module 11 is used to obtain the current predicted gas consumption of the demand side in the gas pipeline network and determine the cumulative duration of the historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption of the demand side at different historical times and the corresponding historical supply data of the supply side in the gas pipeline network;

[0119] A first assignment module, for determining the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions if the accumulated time duration belongs to a first preset time duration interval, so as to select target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply end; wherein the comprehensive similarity is the similarity obtained by integrating the cosine similarity in length and the element similarity in direction;

[0120] A second assignment module is used for, if the accumulated duration belongs to a second preset duration interval, obtaining the predicted representation information of the current predicted gas consumption by using the target representation extractor trained based on the historical gas consumption, and assigning the target historical supply data screened from the historical data based on the predicted representation information to the current initial value of the supply end; wherein the duration of the second preset duration interval is greater than the duration of the first preset duration interval;

[0121] A third assignment module is used to input the current predicted gas consumption and the predicted characterization information into a target supply data prediction model trained using the historical characterization information of the historical data if the accumulated duration belongs to a third preset duration interval, and assign the predicted supply data output by the target supply data prediction model to the current initial value of the supply end; wherein the duration of the third preset duration interval is greater than the duration of the second preset duration interval.

[0122] The beneficial effects of the present application are as follows: the present application obtains the current predicted gas consumption at the demand side in the gas pipeline network, and determines the accumulated duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption at the demand side at different historical times and the historical supply data corresponding to the supply side in the gas pipeline network; if the accumulated duration belongs to the first preset duration interval, then the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions is determined, so as to filter out the target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply side; wherein the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction; if the accumulated duration belongs to the second preset duration interval, then The target representation extractor trained based on the historical gas consumption is used to obtain the predicted representation information of the current predicted gas consumption, and the target historical supply data screened from the historical data based on the predicted representation information is assigned to the current initial value of the supply end; wherein, the duration of the second preset time interval is greater than the duration of the first preset time interval; if the cumulative duration belongs to the third preset time interval, the current predicted gas consumption and the predicted representation information are input into the target supply data prediction model trained using the historical representation information of the historical data, and the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; wherein, the duration of the third preset time interval is greater than the duration of the second preset time interval.It can be seen that the present application selects different supply data determination mechanisms according to the cumulative duration of historical data, specifically: when the cumulative duration is short, that is, the cumulative duration belongs to the first preset duration interval, the similarity matching mechanism is selected to determine the comprehensive similarity between the current predicted gas consumption and each historical gas consumption. Because the comprehensive similarity is the similarity obtained by merging the cosine similarity in length and the element similarity in direction, the comprehensive similarity is more accurate, that is, it can more accurately filter out the target historical supply data corresponding to the current predicted gas consumption from the historical data, and assign the target historical supply data to the current initial value of the supply end; when the cumulative duration is not short, that is, the cumulative duration belongs to the second preset duration interval, then the target representation extractor has been fully trained because of the large amount of historical gas consumption data, so the accuracy of the target representation extractor is higher, so the representation matching mechanism can be selected, and the target representation extractor is used to obtain the predicted representation information of the current predicted gas consumption, and then the target historical supply data filtered out from the historical data based on the predicted representation information is assigned to the current initial value of the supply end. The supply data is determined as the current supply data of the supply end, that is, the similarity between the predicted characterization information and the characterization information of the historical data is calculated to determine the target historical supply data, and the target historical supply data is assigned to the current initial value of the supply end; when the cumulative time is long, that is, the cumulative time belongs to the third preset time interval, the target supply data prediction model can be fully trained because the data volume of the historical gas consumption and the historical characterization information are large, so the target supply data prediction model has a higher reliability in this case, and the supply-side generation mechanism can be selected, that is, the target supply data prediction model can directly output the predicted supply data according to the current predicted gas consumption and the predicted characterization information, and then the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; in this way, the present application effectively solves the problem of determining the current supply data under different historical data under different cumulative time conditions, and in the process of gradual accumulation of historical data, the accuracy and reliability of the current supply data assignment will be greatly improved.

[0123] Furthermore, an embodiment of the present application also provides an electronic device. Fig.12 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.

[0124] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for assigning initial values ​​to the supply end of a gas network executed by an electronic device disclosed in any of the aforementioned embodiments.

[0125] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0126] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0127] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0128] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the initial value assignment method of the gas pipeline supply end executed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can also further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0129] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned gas network supply end initial value assignment method is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiment, and will not be repeated here.

[0130] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0131] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. 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 may 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 this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable EPROM (Erasable Programmable Read Only Memory), electrically erasable programmable EEPROM (Electrically Erasable Programmable read only memory), register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0132] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0133] The above is a detailed introduction to the initial value assignment method, device, equipment and medium for the supply end of a gas pipeline network provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for assigning initial values ​​to a gas network supply end, characterized in that: include: Obtain the current predicted gas consumption at the demand side in the gas pipeline network, and determine the cumulative duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption at the demand side at different historical times and the corresponding historical supply data at the supply side in the gas pipeline network; If the accumulated duration belongs to the first preset duration interval, the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions is determined, so as to select the target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply end; wherein the comprehensive similarity is the similarity obtained by integrating the cosine similarity in length and the element similarity in direction; If the accumulated duration belongs to the second preset duration interval, the target representation extractor trained based on the historical gas consumption is used to obtain the predicted representation information of the current predicted gas consumption, and the target historical supply data filtered from the historical data based on the predicted representation information is assigned to the current initial value of the supply end; wherein the duration of the second preset duration interval is greater than the duration of the first preset duration interval; If the accumulated duration belongs to a third preset duration interval, the current predicted gas consumption and the predicted characterization information are input into the target supply data prediction model trained using the historical characterization information of the historical data, and the predicted supply data output by the target supply data prediction model is assigned to the current initial value of the supply end; wherein the duration of the third preset duration interval is greater than the duration of the second preset duration interval.

2. The method for assigning initial values ​​to the supply end of a gas network according to claim 1, characterized in that: The determining of the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions, so as to select target historical supply data from each of the historical supply data based on the comprehensive similarity, comprises: sequentially determining each of the historical gas consumptions as the current gas consumption to be screened; Obtaining the dimensionless cosine similarity between the current predicted gas consumption and the dimensionless current gas consumption to be screened, and determining the element similarity between the current predicted gas consumption and the current gas consumption to be screened; Determine the product of the cosine similarity and the element similarity as the comprehensive similarity between the current predicted gas consumption and the current gas consumption to be screened, so as to obtain a first comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions; The target historical gas consumption with the largest first comprehensive similarity is selected from each of the historical gas consumptions in the historical data, and the historical supply data corresponding to the target historical gas consumption in the historical data is determined as the target historical supply data.

3. The method for assigning initial values ​​to the supply end of a gas network according to claim 2, characterized in that: The step of obtaining the dimensionless cosine similarity between the current predicted gas consumption and the dimensionless current gas consumption to be screened, and determining the element similarity between the current predicted gas consumption and the current gas consumption to be screened includes: Performing dimensionless processing on the current predicted gas consumption and the current gas consumption to be screened to obtain a first processed vector and a second processed vector, and calculating the cosine similarity between the first processed vector and the second processed vector in sequence; The minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened is determined, and the product between the minimum multiple relationships of each element group is determined as the element similarity.

4. The method for assigning initial values ​​to the supply end of a gas network according to claim 3, characterized in that: The determining of the minimum multiple relationship of each element group between the current predicted gas consumption and the current gas consumption to be screened includes: Determine each element group including a first element and a second element respectively; wherein the first element is any element of the current predicted gas consumption, and the second element is an element in the current gas consumption to be screened corresponding to the first element; Determine each of the element groups as a current element group in sequence, and determine a first multiple relationship and a second multiple relationship of the current element group; wherein the first multiple relationship is a first ratio between the first element and the second element, and the second multiple relationship is a ratio between the second element and the first element; The minimum multiple relationship of the current element group is determined from the first multiple relationship and the second multiple relationship to obtain the minimum multiple relationship of each element group.

5. The method for assigning initial values ​​to the supply end of a gas network according to any one of claims 1 to 4, characterized in that: The acquisition process of the target representation extractor includes: Constructing an initial reconstruction model including a representation extractor, a feature recovery layer and a reconstruction layer; wherein the representation extractor includes an input layer, a feature extraction layer and a representation layer; Using the initial reconstruction model as the current reconstruction model, and inputting the historical gas consumption into the input layer of the current reconstruction model, so that the reconstruction layer of the current reconstruction model outputs the reconstructed gas consumption; Calculating a first loss function value between the historical gas consumption and the reconstructed gas consumption; If the first loss function value is not less than a first preset threshold, the first loss function value is used to update the parameters of the characterization extractor in the current reconstruction model to obtain a new current reconstruction model, and then the process jumps back to the step of inputting the historical gas consumption into the input layer of the current reconstruction model; If the first loss function value is less than a first preset threshold, the representation extractor in the current reconstruction model is determined as the target representation extractor.

6. The method for assigning initial values ​​to the supply end of a gas network according to claim 1, characterized in that: The assigning the target historical supply data filtered from the historical data based on the prediction characterization information to the current initial value of the supply end includes: Using the target representation extractor to obtain the historical representation information of the historical gas consumption in the historical data, and respectively determining the second comprehensive similarity between the predicted representation information and each of the historical representation information; The target historical gas consumption with the largest second comprehensive similarity is selected from each of the historical gas consumptions in the historical data, and the historical supply data corresponding to the target historical gas consumption in the historical data is determined as the target historical supply data, and the target historical supply data is assigned to the current initial value of the supply end.

7. The method for assigning initial values ​​to the supply end of a gas network according to claim 1, characterized in that: The process of acquiring the target supply data prediction model includes: Using the target representation extractor to obtain historical representation information of the historical gas consumption, and concatenating the historical gas consumption with the historical representation information to obtain new vector data; Construct an initial prediction model including input layer, feature extraction layer and output layer; Using the initial prediction model as the current prediction model, inputting the new vector data into the current prediction model, and calculating a second loss function value between the prediction supply data generated by the current prediction model and the new vector data; If the second loss function value is not less than a second preset threshold, the parameters of the current prediction model are updated using the second loss function value to obtain a new current prediction model, and the process jumps back to the step of inputting the new vector data into the current prediction model; If the second loss function value is less than a second preset threshold, the current prediction model is determined as the target supply data prediction model.

8. A gas network supply end initial value assignment device, characterized in that: include: An information acquisition module, used to obtain the current predicted gas consumption of the demand side in the gas pipeline network, and determine the cumulative duration of historical data in the gas pipeline network; wherein the historical data includes the historical gas consumption of the demand side at different historical times and the corresponding historical supply data of the supply side in the gas pipeline network; A first assignment module, for determining the comprehensive similarity between the current predicted gas consumption and each of the historical gas consumptions if the accumulated time duration belongs to a first preset time duration interval, so as to select target historical supply data from each of the historical supply data based on the comprehensive similarity, and assign the target historical supply data to the current initial value of the supply end; wherein the comprehensive similarity is the similarity obtained by integrating the cosine similarity in length and the element similarity in direction; A second assignment module is used for, if the accumulated duration belongs to a second preset duration interval, obtaining the predicted representation information of the current predicted gas consumption by using the target representation extractor trained based on the historical gas consumption, and assigning the target historical supply data screened from the historical data based on the predicted representation information to the current initial value of the supply end; wherein the duration of the second preset duration interval is greater than the duration of the first preset duration interval; A third assignment module is used to input the current predicted gas consumption and the predicted characterization information into a target supply data prediction model trained using the historical characterization information of the historical data if the accumulated duration belongs to a third preset duration interval, and assign the predicted supply data output by the target supply data prediction model to the current initial value of the supply end; wherein the duration of the third preset duration interval is greater than the duration of the second preset duration interval.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the method for assigning initial values ​​to the supply end of a gas network as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the method for assigning initial values ​​to the supply end of a gas network are implemented as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Gas usage amount prediction method and system based on big data

    CN115564094A

  • Model training method, photovoltaic power generation power prediction method and device

    CN116502692A