WO2019227596A1 - 命令转发方法及装置、太阳能系统和中央控制器 - Google Patents
命令转发方法及装置、太阳能系统和中央控制器 Download PDFInfo
- Publication number
- WO2019227596A1 WO2019227596A1 PCT/CN2018/094700 CN2018094700W WO2019227596A1 WO 2019227596 A1 WO2019227596 A1 WO 2019227596A1 CN 2018094700 W CN2018094700 W CN 2018094700W WO 2019227596 A1 WO2019227596 A1 WO 2019227596A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- priority
- command
- stored
- cache
- forwarded
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 230000006870 function Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 230000004044 response Effects 0.000 description 7
- 230000003111 delayed effect Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000003068 static effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000010248 power generation Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0426—Programming the control sequence
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0423—Input/output
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0875—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/10—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using selector switches
- G05B19/102—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using selector switches for input of programme steps, i.e. setting up sequence
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02S—GENERATION OF ELECTRIC POWER BY CONVERSION OF INFRARED RADIATION, VISIBLE LIGHT OR ULTRAVIOLET LIGHT, e.g. USING PHOTOVOLTAIC [PV] MODULES
- H02S40/00—Components or accessories in combination with PV modules, not provided for in groups H02S10/00 - H02S30/00
- H02S40/30—Electrical components
- H02S40/34—Electrical components comprising specially adapted electrical connection means to be structurally associated with the PV module, e.g. junction boxes
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02S—GENERATION OF ELECTRIC POWER BY CONVERSION OF INFRARED RADIATION, VISIBLE LIGHT OR ULTRAVIOLET LIGHT, e.g. USING PHOTOVOLTAIC [PV] MODULES
- H02S50/00—Monitoring or testing of PV systems, e.g. load balancing or fault identification
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25257—Microcontroller
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/45—Caching of specific data in cache memory
- G06F2212/452—Instruction code
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E10/00—Energy generation through renewable energy sources
- Y02E10/50—Photovoltaic [PV] energy
Definitions
- the present disclosure relates to, but is not limited to, the field of control technology, and in particular, to a command forwarding method and device, a solar energy system, a central controller, and a computer-readable storage medium.
- Distributed solar system such as building solar system, refers to the deployment of smaller solar power generation and power supply systems at the user's site or near the power site. It is a new type of solar energy utilization method with broad development prospects, which can fully utilize solar energy. Resources.
- a solar system generally includes a solar module, a junction box, and a gateway.
- the solar module is used for photoelectric conversion
- the gateway is responsible for receiving and forwarding control commands. Perform corresponding switches and other actions.
- the gateway forwards different control commands from multiple sources according to the sequence of the command receiving time.
- the present disclosure provides a command forwarding method and device, a solar energy system, a central controller, and a computer-readable storage medium.
- an embodiment of the present disclosure provides a command forwarding method.
- the command forwarding method includes:
- the forwarding step forwards a command stored in the command storage area according to the priority.
- the storing step includes:
- any priority in the first priority range is higher than any priority in the second priority range, and any priority in the second priority range is higher than the third priority Any priority in the priority range.
- storing the received command having a priority in a first priority range into a first priority cache includes:
- the priority of the received command is equal to the priority of the stored command, when the forwarded time of the stored command reaches a preset time from the current time, the received command is stored in the The first priority buffer is described; if the priority of the received command is lower than the priority of the stored command, the received command is discarded.
- the forwarding step includes:
- command forwarding method further includes:
- the forwarding step is performed again from a set timing period, from whether a command to be forwarded is stored in the first priority cache.
- an embodiment of the present disclosure provides a command forwarding apparatus, where the command forwarding apparatus includes:
- Receiving module receiving command
- the storage module stores the received command into the corresponding command storage area according to the priority
- the forwarding module forwards a command stored in the command storage area according to the priority.
- the command forwarding device includes:
- a first storage submodule which stores a received command having a priority in a first priority range into a first priority buffer
- a second storage submodule which stores a received command having a priority in a second priority range to a second priority queue
- a third storage submodule which stores a received command having a priority in a third priority range into a third priority queue
- any priority in the first priority range is higher than any priority in the second priority range, and any priority in the second priority range is higher than the third priority Any priority in the priority range.
- the first storage submodule includes:
- a first cache submodule configured to store the received command to the first priority cache when the first priority cache is in a default storable state
- a priority comparison submodule configured to compare a priority of the received command with a priority of a command stored in the first priority cache when the first priority cache is not in a default storable state level
- a second cache submodule configured to store the received command into the first priority cache if the priority of the received command is higher than the priority of the stored command;
- the third cache submodule is configured to: if the priority of the received command is equal to the priority of the stored command, when the forwarded time of the stored command reaches a preset time from the current time, The received command is stored in the first priority buffer; if the priority of the received command is lower than the priority of the stored command, the received command is discarded.
- the forwarding module includes:
- a first forwarding submodule configured to determine whether a command to be forwarded is stored in the first priority buffer, and if there is, a command to be forwarded stored in the first priority buffer is sent;
- the second forwarding sub-module is configured to determine whether a command to be forwarded is stored in the second priority cache when the first priority cache does not store a command to be forwarded, and if there is a command to be forwarded stored in the second priority cache, Forward the command; if not, when a command is stored in the second priority queue, the command stored in the second priority queue is transferred to the second priority cache;
- the third forwarding submodule is configured to determine whether a command to be forwarded is stored in the third priority cache when neither the second priority cache nor the second priority queue stores a command to be forwarded, and if so, Sending the command to be forwarded stored in the third priority cache, and if not, when the command is stored in the third priority queue, the command stored in the third priority queue is transferred to the third priority Level cache.
- the command forwarding device further includes:
- the timing module is configured to, when the forwarding module is called, re-invoke the forwarding module at a preset timing interval.
- an embodiment of the present disclosure provides a solar energy system including the command forwarding device as described above, wherein the source of the command includes any one or more of a fire protection system, a local input device, and a remote terminal.
- the command includes a switch command and a non-switch command, wherein a priority of the switch command is higher than that of the non-switch command;
- the switch command includes a switch-off command and a switch-on command.
- the switch command includes a global switch command and a local switch command, wherein:
- the global switch command has higher priority than the local switch command
- the priority of the global switch command indicating OFF is higher than the priority of the global switch command indicating Close.
- the priority of the global switch command from the fire protection system is higher than the priority of the global switch command from the local input device, and the priority of the global switch command from the local input device is higher than the priority of the global switch command from the remote terminal. level.
- an embodiment of the present disclosure provides a central controller including a processor and a memory.
- the memory stores at least one executable instruction, and the executable instruction is loaded and executed by the processor to implement the above.
- the command forwarding method is a method for modifying the executable instruction to implement the above.
- an embodiment of the present disclosure provides a computer-readable storage medium that stores at least one executable instruction.
- the executable instruction is loaded and executed by a processor, the command forwarding method described above is implemented. .
- FIG. 1 is a schematic flowchart of a command forwarding method according to an embodiment of the present disclosure
- FIG. 2 is a schematic flowchart of an exemplary implementation manner of step 102 in FIG. 1;
- FIG. 3 is a schematic flowchart of an exemplary implementation manner of step 203 in FIG. 2;
- FIG. 4 is a schematic flowchart of an exemplary implementation manner of step 103 in FIG. 1;
- FIG. 5 is a schematic structural block diagram of a command forwarding apparatus according to an embodiment of the present disclosure.
- FIG. 6 is a structural block diagram of an exemplary composition manner of the storage module 52 of FIG. 5;
- FIG. 7 is a structural block diagram of an exemplary composition manner of the first storage module 61 of FIG. 6;
- FIG. 8 is a structural block diagram of an exemplary composition manner of the forwarding module 503 of FIG. 5;
- FIG. 9 is a schematic diagram of an application scenario of a solar system including a command forwarding device according to an embodiment of the present disclosure.
- An exemplary implementation scenario provided by the present disclosure may be: one or more sources issue commands, and a forwarding device receives these commands, and then forwards these commands to the corresponding system, a component in the system, or a separate device.
- a command forwarding method and device receives these commands, and then forwards these commands to the corresponding system, a component in the system, or a separate device.
- the exemplary embodiments of the present disclosure provide a command forwarding method and device, a solar energy system including the device, and a central controller that executes the method.
- FIG. 1 is a schematic flowchart of a command forwarding method according to an embodiment of the present disclosure.
- the control method may be executed by a central controller having a function of forwarding commands. Referring to FIG. 1, the method includes:
- Step 101 receiving a command
- Storage step 102 Store the received command into the corresponding command storage area according to the priority
- Storage step 103 Forward the command stored in the command storage area according to the priority.
- the received command when a command is received, the received command can be stored in the corresponding command storage area based on the priority of the command, and then the command stored in the command storage area is forwarded according to the priority, so that the need is prioritized
- the processed commands are preferentially forwarded and processed, so the emergency affairs in the system will not be delayed due to the delay of the emergency command forwarding, which accelerates the system's emergency response speed, prevents the situation from being deteriorated due to the delayed command response, and improves the system security And reliability.
- it can effectively improve the forwarding and response speed of commands that need to be processed preferentially in the system, and prevent the delay and loss of key commands caused by the forwarding and processing of common commands.
- each step in FIG. 1 specifically describes the specific implementation manner of each step in FIG. 1 as an example. It should be understood that the receiving step 101, the storing step 102, and the storing step 103 are three steps that can be performed independently, so they can be performed simultaneously or in turn, or one of the steps is triggered and other steps are executed based on related events.
- a command data may include parameters such as source, function, and priority.
- FIG. 2 is a flowchart of an exemplary implementation of step 102 in FIG. 1. See FIG. 2, which includes the following steps:
- Step 201 Parse the received command
- each parameter in the command is extracted, for example, by a predetermined format.
- Step 202 Determine the priority range of the priority of the command. When the priority is in the first priority range, go to step 203; when the priority is in the second priority range, go to step 204; when the priority is in For the third priority range, step 205 is performed.
- the priority of the command can be set when the command is generated at the source according to the protocol, or the corresponding priority can be set based on the source and function and / or other parameters obtained by parsing the command after the command is received, or the priority of the command is also It may not be reflected by a separate data field, but its priority is reflected in the processing flow based on its source and function and / or other parameters.
- step 203 When the priority of the command is in the first priority range, go to step 203; when the priority of the command is in the second priority range, go to step 204; when the priority of the command is in the third priority range, go to Go to step 205.
- the priorities in the first priority range, the second priority range, and the third priority range are sequentially reduced, that is, any priority in the first priority range is higher than the second priority range. Any priority in the priority range, any priority in the second priority range is higher than any priority in the third priority range.
- Each priority range can correspond to a command storage area. It can be understood that more priority ranges and corresponding command storage areas can be set, and the present disclosure does not limit the number of priority ranges and command storage areas.
- the command storage area may be a memory, a buffer, a register or a part thereof and a combination thereof provided in the central controller.
- the first command storage area may include a first priority cache, and in some implementations, the first priority cache may store only one command; the second command storage area may include a second priority cache and a second priority queue, In some implementations, the second priority cache may only store one command, and the second priority queue may store one or more commands, such as forming a first-in-first-out command queue, and the second priority queue may be transferred each time at runtime. Save a command to the second priority cache; the third command storage area may include a third priority cache and a third priority queue.
- the third priority cache may only store one command, and the third priority
- the first-level queue can store one or more commands, for example, a first-in-first-out command queue is formed, and the third-priority queue at runtime can dump a command to the third-level cache at a time.
- Step 203 When the priority is in the first priority range, the received command is stored in the first priority buffer.
- the priority in the first priority range is the highest relative to other priority ranges. Therefore, when the priority of a command is in the first priority range, the command is stored in the first priority cache, and is not stored in a queue. Increase the response speed of the command as much as possible so that the command is not delayed by queuing in the queue.
- the first priority cache can only store one command at a time, when a storage conflict occurs, some of the received commands have a priority in the first priority range. Will or will not be stored in the first priority cache.
- Step 204 When the priority is in the second priority range, the received command is stored in the second priority queue.
- the corresponding second command storage area includes the second priority queue and the second priority cache, so the received command can be stored in the second priority queue.
- forwarding they are sequentially entered into the second priority cache for forwarding.
- Step 205 When the priority is in the third priority range, the received command is stored in the third priority queue.
- the corresponding third command storage area includes the third priority queue and the third priority cache, so the received command can be stored in the third priority queue.
- forwarding they are sequentially entered into the third priority cache for forwarding.
- the first command storage area in step 203 is a priority cache that can only store one command at a time, so there may be conflicts during storage, and a conflict resolution strategy is required.
- FIG. 3 shows an exemplary implementation of step 203 As shown in Figure 3, it includes the following steps:
- Step 301 Determine whether the state of the first priority cache is in a default storable state. If so, go to step 302; if not, go to step 303.
- Each cache can be in one of the following three states: the default storable state, which indicates that commands can be directly stored in it, that is, no command has been stored in it or the stored command has been forwarded and the time of forwarding exceeds the predetermined time from the current time ( The predetermined time is set so that the commands forwarded before the predetermined time are enough to be executed); the forwarded state indicates that the stored command has been forwarded, but the interval between the forwarded time and the current time has not reached the predetermined time; not forwarded Transition state, indicating that the stored command has not been forwarded.
- step 302 if the first priority cache is in a default storable state, go to step 302; otherwise, go to step 303.
- Step 302 When the first priority cache is in a default storable state, store the received command to the first priority cache.
- the first priority cache When the first priority cache is in a default storable state, it indicates that the first priority cache can directly store commands, and it has been determined in the previous steps that the priority of the received command is in the first priority range, so it will directly receive the The received command is stored in the first priority cache.
- Step 303 When the first priority cache is not in a default storable state, compare the priority of the received command with the priority of the command stored in the first priority cache. If the priority of the received command is higher than If the priority of the stored command is equal to the priority of the stored command, go to step 305; if the priority of the received command is equal to the priority of the stored command, go to step 305; if the priority of the received command is lower than the stored command Priority, go to step 306.
- the command stored in the first priority cache can be directly overwritten with the received command, that is, Go to step 304: store the received command to the first priority cache.
- step 306 discard the received command.
- the command may be temporarily stored in another area, and the storage process may be entered after a period of time.
- the priority of the received command is equal to the priority of the stored command, it means that the priority of the two commands is the same, and it is necessary to go to step 305: determine whether the stored command has been forwarded, and if it is forwarded, go to step 307; If it is not forwarded, the stored command should not be overwritten, and go to step 306 to discard the received command.
- the command may be temporarily stored in another area, and the storage process may be entered after a period of time.
- step 307 determine whether the forwarding time has reached a preset time from the current time. If it reaches, it means that the stored command has been forwarded and the controlled object corresponding to the command can be considered to be executed. The command is completed, so go to step 304 to store the command in the first priority cache. If the forwarding time does not reach the preset time from the current time, the stored command should not be overwritten, so go to step 306 to discard the received command.
- the command may be temporarily stored in another area, and the storage process may be entered after a period of time.
- FIG. 4 is a flowchart of an exemplary implementation of step 103 in FIG. 1. See FIG. 4, which includes the following steps:
- Step 401 Determine whether a command to be forwarded is stored in the first priority cache, and if yes, go to step 402; if not, go to step 403.
- the priority of any command to be forwarded stored in the first priority cache is higher than the priority of any command to be forwarded stored in the second priority cache and the second priority queue.
- the priority of any command to be forwarded stored in the priority cache and the second priority queue is higher than the priority of any command to be forwarded stored in the third priority cache and the third priority queue.
- the command stored in the first priority cache has the highest priority, so first check whether the command to be forwarded is stored in the first priority cache. Whether or not a command to be forwarded is stored can be determined according to the state of the first priority cache. In the default storable state, it is regarded as no, and other states are regarded as yes. If so, go to step 402, and if not, go to step 403.
- the first priority cache may store the command that has been forwarded, that is, the cache state is the forwarded state. At this time, it can be judged whether the forwarding time from the current time exceeds the preset time. If it has exceeded the preset time, The duration may be regarded as no command to be forwarded is stored; it may wait until the preset duration is reached, and after the preset duration is reached, the cache state of the first priority cache is set to the default storable state, and execution is started from step 401 again.
- Step 402 Send a command to be forwarded stored in the first priority buffer.
- Commands to be forwarded are stored in the first priority buffer, so they can be sent directly.
- the command to be forwarded stored in the first priority cache is a global command, so it can be sent in a broadcast manner, so as to be sent to all controlled objects.
- the cache state of the first priority cache may be set to a default storable state after a preset period of time, and execution is started from step 401 again.
- Step 403 Determine whether a command to be forwarded is stored in the second priority cache, and if yes, go to step 404; if not, go to step 405.
- the command in the second priority storage area is processed. First, it can be determined whether there is a command to be forwarded stored in the second priority cache. If yes, go to step 404. Go to step 405.
- Step 404 Send the command to be forwarded stored in the second priority cache.
- Commands to be forwarded are stored in the second priority cache, so they can be sent directly.
- the command to be forwarded stored in the second priority cache is a local command, so it can be unicast to the corresponding controlled object.
- the cache state of the second priority cache may be set to a default storable state after a set period of time, and execution is started again from step 401.
- Step 405 Determine whether a command to be forwarded is stored in the second priority queue, and if yes, go to step 406; if not, go to step 407.
- the commands stored in the second priority queue need to be fetched and sent to the second priority cache. Therefore, when no commands to be forwarded are stored in the second priority cache, it is necessary to check whether the commands to be forwarded are stored in the second priority queue. If yes, go to step 406; if no, go to step 407.
- Step 406 Dump the command stored in the second priority queue into the second priority cache, and then return to execute step 401.
- the transferred commands can be forwarded when the next step 404 is performed, and generally only one command is transferred at a time. After this step 406 is performed, go to step 401 to start again.
- Step 407 Determine whether a command to be forwarded is stored in the third priority cache, and if yes, go to step 408; if not, go to step 409.
- step 405 If the judgment result of step 405 is no, it indicates that neither the second priority cache nor the second priority queue stores commands to be forwarded. Then, the command in the third priority storage area is processed. First, it can be determined whether the third priority cache is The command to be forwarded is stored, if yes, go to step 408, if no, go to step 409.
- Step 408 Send the command to be forwarded stored in the third priority buffer, and then return to execute step 401.
- Commands to be forwarded are stored in the third priority buffer, so they can be sent directly.
- the command-oriented object can be broadcast or unicast.
- the cache state of the third priority cache is set to the default storable state after a set period of time, and then go to step 401 to start again.
- Step 409 Determine whether a command to be forwarded is stored in the third priority queue, and if yes, go to step 410; if not, go back to step 401.
- the commands stored in the third priority queue need to be fetched and sent to the third priority cache. Therefore, when no commands to be forwarded are stored in the third priority cache, it is necessary to check whether the commands to be forwarded are stored in the third priority queue. If yes, go to step 410; if no, go to step 401 to restart.
- Step 410 Dump the command stored in the third priority queue into the third priority cache, and then return to execute step 401.
- the transferred commands can be forwarded when the next step 408 is performed. After performing this step, go to step 401 to restart.
- steps 401-410 the commands in the second priority cache and the second priority queue are processed only when there are no commands stored in the first priority cache, and only in the first priority cache.
- Commands in the third priority cache and the third priority queue are processed only when there are no stored commands and no commands are stored in the second priority cache or the second priority queue.
- steps 402, 404, 406, 408, or 410 go to step 401 to start again. This is to ensure that the commands stored in the first priority cache can be forwarded at any time, so as not to Delays in processing other steps.
- a timer task may also be started at the same time as step 401 or a little later.
- the timer task is set with a timing duration, so that every set timing duration starts from step 401. Perform the forwarding again.
- the preset processing of the first priority cache is performed when the set timing period arrives, it may also be performed until the forwarding processing of the first priority cache ends. Go to step 401 and start over.
- FIG. 5 is a structural block diagram of a command forwarding apparatus according to an embodiment of the present disclosure.
- the command forwarding device includes:
- the receiving module 51 is configured to receive a command
- the storage module 52 is configured to store the received command into a corresponding command storage area according to a priority
- the forwarding module 53 is configured to forward a command stored in a command storage area according to the priority.
- the storage module 52 may include:
- a first storage sub-module 61 configured to store a received command having a priority in a first priority range to a first priority cache
- a second storage sub-module 62 configured to store a received command having a priority in a second priority range to a second priority queue
- the third storage sub-module 63 is configured to store a received command having a priority in a third priority range to a third priority queue.
- any priority in the first priority range is higher than any priority in the second priority range, and any priority in the second priority range is higher than any priority in the third priority range. level.
- the first storage sub-module 61 may include:
- the first cache submodule 71 is configured to store the received command to the first priority cache when the first priority cache is in a default storable state;
- the priority comparison submodule 72 is configured to compare the priority of a received command with the priority of a command stored in the first priority cache when the first priority cache is not in a default storable state;
- the second cache sub-module 73 is configured to store the received command into the first priority cache if the priority of the received command is higher than the priority of the stored command;
- the third cache submodule 74 is configured to store the received command when the received command has a priority equal to the stored command's priority when the stored command's forwarding time reaches a preset time from the current time. To the first priority cache.
- the storage module 53 may include the following sub-modules:
- the first forwarding sub-module 81 is configured to determine whether a command to be forwarded is stored in the first priority cache, and if there is, a command to be forwarded stored in the first priority cache is sent;
- the second forwarding sub-module 82 is configured to determine whether a command to be forwarded is stored in the second priority cache when the first priority cache does not store a command to be forwarded, and if there is a command to be forwarded stored in the second priority cache, Command; if not, when a command is stored in the second priority queue, the command stored in the second priority queue is transferred to the second priority cache;
- the third forwarding sub-module 83 is configured to determine whether a command to be forwarded is stored in the third priority cache when neither a command to be forwarded is stored in the second priority cache or the second priority queue, and if there is a command to be forwarded in the third priority cache, The command to be forwarded stored in the priority cache is sent. If not, when the command is stored in the third priority queue, the command stored in the third priority queue is transferred to the third priority cache.
- the priority of any command to be forwarded stored in the first priority cache is higher than the priority of any command to be forwarded stored in the second priority cache and the second priority queue.
- the priority of any command to be forwarded stored in the second priority queue is higher than the priority of any command to be forwarded stored in the third priority cache and the third priority queue.
- the device may further include:
- the timing module is configured such that when the forwarding module 503 is called, the forwarding module 503 is called again at a set timing interval.
- command forwarding device provided in the foregoing embodiment is described by taking only the division of the above functional modules as an example.
- the above functions may be allocated by different functional modules according to needs, that is, the internal of the device
- the structure or program is divided into different functional modules to complete all or part of the functions described above.
- the apparatus provided by the foregoing embodiments and the method provided by the method embodiments belong to the same concept. For specific implementation processes and beneficial effects, refer to the method embodiments, and details are not described herein again.
- FIG. 9 is a schematic diagram of an application scenario of a solar system including a command forwarding device.
- the command forwarding device is shown as a central controller.
- a communication connection is established between the central controller 11 and each of the local gateways 12, and each of the local gateways 12 is in communication with each of the junction box circuits 13 associated with the local gateway 12.
- three local gateways 12 are respectively associated with two, one and three junction box circuits 13 in FIG. 9.
- the inverter 14 connected to the junction box circuit 13 may also be directly connected to the central controller 11 or connected through a local gateway.
- the central controller 11 can perform the control operation of the solar energy system through the local gateway 12, the junction box circuit 13, and the inverter 14.
- a communication connection is established between the central controller 11 and the fire protection system 20, and a user input device 15 is provided on or around the central controller 11.
- the central controller 11 can also be connected to the remote terminal 40 through the Internet or WIFI, and the central controller 11 and the user terminal 40 can also be connected through the server as an intermediary device. Therefore, the central controller 11 can receive commands from at least one of the fire protection system 20, the local input device 15, and the user terminal 40, and then forward the commands to the local gateway 12 and the inverter 14.
- the local gateway 12 then sends the commands to the corresponding junction box Circuit 13, components in the solar system (such as junction box circuit 13 and inverter 14) can perform corresponding processing according to commands.
- the source of the command may include one or more of a fire protection system 20, a local input device 15, and a remote terminal 40.
- the fire protection system 20 in the present disclosure may be, for example, a circuit system for receiving a fire alarm signal in an installation place of the solar module;
- the local input device 15 may be a button, a control panel, and a touch provided on or around the central controller.
- Input devices such as boards can be operated by operators to issue commands to the central controller 11; remote terminals 40, such as mobile phones and computers, can be connected to the central controller 11 through a server or directly through wired or wireless signals, and can be sent to The central controller 11 sends commands; thus the sources of the above commands may include, but are not limited to, the fire protection system 20, the local input device 15, and the user terminal 40. It should be understood that, if necessary, other types of command sources may also be included.
- the central controller 11 in the present disclosure may also be referred to as a solar controller, which has functions of receiving, storing, and forwarding of commands, and may have other control and monitoring functions, including hardware and software required to implement these functions.
- the types of commands applied to a solar system may include, for example, a shutdown component command, a closure component command, a junction box data query command, a gateway / junction box user configuration command, a junction box maintenance command, and a gateway maintenance command.
- the most important commands for the solar system include the command to turn off the module and the command to close the module, which need to be prioritized and can be regarded as a key command, which can also be called a switch command.
- Other commands can be regarded as ordinary commands and can also be called non-switching commands.
- key commands take precedence over ordinary commands.
- the key commands that is, the switch command
- the global switch command is a command to turn off the components or close all components in the solar system.
- the closed component command can also be called a global shutdown / close command; and the local switch command is a closed component command that closes some components in the solar system or a closed component command that closes some components. It can also be called a partial shutdown. / Close command.
- the global switch command is directed to all junction boxes in the solar system, and is used to shut down or close them; and the local switch command is directed to some junction boxes or a single junction box in the solar system, to turn it off or closed. .
- Fire protection systems or local input devices generally only send global switch commands, while remote terminals can send any one or more of these commands.
- the general priority principle that commands need to be processed is: For key commands, the fire protection system controls the fire safety of the entire building. When a fire occurs, its information has the highest timeliness and accuracy, so the commands it sends have the highest priority; local Monitoring personnel can find that the timeliness and accuracy of the fire are second, so the commands sent by the local input device need lower priority; the user terminal generally can only judge based on the latest round of temperature data reporting, and the delay Larger and therefore requires lower priority.
- the priority of the ordinary commands sent by the user terminal generally does not involve emergency affairs, so it may require the lowest priority.
- the priority of global switch commands should be higher than the priority of local switch commands, and the priority of local switch commands should be higher than the priority of non-switch commands.
- global switch commands are stored in the first priority cache
- local switch commands are stored in the second priority queue
- non-switch commands are stored in the third priority queue, that is, the priority of all global switch commands is considered to be first Priority range.
- the priority of all local switch commands is in the second priority range, and the priority of all non-switch commands is in the third priority range.
- the first priority range is the same, the global switch command from the fire protection system should have higher priority than the global switch command from the local input device, and the global switch command from the local input device should have higher priority.
- the priority of the global switch command from the remote terminal; and among the global switch commands from the same source, the priority of the global switch command indicating OFF should be higher than the priority of the global switch command indicating Close.
- Such a setting can, for example, enable the global switch instruction to indicate shutdown in the fire protection system to have the highest priority. That is, whenever a fire alarm is detected by the fire protection system, the global switch instruction issued to indicate shutdown can be forwarded and executed with the highest priority, so that solar energy The system can quickly respond to the global shutdown of the fire alarm.
- the command forwarding device When the command forwarding device provided in the solar energy system of this embodiment receives a command from a fire-fighting system, a local input device, or a remote terminal, it can store the received command in the corresponding command storage area according to the priority, and also forward the command. According to the priority of the command, so that the commands that need to be processed are preferentially forwarded and processed, the emergency affairs in the solar system will not be delayed due to the delay of the command forwarding, which accelerates the emergency response speed of the solar system and prevents The deterioration of the situation caused by the delayed response has improved the safety and reliability of the solar system. Especially when there are many commands and many sources, it can effectively improve the forwarding and response speed of commands that need to be processed in the solar system, and prevent the delay and loss of key commands caused by the forwarding and processing of common commands.
- An embodiment of the present disclosure further provides a central controller including a processor and a memory, where the memory stores at least one executable instruction, and the executable instruction is loaded and executed by the processor to implement any of the foregoing.
- These executable instructions may be executed in an operating environment of an embedded Linux system, for example.
- the processor may include a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), Programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, or multiple integrated circuits for controlling program execution.
- Memory may include read-only memory (Read-Only Memory, ROM) or other types of static storage devices that can store static information and instructions, random access memory (Random, Access Memory, RAM) or other types of information that can store information and instructions
- Dynamic storage devices can also include electrically erasable and programmable read-only memory (Electrically Programmable Read-Only Memory (EEPROM)), compact discs (Compact Disc Read-Only Memory (CD-ROM)) or other optical disc storage, optical disc storage ( (Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be stored by a computer Any other media, but not limited to this.
- the memory can be set independently or integrated with the processor.
- An embodiment of the present disclosure also provides a computer-readable storage medium.
- the storage medium stores at least one executable instruction.
- the executable instruction When the executable instruction is loaded and executed by a processor, the command forwarding method described above is implemented.
- Computer-readable storage media may include read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (Random Access Memory, RAM), or can store information and instructions Other types of dynamic storage devices can also include electrically erasable programmable read-only memory (Electrically Programmable Read-Only Memory (EEPROM)), Compact Disc (Read-Only Memory, CD-ROM) or other optical disk storage , Optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store the desired program code in the form of instructions or data structures and Any other medium that can be accessed by a computer, but is not limited to this.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Automation & Control Theory (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Photovoltaic Devices (AREA)
Abstract
提供了一种命令转发方法及装置、太阳能系统、中央控制器和计算机可读存储介质。该方法包括:接收步骤,接收命令;存储步骤,将接收到的命令按照优先级存入相应的命令存储区域;转发步骤,根据优先级,将命令存储区域中存储的命令进行转发。
Description
本公开涉及但不限于控制技术领域,尤其是一种命令转发方法及装置、太阳能系统、中央控制器和计算机可读存储介质。
分布式太阳能系统,例如建筑太阳能系统,是指在用户现场或靠近用电现场配置较小的太阳能发电和供电系统,是一种新型的具有广阔发展前景的太阳能利用方式,能够较充分地利用太阳能资源。
相关技术中太阳能系统一般可包括太阳能组件、接线盒和网关,其中,太阳能组件用于进行光电转换、网关负责进行控制命令的接收和转发,而接线盒作为太阳能组件的电能汇集点,根据控制命令执行相应的开关等动作。相关技术的分布式太阳能系统中,网关根据命令接收时间的先后顺序对来自多个来源的不同控制命令进行转发。
相关技术的太阳能系统中在出现紧急情况而需要控制时,可能控制命令不能及时下发和得到执行,这种响应迟缓可能会使得事态加重和恶化。
发明内容
本公开提供一种命令转发方法及装置、太阳能系统、中央控制器和计算机可读存储介质。
第一方面,本公开实施例提供了一种命令转发方法,所述命令转发方法包括:
接收步骤,接收命令;
存储步骤,将接收到的命令按照优先级存入相应的命令存储区域;
转发步骤,根据所述优先级,将所述命令存储区域中存储的命令进行转发。
可选择地,所述存储步骤包括:
将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存;
将优先级处于第二优先级范围的接收到的命令存储到第二优先级队列;
将优先级处于第三优先级范围的接收到的命令存储到第三优先级队列;
其中,所述第一优先级范围中的任一优先级高于所述第二优先级范围中的任一优先级,所述第二优先级范围中的任一优先级高于所述第三优先级范围中的任一优先级。
可选择地,所述将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存,包括:
当所述第一优先级缓存处于默认可存储状态时,将所述接收到的命令存储到所述第一优先级缓存;
当所述第一优先级缓存不处于默认可存储状态时,比较所述接收到的命令的优先级与所述第一优先级缓存中已存储的命令的优先级;
如果所述接收到的命令的优先级高于所述已存储的命令的优先级,将所述接收到的命令存储到所述第一优先级缓存;
如果所述接收到的命令的优先级等于所述已存储的命令的优先级,在所述已存储的命令的转发时刻距当前时刻达到预设时长时,将所述接收到的命令存储到所述第一优先级缓存;如果所述接收到的命令的优先级低于所述已存储的命令的优先级,则丢弃所述接收到的命令。
可选择地,所述转发步骤包括:
判断第一优先级缓存中是否存储有待转发命令,如果有则发送所述第一优先级缓存中存储的待转发命令;
当所述第一优先级缓存没有存储有待转发命令时,判断第二优先级缓存中是否存储有待转发命令,如果有,则发送第二优先级缓存中存储的待转发命令;如果没有,在第二优先级队列存储有命令时,将所述第二优先级队列中存储的命令转存到所述第二优先级缓存中;
当所述第二优先级缓存和所述第二优先级队列中都没有存储有待转发命令时,判断第三优先级缓存中是否存储有待转发命令,如果有,则发送所述第三优先级缓存中存储的待转发命令,如果没有,在第三优先级队列中存储有命令时,将所述第三优先级队列中存储的命令转存到所述第三优先级缓存 中,
可选择地,所述命令转发方法还包括:
在所述转发步骤被执行时,每隔设定的定时时长,从所述所述第一优先级缓存中是否存储有待转发命令起再次执行所述转发步骤。
第二方面,本公开实施例提供了一种命令转发装置,所述命令转发装置包括:
接收模块,接收命令;
存储模块,将接收到的命令按照优先级存入相应的命令存储区域;
转发模块,根据所述优先级,将所述命令存储区域中存储的命令进行转发。
可选择地,所述命令转发装置包括:
第一存储子模块,将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存;
第二存储子模块,将优先级处于第二优先级范围的接收到的命令存储到第二优先级队列;
第三存储子模块,将优先级处于第三优先级范围的接收到的命令存储到第三优先级队列,
其中,所述第一优先级范围中的任一优先级高于所述第二优先级范围中的任一优先级,所述第二优先级范围中的任一优先级高于所述第三优先级范围中的任一优先级。
可选择地,所述第一存储子模块包括:
第一缓存子模块,被配置为当所述第一优先级缓存处于默认可存储状态时,将所述接收到的命令存储到所述第一优先级缓存;
优先级比较子模块,被配置为当所述第一优先级缓存不处于默认可存储状态时,比较所述接收到的命令的优先级与所述第一优先级缓存中已存储的命令的优先级;
第二缓存子模块,被配置为如果所述接收到的命令的优先级高于所述已存储的命令的优先级,将所述接收到的命令存储到所述第一优先级缓存;
第三缓存子模块,被配置为如果所述接收到的命令的优先级等于所述已存储的命令的优先级,在所述已存储的命令的转发时刻距当前时刻达到预设时长时,将所述接收到的命令存储到所述第一优先级缓存;如果所述接收到的命令的优先级低于所述已存储的命令的优先级,则丢弃所述接收到的命令。
可选择地,所述转发模块包括:
第一转发子模块,被配置为判断第一优先级缓存中是否存储有待转发命令,如果有则发送所述第一优先级缓存中存储的待转发命令;
第二转发子模块,被配置为当所述第一优先级缓存没有存储有待转发命令时,判断第二优先级缓存中是否存储有待转发命令,如果有则发送第二优先级缓存中存储的待转发命令;如果没有,在第二优先级队列存储有命令时,将所述第二优先级队列中存储的命令转存到所述第二优先级缓存中;
第三转发子模块,被配置为当所述第二优先级缓存和所述第二优先级队列中都没有存储有待转发命令时,判断第三优先级缓存中是否存储有待转发命令,如果有则发送所述第三优先级缓存中存储的待转发命令,如果没有,在第三优先级队列中存储有命令时,将所述第三优先级队列中存储的命令转存到所述第三优先级缓存中。
可选择地,所述命令转发装置还包括:
定时模块,被配置为在所述转发模块被调用时,每隔设定的定时时长,重新调用所述转发模块。
第三方面,本公开实施例提供了一种太阳能系统,包括如上所述的命令转发装置,其中所述命令的来源包括:消防系统、本地输入设备和远程终端中的任意一种或多种。
可选择地,所述命令包括开关命令和非开关命令,其中开关命令的优先级高于非开关命令;开关命令包括:关断组件命令和闭合组件命令。
可选择地,所述开关命令包括全局开关命令和局部开关命令,其中,
全局开关命令的优先级高于局部开关命令的优先级;
在来自相同来源的全局开关命令中,指示关断的全局开关命令的优先级高于指示闭合的全局开关命令的优先级。
可选择地,来自消防系统的全局开关命令的优先级高于来自本地输入设备的全局开关命令的优先级,来自本地输入设备的全局开关命令的优先级高于来自远程终端的全局开关命令的优先级。
第四方面,本公开实施例提供了一种中央控制器,包括处理器和存储器,所述存储器中存储有至少一条可执行指令,所述可执行指令由所述处理器加载并执行以实现如上所述的命令转发方法。
第五方面,本公开实施例提供了一种计算机可读存储介质,所述存储介质存储有至少一条可执行指令,所述可执行指令由处理器加载并执行时实现如上所述的命令转发方法。
为了更清楚地说明本公开实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,这些附图的合理变型也都涵盖在本公开的保护范围中。
图1为本公开一实施例提供的命令转发方法的流程示意图;
图2为图1的步骤102的一种例示性实现方式的流程示意图;
图3为图2的步骤203的一种例示性实现方式的流程示意图;
图4为图1的步骤103的一种例示性实现方式的流程示意图;
图5为本公开一实施例提供的命令转发装置的示意性结构框图;
图6为图5的存储模块52的一种例示性组成方式的结构框图;
图7为图6的第一存储模块61的一种例示性组成方式的结构框图;
图8为图5的转发模块503的一种例示性组成方式的结构框图;
图9为本公开一实施例提供的包括有命令转发装置的太阳能系统的应用场景示意图。
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。
显然,下面描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于所描述的本公开的实施例,本领域普通技术人员在无需创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
除非另外定义,本公开使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。
本公开中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性连接或通讯连接,且该连接可以是直接的或间接的。
本公开提供的一个例示性实施场景可以是:一个或多个来源发出命令,而一个转发装置接收这些命令,然后将这些命令转发给对应的系统、系统中的组件或单独的装置。为了使得这些命令中紧急的、重要的命令不会延迟或丢失,本公开的例示性实施例提供了命令转发方法和装置,以及包括该装置的太阳能系统和执行该方法的中央控制器。
图1是本公开一实施例提供的一种命令转发方法的流程示意图。该控制方法可以由具有转发命令功能的中央控制器执行,参见图1,该方法包括:
接收步骤101:接收命令;
存储步骤102:将接收到的命令按照优先级存入相应的命令存储区域;
存储步骤103:根据优先级,将命令存储区域中存储的命令进行转发。
采用本实施例提供的方法,在接收到命令时,可基于命令的优先级将接收到的命令存入相应的命令存储区域,然后根据优先级转发命令存储区域中存储的命令,从而使需要优先处理的命令得到优先转发和处理,则系统中的紧急事务不会因为紧急命令转发的延迟而延迟处理,加快了系统的紧急响应速度,防止因为命令响应延迟导致的事态恶化,提升了系统的安全性和可靠性。尤其在命令数量多、来源多时能有效提升系统中需要优先处理的命令的转发和响应速度,防止普通命令的转发和处理造成关键命令的迟滞和丢失。
下面具体对图1的各步骤的具体实现方式进行例示性说明。应该理解的是,接收步骤101、存储步骤102和存储步骤103是三个可以独立执行的步骤,因此可以同时执行,也可以轮流执行,或者基于相关事件触发其中一个步骤执行并 带动其他步骤执行。
在步骤101中,中央控制器可以对一个或多个输入端口进行监听,来自任一来源的命令在对应端口出现时即能被中央控制器接收。在一个例示性方式中,一个命令数据可以包括来源、功能、优先级等参数。
图2是图1的步骤102的一个例示性实现方式的流程示意图。参见图2,其包括以下步骤:
步骤201:解析接收到的命令;
在该步骤中,例如通过预定的格式提取命令中的各个参数。
步骤202:确定该命令的优先级所处的优先级范围,当优先级处于第一优先级范围时,执行步骤203;当优先级处于第二优先级范围时,执行步骤204;当优先级处于第三优先级范围时,执行步骤205。
在该步骤中,首先对于接收到的每个命令,确定其优先级。可以根据协议在来源处生成命令时即设置命令的优先级,也可以在命令被接收后基于解析该命令得到的来源和功能和/或其他参数而设置对应的优先级,或者命令的优先级也可不由独立的一个数据字段体现,而是在处理流程中基于其来源和功能和/或其他参数进行处理来体现其优先级。
得到每个命令的优先级之后,就可以判定其所处的优先级范围,一般地,优先级与优先级范围的对应关系已经预先设置,因此得到优先级即可直接得到其对应的优先级范围。
当命令的优先级处于第一优先级范围时,转到步骤203;当命令的优先级处于第二优先级范围时,转到步骤204;当命令的优先级处于第三优先级范围时,转到步骤205。
在本公开的实施例中,第一优先级范围、第二优先级范围和第三优先级范围中的优先级是依次降低的,即第一优先级范围中的任一优先级高于第二优先级范围中的任一优先级,第二优先级范围中的任一优先级高于第三优先级范围中的任一优先级。
每个优先级范围可以对应一个命令存储区域。可以理解的是,还可以设置更多的优先级范围和对应的命令存储区域,本公开不限制优先级范围和命令存储区域的数量。
命令存储区域可以是设置在中央控制器中的存储器、缓存器、寄存器或它们的一部分及其组合。例如,第一命令存储区域可以包括第一优先级缓存,在一些实现方式中第一优先级缓存仅能存储一个命令;第二命令存储区域可以包括第二优先级缓存和第二优先级队列,在一些实现方式中第二优先级缓存可能仅能存储一个命令,第二优先级队列可以存储一个或多个命令,例如形成先进先出的命令队列,运行时第二优先级队列每次可以转存一个命令到第二优先级缓存中;第三命令存储区域可以包括第三优先级缓存和第三优先级队列,在一些实现方式中第三优先级缓存可能仅能存储一个命令,第三优先级队列可以存储一个或多个命令,例如形成先进先出的命令队列,运行时第三优先级队列每次可以转存一个命令到第三优先级缓存中。
步骤203:当优先级处于第一优先级范围时,将接收到的命令存储到第一优先级缓存。
第一优先级范围中的优先级相对其他优先级范围最高,因此当命令的优先级处于第一优先级范围时,将该命令存储到第一优先级缓存,不以队列的方式进行存储,以尽可能提高该命令的响应速度,使得命令不因在队列排队而延迟。参见在下文具体描述的存储方式,可以理解的是,由于第一优先级缓存一次只能存储一个命令,在出现存储冲突时,接收到的命令中一部分优先级处于第一优先级范围的命令不会或暂时不会存储到第一优先级缓存中。
步骤204:当优先级处于第二优先级范围时,将接收到的命令存储到第二优先级队列。
接收到的命令的优先级处于第二优先级范围时,对应的第二命令存储区域包括第二优先级队列和第二优先级缓存,所以接收到的命令可以存储在第二优先级队列中,在转发时再依次进入第二优先级缓存中进行转发。
步骤205:当优先级处于第三优先级范围时,将接收到的命令存储到第三优先级队列。
接收到的命令的优先级处于第三优先级范围时,对应的第三命令存储区域包括第三优先级队列和第三优先级缓存,所以接收到的命令可以存储在第三优先级队列中,在转发时再依次进入第三优先级缓存中进行转发。
其中,步骤203中第一命令存储区域为一次只能存储一个命令的优先级缓存,因此存储时可能存在冲突,需要有解决冲突的策略,图3示出了步骤203的一种例示性实现方式,如图3所示,其包括以下步骤:
步骤301:确定第一优先级缓存的状态是否处于默认可存储状态,如果是,则执行步骤302;如果否,则执行步骤303。
每个缓存可处于以下三个状态之一:默认可存储状态,表明其中可以直接存入命令,也就是说其中未存储有命令或存储的命令已经转发完毕且转发时刻距当前时刻超过预定时长(这个预定时长被设置为使得在该预定时长前转发的命令足以被执行完毕);已转发状态,表明存储的命令已经转发,但转发时刻与当前时刻之间的间隔时长尚未达到预定时长;未转发转态,表明存储的命令尚未被转发。
在该步骤中,如果第一优先级缓存处于默认可存储状态,则转到步骤302;否则转到步骤303。
步骤302:当第一优先级缓存处于默认可存储状态时,将接收到的命令存储到第一优先级缓存。
在第一优先级缓存处于默认可存储状态时,表明第一优先级缓存可以直接存入命令,而之前的步骤中已经确定接收到的命令的优先级处于第一优先级范围,因此直接将接收到的命令存储到第一优先级缓存。
步骤303:当第一优先级缓存不为默认可存储状态时,比较接收到的命令的优先级与第一优先级缓存中已存储的命令的优先级,如果接收到的命令的优先级高于已存储的命令的优先级,则转到步骤304;如果接收到的命令的优先级等于已存储的命令的优先级,转到步骤305;如果接收到的命令的优先级低于已存储的命令的优先级,转到步骤306。
当接收到的命令的优先级高于已存储的命令的优先级时,说明接收到的命令需要优先得到处理,因此可直接用接收到的命令覆盖第一优先级缓存中已存储的命令,即转到步骤304:将接收到的命令存储到第一优先级缓存。
在接收到的命令的优先级低于已存储的命令的优先级时,说明已存储的命令应当优先处理,因此转到步骤306:丢弃接收到的命令。在其他实施方式中,也可将该命令暂存到另一区域,待一段时间后再进入存储流程。
接收到的命令的优先级等于已存储的命令的优先级时,说明两者的优先级一样,还需要转到步骤305:判断已存储的命令是否已转发,如果已经转发,转到步骤307;如果没有被转发,则已存储的命令不应被覆盖,转到步骤306丢弃接收到的命令。在其他实施方式中,也可将该命令暂存到另一区域,待一段时间后再进入存储流程。
当已存储的命令已经被转发时,转到步骤307:判断转发时刻距当前时刻是否达到预设时长,如果达到,则说明已存储的命令已经被转发且可认为该命令对应的受控对象执行该命令完毕,因此转到步骤304将该命令存储到第一优先级缓存。如果转发时刻距当前时刻没有达到预设时长,则已存储的命令不应被覆盖,因此转到步骤306丢弃接收到的命令。在其他实施方式中,也可将该命令暂存到另一区域,待一段时间后再进入存储流程。
图4是图1的步骤103的一个例示性实现方式的流程示意图。参见图4,其包括以下步骤:
步骤401:判断第一优先级缓存中是否存储有待转发命令,如果是,则执行步骤402;如果否,则执行步骤403。
从上面的存储步骤可知,第一优先级缓存中存储的任一待转发命令的优先级高于第二优先级缓存和第二优先级队列中存储的任一待转发命令的优先级,第二优先级缓存和第二优先级队列中存储的任一待转发命令的优先级高于第三优先级缓存和第三优先级队列中存储的任一待转发命令的优先级。
第一优先级缓存中存储的命令的优先级最高,因此首先查看第一优先级缓存中是否存储有待转发命令。是否存储有待转发命令可以根据第一优先级缓存所处的状态来判断,处于默认可存储状态则视为没有,其他状态视为有,如果有,转到步骤402,没有则转到步骤403。
在一些可能的情形中,第一优先级缓存中可能存储有已经转发的命令,即缓存状态为已转发状态,此时可以判断其转发时刻距当前时刻是否超过预设时长,如果已经超过预设时长可以视为没有存储待转发命令;没有达到预设时长则可等待,直到达到预设时长后将第一优先级缓存的缓存状态设置为默认可存储状态,再次从步骤401开始执行。
步骤402:发送第一优先级缓存中存储的待转发命令。
第一优先级缓存中存储有待转发命令,因此可直接进行发送。在一些实施方式中,第一优先级缓存中存储的待转发命令为全局性命令,因此可以以广播的方式进行发送,从而发送到所有的受控对象。
将第一优先级缓存中存储的待转发命令发送完之后,可以经过预设时长后将第一优先级缓存的缓存状态设置为默认可存储状态,再次从步骤401开始执行。
步骤403:判断第二优先级缓存中是否存储有待转发命令,如果是,则执行步骤404,如果否,则执行步骤405。
当第一优先级缓存没有存储有待转发命令时,则对第二优先级存储区域的命令进行处理,首先可以判断第二优先级缓存中是否存储有待转发命令,有则转到步骤404,没有则转到步骤405。
步骤404:发送第二优先级缓存中存储的待转发命令。
第二优先级缓存中存储有待转发命令,因此可直接进行发送。在一些实施方式中,第二优先级缓存中存储的待转发命令为局部命令,因此可以单播发送到对应的受控对象。
将第二优先级缓存中存储的待转发命令发送完之后,可以经过设定时长后将第二优先级缓存的缓存状态设置为默认可存储状态,再次从步骤401开始执行。
步骤405:判断第二优先级队列中是否存储有待转发命令,如果是,则执行步骤406;如果否,则执行步骤407。
第二优先级队列中存储的命令需要提取到第二优先级缓存中进行发送,因此在第二优先级缓存中没有存储有待转发命令时,需要查看第二优先级队列中是否存储有待转发命令。如果有则转到步骤406,没有则转到步骤407。
步骤406:将第二优先级队列中存储的命令转存到第二优先级缓存中,然后返回执行步骤401。
将第二优先级队列中存储的命令转存到第二优先级缓存中后,就可以下次执行步骤404时将转存的命令转发出去,一般一次只转存一个命令。该步骤406执行完之后,转到步骤401重新开始。
步骤407:判断第三优先级缓存中是否存储有待转发命令,如果是,则执行步骤408;如果否,则执行步骤409。
步骤405的判断结果为否即指示第二优先级缓存和第二优先级队列都没有存储有待转发命令,则对第三优先级存储区域的命令进行处理,首先可以判断第三优先级缓存中是否存储有待转发命令,有则转到步骤408,没有则转到步骤409。
步骤408:将第三优先级缓存中存储的待转发命令进行发送,然后返回执行步骤401。
第三优先级缓存中存储有待转发命令,因此可直接进行发送。根据命令的 面向的对象可进行广播或单播发送。
该步骤执行完之后,经过设定时长后将第三优先级缓存的缓存状态设置为默认可存储状态,转到步骤401重新开始。
步骤409:判断第三优先级队列中是否存储有待转发命令,如果是,则执行步骤410;如果否,则返回执行步骤401。
第三优先级队列中存储的命令需要提取到第三优先级缓存中进行发送,因此在第三优先级缓存中没有存储待转发命令时,需要查看第三优先级队列中是否存储有待转发命令。如果有则转到步骤410,没有则转到步骤401重新开始。
步骤410:将第三优先级队列中存储的命令转存到第三优先级缓存中,然后返回执行步骤401。
将第三优先级队列中存储的命令转存到第三优先级缓存中后,就可以在下次执行步骤408时将转存的命令转发出去。执行完该步骤之后转到步骤401重新开始。
从上述步骤401-410可以看出,只有第一优先级缓存中没有存储有命令时,才会对第二优先级缓存和第二优先级队列中的命令进行处理,只有第一优先级缓存中没有存储命令且第二优先级缓存和第二优先级队列中都没有存储命令时,才会对第三优先级缓存和第三优先级队列中的命令进行处理。在执行完一些步骤,例如步骤402、404、406、408或410之后,都转到步骤401重新开始,这是为了确保第一优先级缓存中随时存入的命令能得到及时的转发,不至于因为处理其他步骤而耽误时间。
在图4示出的实现方式中,还可以在步骤401开始的同时或稍前稍后启动定时器任务,定时器任务中设置有定时时长,从而每隔设定的定时时长,从步骤401起再次执行转发,在一些可能的实现方式中,如果当设定的定时时长到达时,在执行对第一优先级缓存的转发处理,也可以直到对第一优先级缓存的转发处理结束时,再转到步骤401从头开始。
在命令转发之后经过一段设定时长之后,还可以查询各个命令受控对象的相应状态,例如对于与关断相关的命令,相应组件是否执行了关断,然后将查询到的结果汇集到中央控制器,并可反馈到相应的命令来源处。
图5是本公开一实施例提供的命令转发装置的结构框图。参见图5,该命令转发装置包括:
接收模块51,被配置为接收命令;
存储模块52,被配置为将接收到的命令按照优先级存入相应的命令存储区域;
转发模块53,被配置为根据所述优先级,将命令存储区域中存储的命令进行转发。
在一些可能的实现方式中,参见图6,存储模块52可包括:
第一存储子模块61,被配置为将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存;
第二存储子模块62,被配置为将优先级处于第二优先级范围的接收到的命令存储到第二优先级队列;
第三存储子模块63,被配置为将优先级处于第三优先级范围的接收到的命令存储到第三优先级队列。
其中,第一优先级范围中的任一优先级高于第二优先级范围中的任一优先级,第二优先级范围中的任一优先级高于第三优先级范围中的任一优先级。
作为一种可能的实现方式,参见图7,第一存储子模块61可包括:
第一缓存子模块71,被配置为当第一优先级缓存处于默认可存储状态时,将接收到的命令存储到第一优先级缓存;
优先级比较子模块72,被配置为当第一优先级缓存不处于默认可存储状态时,比较接收到的命令的优先级与第一优先级缓存中已存储的命令的优先级;
第二缓存子模块73,被配置为如果接收到的命令的优先级高于已存储的命令的优先级,将接收到的命令存储到第一优先级缓存;
第三缓存子模块74,被配置为如果接收到的命令的优先级等于已存储的命令的优先级,在已存储的命令的转发时刻距当前时刻达到预设时长时,将接收到的命令存储到第一优先级缓存。
在一些可能的实现方式中,参见图8,存储模块53可包括下列子模块:
第一转发子模块81,被配置为判断第一优先级缓存中是否存储有待转发命令,如果有则发送所述第一优先级缓存中存储的待转发命令;
第二转发子模块82,被配置为当第一优先级缓存没有存储有待转发命令时,判断第二优先级缓存中是否存储有待转发命令,如果有则发送第二优先级缓存 中存储的待转发命令;如果没有,在第二优先级队列存储有命令时,将第二优先级队列中存储的命令转存到第二优先级缓存中;
第三转发子模块83,被配置为当第二优先级缓存和第二优先级队列中都没有存储有待转发命令时,判断第三优先级缓存中是否存储有待转发命令,如果有则将第三优先级缓存中存储的待转发命令进行发送,如果没有,在第三优先级队列中存储有命令时,将第三优先级队列中存储的命令转存到第三优先级缓存中。
其中,第一优先级缓存中存储的任一待转发命令的优先级高于第二优先级缓存和第二优先级队列中存储的任一待转发命令的优先级,第二优先级缓存和第二优先级队列中存储的任一待转发命令的优先级高于第三优先级缓存和第三优先级队列中存储的任一待转发命令的优先级。
其中,该装置还可包括:
定时模块,被配置为转发模块503被调用时,每隔设定的定时时长,重新调用转发模块503。
需要说明的是,上述实施例中提供的命令转发装置,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构或程序划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例提供的方法属于同一构思,其具体实现过程和带来的有益效果详见方法实施例,这里不再赘述。
本公开一实施例还提供了一种太阳能系统,其中包括有本公开实施例中提供的命令转发装置。图9示出了包括有命令转发装置的太阳能系统的应用场景示意图。图9中,命令转发装置被示出为中央控制器。参见图9,该应用场景中,中央控制器11分别与每个本地网关12之间建立有通信连接,而其中每一个本地网关12都与其所关联的每个接线盒电路13之间通信连接。示例性地,图9中分别示出了分别与两个、一个和三个接线盒电路13相关联的三个本地网关12。此外,接线盒电路13所连接的逆变器14也可与中央控制器11直接通信连接或者通过一个本地网关通信连接。从而,中央控制器11可以通过本地网关12、接线盒电路13和逆变器14进行太阳能系统的控制操作。此外,中央控制器11还与消防系统20之间建立有通信连接,中央控制器11上或外围还设置有用户输 入设备15。中央控制器11上还可通过互联网或WIFI等方式连接到远程终端40,也可通过服务器作为中介设备将中央控制器11和用户终端40相连。从而中央控制器11可以接收消防系统20、本地输入设备15和用户终端40中至少一个的命令,然后转发到本地网关12和逆变器14,本地网关12再将命令下发到对应的接线盒电路13,太阳能系统中的组件(例如接线盒电路13和逆变器14)就可根据命令执行相应的处理。
在太阳能系统中,命令的来源可包括消防系统20、本地输入设备15和远程终端40中的一种或多种。本公开中的消防系统20可以例如是所述太阳能组件的安装场所内用来接收消防报警信号的电路系统;本地输入设备15可以是设置在中央控制器上或其外围的按键、操控板和触摸板等输入设备,可以由操作人员操作而向中央控制器11发出命令;远程终端40例如为手机、电脑等,可以通过服务器或直接通过有线或无线方式信号连接到中央控制器11,并可以向中央控制器11发送命令;从而上述命令的来源可以包括而不仅限于消防系统20、本地输入设备15和用户终端40。应当理解的是,在必要时,还可以包括其他类型的命令来源。本公开中的中央控制器11又可称为太阳能中控器,其具有命令的接收、存储和转发功能,并可具有其他控制和监测功能,包括实现这些功能所需的硬件和软件。
应用于太阳能系统的命令类型例如可以包括:关断组件命令、闭合组件命令、接线盒数据查询命令、网关/接线盒用户配置命令、接线盒维护命令、网关维护命令。其中对太阳能系统最为重要的命令包括关断组件命令和闭合组件命令,这是需要进行优先处理的,可以视为关键命令,也可称为开关命令。而其他命令可视为普通命令,也可称为非开关命令。显然,关键命令的优先级要高于普通命令。
其中从针对的受控对象来看,关键命令即开关命令又可分为全局开关命令和局部开关命令,全局开关命令即为使太阳能系统中所有组件关闭的关断组件命令或使所有组件闭合的闭合组件命令,也可称为全局关断/闭合命令;而局部开关命令即为使太阳能系统中部分组件关闭的关断组件命令或使部分组件闭合的闭合组件命令,也可称为局部关断/闭合命令。在一些可能的实现方式中,全局开关命令针对太阳能系统中所有接线盒,用于使其关断或闭合;而局部开关命令针对太阳能系统中部分接线盒或者单个接线盒,使其关断或闭合。
消防系统或本地输入设备一般只发送全局开关命令,而远程终端可发送以 上任意一种或多种命令。命令需要处理的一般优先原则是:对于关键命令,消防系统控制着整栋建筑物消防安全,当发生火灾时,其信息的时效性和准确性最高,因此其发送的命令的优先级最高;本地监控人员能够发现火灾的时效性和准确性次之,因此通过本地输入设备发送的命令,其需要的优先级低一些;而用户终端一般只能根据最近一轮温度数据的上报来判断,时延较大,因此需要的优先级更低。而由用户终端发送的普通命令的优先级一般不涉及紧急事务,因此可能需要的优先级最低。
基于以上原则,全局开关命令的优先级应高于局部开关命令的优先级,而局部开关命令的优先级应高于非开关命令的优先级。例如,将全局开关命令存储到第一优先级缓存,将局部开关命令存储到第二优先级队列,将非开关命令存储到第三优先级队列,即认为所有全局开关命令的优先级处于第一优先级范围,所有局部开关命令的优先级处于第二优先级范围,所有非开关命令的优先级处于第三优先级范围。而虽然同处第一优先级范围,但来自消防系统的全局开关命令的优先级应高于来自本地输入设备的全局开关命令的优先级,来自本地输入设备的全局开关命令的优先级应高于来自远程终端的全局开关命令的优先级;并且在来自相同来源的全局开关命令中,指示关断的全局开关命令的优先级应高于指示闭合的全局开关命令的优先级。
如此设置,例如可使得来自消防系统中指示关断的全局开关指令得到最高优先级,即只要消防系统发现火警,其发出的指示关断的全局开关指令能得到最优先的转发和执行,使太阳能系统能迅速对火警做出全局关断的响应。
本实施例的太阳能系统中设置的命令转发装置在接收到消防系统、本地输入设备或者远程终端的命令时,可将接收到的命令按照优先级存储到对应的命令存储区域,而转发命令时也根据命令的优先级进行,从而使需要优先处理的命令得到优先转发和处理,则太阳能系统中的紧急事务不会因为命令转发的延迟而延迟处理,加快了太阳能系统的紧急响应速度,防止因为命令响应延迟导致的事态恶化,提升了太阳能系统的安全性和可靠性。尤其在命令数量多、来源多时能有效提升太阳能系统中需要优先处理的命令的转发和响应速度,防止普通命令的转发和处理造成关键命令的迟滞和丢失。
本公开的一实施例还提供了一种中央控制器,包括处理器和存储器,所述存储器中存储有至少一条可执行指令,所述可执行指令由所述处理器加载并执 行以实现上述任意一种命令转发方法所执行的操作。其中这些可执行指令例如可在嵌入式Linux系统的操作环境中执行。其中,所述处理器可以包括通用中央处理器(CPU),微处理器,特定应用集成电路(Application-Specific Integrated Circuit,ASIC),数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器,或者多个用于控制程序执行的集成电路。存储器可以包括只读存储器(Read-Only Memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(Random Access Memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以包括电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立设置的,也可以和处理器集成在一起。
本公开的一实施例还提供了一种计算机可读存储介质,该存储介质存储有至少一条可执行指令,可执行指令由处理器加载并执行时实现如上所述的命令转发方法。计算机可读存储介质可以包括只读存储器(Read-Only Memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(Random Access Memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以包括电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
以上所述仅为本公开的例示性实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。
Claims (16)
- 一种命令转发方法,所述命令转发方法包括:接收步骤,接收命令;存储步骤,将接收到的命令按照优先级存入相应的命令存储区域;转发步骤,根据所述优先级,将所述命令存储区域中存储的命令进行转发。
- 根据权利要求1所述的命令转发方法,所述存储步骤包括:将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存;将优先级处于第二优先级范围的接收到的命令存储到第二优先级队列;将优先级处于第三优先级范围的接收到的命令存储到第三优先级队列;其中,所述第一优先级范围中的任一优先级高于所述第二优先级范围中的任一优先级,所述第二优先级范围中的任一优先级高于所述第三优先级范围中的任一优先级。
- 根据权利要求2所述的命令转发方法,所述将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存,包括:当所述第一优先级缓存处于默认可存储状态时,将所述接收到的命令存储到所述第一优先级缓存;当所述第一优先级缓存不处于默认可存储状态时,比较所述接收到的命令的优先级与所述第一优先级缓存中已存储的命令的优先级;如果所述接收到的命令的优先级高于所述已存储的命令的优先级,将所述接收到的命令存储到所述第一优先级缓存;如果所述接收到的命令的优先级等于所述已存储的命令的优先级,在所述已存储的命令的转发时刻距当前时刻达到预设时长时,将所述接收到的命令存储到所述第一优先级缓存;如果所述接收到的命令的优先级低于所述已存储的命令的优先级,则丢弃所述接收到的命令。
- 根据权利要求1-3中任一项所述的命令转发方法,所述转发步骤包括:判断第一优先级缓存中是否存储有待转发命令,如果有,则发送所述第一优先级缓存中存储的待转发命令;当所述第一优先级缓存没有存储有待转发命令时,判断第二优先级缓存中是否存储有待转发命令,如果有,则发送第二优先级缓存中存储的待转发命令;如果没有,在第二优先级队列存储有命令时,将所述第二优先级队列中存储的命令转存到所述第二优先级缓存中;当所述第二优先级缓存和所述第二优先级队列中都没有存储有待转发命令时,判断第三优先级缓存中是否存储有待转发命令,如果有,则发送所述第三优先级缓存中存储的待转发命令;如果没有,在第三优先级队列中存储有命令时,将所述第三优先级队列中存储的命令转存到所述第三优先级缓存中。
- 根据权利要求4所述的命令转发方法,所述命令转发方法还包括:在所述转发步骤被执行时,每隔设定的定时时长,从所述判断第一优先级缓存中是否存储有待转发命令起再次执行所述转发步骤。
- 一种命令转发装置,所述命令转发装置包括:接收模块,接收命令;存储模块,将接收到的命令按照优先级存入相应的命令存储区域;转发模块,根据所述优先级,将所述命令存储区域中存储的命令进行转发。
- 根据权利要求6所述的命令转发装置,所述存储模块包括:第一存储子模块,将优先级处于第一优先级范围的接收到的命令存储到第一优先级缓存;第二存储子模块,将优先级处于第二优先级范围的接收到的命令存储到第二优先级队列;第三存储子模块,将优先级处于第三优先级范围的接收到的命令存储到第三优先级队列;其中,所述第一优先级范围中的任一优先级高于所述第二优先级范围中的任一优先级,所述第二优先级范围中的任一优先级高于所述第三优先级范围中的任一优先级。
- 根据权利要求7所述的命令转发装置,所述第一存储子模块包括:第一缓存子模块,被配置为当所述第一优先级缓存处于默认可存储状态时,将所述接收到的命令存储到所述第一优先级缓存;优先级比较子模块,被配置为当所述第一优先级缓存不处于默认可存储状态时,比较所述接收到的命令的优先级与所述第一优先级缓存中已存储的命令的优先级;第二缓存子模块,被配置为如果所述接收到的命令的优先级高于所述已存储的命令的优先级,将所述接收到的命令存储到所述第一优先级缓存;第三缓存子模块,被配置为如果所述接收到的命令的优先级等于所述已存储的命令的优先级,在所述已存储的命令的转发时刻距当前时刻达到预设时长时,将所述接收到的命令存储到所述第一优先级缓存;如果所述接收到的命令的优先级低于所述已存储的命令的优先级,则丢弃所述接收到的命令。
- 根据权利要求6-8中任一项所述的命令转发装置,所述转发模块包括:第一转发子模块,被配置为判断第一优先级缓存中是否存储有待转发命令,如果有,则发送所述第一优先级缓存中存储的待转发命令;第二转发子模块,被配置为当所述第一优先级缓存没有存储有待转发命令时,判断第二优先级缓存中是否存储有待转发命令,如果有,则发送第二优先级缓存中存储的待转发命令;如果没有,在第二优先级队列存储有命令时,将所述第二优先级队列中存储的命令转存到所述第二优先级缓存中;第三转发子模块,被配置为当所述第二优先级缓存和所述第二优先级队列中都没有存储有待转发命令时,判断第三优先级缓存中是否存储有待转发命令,如果有,则发送所述第三优先级缓存中存储的待转发命令,如果没有, 在第三优先级队列中存储有命令时,将所述第三优先级队列中存储的命令转存到所述第三优先级缓存中。
- 根据权利要求9所述的命令转发装置,所述命令转发装置还包括:定时模块,被配置为在所述转发模块被调用时,每隔设定的定时时长,重新调用所述转发模块。
- 一种太阳能系统,包括如权利要求6-10中任一项所述的命令转发装置,其中所述命令的来源包括:消防系统、本地输入设备和远程终端中的任意一种或多种。
- 根据权利要求11所述的太阳能系统,所述命令包括开关命令和非开关命令,其中开关命令的优先级高于非开关命令;开关命令包括:关断组件命令和闭合组件命令。
- 根据权利要求12所述的太阳能系统,所述开关命令还包括全局开关命令和局部开关命令,其中,全局开关命令的优先级高于局部开关命令的优先级;在来自相同来源的全局开关命令中,指示关断的全局开关命令的优先级高于指示闭合的全局开关命令的优先级。
- 根据权利要求13所述的太阳能系统,来自消防系统的全局开关命令的优先级高于来自本地输入设备的全局开关命令的优先级,来自本地输入设备的全局开关命令的优先级高于来自远程终端的全局开关命令的优先级。
- 一种中央控制器,包括处理器和存储器,所述存储器中存储有至少一条可执行指令,所述可执行指令由所述处理器加载并执行以实现如权利要求1至5中任一项所述的命令转发方法。
- 一种计算机可读存储介质,所述存储介质存储有至少一条可执行指令,所述可执行指令由处理器加载并执行时实现如权利要求1至5中任一项所述的命令转发方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810557393.4A CN108663971A (zh) | 2018-06-01 | 2018-06-01 | 命令转发方法及装置、太阳能系统和中央控制器 |
CN201810557393.4 | 2018-06-01 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019227596A1 true WO2019227596A1 (zh) | 2019-12-05 |
Family
ID=63775178
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/094700 WO2019227596A1 (zh) | 2018-06-01 | 2018-07-05 | 命令转发方法及装置、太阳能系统和中央控制器 |
Country Status (7)
Country | Link |
---|---|
US (1) | US20190370179A1 (zh) |
EP (1) | EP3575965A1 (zh) |
JP (1) | JP2019212271A (zh) |
KR (1) | KR20190137666A (zh) |
CN (1) | CN108663971A (zh) |
AU (1) | AU2018236884A1 (zh) |
WO (1) | WO2019227596A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3885926B1 (en) * | 2020-03-25 | 2024-08-28 | Carrier Corporation | Fire protection system |
CN112769895B (zh) * | 2020-12-18 | 2023-10-13 | 杭州涂鸦信息技术有限公司 | 一种群组或场景的控制方法及相关装置 |
CN114488976A (zh) * | 2022-01-13 | 2022-05-13 | 吉林省电力科学研究院有限公司 | 一种用于dcs的数据接收系统 |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060072262A1 (en) * | 2004-09-28 | 2006-04-06 | American Power Conversion Corporation | System and method for allocating power to loads |
CN105972694A (zh) * | 2016-06-15 | 2016-09-28 | 青岛恒金源电子科技有限公司 | 一种基于云任务调度的智能采暖控制系统 |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007099613A1 (ja) * | 2006-02-28 | 2007-09-07 | Fujitsu Limited | コマンド選択方法、装置、コマンド投入方法、及び装置 |
US20110321052A1 (en) * | 2010-06-23 | 2011-12-29 | International Business Machines Corporation | Mutli-priority command processing among microcontrollers |
US9519943B2 (en) * | 2010-12-07 | 2016-12-13 | Advanced Micro Devices, Inc. | Priority-based command execution |
CN102695128A (zh) * | 2011-03-21 | 2012-09-26 | 中兴通讯股份有限公司 | 一种组呼业务中发送通知命令的方法、装置及系统 |
US9021146B2 (en) * | 2011-08-30 | 2015-04-28 | Apple Inc. | High priority command queue for peripheral component |
CN103179051B (zh) * | 2013-03-19 | 2016-04-27 | 安科智慧城市技术(中国)有限公司 | 一种流媒体的转发方法和系统 |
CN103647807B (zh) * | 2013-11-27 | 2017-12-15 | 华为技术有限公司 | 一种信息缓存方法、装置和通信设备 |
CN111176559B (zh) * | 2015-12-04 | 2023-07-11 | 成都华为技术有限公司 | 数据写入方法及装置、双活系统 |
CN105867844B (zh) * | 2016-03-28 | 2019-01-25 | 北京联想核芯科技有限公司 | 一种命令控制方法及存储设备 |
JP2017208660A (ja) * | 2016-05-17 | 2017-11-24 | 富士通株式会社 | 情報処理装置、管理方法及び情報処理プログラム |
-
2018
- 2018-06-01 CN CN201810557393.4A patent/CN108663971A/zh active Pending
- 2018-07-05 WO PCT/CN2018/094700 patent/WO2019227596A1/zh active Application Filing
- 2018-09-19 EP EP18195427.2A patent/EP3575965A1/en not_active Withdrawn
- 2018-09-20 US US16/136,323 patent/US20190370179A1/en not_active Abandoned
- 2018-09-28 AU AU2018236884A patent/AU2018236884A1/en not_active Abandoned
- 2018-10-24 KR KR1020180127595A patent/KR20190137666A/ko not_active Application Discontinuation
- 2018-10-24 JP JP2018199903A patent/JP2019212271A/ja active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060072262A1 (en) * | 2004-09-28 | 2006-04-06 | American Power Conversion Corporation | System and method for allocating power to loads |
CN105972694A (zh) * | 2016-06-15 | 2016-09-28 | 青岛恒金源电子科技有限公司 | 一种基于云任务调度的智能采暖控制系统 |
Also Published As
Publication number | Publication date |
---|---|
US20190370179A1 (en) | 2019-12-05 |
KR20190137666A (ko) | 2019-12-11 |
JP2019212271A (ja) | 2019-12-12 |
CN108663971A (zh) | 2018-10-16 |
EP3575965A1 (en) | 2019-12-04 |
AU2018236884A1 (en) | 2019-12-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20220400028A1 (en) | Operation control method and device, household electrical appliance, and storage medium | |
WO2019227596A1 (zh) | 命令转发方法及装置、太阳能系统和中央控制器 | |
US9672057B2 (en) | Notification of target before all guest data is copied to target in live migration | |
EP3404872A1 (en) | Device control method, network device, and network system | |
KR20120106897A (ko) | 네트워크 접속을 유휴화하기 위한 방법 및 장치 | |
US10158705B2 (en) | Migration of hosts | |
CN107797859B (zh) | 一种定时任务的调度方法及一种调度服务器 | |
CN104159231A (zh) | 客户端后台流量的优化方法及客户端 | |
WO2015070393A1 (en) | Method and apparatus for qcn-like cross-chip function in multi-stage ethernet switching | |
CN109286584B (zh) | 一种多核系统中的分片重组方法、装置及设备 | |
CN107634868B (zh) | 一种管理网络服务的方法和系统 | |
CN107179912B (zh) | 一种分布式架构软件定义网络控制器的热升级方法 | |
WO2012171398A1 (zh) | 实时处理系统中的共享资源访问方法和实时处理系统 | |
US12026501B2 (en) | Automated process and system update scheduling in a computer network | |
JPWO2014171413A1 (ja) | 処理性能低下を回避するメッセージシステム | |
US11455185B2 (en) | Service schedule optimization for background execution limits | |
JP2004192256A (ja) | ネットワークコントローラ | |
CN109462423B (zh) | 一种数据传输单元的检查方法、装置、设备和介质 | |
CN113612703B (zh) | 交换机的启动控制方法、装置、设备及介质 | |
US11563659B2 (en) | Edge alert coordinator for mobile devices | |
US12114408B2 (en) | Controller for providing uninterrupted control of a node in a lighting network and a method thereof | |
US20200226010A1 (en) | Netlink asynchronous notifications for native and third party application in distributed network systems | |
US20240143307A1 (en) | Scheduling a pausable automated process in a computer network | |
JP2018085694A (ja) | 中継装置及び通信システム | |
CN117675579A (zh) | 一种基于dpu服务网格加速的方法、系统及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18920461 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26.03.2021) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18920461 Country of ref document: EP Kind code of ref document: A1 |