Electric power spot market clearing method and device based on breakpoint recovery, computer equipment, readable storage medium and program product

By using breakpoint recovery technology in the power spot market clearing system and using the persistent database to store and recover data files and identifiers during the execution phase, the problem of low disaster recovery capacity under system disasters is solved, and rapid recovery and efficient execution are achieved. Electricity spot market clearing tasks.

CN118860745APending Publication Date: 2024-10-29CHINA SOUTHERN POWER GRID COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411050697.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The existing power spot market clearing method has low disaster tolerance in system disaster environments, which results in the need to re-execute the task after interruption, which is inefficient.

Method used

The method based on breakpoint recovery is adopted, and the data files and stage identifiers of the execution phase are stored in the persistent database. The execution continues after the breakpoint is restored, which improves the disaster recovery capability of the system.

Benefits of technology

It achieves rapid recovery after interruption and continues to perform the power spot market clearing task, improving the system's disaster recovery capability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860745A_ABST
    Figure CN118860745A_ABST
Patent Text Reader

Abstract

The invention relates to an electric power spot market clearing method and device based on breakpoint recovery, computer equipment, a readable storage medium and a program product. The method comprises the following steps: detecting that an electric power spot market settlement method is started and a data file is stored in a persistent database, recovering the data file into a memory, and according to a stage identifier closest to the starting time of the electric power spot market settlement method, starting the data file; and calling a target code logic block in each code logic block corresponding to the electric power spot market clearing method, and clearing the electric power spot market in combination with the target code logic block and the recovered data. Compared with a traditional execution mode that a task needs to be executed again after interruption, the scheme has the advantages that the execution stages are divided in advance, the corresponding code logic blocks are associated, the data file is stored after each stage is executed, the breakpoint position is determined by querying the data file when the interruption is generated, and clearing continues to be executed from the breakpoint position; and the disaster recovery capability of clearing in the electric power spot market is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electric power technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for clearing an electric power spot market based on breakpoint recovery. Background Art

[0002] The clearing of the electricity spot market is the core link of the electricity spot market technology and plays an extremely important role in the optimization of the power grid. At present, the analysis method of the clearing of the electricity spot market is usually to start the calculation tasks one by one and achieve clearing in tens of minutes in a single calculation task. However, the current market clearing analysis task takes a long time. When the system encounters a disaster environment and causes the task to be interrupted, the task needs to be re-performed, resulting in a reduction in the disaster recovery capability of the system.

[0003] Therefore, the current method of clearing the electricity spot market has the defect of low disaster tolerance. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for clearing the electricity spot market based on breakpoint recovery that can improve disaster recovery capabilities in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for clearing a power spot market based on breakpoint recovery, the method comprising:

[0006] When it is detected that the electricity spot market clearing algorithm is started, querying a persistent database; the persistent database is used to store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage;

[0007] If the data file is stored in the persistent database, restore the data file to the memory to obtain the restored data;

[0008] Reading the phase identifier in the persistent database that is closest to the start time of the electricity spot market clearing algorithm, and calling the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm according to the phase identifier;

[0009] Taking the target code logic block as a starting point, the electricity spot market clearing algorithm is executed according to the restored data to perform electricity spot market clearing.

[0010] In one embodiment, the method takes the target code logic block as a starting point, executes the electricity spot market clearing algorithm according to the restored data, and after clearing the electricity spot market, further comprises:

[0011] When it is detected that the target execution phase corresponding to the target code logic block is completed, the data cached in the memory of the target code logic block is serialized to obtain a serialized data stream;

[0012] The data stream and the stage identifier corresponding to the target execution stage are written into the data file, and the data file is stored in the persistent database.

[0013] In one embodiment, restoring the data file to the memory to obtain the restored data includes:

[0014] Call the data file through the deserialization interface;

[0015] Deserialize the data file to obtain data streams corresponding to each of the stored execution stages in the data file;

[0016] The data stream is cached in a memory to obtain the restored data.

[0017] In one embodiment, after detecting that the electricity spot market clearing algorithm is started, the method further includes:

[0018] If the phase identifier is not read in the persistent database, an initial phase identifier of the initial phase of the electricity spot market clearing algorithm is determined as the phase identifier closest to the start time of the electricity spot market clearing algorithm.

[0019] In one embodiment, the method further comprises:

[0020] Dividing the execution phases according to the functions in the electricity spot market clearing algorithm and the execution order of the functions, and obtaining the phase identifiers of the execution phases and the phase identifiers corresponding to the execution phases;

[0021] According to the functions of each of the execution stages, determining each code logic block corresponding to each of the execution stages from the code corresponding to the electricity spot market clearing algorithm;

[0022] Each of the phase identifiers is associated with each of the corresponding code logic blocks and stored.

[0023] In one embodiment, the execution phases are divided according to the functions in the electricity spot market clearing algorithm and the execution order of the functions, and the execution phases and the phase identifiers corresponding to the execution phases are obtained, including:

[0024] Obtaining a unit commitment algorithm that considers network security constraints in the electricity spot market clearing algorithm;

[0025] Performing mixed integer programming on the unit commitment algorithm considering network security constraints to obtain corresponding multiple sub-problems;

[0026] Obtain the name of the unit combination algorithm considering network security constraints, and according to the unit combination algorithm considering network security constraints including multiple sub-problems and the name, obtain the execution stage and the corresponding stage identifier of the unit combination algorithm considering network security constraints.

[0027] In a second aspect, the present application provides a power spot market clearing device based on breakpoint recovery, the device comprising:

[0028] A detection module, configured to query a persistent database when detecting that the electricity spot market clearing algorithm is started; the persistent database is configured to store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage;

[0029] A recovery module, used for restoring the data file to the memory to obtain the restored data if the data file is stored in the persistent database;

[0030] A calling module, used for reading the phase identifier in the persistent database that is closest to the start time of the electricity spot market clearing algorithm, and calling the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm according to the phase identifier;

[0031] A clearing module is used to take the target code logic block as a starting point, execute the electricity spot market clearing algorithm according to the restored data, and perform electricity spot market clearing.

[0032] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0033] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0034] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0035] The above-mentioned method, device, computer equipment, computer-readable storage medium and computer program product for clearing the electricity spot market based on breakpoint recovery, by detecting that the electricity spot market clearing algorithm is started, if a data file is found to be stored in the persistent database, the data file is restored to the memory, and the stage identifier closest to the start time of the electricity spot market clearing algorithm in the persistent database is read. According to the stage identifier, the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm is called, and the target code logic block and the recovered data are combined to execute the electricity spot market clearing algorithm and perform electricity spot market clearing. Compared with the traditional execution method that requires re-execution of tasks after interruption, this scheme divides each execution stage in advance and associates the corresponding code logic block, stores the data file after executing each stage, and determines the breakpoint position by querying the data file when an interruption occurs, and continues to execute clearing from the breakpoint position, thereby improving the disaster recovery capability of clearing the electricity spot market. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0037] Figure 1 It is a flow chart of a method for clearing a power spot market based on breakpoint recovery in one embodiment;

[0038] Figure 2 A schematic diagram of a flow chart of stage division steps in an embodiment;

[0039] Figure 3 It is a flow chart of a method for clearing a power spot market based on breakpoint recovery in another embodiment;

[0040] Figure 4 It is a structural block diagram of a power spot market clearing device based on breakpoint recovery in one embodiment;

[0041] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] In one embodiment, Figure 1 As shown, a method for clearing the electricity spot market based on breakpoint recovery is provided. This embodiment takes the method applied to a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server, including the following steps S202 to S208. Among them:

[0044] Step S202, when it is detected that the electricity spot market clearing algorithm is started, query the persistent database; the persistent database is used to store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage.

[0045] The electricity spot market clearing algorithm may be an algorithm for clearing the spot market of the power system, and the server may execute the electricity spot market clearing algorithm to achieve electricity spot market clearing. In the process of executing the electricity spot market clearing algorithm, there is an unexpected interruption event. In order to ensure the execution safety and integrity of the electricity spot market clearing algorithm, the server may perform breakpoint recovery when the execution of the electricity spot market clearing algorithm is interrupted.

[0046] Wherein, a persistent database may be provided in the server. After the execution is interrupted, the server may detect whether the electricity spot market clearing algorithm is restarted from the interruption. If the server detects that the electricity spot market clearing algorithm is interrupted and restarted, the server may query the persistent database. Wherein, the persistent database may store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage. The electricity spot market clearing algorithm includes multiple functions and code logics. The server may divide the execution stage of the electricity spot market clearing algorithm in advance based on the functions and code logics, divide it into multiple execution stages, and determine the stage identifier of each execution stage, for example, determine the stage name of each execution stage as the stage identifier, so that when the server performs interruption recovery, it can restore to the execution step before the interruption based on the divided execution stages. The above-mentioned stored execution stage may be a data file of the persistent database of the corresponding execution stage that has been stored in the server, wherein the data of the stored execution stage in the persistent database includes the data file and the stage identifier corresponding to the stored stage.

[0047] Step S204: If there are data files stored in the persistent database, the data files are restored to the memory to obtain the restored data.

[0048] Among them, when the server restarts after detecting the program interruption of the electricity spot market clearing algorithm, it determines whether an interruption of the algorithm occurs. The server can detect whether a data file containing relevant data of the stored execution stage is stored in the persistent database. If the server finds the above-mentioned data file stored in the persistent database, the server can determine that an unexpected interruption has occurred. The above-mentioned data file stores relevant data corresponding to each execution stage of the electricity spot market clearing algorithm, and is in the form of persistent storage. In order to use these data to execute the electricity spot market clearing algorithm after the interruption is recovered, the server can restore the above-mentioned data file at this time, and restore the data file in the persistent database to the memory to obtain the restored data. Among them, the above-mentioned recovery can be restored in the form of deserialization.

[0049] Step S206, reading the phase identifier closest to the start time of the electricity spot market clearing algorithm in the persistent database, and calling the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm according to the phase identifier.

[0050] When the server completes the calculation task of each execution stage of the electricity spot market clearing algorithm, the server can store the relevant data files of the corresponding execution stage together with the stage identifier of the execution stage persistently. The above data files can include the data files of each stored execution stage and the stage identifier corresponding to the stored execution stage.

[0051] The server can determine the stage identifiers corresponding to the stored execution stages by calling the persistent database. Each stage identifier has a corresponding execution time, and the execution time indicates the time when the execution stage corresponding to the stage identifier is completed. Thus, the server can read the stage identifier in the persistent database that is closest to the start time of the above-mentioned power spot market clearing algorithm, and the stage identifier indicates the last execution stage executed before the power spot market clearing algorithm was interrupted.

[0052] The server can perform breakpoint recovery on the electricity spot market clearing algorithm based on the above-mentioned most recent stage identifier. Among them, each stage identifier of each execution stage can be bound and associated with the corresponding code logic block. That is, the server can pre-determine the code logic block corresponding to each execution stage, and associate and bind the code logic block with the stage identifier of the corresponding stage, so that the server can quickly find the code logic block of the corresponding stage based on the stage identifier. Since the above-mentioned electricity spot market clearing algorithm can have multiple execution stages, the server also has multiple code logic blocks pre-stored. The server can call the target code logic block of each code logic block corresponding to the electricity spot market clearing algorithm based on the above-mentioned most recent stage identifier. The target code logic block can represent the code logic block that was last executed before the electricity spot market clearing algorithm was interrupted.

[0053] Step S208, starting from the target code logic block, executing the electricity spot market clearing algorithm according to the restored data to clear the electricity spot market.

[0054] After the server determines the target code logic block, it can determine the target code logic block as the starting point for breakpoint recovery, and based on the order of each execution stage, obtain the code logic blocks of each execution stage after the target code logic block, and execute the electricity spot market clearing algorithm in combination with the above-mentioned recovered data to realize the clearing of the electricity spot market from the breakpoint. The above-mentioned recovered data can be in the server's memory, and in the process of the server executing the above-mentioned code logic blocks, the recovered data can be called in the corresponding steps to execute the electricity spot market clearing algorithm. That is, the data recovered from the data file can be used as the call data in the code execution process of the electricity spot market clearing algorithm.

[0055] In the above-mentioned electricity spot market clearing method based on breakpoint recovery, when the electricity spot market clearing algorithm is detected to be started, if a data file is queried to be stored in the persistent database, the data file is restored to the memory, and the stage identifier closest to the start time of the electricity spot market clearing algorithm in the persistent database is read. According to the stage identifier, the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm is called, and the target code logic block and the recovered data are combined to execute the electricity spot market clearing algorithm and perform electricity spot market clearing. Compared with the traditional execution method that requires re-execution of tasks after interruption, this scheme divides each execution stage in advance and associates the corresponding code logic block, stores the data file after executing each stage, and determines the breakpoint position by querying the data file when an interruption occurs, and continues to execute clearing from the breakpoint position, thereby improving the disaster recovery capability of electricity spot market clearing.

[0056] In one embodiment, taking the target code logic block as the starting point, executing the electricity spot market clearing algorithm according to the recovered data, and after clearing the electricity spot market, it also includes: when it is detected that the target execution phase corresponding to the target code logic block is completed, serializing the data cached in the memory of the target code logic block to obtain a serialized data stream; writing the data stream and the phase identifier corresponding to the target execution phase into a data file, and storing the data file in a persistent database.

[0057] In this embodiment, the server can perform persistent storage of data for each completed execution stage, so that when breakpoint recovery is needed, the server can restore data from the persistent database in a timely manner. The server can detect whether the execution stage corresponding to the code logic block is completed during the execution of the code logic block. For example, taking the execution of the target code logic block as an example, when the server detects that the target execution stage corresponding to the target code logic block is completed, the server can serialize the data cached in the memory of the target code logic block to obtain a serialized data stream, and write the data stream and the stage identifier corresponding to the target execution stage into the data file, so that the server stores the data file in the persistent database to achieve persistent storage.

[0058] Specifically, in order to realize the breakpoint continuation of the optimization and clearing algorithm of the power spot system, it is necessary to regularly store the non-persistent memory data in the software calculation process, so that the most recent calculation data before the interruption can be read back before the calculation is resumed to ensure the correctness of the breakpoint continuation. That is, in the normal operation steps of the server, once each execution stage is completed, the server can call the serialization interface of the calculation process data class to serialize the data and write it together with the completion stage identifier into the local persistent data file for storage.

[0059] Among them, in order to achieve the above capabilities, the server can encapsulate all the data required by the software where the electricity spot market clearing algorithm is located when executing the electricity spot market clearing algorithm as members of the data class, and provide a corresponding serialization interface. After each execution phase is completed, the server serializes all the data cached in the memory of the entire data class into a 01 data stream, that is, the above-mentioned serialized data stream, and writes it into the data file. The server uses the disk's persistence capability for files to achieve periodic persistence of the calculation process data, thereby using the persistently stored data files to achieve breakpoint recovery of the electricity spot market clearing algorithm. In addition, in some embodiments, the above-mentioned data files can be further stored in a distributed database to achieve higher reliability and breakpoint recovery capabilities in the cluster.

[0060] Through this embodiment, the server can perform persistent storage of data for each completed execution stage during the execution of the electricity spot market clearing algorithm, so that when breakpoint recovery is required, the server can restore data from the persistent database in a timely manner, thereby improving the disaster recovery capability of the electricity spot market clearing.

[0061] In one embodiment, a data file is restored to memory to obtain the restored data, including: calling the data file through a deserialization interface; deserializing the data file to obtain data streams corresponding to each stored execution stage in the data file; caching the data streams to memory to obtain the restored data.

[0062] In this embodiment, when the server performs breakpoint recovery, it is necessary to restore the persistently stored data files so that the code of the electricity spot market clearing algorithm can be called. Among them, the server can restore the non-serialized data files to serialized data streams, and the server can call the data files in the persistent database through the deserialization interface. The server can deserialize the above data files to obtain the data streams corresponding to each stored execution stage in the data file. Among them, these data streams can be data streams in sequence form, and the server caches the data streams in memory to obtain the restored data.

[0063] Specifically, in the breakpoint recovery step, the server first reads the local persistent data file through the algorithm. The data file can be a non-serialized data file. The server can execute the deserialization interface of the data class to restore the data in the data file to the memory. Among them, in the server performing the breakpoint recovery calculation, the server can pull the data file stored closest to the current time from the local or distributed database, and directly restore the data in the data file to the memory through the deserialization interface of the data class in the algorithm. Based on the data in the memory, the program of the electricity spot market clearing algorithm continues to be executed from the specified execution stage.

[0064] Through this embodiment, the server can determine that a clearing interruption has occurred when detecting a data file stored in a persistent database. The server can restore the data file in the database and use the restored data to recover the interruption of the electricity spot market clearing algorithm, thereby improving the disaster recovery capability of the electricity spot market clearing.

[0065] In one embodiment, after detecting that the electricity spot market clearing algorithm is started, it also includes: if the stage identifier is not read in the persistent database, determining the initial stage identifier of the initial stage of the electricity spot market clearing algorithm as the stage identifier closest to the start time of the electricity spot market clearing algorithm.

[0066] In this embodiment, the server can detect whether the read-in start / start phase identifier is received after the electricity spot market clearing algorithm is restarted, and the server can obtain the phase identifier by querying from the data file. The start / start phase identifier indicates the phase that needs to be used as the starting point of operation when the electricity spot market clearing algorithm is restored from a breakpoint. If the server does not read the phase identifier in the persistent database, it means that any stage was not completed during the last execution of the electricity spot market clearing algorithm. The server can obtain the initial phase identifier of the initial phase of the electricity spot market clearing algorithm, and use the initial phase identifier as the phase identifier closest to the start time of the electricity spot market clearing algorithm. Therefore, if the server does not read the phase identifier, it can use the execution phase corresponding to the above initial phase identifier as the starting point to execute the electricity spot market clearing algorithm.

[0067] Specifically, when the server calls up the algorithm program, such as when starting the electricity spot market clearing algorithm, through the algorithm upstream scheduler, it can first check whether there is a persistent data file stored locally. If the file exists, it means that there is an unexpected interruption in the electricity spot market clearing algorithm. The server reads the stage identifier closest to the current time before the interruption, such as the stage name, through the scheduler, and passes it to the algorithm program through the parameter interface. Among them, the server can detect whether the stage identifier read in by the parameter interface is read. If not, the server can determine the above initial stage identifier as the closest stage identifier, so that the server can run the electricity spot market clearing algorithm program from the first stage. Otherwise, the server can enter the execution step of breakpoint recovery.

[0068] Through this embodiment, during the interruption recovery process of the electricity spot market clearing algorithm, the server can determine whether it is necessary to use the execution stage corresponding to the initial stage identifier as the starting point for algorithm recovery execution by detecting whether the stage identifier is read in the data file, thereby improving the disaster recovery capability of the electricity spot market clearing.

[0069] In one embodiment, it also includes: dividing the execution stages according to the various functions in the electricity spot market clearing algorithm and the execution order of each function, and obtaining the stage identifiers of each execution stage and the corresponding stage of each execution stage; according to the function of each execution stage, determining the various code logic blocks corresponding to each execution stage from the code corresponding to the electricity spot market clearing algorithm; associating and storing each stage identifier with the corresponding code logic block.

[0070] In this embodiment, the server can pre-divide the electricity spot market clearing algorithm into stages, divide it into multiple execution stages, and determine the corresponding stage identifiers. The server can also associate and bind the stage identifiers with the code logic blocks corresponding to each execution stage to achieve fast calling during the interruption recovery process.

[0071] Among them, the electricity spot market clearing algorithm may include multiple functions. The server can divide the execution stages according to the various functions in the electricity spot market clearing algorithm and the execution order of each function, and obtain the stage identifiers of each execution stage and the corresponding stage identifiers of each execution stage. Among them, the above-mentioned stage identifier can be the name of the function corresponding to the execution stage. The server can also determine the various code logic blocks corresponding to each execution stage from the code corresponding to the electricity spot market clearing algorithm according to the function of each execution stage, and associate and store each stage identifier with the corresponding code logic block, for example, based on the name represented by the stage identifier, query the code logic block with the function corresponding to the name for association and binding. Among them, when the server divides each execution stage, it can also divide each execution stage again to make the running time of each execution stage more balanced and reduce the recovery time of interruptions between stages.

