CN115981610B - Comprehensive operation platform of photovoltaic energy storage system based on Lua script - Google Patents

Comprehensive operation platform of photovoltaic energy storage system based on Lua script Download PDF

Info

Publication number
CN115981610B
CN115981610B CN202310259244.0A CN202310259244A CN115981610B CN 115981610 B CN115981610 B CN 115981610B CN 202310259244 A CN202310259244 A CN 202310259244A CN 115981610 B CN115981610 B CN 115981610B
Authority
CN
China
Prior art keywords
formula
calculation
triggering
task
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310259244.0A
Other languages
Chinese (zh)
Other versions
CN115981610A (en
Inventor
李绍平
崔显成
刘毅
王松乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ustc Sinovate Software Co ltd
Original Assignee
Ustc Sinovate Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ustc Sinovate Software Co ltd filed Critical Ustc Sinovate Software Co ltd
Priority to CN202310259244.0A priority Critical patent/CN115981610B/en
Publication of CN115981610A publication Critical patent/CN115981610A/en
Application granted granted Critical
Publication of CN115981610B publication Critical patent/CN115981610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention belongs to the field of computers, and particularly relates to a comprehensive operation platform and a coordination controller of a photovoltaic energy storage system based on Lua script. The system adopts Lua as a calculation script language, C++ is designed by a host language, and the system characteristics are as follows: 1. dividing the formula script into a macro formula, a preprocessing formula and a public formula; the macro formula generates a preset fixed value for the command executor to call; the preprocessing formula is calculated in advance, and the output result is only called by other formulas; executing various computing tasks by a public formula; 2. the triggering scheduling mode is divided into data change triggering, external scheduling instruction triggering receiving, periodic triggering, task scheduling triggering, timing triggering and manual triggering; 3. the data output mode comprises outputting to a real-time database; transmitting an instruction to an external device of the system; output to a relational library, and custom output. The invention solves the problems that the traditional computing system has single function and poor performance and cannot adapt to the emerging scene.

Description

Comprehensive operation platform of photovoltaic energy storage system based on Lua script
Technical Field
The invention belongs to the field of computers, and particularly relates to a comprehensive operation platform and a coordination controller of a photovoltaic energy storage system based on Lua script.
Background
With the improvement of the social and economic level and the further development of communication, information and automatic control technologies, the dispatching and operation automation degree of the power grid reaches a new step, and the automatic operation control of the power grid is basically realized. On the basis, the intelligent power grid becomes a new important direction for the transformation and development of the power system, and is also an important trend for the development of technological innovation of the power system. Along with the continuous expansion of the scale of wind energy and solar energy power generation, the intelligent power grid has the capability of receiving various new energy sources, meets the bidirectional interaction between all nodes of power transmission and transformation power consumption of power grid operation and information, and establishes an economical, safe, clean and flexible high-performance intelligent system.
In a typical distributed photovoltaic grid-connected management system, a special energy storage system is generally configured to balance the difference between real-time generated energy and grid-connected electric quantity, and the coordination control between a power grid and a distributed photovoltaic power station and the transmission and data processing of information of energy distribution are not separated. In order to achieve the objective, developing a system for completing a large number of specified complex computing tasks in a distributed photovoltaic grid-connected management system and efficiently managing and rapidly executing a data processing process is a technical problem to be solved by those skilled in the art. However, the traditional computing system takes the measuring point as the center, only receives a simple formula and formula nested calculation, and the calculation result is only written into the computing point, so that the data output mode is single and the data scheduling mode is single. It is difficult to find use in a distributed photovoltaic grid-tie management system or in a coordinated controller of an energy storage system.
Disclosure of Invention
The method aims at solving the problems that the traditional computing system has single function and poor performance, and cannot adapt to more complex data processing and equipment management tasks in the emerging control and management scene of the Internet of things; the invention provides a comprehensive operation platform and a coordination controller of a photovoltaic energy storage system based on a Lua script.
The invention is realized by adopting the following technical scheme:
a comprehensive operation platform of a photovoltaic energy storage system based on Lua script is designed by adopting Lua as a calculation script language and C++ as a host language, so that a large number of complex calculation tasks in a distributed photovoltaic grid-connected management system are managed and executed. The comprehensive operation platform provided by the invention adopts a calculation script model, a trigger scheduling mode and a data output mode as follows:
1. computing script model
The formula script is divided into three types of macro formulas, preprocessing formulas and public formulas. The macro formula is used for generating a preset fixed value when the calculation engine is started, and the fixed value is used for being called by the command executor. The preprocessing formula completes calculation in advance before any calculation period starts, and the output result is only called by other formulas and is not output to the outside. The public formula is a main body for executing various computing tasks; the attributes to be defined in each common formula include formula content, trigger mode and formula value type. The formula value types are classified into basic data, state data, and instruction data.
2. Triggering scheduling mode
The trigger mode of any one calculation task is set as one or more of data change trigger, external dispatching instruction trigger, periodic trigger, scheduled task trigger, timing trigger and manual trigger.
3. Data output mode
According to the formula value types of public formulas adopted by different calculation tasks, the data output types of the calculation tasks are divided into the following three types: (1) outputting the basic data to a real-time database; (2) transmitting the instruction data to the specified off-system device; (3) The state data is output to a relational library, and (4) the data is output in other self-defining modes.
As a further improvement of the invention, in the triggering mode of the calculation task, the data change triggering refers to triggering the calculation task when the measuring point or the sub-formula data value in the formula script is changed. The "receiving external scheduling instruction trigger" means that the comprehensive operation platform receives the scheduling instruction of the external system through the corresponding communication protocol and analyzes the scheduling instruction to trigger the calculation task. The period triggering refers to the triggering of a calculation task when the system operation period reaches the preset period operation parameter in real-time calculation and historical calculation and the period operation parameter is preset. In the mode of 'planning task triggering', a scheduling frequency and a corresponding scheduling time are required to be preset, wherein the scheduling frequency refers to the triggering times of the computing tasks in the scheduling time, and the computing tasks which are set as 'planning task triggering' trigger the computing tasks in the scheduling time range according to the scheduling frequency opportunistically. "timed trigger" refers to setting a trigger time and triggering a computing task when the trigger time is reached or a temporary timed task occurs. "Manual trigger" refers to a trigger mode that receives a manual dispatch service and manually initiates a computing task.
As a further improvement of the present invention, in the integrated computing platform, separate threads are set for different computing tasks, and the thread types include: communication dispatch thread, periodic run thread group, real-time data monitoring thread, timer thread, manual execution message monitoring thread.
In the scheme of the invention, the characteristics of each independent thread in the comprehensive operation platform are as follows:
the communication scheduling thread is responsible for communicating with related equipment in an external system, receiving related scheduling instructions, and triggering corresponding computing tasks after instruction analysis is completed.
The periodic operation thread group is used for operating a series of long-term operation threads, and polling calculation is carried out on the calculation script according to the operation period set in each calculation task.
The real-time data monitoring thread is used for polling data in the real-time snapshot, when the values of the reference measuring points in the formula change, the corresponding calculation task is triggered if the triggering mode of the calculation task comprises data change triggering.
The timer thread is responsible for managing the task triggered by the scheduled task and the task triggered by the timing, and triggers the corresponding calculation task by combining clock information.
The manual execution message monitoring thread is used for realizing the triggering management of the manually triggered computing task by monitoring the middleware message, and after the user gives an instruction, the system sends a related Mqtt message to the computing program, and the computing program triggers the computing task after receiving the related information.
As a further improvement of the invention, the number of threads in the periodically running thread group is customized according to the maximum number of periodically running computing tasks required, so as to ensure that all the periodically running computing tasks can still run in time without collision when triggered simultaneously.
As a further improvement of the invention, the elements of each calculation script in the calculation script model comprise measuring points, formulas, functions, circulation control and condition control. The attributes of a "measurement point" include the source of the data and the type of data. The "formula" is used to define the respective data processing method for each computing task. "functions" reflect different types of functions employed or called by the formula process; the attributes of "loop control" and "condition control" are used together to define the trigger mode corresponding to each computing task.
As a further refinement of the present invention, the types of functions employed in the different computing tasks include mathematical functions, time functions, measurement and formula related functions, and other custom functions.
The operation operators applied in the data processing process of each computing task comprise: arithmetic operators, relational operators, logical operators, bit operators, assignment operators, and miscellaneous operators.
The operation process of the comprehensive operation platform of the photovoltaic energy storage system based on the Lua script is as follows:
s1: initializing the system, wherein the initialization content comprises the following steps:
s11: the point table is initialized.
S12: reading the configuration of the calculation script to form a hash table formula value bycod; in the data structure of Formula Value ByCod, key is the Code of Formula, and Value is the Formula calculation result Value. The function is to directly call the calculated value of the related formula according to the hash when the formula is nested and called, and the formula is not needed to be recalculated once.
S13: extracting all measuring points in the calculation script, and forming two hash tables according to the measuring points: tagByCodeMap and snapbyccodemap. In the data structure of TagByCodeMap, key is TagCode, and Value is measurement point parameter information. In the data structure of SnapoyCodeMap, key is TagCode, value is used for storing snapshot values.
S14: and extracting the time node of the scheduled task in the script configuration parameters of the scheduled task formula, and storing the time node into a scheduleList.
S15: extracting a timing time node in the timer formula script, and storing the timing time node into a dtList.
S16: the extraction triggering mode comprises all measuring points in a formula triggered by data change, and a vector formula tagvec and a hash formula bytagcodemap are generated. In the structure of the vector formula tagvec, key is TagCode, and Value is a formula list containing response measuring points. And in the data change triggering thread, polling the snapshot value of the measuring point to which the formula tagvec belongs is scanned, and triggering to search the related formula array according to the formula byTagCodeMap for calculation when the snapshot value is changed.
S2: the following multiple services are synchronously completed, and corresponding computing tasks are executed in different threads:
s21: operating a dispatch communication service, and judging whether the service is started or not according to configuration information: in the starting state, the relevant configuration is firstly read, the corresponding interface is selected according to the protocol provided by the external system, the scheduling instruction is received, and after the analysis is completed, the corresponding calculation task is triggered.
S22: and running a timer service, realizing a planned task function and a timer task function by using the timer service, judging whether a timer trigger event is consistent with the trigger time of a task triggered by the planned task or the timer, and triggering a corresponding calculation task if the timer trigger event is consistent with the trigger time of the task triggered by the planned task or the timer.
S23: and (3) running a snapshot scanning service, scanning a measuring point value in the formula TagVec, and triggering a computing task corresponding to the relevant data change triggering type.
S24: and subscribing the manual trigger calculation message, and triggering the corresponding calculation task after receiving the manual trigger message.
After any calculation task in the steps S21-S24 is triggered and executed, the data output is divided into two types of formula calculation result output and an output function embedded in a formula, and the output result is sent to the MQ middleware in the form of an MQ message and then processed by a corresponding program.
The present invention also provides a coordination controller comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. The coordination controller is applied to an Internet of things control system of the distributed power grid, and is designed by adopting the framework of the comprehensive operation platform of the photovoltaic energy storage system realized based on the Lua script, and when a processor in the coordination controller executes a computer program in a memory, the realized functions comprise real-time calculation, historical calculation, coordinated linkage control, fault early warning, energy management and scheduling.
The coordination controller is applied to management of a distributed power grid, and in an Internet of things control system of the distributed power grid, the implementation process of each function of the coordination controller is as follows:
(1) And performing performance calculation and consumption difference analysis according to the data in the real-time database by using the designed calculation script model.
(2) And carrying out logic calculation by using the calculation script model, sending a control instruction to an Internet of things control system of the distributed power grid according to a logic calculation result, controlling the on-off state and the regulation running state of the Internet of things equipment, and realizing the coordination linkage control function among the equipment.
(3) And carrying out coordinated control and energy distribution on each device in the Internet of things control system of the distributed power grid.
(4) And carrying out real-time fault early warning on the running state of the equipment by utilizing the reference data of the expert database or the experience database, and intervening the running state of the fault equipment in advance to avoid the occurrence of equipment faults.
(5) And receiving a dispatching instruction of the power grid, analyzing the dispatching instruction and controlling the PCS or the grid-connected inverter to realize the functions of planning tracking, smooth control, frequency modulation and peak shaving of the power grid.
The technical scheme provided by the invention has the following beneficial effects:
the invention designs a new architecture of a comprehensive operation platform by utilizing a flexible and efficient Lua script language, and the architecture can execute diversified calculation tasks by utilizing diversified data and realize various different types of output. The system has more abundant functions, and can completely meet the requirements of the emerging distributed photovoltaic grid-connected management system on complex functions such as real-time historical calculation, internet of things control, fault early warning, scheduling instruction receiving and calculation triggering analysis and the like in the energy management system.
The comprehensive operation platform can be built based on the existing hardware equipment, and can run more efficient computing services in the existing data processing equipment. The comprehensive computing system performs classified management on a large number of computing services in a distributed photovoltaic grid-connected management system such as a distributed power grid through an improved trigger management mode, so that any computing task is guaranteed to have high quick response characteristics and high-efficiency processing capacity. The computing task conflict under the complex application scene is avoided; therefore, has higher practical value.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention. In the drawings:
fig. 1 is a frame diagram of a comprehensive operation platform of a photovoltaic energy storage system based on Lua script implementation provided in embodiment 1 of the present invention.
Fig. 2 is a system characteristic diagram of a comprehensive operation platform of a photovoltaic energy storage system based on Lua script implementation provided in embodiment 1 of the present invention.
Fig. 3 is a step diagram of the operation process of the comprehensive operation platform of the photovoltaic energy storage system based on the Lua script.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Example 1
The embodiment provides a comprehensive operation platform of a photovoltaic energy storage system based on Lua script, which is designed by adopting Lua as a calculation script language and C++ as a host language, and is mainly used for managing and executing a large number of complex calculation tasks in a distributed photovoltaic grid-connected management system. Because the self-defined function is cited in the calculation script and is realized by C++, the C++ and Lua realize the mutual calling in the system. The flexible and efficient Lua script language makes the system have high operation efficiency; the system has all functions in the traditional system, and can completely realize the functions of real-time historical calculation, internet of things control, fault early warning, scheduling instruction receiving, trigger calculation analysis and the like in the energy management system. As shown in FIG. 1, the comprehensive operation platform collects measurement point data of the Internet of things device, provides corresponding calculation service when corresponding calculation tasks are triggered, and the calculation results can be written into a real-time database, a relational library, transmitted to other systems in a mode of sending control instructions, or output to a designated object.
Specifically, in the architecture of the integrated computing platform provided in this embodiment, a computation script model, a trigger scheduling manner, and data output are mainly defined and optimized. As shown in fig. 2, in the technical scheme of the present invention, various characteristics of the comprehensive operation platform are as follows:
1. computing script model
The formula script is divided into three types of macro formulas, preprocessing formulas and public formulas. The macro formula is used for generating a preset fixed value when the calculation engine is started, and the fixed value is used for being called by the command executor. The preprocessing formula completes calculation in advance before any calculation period starts, and the output result is only called by other formulas and is not output to the outside. The public formula is a main body for executing various computing tasks; the attributes to be defined in each common formula include formula content, trigger mode and formula value type. The formula value types are classified into basic data, state data, and instruction data.
In this embodiment, elements of each calculation script in the calculation script model include a measurement point, a formula, a function, a loop control, and a condition control. The attributes of a "measurement point" include the source of the data and the type of data. The "formula" is used to define the respective data processing method for each computing task. "functions" reflect different types of functions employed or called by the formula process; the attributes of "loop control" and "condition control" are used together to define the trigger mode corresponding to each computing task. The types of functions employed in the different computing tasks include mathematical functions, time functions, measurement and formula related functions, and other custom functions. The operation operators applied in the data processing process of each computing task comprise: arithmetic operators, relational operators, logical operators, bit operators, assignment operators, and miscellaneous operators.
2. Triggering scheduling mode
The trigger mode of any one calculation task is set as one or more of data change trigger, external dispatching instruction trigger, periodic trigger, scheduled task trigger, timing trigger and manual trigger.
3. Data output mode
According to the formula value types of public formulas adopted by different calculation tasks, the data output types of the calculation tasks are divided into the following three types: (1) outputting the basic data to a real-time database; (2) transmitting the instruction data to the specified off-system device; (3) The state data is output to a relational library, and (4) the data is output in other self-defining modes.
Specifically, in a triggering mode of a calculation task, the term "data change triggering" refers to triggering the calculation task when a measurement point or a sub-formula data value in a formula script changes. The "receiving external scheduling instruction trigger" means that the comprehensive operation platform receives the scheduling instruction of the external system through the corresponding communication protocol and analyzes the scheduling instruction to trigger the calculation task. The period triggering refers to the triggering of a calculation task when the system operation period reaches the preset period operation parameter in real-time calculation and historical calculation and the period operation parameter is preset. In the mode of 'planning task triggering', a scheduling frequency and a corresponding scheduling time are required to be preset, wherein the scheduling frequency refers to the triggering times of the computing tasks in the scheduling time, and the computing tasks which are set as 'planning task triggering' trigger the computing tasks in the scheduling time range according to the scheduling frequency opportunistically. "timed trigger" refers to setting a trigger time and triggering a computing task when the trigger time is reached or a temporary timed task occurs. "Manual trigger" refers to a trigger mode that receives a manual dispatch service and manually initiates a computing task.
In order to realize that the comprehensive operation platform can effectively cope with a large number of complex and repeated calculation tasks, the embodiment sets independent threads for different calculation tasks. The types of threads are divided into: communication dispatch thread, periodic run thread group, real-time data monitoring thread, timer thread, manual execution message monitoring thread. Wherein each independent thread is characterized as follows:
the communication scheduling thread is responsible for communicating with related equipment in an external system, receiving related scheduling instructions, and triggering corresponding computing tasks after instruction analysis is completed.
The periodic operation thread group is used for operating a series of long-term operation threads, and polling calculation is carried out on the calculation script according to the operation period set in each calculation task. In particular, in the designed comprehensive operation platform, the number of threads in the periodically running thread group is customized according to the maximum number of periodically running computing tasks required, so that all the periodically running computing tasks can still run in time without collision when triggered simultaneously.
The real-time data monitoring thread is used for polling data in the real-time snapshot, when the values of the reference measuring points in the formula change, the corresponding calculation task is triggered if the triggering mode of the calculation task comprises data change triggering.
The timer thread is responsible for managing the task triggered by the scheduled task and the task triggered by the timing, and triggers the corresponding calculation task by combining clock information.
The manual execution message monitoring thread is used for realizing the triggering management of the manually triggered computing task by monitoring the middleware message, and after the user gives an instruction, the system sends a related Mqtt message to the computing program, and the computing program triggers the computing task after receiving the related information.
The comprehensive operation platform based on the designed photovoltaic energy storage system realized based on the Lua script is shown in fig. 3, and the operation process of the comprehensive operation platform is approximately as follows:
s1: initializing a system, wherein the initialization content is shown as S11-S16:
s11: the point table is initialized.
S12: and reading the configuration of the calculation script to form a hash table formula value bycod. In the data structure of Formula Value ByCod, key is the Code of Formula, and Value is the Formula calculation result Value. The function is to directly call the calculated value of the related formula according to the hash when the formula is nested and called, and the formula is not needed to be recalculated once.
S13: extracting all measuring points in the calculation script, and forming two hash tables according to the measuring points: tagByCodeMap and snapbyccodemap. In the data structure of TagByCodeMap, key is TagCode, and Value is measurement point parameter information. In the data structure of SnapoyCodeMap, key is TagCode, value is used for storing snapshot values.
S14: and extracting the time node of the scheduled task in the script configuration parameters of the scheduled task formula, and storing the time node into a scheduleList.
S15: extracting a timing time node in the timer formula script, and storing the timing time node into a dtList.
S16: the extraction triggering mode comprises all measuring points in a formula triggered by data change, and a vector formula tagvec and a hash formula bytagcodemap are generated. In the structure of the vector formula tagvec, key is TagCode, and Value is a formula list containing response measuring points. And in the data change triggering thread, polling the snapshot value of the measuring point to which the formula tagvec belongs is scanned, and triggering to search the related formula array according to the formula byTagCodeMap for calculation when the snapshot value is changed.
S2: synchronously running the services as S11-S16, and completing corresponding calculation tasks in independent threads:
s21: operating a dispatch communication service, and judging whether the service is started or not according to configuration information: in the starting state, the relevant configuration is firstly read, the corresponding interface is selected according to the protocol provided by the external system, the scheduling instruction is received, and after the analysis is completed, the corresponding calculation task is triggered.
S22: and running a timer service, realizing a planned task function and a timer task function by using the timer service, judging whether a timer trigger event is consistent with the trigger time of a task triggered by the planned task or the timer, and triggering a corresponding calculation task if the timer trigger event is consistent with the trigger time of the task triggered by the planned task or the timer.
S23: and (3) running a snapshot scanning service, scanning a measuring point value in the formula TagVec, and triggering a computing task corresponding to the relevant data change triggering type.
S24: and subscribing the manual trigger calculation message, and triggering the corresponding calculation task after receiving the manual trigger message.
After any calculation task in the steps S21-S24 is triggered and executed, the data output is divided into two types of formula calculation result output and an output function embedded in a formula, and the output result is sent to the MQ middleware in the form of an MQ message and then processed by a corresponding program.
Example 2
The present invention also provides a coordination controller comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. The coordination controller is applied to an internet of things control system of a distributed power grid, and is designed by adopting the architecture of a comprehensive operation platform of the photovoltaic energy storage system realized based on the Lua script as in the embodiment 1, and when a processor in the coordination controller executes a computer program in a memory, the realized functions comprise real-time calculation, historical calculation, coordination linkage control, fault early warning, energy management and scheduling.
In this embodiment, the memory (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like. Of course, the memory may also include both internal storage units of the computer device and external storage devices. In this embodiment, the memory is typically used to store an operating system and various application software installed on the computer device. In addition, the memory can be used to temporarily store various types of data that have been output or are to be output.
The processor may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor is typically used to control the overall operation of the computer device. In this embodiment, the processor is configured to operate the program code or process data stored in the memory, so as to implement the operation process of the comprehensive operation platform as in embodiment 1, and further apply the coordination controller to the management of the distributed power network, where in the internet of things control system of the distributed power network, the implementation process of each function of the coordination controller is as follows:
(1) And performing performance calculation and consumption difference analysis according to the data in the real-time database by using the designed calculation script model.
(2) And carrying out logic calculation by using the calculation script model, sending a control instruction to an Internet of things control system of the distributed power grid according to a logic calculation result, controlling the on-off state and the regulation running state of the Internet of things equipment, and realizing the coordination linkage control function among the equipment.
(3) And carrying out coordinated control and energy distribution on each device in the Internet of things control system of the distributed power grid.
(4) And carrying out real-time fault early warning on the running state of the equipment by utilizing the reference data of the expert database or the experience database, and intervening the running state of the fault equipment in advance to avoid the occurrence of equipment faults.
(5) And receiving a dispatching instruction of the power grid, analyzing the dispatching instruction and controlling the PCS or the grid-connected inverter to realize the functions of planning tracking, smooth control, frequency modulation and peak shaving of the power grid.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (10)

1. A comprehensive operation platform of a photovoltaic energy storage system based on Lua script is designed by adopting Lua as a calculation script language and C++ as a host language, so that a large number of complex calculation tasks in a distributed photovoltaic grid-connected management system are managed and executed; the method is characterized in that a calculation script model, a trigger scheduling mode and a data output mode adopted by the comprehensive operation platform are as follows:
1. computing script model
Dividing the formula script into three categories of a macro formula, a preprocessing formula and a public formula; the macro formula is used for generating a preset fixed value when the computing engine is started, and the fixed value is used for being called by the command executor; the preprocessing formula completes calculation in advance before any calculation period starts, and an output result is only called by other formulas and is not output to the outside; the public formula is a main body for executing various computing tasks; the attribute to be defined in each public formula comprises formula content, a triggering mode and a formula value type; the formula value type is divided into basic data, state data and instruction data;
2. triggering scheduling mode
Setting the triggering mode of any one calculation task as one or more of data change triggering, external dispatching instruction triggering, periodic triggering, scheduled task triggering, timing triggering and manual triggering;
3. data output mode
According to the formula value types of public formulas adopted by different calculation tasks, the data output types of the calculation tasks are divided into the following three types: (1) outputting the basic data to a real-time database; (2) transmitting the instruction data to the specified off-system device; (3) The state data is output to a relational library, and (4) the data is output in other self-defining modes.
2. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 1, wherein: in the triggering mode of the calculation task, the data change triggering refers to triggering the calculation task when the measuring point or the sub-formula data value in the formula script is changed; the step of 'receiving external scheduling instruction trigger' means that the comprehensive operation platform receives the scheduling instruction of an external system through a corresponding communication protocol and analyzes the scheduling instruction to trigger a calculation task; the period triggering refers to the triggering of a calculation task when the system operation period reaches the preset period operation parameter in real-time calculation and historical calculation; the scheduling frequency and the corresponding scheduling time are required to be preset in a mode of 'planning task triggering', wherein the scheduling frequency refers to the triggering times of the calculated tasks in the scheduling time; the calculation task set as 'planning task triggering' triggers the calculation task according to scheduling frequency opportunistic in the scheduling time range; the timing trigger means setting a trigger time and triggering a calculation task when reaching the trigger time or a temporary timing task occurs; "Manual trigger" refers to a trigger mode that receives a manual dispatch service and manually initiates a computing task.
3. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 1, wherein: in the comprehensive operation platform, setting independent threads for different computing tasks, wherein the thread types comprise: communication dispatch thread, periodic run thread group, real-time data monitoring thread, timer thread, manual execution message monitoring thread.
4. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 3, wherein: in each independent thread of the comprehensive operation platform, the communication scheduling thread is responsible for communicating with related equipment in an external system, receiving related scheduling instructions, and triggering corresponding calculation tasks after completing instruction analysis; the periodic operation thread group is used for operating a series of long-term operation threads, and polling calculation is carried out on the calculation script according to the operation period set in each calculation task; the real-time data monitoring thread is used for polling data in the real-time snapshot, when the value of the reference measuring point in the formula changes, if the triggering mode of the computing task comprises data change triggering, triggering the corresponding computing task; the timer thread is responsible for managing the scheduled task triggering and the task triggered at fixed time, and triggering the corresponding calculation task by combining clock information; the manual execution message monitoring thread is used for realizing the triggering management of the manually triggered computing task by monitoring the middleware message, and after the user gives an instruction, the system sends a related Mqtt message to the computing program, and the computing program triggers the computing task after receiving the related information.
5. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 4, wherein: the number of threads in the periodic operation thread group is customized according to the maximum number of computing tasks which are required to be periodically operated, so that all periodic computing tasks can be timely operated without conflict when triggered at the same time.
6. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 1, wherein: the elements of each calculation script in the calculation script model comprise measuring points, formulas, functions, circulation control and condition control; the attributes of the "measurement points" include the source of the data and the type of the data; the formula is used for limiting the corresponding data processing method of each calculation task;
"functions" reflect different types of functions employed or called by the formula process; the attributes of "loop control" and "condition control" are used together to define the trigger mode corresponding to each computing task.
7. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 6, wherein: the function types adopted in different calculation tasks comprise mathematical functions, time functions, measuring points and formula related functions and other custom functions;
the operation operators applied in the data processing process of each computing task comprise: arithmetic operators, relational operators, logical operators, bit operators, assignment operators, and miscellaneous operators.
8. The integrated computing platform of the photovoltaic energy storage system based on Lua script implementation as claimed in claim 1, wherein: the operation process of the comprehensive operation platform is as follows:
s1: initializing the system, wherein the initializing content comprises the following steps:
s11: initializing a point table;
s12: reading the configuration of the calculation script to form a hash table formula value bycod; in the data structure of Formula Value ByCod, key is the Code of Formula, and Value is the Formula calculation result Value; the function is to directly call the calculated value of the related formula according to the hash when the formula is nested and called, and the formula is not needed to be recalculated once;
s13: extracting all measuring points in the calculation script, and forming two hash tables according to the measuring points: tagByCodeMap and snapbyccodemap; in the data structure of TagByCodeMap, key is TagCode, and Value is measurement point parameter information; in the data structure of the SnapByCodeMap, key is TagCode, value is used for storing snapshot values;
s14: extracting a planning task time node in a planning task formula script configuration parameter, and storing the planning task time node into a scheduleList;
s15: extracting a timing time node in a timer formula script, and storing the timing time node into a dtList;
s16: extracting all measuring points in a formula triggered by data change in a triggering mode, and generating a vector formula TagVec and a hash formula AryByTagCodeMap; in the structure of the vector formula tagvec, key is TagCode, and Value is a formula list containing response measuring points; in a data change triggering thread, polling the snapshot value of the measuring point to which the formula tagvec belongs, and triggering to search a related formula array according to the formula byTagCodeMap for calculation when the snapshot value changes;
s2: the following multiple services are synchronously completed, and corresponding computing tasks are executed in different threads:
s21: operating a dispatch communication service, and judging whether the service is started or not according to configuration information: in the starting state, firstly, the relevant configuration is read, the corresponding interface is selected according to the protocol provided by the external system, the scheduling instruction is received, and after the analysis is completed, the corresponding calculation task is triggered;
s22: running a timer service, realizing a planned task function and a timer task function by using the timer service, judging whether a timer trigger event is consistent with the trigger time of a task triggered by the planned task or the timer, and triggering a corresponding calculation task if the timer trigger event is consistent with the trigger time of the task triggered by the planned task or the timer;
s23: the snapshot scanning service is operated, measuring point values in the formula tagvec are scanned, and calculation tasks corresponding to the relevant data change triggering types are triggered;
s24: subscribing a manual trigger calculation message, and triggering a corresponding calculation task after receiving the manual trigger message;
after any calculation task in the steps S21-S24 is triggered and executed, the data output is divided into two types of formula calculation result output and an output function embedded in a formula, and the output result is sent to the MQ middleware in the form of an MQ message and then processed by a corresponding program.
9. A coordination controller comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized by: the coordination controller is applied to an Internet of things control system of a distributed power grid, and is designed by adopting the framework of the comprehensive operation platform of the photovoltaic energy storage system realized based on the Lua script according to any one of claims 1-8, and when a processor in the coordination controller executes a computer program in a memory, the realized functions comprise real-time calculation, historical calculation, coordination linkage control, fault early warning, energy management and scheduling.
10. The coordination controller of claim 9, wherein: in an Internet of things control system of a distributed power grid, the implementation process of each function of a coordination controller is as follows:
(1) Performing performance calculation and consumption difference analysis according to data in a real-time database by using a designed calculation script model;
(2) Carrying out logic calculation by using a calculation script model, sending a control instruction to an Internet of things control system of the distributed power grid according to a logic calculation result, controlling the on-off state and the adjustment running state of the Internet of things equipment, and realizing a coordinated linkage control function among the equipment;
(3) Carrying out coordination control and energy distribution on each device in an Internet of things control system of a distributed power grid;
(4) Real-time fault early warning is carried out on the running state of the equipment by utilizing reference data of an expert database or an experience database, and the running state of the fault equipment is intervened in advance, so that equipment faults are avoided;
(5) And receiving a dispatching instruction of the power grid, analyzing the dispatching instruction and controlling the PCS or the grid-connected inverter to realize the functions of planning tracking, smooth control, frequency modulation and peak shaving of the power grid.
CN202310259244.0A 2023-03-17 2023-03-17 Comprehensive operation platform of photovoltaic energy storage system based on Lua script Active CN115981610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310259244.0A CN115981610B (en) 2023-03-17 2023-03-17 Comprehensive operation platform of photovoltaic energy storage system based on Lua script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310259244.0A CN115981610B (en) 2023-03-17 2023-03-17 Comprehensive operation platform of photovoltaic energy storage system based on Lua script

Publications (2)

Publication Number Publication Date
CN115981610A CN115981610A (en) 2023-04-18
CN115981610B true CN115981610B (en) 2023-06-02

Family

ID=85972501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310259244.0A Active CN115981610B (en) 2023-03-17 2023-03-17 Comprehensive operation platform of photovoltaic energy storage system based on Lua script

Country Status (1)

Country Link
CN (1) CN115981610B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1124949A (en) * 1997-07-04 1999-01-29 Toshiba Corp Parallel processing controller
CN102346671A (en) * 2011-09-29 2012-02-08 南京国电南自轨道交通工程有限公司 Calculation method based on expansible script language
WO2016054922A1 (en) * 2014-10-10 2016-04-14 华为技术有限公司 Decision coordination method, implementation device and decision coordinator
CN107844369A (en) * 2017-12-04 2018-03-27 科大国创软件股份有限公司 A kind of method that big data transformation task cutting is realized in task based access control scheduling
CN108170638A (en) * 2017-12-21 2018-06-15 平安科技(深圳)有限公司 Computational methods, device, equipment and storage medium based on Excel tables
CN112148270A (en) * 2020-08-12 2020-12-29 珠海伟诚科技股份有限公司 Real-time computing and data interaction method, system and medium
CN112346736A (en) * 2020-11-17 2021-02-09 北京九章云极科技有限公司 Data processing method and system
WO2021036451A1 (en) * 2019-08-27 2021-03-04 苏宁云计算有限公司 Real-time communication method and apparatus for distributed system, and distributed system
CN112685150A (en) * 2020-12-21 2021-04-20 联想(北京)有限公司 Multi-language program execution method, device and storage medium
CN114253736A (en) * 2021-07-28 2022-03-29 谭世克 Novel intelligent distributed computing and operating system for power grid
US11314531B1 (en) * 2020-05-28 2022-04-26 UiPath Inc. Systems and methods for robotic process automation of mobile platforms

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8255890B2 (en) * 2007-02-14 2012-08-28 The Mathworks, Inc. Media for performing parallel processing of distributed arrays
US9836305B1 (en) * 2015-03-18 2017-12-05 Misys Global Limited Systems and methods for task parallelization
US20200249936A1 (en) * 2019-02-04 2020-08-06 James Ronald Barfield, JR. Method and system for a platform for api based user supplied algorithm deployment

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1124949A (en) * 1997-07-04 1999-01-29 Toshiba Corp Parallel processing controller
CN102346671A (en) * 2011-09-29 2012-02-08 南京国电南自轨道交通工程有限公司 Calculation method based on expansible script language
WO2016054922A1 (en) * 2014-10-10 2016-04-14 华为技术有限公司 Decision coordination method, implementation device and decision coordinator
CN107844369A (en) * 2017-12-04 2018-03-27 科大国创软件股份有限公司 A kind of method that big data transformation task cutting is realized in task based access control scheduling
CN108170638A (en) * 2017-12-21 2018-06-15 平安科技(深圳)有限公司 Computational methods, device, equipment and storage medium based on Excel tables
WO2021036451A1 (en) * 2019-08-27 2021-03-04 苏宁云计算有限公司 Real-time communication method and apparatus for distributed system, and distributed system
US11314531B1 (en) * 2020-05-28 2022-04-26 UiPath Inc. Systems and methods for robotic process automation of mobile platforms
CN112148270A (en) * 2020-08-12 2020-12-29 珠海伟诚科技股份有限公司 Real-time computing and data interaction method, system and medium
CN112346736A (en) * 2020-11-17 2021-02-09 北京九章云极科技有限公司 Data processing method and system
CN112685150A (en) * 2020-12-21 2021-04-20 联想(北京)有限公司 Multi-language program execution method, device and storage medium
CN114253736A (en) * 2021-07-28 2022-03-29 谭世克 Novel intelligent distributed computing and operating system for power grid

Also Published As

Publication number Publication date
CN115981610A (en) 2023-04-18

Similar Documents

Publication Publication Date Title
WO2021213293A1 (en) Ubiquitous operating system oriented toward group intelligence perception
CN109670199B (en) Efficient power grid topology analysis method and device
CN104991830A (en) YARN resource allocation and energy-saving scheduling method and system based on service level agreement
CN104765641B (en) A kind of job scheduling method and system
CN104679595B (en) A kind of application oriented IaaS layers of dynamic resource allocation method
AU2019397506A1 (en) Hybrid power plant
Bakakeu et al. An artificial intelligence approach for online optimization of flexible manufacturing systems
CN115543624A (en) Heterogeneous computing power arrangement scheduling method, system, equipment and storage medium
KR20220012935A (en) Cross-domain data interaction method and device
CN111786421B (en) Power grid dispatching method and device
CN115981610B (en) Comprehensive operation platform of photovoltaic energy storage system based on Lua script
Goubaa et al. Scheduling periodic and aperiodic tasks with time, energy harvesting and precedence constraints on multi-core systems
Venkataswamy et al. Rare: Renewable energy aware resource management in datacenters
Toersche et al. Energy management with TRIANA on FPAI
CN116028193B (en) Big data task dynamic high-energy-efficiency scheduling method and system for mixed part cluster
CN112948088A (en) Cloud workflow intelligent management and scheduling system in cloud computing platform
CN112039127A (en) Day-ahead scheduling method and system considering wind power prediction error related characteristics
CN105207215B (en) A kind of electric load dispatch control method
CN113632132A (en) Computer-aided energy management method and energy management system
Teixeira et al. TOOCC: Enabling heterogeneous systems interoperability in the study of energy systems
CN116488149A (en) Method and device for determining micro-grid power generation strategy and micro-grid
CN109213105A (en) A kind of reconfigurable device realizes restructural method and dcs
CN114896049A (en) Method, system, equipment and medium for scheduling operation tasks of electric power artificial intelligence platform
Caux et al. Smart datacenter electrical load model for renewable sources management
Liu et al. Computation Offloading and Task Scheduling with Fault-Tolerance for Minimizing Redundancy in Edge Computing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant