Method, device and equipment for constructing digital twin, and readable storage medium
By constructing a digital twin, tracing the source of interaction signals of secondary equipment, and building a program mirror, the problem of inconvenience in the research of secondary equipment in the existing technology is solved, and an efficient and low-cost research method is realized.
Patent Information
- Application Number
- CN202210928380.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-08-03
AI Technical Summary
In existing technologies, research on secondary equipment in DC control and protection systems requires real-time system simulation, which results in large systems that are difficult to maintain and hinders efficient research.
By constructing a digital twin, the interaction relationships between functional modules are obtained by tracing the source of interactive signals in secondary equipment, and a program mirror of each functional module is constructed. Finally, a digital twin is constructed, and efficient research is achieved by using graph neural networks and mirror templates for training.
It enables efficient research on secondary equipment, occupies little space, has low maintenance costs, and high economic benefits, and allows for transparent research on secondary equipment within a digital twin.
Smart Images

Figure CN115238586B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power grid, more particularly, to a method and device for constructing a digital twin, an apparatus and a readable storage medium. BACKGROUND
[0002] In the prior art, if the secondary equipment in the DC control protection system needs to be researched, a real-time simulation system containing a simulation power grid needs to be connected to the DC control protection hardware, and the research of the secondary equipment can be realized in combination of the real-time simulation system and the DC control protection hardware. However, the real-time simulation system is large and difficult to maintain, which brings inconvenience to the research of the secondary equipment. SUMMARY
[0003] Therefore, the present application provides a method and device for constructing a digital twin, an apparatus and a readable storage medium, which are used to solve the problem that the secondary equipment is difficult to be researched in the prior art.
[0004] In order to achieve the above-mentioned purpose, the present application provides the following solutions.
[0005] A method for constructing a digital twin includes the following steps.
[0006] Determine the secondary equipment to be constructed, wherein the secondary equipment contains a plurality of functional modules, each functional module runs in the transmission of interaction signals to realize the operation of the secondary equipment, and the interaction signals transmitted between the functional modules during the operation of the secondary equipment are all traceable signals.
[0007] Trace the source of each interaction signal in the secondary equipment to obtain the interaction relationship between the functional modules.
[0008] Construct the program image of each functional module in the secondary equipment.
[0009] Construct the digital twin of the secondary equipment according to the program image of each functional module and the interaction relationship between the functional modules.
[0010] Optionally, tracing the source of each interaction signal in the secondary equipment to obtain the interaction relationship between the functional modules includes the following steps.
[0011] Obtain a graph neural network.
[0012] Use the graph neural network to trace the source of each interaction signal in the secondary equipment to obtain the interaction relationship between the functional modules output by the graph neural network.
[0013] Optionally, the step of obtaining a graph neural network includes the following steps.
[0014] obtaining a plurality of training data of the graph neural network, wherein each of the plurality of training data is an interaction signal and an edge vector of each of a plurality of secondary devices, each of the interaction signals comprises an identifier of a function module corresponding to the interaction signal, and the edge vector represents an interaction relationship between identifiers of the function modules;
[0015] inputting the plurality of training data into the graph neural network one by one to obtain a predicted interaction relationship output by the graph neural network until a first loss value corresponding to the graph neural network is less than a first threshold value, wherein the first loss value is determined according to the predicted interaction relationship and the edge vector.
[0016] Optionally, the constructing of the program image of each function module in the secondary device comprises:
[0017] obtaining an input signal and an output signal corresponding to each function module, and taking the input signal and the output signal as training data corresponding to the function module;
[0018] selecting one of a plurality of image templates in a preset image template set as a target image, and removing the target image from the image template set;
[0019] inputting the training data into the target image to obtain a predicted signal output by the target image, the predicted signal corresponding to the input signal in the training data;
[0020] calculating a second loss value of the target model according to the predicted signal and the output signal;
[0021] adjusting parameters of the target image according to the second loss value until a loss value corresponding to the target image reaches a minimum value that can be reached by the target image;
[0022] when the minimum value is greater than the second threshold value, returning to the step of selecting one of a plurality of image templates in a preset image template set as a target image until the second loss value corresponding to the target image is not greater than the second threshold value;
[0023] taking the finally obtained target image as the program image of the function module to obtain a program image corresponding to each function module.
[0024] Optionally, the adjusting of the parameters of the target image according to the second loss value comprises:
[0025] obtaining a preset adjustable parameter set corresponding to the target image, the adjustable parameter set comprising a plurality of parameter types corresponding to the target image and adjustable in value;
[0026] According to each parameter type in the adjustable parameter set and the second loss value, the parameters of the target mirror image are adjusted.
[0027] Optionally, after constructing the digital twin of the secondary device according to the program image of each functional module and the interaction relationship between the functional modules, the method further comprises:
[0028] Verifying the simulation error between the constructed digital twin and the secondary device.
[0029] Optionally, the verifying the simulation error between the constructed digital twin and the real secondary device comprises:
[0030] Obtaining real input signals and real output signals corresponding to the secondary device;
[0031] Inputting the real input signals into the digital twin corresponding to the secondary device to obtain a to-be-tested signal corresponding to the real input signals output by the digital twin corresponding to the secondary device, the to-be-tested signal being an output of the digital twin corresponding to the secondary device under the triggering of the real input signals;
[0032] Calculating the error between the real output signals and the to-be-tested signals, and determining the simulation error of the digital twin corresponding to the secondary device according to the error.
[0033] A digital twin construction device comprises:
[0034] An acquisition unit configured to determine a secondary device to be constructed into a digital twin, wherein the secondary device comprises a plurality of functional modules, each functional module runs in the transmission of interaction signals to realize the running of the secondary device, and each interaction signal transmitted between the functional modules in the running of the secondary device is a traceable signal;
[0035] A tracing unit configured to trace the source of each interaction signal in the secondary device to obtain the interaction relationship between the functional modules;
[0036] A construction unit configured to construct the program image of each functional module in the secondary device;
[0037] A utilization unit configured to construct the digital twin of the secondary device according to the program image of each functional module and the interaction relationship between the functional modules.
[0038] A digital twin construction device comprises a memory and a processor;
[0039] The memory is configured to store a program;
[0040] The processor is configured to execute the program to implement each step of the method for constructing a digital twin.
[0041] A readable storage medium stores a computer program, and the computer program is executed by a processor to implement each step of the method for constructing a digital twin.
[0042] As can be seen from the above technical solutions, the method for constructing a digital twin provided by the application can construct a digital twin of a secondary device, and the digital twin constructed by the application can be used to study the secondary device in a DC control protection system.
[0043] The digital twin constructed in the application not only can realize the function of the secondary device corresponding to the digital twin, but also occupies less space and has lower maintenance cost, thereby bringing higher economic benefits. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0045] Figure 1 A flow chart of a method for constructing a digital twin disclosed in an embodiment of the present application;
[0046] Figure 2 A structure block diagram of a device for constructing a digital twin disclosed in an embodiment of the present application;
[0047] Figure 3 A hardware structure block diagram of a device for constructing a digital twin disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0049] The method for constructing a digital twin provided by the present application can be applied in the field of electric power, and a digital twin of a secondary device to be studied can be constructed by using the present application. The study and optimization of the secondary device can be realized by studying the digital twin, such as parameter optimization, setting interference, setting fault, etc.
[0050] Next, the construction method of the digital twin of the present application is described in detail, including the following steps: Figure 1 The construction method of the digital twin of the present application is described in detail, including the following steps:
[0051] Step S1, determining the secondary equipment to be constructed.
[0052] Specifically, the secondary equipment contains a plurality of functional modules. The normal operation of the secondary equipment is based on the sequential operation of each functional module.
[0053] Wherein, each functional module is sequentially operated by transmitting interaction signals, and the interaction signals transmitted between each functional module during the operation of the secondary equipment are all traceable signals, which indicate the sending functional module and the receiving functional module of each interaction signal.
[0054] Step S2, tracing the source of each interaction signal in the secondary equipment to obtain the interaction relationship between each functional module.
[0055] Specifically, each interaction signal can be traced in various ways, for example, the connection relationship between each functional module can be determined through the wiring diagram of the secondary equipment, thereby determining the source of each interaction signal and obtaining the interaction relationship between each functional module; or a graph neural network can be used to trace the interaction signal, thereby determining the source of each interaction signal and obtaining the interaction relationship between each functional module.
[0056] There can be communication nodes such as switches in the secondary equipment, and the main function of the communication nodes is to transmit interaction signals, so the interaction signals transmitted in each communication node can also be traced to their source and receiving functional module.
[0057] Step S3, constructing a program image of each functional module in the secondary equipment.
[0058] Specifically, each functional module in the secondary equipment can be simulated using simulation software to obtain a program image of each functional module, wherein the corresponding data of each functional module can be obtained in advance, and the program image can be constructed on the simulation software; or a plurality of program image templates can be constructed in advance, a program image template corresponding to the functional module can be selected, and the parameters of the program template can be adjusted based on the functional module to obtain a program image corresponding to the functional module.
[0059] Each program image can realize the function of the secondary equipment according to the running order of each functional module in the secondary equipment.
[0060] The program image corresponding to each function module can output an output signal corresponding to an input signal of the function module under the triggering of the input signal, and the similarity between the output signal and a signal output by the function module under the triggering of the input signal is higher than a certain threshold.
[0061] The interaction relationship between the function modules in the secondary device can be determined first, and then the program images of the function modules in the secondary device can be constructed, or the program images of the function modules in the secondary device can be constructed first, and then the interaction relationship between the function modules in the secondary device can be determined, which is not limited in the application.
[0062] In step S4, a digital twin of the secondary device is constructed according to the program images of the function modules and the interaction relationship between the function modules.
[0063] Specifically, the execution order of the program images in the running process and the interaction relationship, connection relationship and the like between the program images can be constructed according to the program images, the interaction relationship between the function modules and the correspondence between the program images and the function modules, so as to realize the construction of the digital twin of the secondary device.
[0064] The function of the digital twin is the same as that of the secondary device, and the secondary device can be researched by researching the digital twin.
[0065] As can be seen from the above technical solution, the construction method of the digital twin provided in the embodiments of the application can first determine a secondary device to be constructed, trace the source of each interaction signal in the secondary device, obtain the interaction relationship between the function modules, so as to obtain the signal transmission relationship, execution logic and execution order between the internal components in the secondary device; the program image of each function module in the secondary device can be constructed, so as to construct the program image of the internal components in the secondary device; the digital twin of the secondary device can be constructed according to the program images of the function modules and the interaction relationship between the function modules, so as to realize the construction of the digital twin of the secondary device by constructing the internal components and the interaction relationship between the internal components in the secondary device.
[0066] After the digital twin of the secondary device is constructed, the digital twin can reflect the whole life cycle of the entity secondary device, so that the digital twin constructed by the application can be used to research the secondary device in the DC control and protection system, and in the digital twin, the data is highly transparent, which is more conducive to the research of the secondary device.
[0067] In addition, the digital twin constructed in the application not only can realize the function of the secondary device corresponding to the digital twin, but also occupies less space and has lower maintenance cost, which can bring higher economic benefits.
[0068] In some embodiments of the present application, the process of step S2, tracing the source of each interaction signal in the secondary equipment, obtaining the interaction relationship between each functional module, is described in detail, and the specific steps are as follows:
[0069] S20, obtaining a graph neural network.
[0070] Specifically, a graph neural network can be pre-trained, and the trained graph neural network can be used to predict the interaction relationship between each functional module in each type of secondary equipment and output the interaction relationship between each functional module.
[0071] S21, using the graph neural network to trace the source of each interaction signal in the secondary equipment, and obtaining the interaction relationship between each functional module output by the graph neural network.
[0072] Specifically, the graph neural network can be used to find the source of each interaction signal, determine the sending functional module and the receiving functional module of each interaction signal, so that the graph neural network determines and outputs the interaction relationship between each functional module.
[0073] As can be seen from the above technical solution, compared with the previous embodiment, the present embodiment provides an optional way of using a graph neural network to determine the interaction relationship between each functional module. As can be seen, by using a graph neural network, the interaction relationship between each functional module can be determined more efficiently, quickly and accurately.
[0074] In some embodiments of the present application, the process of step S20, obtaining a graph neural network, is described in detail, and the specific steps are as follows:
[0075] S200, obtaining a plurality of training data of the graph neural network, wherein the plurality of training data are each interaction signal and an edge vector in a plurality of secondary equipment, each interaction signal includes the identification of the functional module corresponding to the interaction signal, and the edge vector represents the interaction relationship between the identification of each functional module.
[0076] Specifically, the graph neural network can be trained to improve the accuracy of the graph neural network in determining the interaction relationship between each functional module.
[0077] Each training data corresponds to each interaction signal and an edge vector in a secondary equipment.
[0078] The plurality of secondary devices can be acquired, and the interaction signals in the running process of each secondary device can be acquired, and the identifier of the sending function module and the identifier of the receiving function module of each interaction signal can be determined, and the interaction signal is corresponded to the identifier of the sending function module and the identifier of the receiving function module, and the edge vector is constructed according to the interaction logic of each function module, and the edge vector represents the interaction relationship between the identifier of the sending function module and the identifier of the receiving function module corresponding to each interaction signal.
[0079] The interaction relationship between the identifier of the sending function module and the identifier of the receiving function module corresponding to each interaction signal includes the interaction relationship between the identifier of the sending function module and the identifier of the receiving function module corresponding to the same interaction signal, and also includes the interaction relationship between the identifier of the sending function module and the identifier of the receiving function module corresponding to different interaction signals.
[0080] The interaction signals and the edge vector corresponding to the same secondary device can constitute one training data or a plurality of training data.
[0081] S201, the plurality of training data is input into the graph neural network one by one, and the predicted interaction relationship output by the graph neural network is obtained until the first loss value corresponding to the graph neural network is less than the first threshold value, wherein the first loss value is determined according to the predicted interaction relationship and the edge vector.
[0082] Specifically, the training data can be used to train the graph neural network.
[0083] During the training process, a target training data can be randomly selected in the training data, and the training data is input into the graph neural network to obtain the output of the graph neural network, and the output is the predicted interaction relationship between each function module, and each function module is represented by the identifier of the function module in the predicted interaction relationship.
[0084] The loss value of the graph neural network can be calculated according to the predicted interaction relationship and the edge vector in the target training data, and the loss value is taken as the first loss value.
[0085] The parameters of the graph neural network can be adjusted according to the first loss value, the graph neural network is updated, and the step of randomly selecting a target training data in the training data is returned until the first loss value is less than the first threshold value.
[0086] The size of the first threshold value can be set according to the requirement of accuracy in actual scene. Generally, the first threshold value can be 0.
[0087] It can be seen from the technical solution that the embodiment provides an optional way of training a graph neural network. Through the training of the graph neural network according to the technical solution, the accuracy of the graph neural network in tracing the source of the interaction signal and determining the interaction relationship between the functional modules can be further improved.
[0088] In some embodiments of the present application, the process of step S3, constructing the program image of each functional module in the secondary device, is described in detail, and the specific steps are as follows:
[0089] S30, obtaining the input signal and the output signal corresponding to each functional module, and taking the input signal and the output signal as the training data corresponding to the functional module.
[0090] Specifically, when simulating each functional module to construct the program image of each functional module, the pre-constructed image template can be trained to obtain the program image of the functional module.
[0091] During the training process, the input signal and the output signal of each functional module can be obtained. The input signal and the output signal can be interaction signals.
[0092] The input signal corresponding to each functional module is the input of the functional module, and the output signal corresponding to each functional module is the output of the functional module under the triggering of the input signal. The input signal and the output signal form the training data of the functional module.
[0093] S31, selecting an image template as a target image from a pre-set image template set containing multiple types of image templates, and removing the target image from the image template set.
[0094] Specifically, the image template set contains multiple types of program image templates, and the types of the functional modules of each secondary device do not exceed the types of the program images contained in the image template set.
[0095] The program image of each functional module can be constructed step by step. If the internal composition of the functional module cannot be determined, that is, the type of the functional module cannot be determined, an image template can be randomly selected as a target image from the image template set, and the target image can be removed from the image template set.
[0096] If the type of the functional module can be determined, an image template matching the type of the functional module can be selected as a target image from the image template set, and the target image can be removed from the image template set.
[0097] When the construction of the current function module is completed, the image template set is restored when the program image of the next function module is constructed, that is, the image template set corresponding to each function module is consistent when the construction of the program image of each function module starts.
[0098] S32, input the training data into the target mirror to obtain a prediction signal output by the target mirror, the prediction signal corresponding to the input signal in the training data.
[0099] Specifically, the target mirror is trained using the training data to obtain a prediction signal output by the target mirror until the loss value of the target mirror after parameter adjustment has reached the minimum value that the target mirror can reach.
[0100] S33, according to the prediction signal and the output signal, a second loss value of the target model is calculated and obtained.
[0101] Specifically, the relative mean square error between the prediction signal output by the target mirror and the output signal output by the function module under the trigger of the same input signal can be calculated, and the relative mean square error is taken as the second loss value.
[0102] The way to calculate the relative mean square error between the prediction signal and the output signal can be to calculate the absolute value of the difference between the prediction signal and the output signal at each collection point, add the absolute value of the difference between the prediction signal and the output signal at each collection point, obtain the sum of the absolute value of the difference, and calculate the square of the ratio between the sum of the absolute value of the difference and the rated value of the output signal, obtain the square number, and calculate the ratio of the square number and the number of collection points, then take the square root of the ratio, and take the value after the square root as the relative mean square error.
[0103] The relative mean square error can be calculated by formula, and the formula for calculating the relative mean square error between the prediction signal and the output signal is as follows:
[0104]
[0105] Where, IEd(T i ) represents the waveform value of the prediction signal at the i-th collection point, IEr(T i ) represents the waveform value of the output signal at the i-th collection point, N represents the number of collection points, the collection is equal interval collection, and the collection interval is determined according to the sampling rate of the prediction signal and the output signal, R ref represents the rated value of the output signal.
[0106] S34, according to the second loss value, the parameters of the target mirror are adjusted until the loss value corresponding to the target mirror reaches the minimum value that the target mirror can reach.
[0107] Specifically, the second loss value after each parameter adjustment can be recorded, and when the second loss value increases after the parameter adjustment, the parameter is adjusted in reverse.
[0108] When the increase or decrease of any parameter results in an increase in the second loss value, the parameter of the target image is stopped from being adjusted, and it is considered that the minimum value that the target image can reach has been reached.
[0109] S35, when judging whether the minimum second loss value of the target image is greater than the second threshold value, if yes, returning to execute step S31, and taking the finally obtained target image as the program image of the function module to obtain the program image corresponding to each function module.
[0110] Specifically, when the minimum value that the target image can reach is reached, the second loss value of the target image is compared with the second threshold value, and if the second loss value is greater than the second threshold value, it indicates that the target image is selected incorrectly, and a new target image needs to be selected and retrained until the second loss value of the target image obtained by training is less than the second threshold value. The target image with the second loss value less than the second threshold value is taken as the program image of the function module corresponding to the training data.
[0111] The size of the second threshold value can be set in advance according to the actual scene, and if the accuracy requirement is high, the second threshold value can be small. Generally, the second threshold value can be 10%.
[0112] As can be seen from the above technical solution, the embodiment provides an optional way of constructing a program image of a function module. Through the above way, the similarity between the program image and the corresponding function module can be further improved, so that the digital twin of the secondary device constructed is more reliable and more accurate.
[0113] In some embodiments of the present application, the process of adjusting the parameters of the target image according to the second loss value in step S34 is described in detail, and the steps are as follows:
[0114] S340, obtaining a preset adjustable parameter set corresponding to the target image, the adjustable parameter set containing a plurality of numerical adjustable parameter types corresponding to the target image.
[0115] Specifically, each image template in the image template set corresponds to an adjustable parameter set, and the adjustable parameter set contains all parameter types whose parameter value size can be adjusted during the training process of the image template.
[0116] Based on this, the target image has a corresponding adjustable parameter set.
[0117] S341、According to each parameter type in the adjustable parameter set and the second loss value, adjust the parameters of the target mirror image.
[0118] Specifically, according to the second loss value, a parameter type can be selected from the adjustable parameter set corresponding to the target mirror image, and the parameter value corresponding to the selected parameter type can be adjusted.
[0119] From the above technical solution, it can be seen that the embodiment provides an optional way to adjust the parameters of the target mirror image. Through the above method, the adjustable parameters in the target mirror image can be adjusted, and the parameters in the target mirror image that are not suitable for adjustment are not adjusted, thereby avoiding damage to the target mirror image.
[0120] In some embodiments of the present application, it is considered that the constructed digital twin can be verified to ensure the similarity between the constructed digital twin and the secondary device, so as to further improve the practical significance of researching the digital twin. Therefore, after step S4, the following step can be added:
[0121] S5, verify the simulation error between the constructed digital twin and the secondary device.
[0122] Specifically, whether the functions of the constructed digital twin and the secondary device are similar can be verified to determine the simulation error between the constructed digital twin and the secondary device.
[0123] After obtaining the simulation error, the simulation error and a preset third threshold value can also be compared. If the simulation error is greater than the third threshold value, the first threshold value and / or the second threshold value can be reduced, and the present application can be re-executed until the simulation error is lower than the third threshold value.
[0124] The size of the third threshold value can be set according to the actual scene. When the similarity requirement of the digital twin and the secondary device is high, the third threshold value can be small.
[0125] From the above technical solution, it can be seen that the embodiment adds an optional technical solution for verifying the simulation error between the constructed digital twin and the secondary device. Through the embodiment, the similarity between the digital twin and the secondary device can be further ensured.
[0126] In some embodiments of the present application, the process of step S5, verifying the simulation error between the constructed digital twin and the secondary device, is described in detail as follows:
[0127] S50, obtain the real input signal and the real output signal corresponding to the secondary device.
[0128] Specifically, a real input signal inputting the secondary equipment can be acquired, and the secondary equipment outputs a real output signal under the triggering of the input signal.
[0129] S51, inputting the real input signal into the digital twin corresponding to the secondary equipment to obtain a to-be-tested signal corresponding to the real input signal and output by the digital twin corresponding to the secondary equipment, the to-be-tested signal being an output of the digital twin corresponding to the secondary equipment under the triggering of the real input signal.
[0130] Specifically, the real input signal is inputted into the digital twin to obtain a predicted signal output by the digital twin under the triggering of the real input signal.
[0131] S52, calculating an error between the real output signal and the to-be-tested signal, and determining a simulation error of the digital twin corresponding to the secondary equipment according to the error.
[0132] Specifically, a relative mean square error between the real output signal and the to-be-tested signal can be calculated, and the relative mean square error is taken as the simulation error.
[0133] The relative mean square error between the real output signal and the to-be-tested signal can be calculated in the manner of calculating the relative mean square error in step S33 of the above embodiment.
[0134] At this time, IEd(T i ) represents a waveform value of the to-be-tested signal at the i-th acquisition point, IEr(T i ) represents a waveform value of the real output signal at the i-th acquisition point, N represents the number of acquisition points, the acquisition is equal-interval acquisition, the acquisition interval is determined according to the sampling rate of the to-be-tested signal and the real output signal, and R ref represents a rated value of the real output signal.
[0135] As can be seen from the above technical solution, the embodiment provides an optional manner of calculating a simulation error of a digital twin relative to a secondary equipment. Through the above manner, the similarity between the digital twin and the secondary equipment can be more reliably judged.
[0136] Next, the construction device of the digital twin provided in the present application will be introduced, and the construction device of the digital twin provided below can be correspondingly referred to the construction method of the digital twin provided above. Figure 2 Referring to
[0137] , the construction device of the digital twin can include: Figure 2
[0138] The acquisition unit 1 is configured to determine a secondary device to be constructed as a digital twin, wherein the secondary device comprises a plurality of functional modules, each functional module runs in the transmission of an interaction signal to realize the operation of the secondary device, and the interaction signals transmitted between the functional modules during the operation of the secondary device are all traceable signals.
[0139] The tracing unit 2 is configured to trace the source of each interaction signal in the secondary device to obtain the interaction relationship between the functional modules.
[0140] The construction unit 3 is configured to construct a program image of each functional module in the secondary device.
[0141] The utilization unit 4 is configured to construct a digital twin of the secondary device according to the program images of the functional modules and the interaction relationship between the functional modules.
[0142] Further, the tracing unit can comprise:
[0143] The graph neural network acquisition unit is configured to acquire a graph neural network.
[0144] The signal tracing unit is configured to trace the source of each interaction signal in the secondary device by using the graph neural network to obtain the interaction relationship between the functional modules output by the graph neural network.
[0145] Further, the signal tracing unit can comprise:
[0146] The first signal tracing unit is configured to acquire a plurality of training data of the graph neural network, wherein the plurality of training data are each interaction signal and an edge vector in a plurality of secondary devices, each interaction signal comprises an identifier of a functional module corresponding to the interaction signal, and the edge vector represents an interaction relationship between the identifiers of the functional modules.
[0147] The second signal tracing unit is configured to input the plurality of training data into the graph neural network one by one to obtain a predicted interaction relationship output by the graph neural network until a first loss value corresponding to the graph neural network is less than a preset first threshold, wherein the first loss value is determined according to the predicted interaction relationship and the edge vector.
[0148] Further, the construction unit can comprise:
[0149] The training data acquisition unit is configured to acquire an input signal and an output signal corresponding to each functional module and take the input signal and the output signal as the training data corresponding to the functional module.
[0150] The target image selecting unit is configured to select one image template as a target image from a preset image template set containing multiple types of image templates, and remove the target image from the image template set.
[0151] The prediction signal obtaining unit is configured to input the training data into the target image to obtain a prediction signal output by the target image, the prediction signal corresponding to an input signal in the training data.
[0152] The loss value calculating unit is configured to calculate and obtain a second loss value of the target model according to the prediction signal and the output signal.
[0153] The parameter adjusting unit is configured to adjust parameters of the target image according to the second loss value until a loss value corresponding to the target image reaches a minimum value that can be reached by the target image.
[0154] The numerical value comparing unit is configured to return to call the target image selecting unit when the minimum value is greater than the second threshold value until the second loss value corresponding to the target image is not greater than the second threshold value.
[0155] The program image obtaining unit is configured to obtain the target image as a program image of the function module to obtain a program image corresponding to each function module.
[0156] Further, the parameter adjusting unit can include:
[0157] The first parameter adjusting unit is configured to obtain a preset adjustable parameter set corresponding to the target image, the adjustable parameter set containing multiple parameter types of the target image that can be adjusted in value.
[0158] The second parameter adjusting unit is configured to adjust parameters of the target image according to each parameter type in the adjustable parameter set and the second loss value.
[0159] Further, the digital twin construction device can further include:
[0160] The verification unit is configured to verify a simulation error between the constructed digital twin and the secondary device.
[0161] Further, the verification unit can include:
[0162] Obtain real input signals and real output signals corresponding to the secondary device.
[0163] a first verification unit configured to input the real input signal into the digital twin corresponding to the secondary device to obtain a to-be-tested signal corresponding to the real input signal and output by the digital twin corresponding to the secondary device, the to-be-tested signal being an output of the digital twin corresponding to the secondary device under the triggering of the real input signal;
[0164] a second verification unit configured to calculate an error between the real output signal and the to-be-tested signal, and determine a simulation error of the digital twin corresponding to the secondary device according to the error.
[0165] The construction device of the digital twin provided in the application can be applied to a digital twin construction device, such as a PC terminal, a server, a server cluster, and the like. Optionally, Figure 3 A hardware structure block diagram of the digital twin construction device is shown, and the hardware structure of the digital twin construction device can include at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4. Figure 3
[0166] In the embodiments of the application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 complete mutual communication through the communication bus 4.
[0167] The processor 1 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the application, etc.
[0168] The memory 3 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.
[0169] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to:
[0170] determine a secondary device to be constructed as a digital twin, wherein the secondary device includes a plurality of functional modules, each functional module runs in the transmission of an interaction signal to realize the running of the secondary device, and the interaction signal transmitted between the functional modules in the running of the secondary device is a traceable signal;
[0171] trace the source of each interaction signal in the secondary device to obtain the interaction relationship between the functional modules;
[0172] construct a program image of each functional module in the secondary device.
[0173] According to the program image of each functional module and the interaction relationship between the functional modules, the digital twin of the secondary device is constructed.
[0174] Optionally, the refinement function and the extension function of the program can refer to the description above.
[0175] The embodiments of the present application also provide a storage medium which can store a program suitable for a processor to execute, and the program is used for:
[0176] determining a secondary device to be constructed into a digital twin, wherein the secondary device comprises a plurality of functional modules, each functional module runs in the transmission of interaction signals to realize the running of the secondary device, and each interaction signal transmitted between the functional modules in the running of the secondary device is a traceable signal;
[0177] tracing the source of each interaction signal in the secondary device to obtain the interaction relationship between the functional modules;
[0178] constructing a program image of each functional module in the secondary device;
[0179] According to the program image of each functional module and the interaction relationship between the functional modules, the digital twin of the secondary device is constructed.
[0180] Optionally, the refinement function and the extension function of the program can refer to the description above.
[0181] Finally, it should be noted that in this document, the terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0182] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between each embodiment can be referred to each other.
[0183] The above description of disclosed embodiments enables one of ordinary skill in the art to make and use various embodiments of the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Various embodiments of the present application can be combined with each other. Thus, the present application is not to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for constructing a digital twin, characterized in that, include: A secondary device for constructing a digital twin is identified, wherein the secondary device contains multiple functional modules, each of which operates through the transmission of interactive signals to enable the operation of the secondary device, and the interactive signals transmitted between the functional modules during the operation of the secondary device are all traceable signals. Multiple training data sets for a graph neural network are acquired, wherein the multiple training data sets are various interaction signals and edge vectors in multiple secondary devices. Each interaction signal includes the identifier of the functional module corresponding to the interaction signal, and the edge vectors represent the interaction relationship between the identifiers of the functional modules. The interaction relationship between the identifiers of the sending functional module and the identifiers of the receiving functional module corresponding to each interaction signal includes the interaction relationship between the identifiers of the sending functional module and the identifiers of the receiving functional module corresponding to the same interaction signal, and also includes the interaction relationship between the identifiers of the sending functional module and the identifiers of the receiving functional module corresponding to different interaction signals. The multiple training data are input into the graph neural network one by one to obtain the predicted interaction relationship output by the graph neural network, until the first loss value corresponding to the graph neural network is less than a preset first threshold, wherein the first loss value is determined according to the predicted interaction relationship and the edge vector; Using the graph neural network, the source of each interaction signal in the secondary device of the digital twin to be constructed is traced, and the interaction relationship between each functional module in the secondary device of the digital twin to be constructed is obtained from the graph neural network output. Construct a program image of each functional module in the secondary device of the digital twin to be constructed; Based on the program images of each functional module and the interaction relationships between the functional modules in the secondary device to be constructed as a digital twin, the digital twin of the secondary device is constructed.
2. The method for constructing a digital twin according to claim 1, characterized in that, The program image of each functional module in the secondary device for constructing the digital twin to be constructed includes: Acquire the input and output signals corresponding to each functional module, and use the input and output signals as training data for the functional module. From a preset set of image templates containing multiple types of image templates, select an image template as the target image, and remove the target image from the set of image templates. The training data is input into the target image to obtain the predicted signal output by the target image, and the predicted signal corresponds to the input signal in the training data; The second loss value of the target image is calculated and obtained based on the predicted signal and the output signal; Based on the second loss value, the parameters of the target image are adjusted until the loss value corresponding to the target image reaches the minimum value that the target image can achieve; When the minimum value is greater than the second threshold, return to the step of selecting a mirror template as the target mirror from a preset set of mirror templates containing multiple types of mirror templates, until the second loss value corresponding to the target mirror is not greater than the second threshold. The final target image is used as the program image of the functional module to obtain the program image corresponding to each functional module.
3. The method for constructing a digital twin according to claim 2, characterized in that, Based on the second loss value, the parameters of the target image are adjusted, including: Obtain a preset set of adjustable parameters corresponding to the target image, wherein the set of adjustable parameters contains multiple parameter types with adjustable values corresponding to the target image; The parameters of the target image are adjusted according to the parameter types in the adjustable parameter set and the second loss value.
4. The method for constructing a digital twin according to claim 1, characterized in that, After constructing the digital twin of the secondary device based on the program images of each functional module and the interaction relationships between the functional modules in the secondary device to be constructed as a digital twin, the process further includes: Verify the simulation error between the constructed digital twin and the secondary device.
5. The method for constructing a digital twin according to claim 4, characterized in that, The simulation error between the constructed digital twin and the real secondary equipment includes: Obtain the actual input signal and actual output signal corresponding to the secondary device; The real input signal is input into the digital twin corresponding to the secondary device to obtain the test signal output by the digital twin corresponding to the secondary device, which is the output of the digital twin corresponding to the secondary device under the trigger of the real input signal. Calculate the error between the actual output signal and the signal under test, and determine the simulation error of the digital twin corresponding to the secondary device based on the error.
6. A device for constructing a digital twin, characterized in that, include: An acquisition unit is used to determine a secondary device for constructing a digital twin, wherein the secondary device contains multiple functional modules, each of which operates in the transmission of interactive signals to realize the operation of the secondary device, and the interactive signals transmitted between the functional modules during the operation of the secondary device are all traceable signals. A tracing unit is used to acquire multiple training data sets for a graph neural network. These training data sets consist of interaction signals and edge vectors from multiple secondary devices. Each interaction signal includes an identifier for a corresponding functional module, and the edge vectors represent the interaction relationships between the identifiers of the functional modules. The interaction relationships between the identifiers of the sending and receiving functional modules corresponding to each interaction signal include those between the identifiers of the same sending and receiving functional modules, as well as those between the identifiers of different sending and receiving functional modules. The multiple training data sets are input one by one into the graph neural network to obtain the predicted interaction relationships output by the graph neural network, until a first loss value corresponding to the graph neural network is less than a preset first threshold. The first loss value is determined based on the predicted interaction relationships and the edge vectors. Using the graph neural network, the source of each interaction signal in the secondary devices of the digital twin to be constructed is traced, obtaining the interaction relationships between the functional modules in the secondary devices of the digital twin to be constructed, as output by the graph neural network. Construction unit, used to construct the program image of each functional module in the secondary device of the digital twin to be constructed; The utilization unit is used to construct a digital twin of the secondary device based on the program images of each functional module and the interaction relationship between each functional module in the secondary device to be constructed into a digital twin.
7. A device for constructing a digital twin, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the various steps of the method for constructing a digital twin as described in any one of claims 1-5.
8. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for constructing a digital twin as claimed in any one of claims 1-5.
Citation Information
Patent Citations
Energy system maintenance method, device and system and storage medium
CN111476386A
Digital twinning model construction method and device
CN112200493A
TPM equipment management virtual verification method and system based on digital twin
CN113792422A