[0072] In one embodiment, the execution stages are divided according to each function in the electricity spot market clearing algorithm and the execution order of each function, and each execution stage and the stage identifier corresponding to each execution stage are obtained, including: obtaining the unit combination algorithm considering network security constraints in the electricity spot market clearing algorithm; performing mixed integer programming on the unit combination algorithm considering network security constraints to obtain corresponding multiple sub-problems; obtaining the name of the unit combination algorithm considering network security constraints, and obtaining the execution stage and the corresponding stage identifier corresponding to the unit combination algorithm considering network security constraints according to the unit combination algorithm considering network security constraints including multiple sub-problems and the name.

[0073] In this embodiment, the above-mentioned electricity spot market clearing algorithm includes SCUC (security constrained unit commitment). The server can obtain the unit combination algorithm considering network security constraints in the electricity spot market clearing algorithm, and perform mixed integer programming on the unit combination algorithm considering network security constraints to obtain corresponding multiple sub-problems. The above-mentioned stage identifier can be the name of the execution stage, then the server can obtain the name of the unit combination algorithm considering network security constraints, obtain the execution stage corresponding to the unit combination algorithm considering network security constraints according to the unit combination algorithm considering network security constraints including multiple sub-problems, and obtain the stage identifier corresponding to the unit combination algorithm considering network security constraints according to the name.

[0074] Specifically, Figure 2 As shown, Figure 2It is a flowchart of the stage division steps in an embodiment. The electricity spot market clearing algorithm has the characteristics of multi-stage serial execution and each stage incurs a large computing time loss, but different stages are generally integrated into one code block. In order to realize the breakpoint continuation calculation in stages, the server can reconstruct the code into multiple execution stages according to the functions of the code logic block, including but not limited to data reading, data verification, pre-solution, SCUC (security constrained unit commitment, unit combination considering network security constraints), SCED (security constrained economic dispatch, economic dispatch considering network security constraints), LPC (Local Price Calcation, node electricity price calculation), data output and other execution stages with clear boundaries and cohesive functions.

[0075] Among them, except for the SCUC stage, the running time of each stage is basically the same. In order to make the running time more balanced and help reduce the recovery time of interruptions between stages, the server can further refine the SCUC stage into multiple MIP (Mixed Integer Programming) sub-problems to obtain multiple sub-problems. The solution of each sub-problem can be an independent stage.

[0076] After dividing the execution phase, the server can bind and associate the phase identifier with the code logic block. For example, the server has an external parameter interface for accepting the phase identifier, and the server software internally binds the code logic block corresponding to the execution phase with the phase identifier. In the software startup phase where the clearing algorithm is located, the corresponding code logic block is found through the phase identifier, and the algorithm can be started from the specified execution phase. Therefore, in the breakpoint recovery step, the server finds the bound code logic block through the received startup phase identifier, and runs the power spot system optimization clearing algorithm from the execution phase corresponding to the code logic block to achieve breakpoint recovery.

[0077] Through the above embodiment, the server divides the algorithm into execution stages by pre-combining each function in the electricity spot market clearing algorithm and the execution time of each function, and binds and associates the corresponding code logic blocks based on the stage identifier of the execution stage. When the electricity spot market clearing algorithm is interrupted, the above-mentioned stage identifier and the bound code logic block can be used to achieve interruption recovery, thereby improving the disaster recovery capability of the electricity spot market clearing.

[0078] In an exemplary embodiment, Figure 3 As shown, Figure 3It is a flow chart of a method for clearing the electricity spot market based on breakpoint recovery in another embodiment. In this embodiment, the server can detect whether an interruption occurs when the electricity spot market clearing algorithm is started. Among them, the server can first check whether there is a local persistent data file when calling up the algorithm program through the algorithm upstream scheduler. If the file exists, it means that the last calculation was unexpectedly interrupted. The server reads all the stage names before the algorithm interruption from the local persistent data file through the scheduler, and determines the most recent stage name (stage identifier) ​​closest to the fault time, restores the persistent data corresponding to this stage to the memory, and passes it to the algorithm program through the parameter interface. The server can detect whether the starting stage name read in by the external parameter interface is received. If not, the calculation program of the electricity spot market clearing algorithm starts from the first stage (initial execution stage). Otherwise, receiving the starting stage name indicates that it is necessary to run from the stage corresponding to the starting stage name as the starting point, and the server will enter the breakpoint recovery step.

[0079] Among them, in the normal running steps, once each execution stage is completed, the server can call the serialization interface of the calculation process data class to serialize the data and write it together with the completion stage name into the local persistent data file.

[0080] In the breakpoint recovery step, the above algorithm first reads the local persistent data file, and executes the deserialization interface of the data class to restore the data in the file to the memory. In the breakpoint recovery step, the server uses the above algorithm to find the target code logic block bound to it through the received starting stage name, and runs the power spot system optimization clearing algorithm from the execution stage corresponding to the target code logic block to achieve breakpoint recovery.

[0081] Through the above-mentioned embodiments, the server pre-divides each execution stage and associates the corresponding code logic block, stores the data file after executing each stage, and when an interruption occurs, determines the breakpoint position by querying the data file, and continues to execute the clearing from the breakpoint position, thereby improving the disaster recovery capability of the electricity spot market clearing. In addition, the server starts the software operation from the specified stage by splitting the software process into stages, serializing and persisting the memory data after the stage ends, and providing an external parameter interface, so as to realize the breakpoint recovery function of the electricity spot system optimization clearing algorithm software, improve the reliability of the clearing optimization calculation, and reduce the recovery time caused by recalculation due to software interruption.

[0082] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0083] Based on the same inventive concept, the embodiment of the present application also provides a device for clearing the electricity spot market based on breakpoint recovery for implementing the above-mentioned method for clearing the electricity spot market based on breakpoint recovery. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more devices for clearing the electricity spot market based on breakpoint recovery provided below can be referred to the limitations of the method for clearing the electricity spot market based on breakpoint recovery in the above text, and will not be repeated here.

[0084] In an exemplary embodiment, Figure 4 As shown, a power spot market clearing device based on breakpoint recovery is provided, comprising: a detection module 500, a recovery module 502, a calling module 504 and a clearing module 506, wherein:

[0085] The detection module 500 is used to query the persistent database when it detects that the electricity spot market clearing algorithm is started; the persistent database is used to store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage.

[0086] The recovery module 502 is used to recover the data files to the memory if there are data files stored in the persistent database, and obtain the recovered data.

[0087] The calling module 504 is used to read the phase identifier in the persistent database that is closest to the start time of the electricity spot market clearing algorithm, and call the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm according to the phase identifier.

[0088] The clearing module 506 is used to execute the electricity spot market clearing algorithm based on the restored data with the target code logic block as the starting point to clear the electricity spot market.

[0089] In one embodiment, the above-mentioned device also includes: a storage module, which is used to serialize the data cached in the memory of the target code logic block when it detects that the target execution stage corresponding to the target code logic block is completed, and obtain a serialized data stream; write the data stream and the stage identifier corresponding to the target execution stage into a data file, and store the data file in a persistent database.

[0090] In one embodiment, the recovery module 502 is used to call the data file through the deserialization interface; deserialize the data file to obtain the data stream corresponding to each stored execution stage in the data file; cache the data stream into the memory to obtain the recovered data.

[0091] In one embodiment, the above-mentioned device also includes: a stage determination module, which is used to determine the initial stage identifier of the initial stage of the electricity spot market clearing algorithm as the stage identifier closest to the start time of the electricity spot market clearing algorithm if the stage identifier is not read in the persistent database.

[0092] In one embodiment, the above-mentioned device also includes: a division association module, which is used to divide the execution stages according to the various functions in the electricity spot market clearing algorithm and the execution order of each function, and obtain the stage identifiers of each execution stage and the corresponding stage of each execution stage; according to the functions of each execution stage, determine the various code logic blocks corresponding to each execution stage from the code corresponding to the electricity spot market clearing algorithm; associate and store each stage identifier with the corresponding code logic block.

[0093] In one embodiment, the above-mentioned partitioning association module is used to obtain the unit combination algorithm considering network security constraints in the electricity spot market clearing algorithm; perform mixed integer programming on the unit combination algorithm considering network security constraints to obtain corresponding multiple sub-problems; obtain the name of the unit combination algorithm considering network security constraints, and obtain the execution stage and corresponding stage identifier corresponding to the unit combination algorithm considering network security constraints based on the unit combination algorithm considering network security constraints including multiple sub-problems and the name.

[0094] Each module in the above-mentioned power spot market clearing device based on breakpoint recovery can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0095] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data files. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for clearing the electricity spot market based on breakpoint recovery is implemented.

[0096] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0097] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned breakpoint recovery-based electricity spot market clearing method when executing the computer program.

[0098] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned power spot market clearing method based on breakpoint recovery is implemented.

[0099] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned power spot market clearing method based on breakpoint recovery when executed by a processor.

[0100] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0101] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0102] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0103] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for clearing the electricity spot market based on breakpoint recovery, characterized in that: The method comprises: When it is detected that the electricity spot market clearing algorithm is started, querying a persistent database; the persistent database is used to store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage; If the data file is stored in the persistent database, restore the data file to the memory to obtain the restored data; Reading the phase identifier in the persistent database that is closest to the start time of the electricity spot market clearing algorithm, and calling the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm according to the phase identifier; Taking the target code logic block as a starting point, the electricity spot market clearing algorithm is executed according to the restored data to perform electricity spot market clearing.

2. The method according to claim 1, characterized in that The method takes the target code logic block as a starting point, executes the electricity spot market clearing algorithm according to the restored data, and after clearing the electricity spot market, further comprises: When it is detected that the target execution phase corresponding to the target code logic block is completed, the data cached in the memory of the target code logic block is serialized to obtain a serialized data stream; The data stream and the stage identifier corresponding to the target execution stage are written into the data file, and the data file is stored in the persistent database.

3. The method according to claim 1, characterized in that The step of restoring the data file to the memory to obtain the restored data includes: Call the data file through the deserialization interface; Deserialize the data file to obtain data streams corresponding to each of the stored execution stages in the data file; The data stream is cached in a memory to obtain the restored data.

4. The method according to claim 1, characterized in that: After the power spot market clearing algorithm is detected to be started, the method further includes: If the phase identifier is not read in the persistent database, an initial phase identifier of the initial phase of the electricity spot market clearing algorithm is determined as the phase identifier closest to the start time of the electricity spot market clearing algorithm.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Dividing the execution phases according to the functions in the electricity spot market clearing algorithm and the execution order of the functions, and obtaining the phase identifiers of the execution phases and the phase identifiers corresponding to the execution phases; According to the functions of each of the execution stages, determining each code logic block corresponding to each of the execution stages from the code corresponding to the electricity spot market clearing algorithm; Each of the phase identifiers is associated with each of the corresponding code logic blocks and stored.

6. The method according to claim 5, characterized in that The execution phase division is performed according to each function in the electricity spot market clearing algorithm and the execution order of each function, and each execution phase and the phase identifier corresponding to each execution phase are obtained, including: Obtaining a unit commitment algorithm that considers network security constraints in the electricity spot market clearing algorithm; Performing mixed integer programming on the unit commitment algorithm considering network security constraints to obtain corresponding multiple sub-problems; Obtain the name of the unit combination algorithm considering network security constraints, and according to the unit combination algorithm considering network security constraints including multiple sub-problems and the name, obtain the execution stage and the corresponding stage identifier of the unit combination algorithm considering network security constraints.

7. A power spot market clearing device based on breakpoint recovery, characterized in that: The device comprises: A detection module, configured to query a persistent database when detecting that the electricity spot market clearing algorithm is started; the persistent database is configured to store data files corresponding to each stored execution stage of the electricity spot market clearing algorithm and each stage identifier corresponding to each stored execution stage; A recovery module, used for restoring the data file to the memory to obtain the restored data if the data file is stored in the persistent database; A calling module, used for reading the phase identifier in the persistent database that is closest to the start time of the electricity spot market clearing algorithm, and calling the target code logic block in each code logic block corresponding to the electricity spot market clearing algorithm according to the phase identifier; A clearing module is used to take the target code logic block as a starting point, execute the electricity spot market clearing algorithm according to the restored data, and perform electricity spot market clearing.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.