CN110719665B - Script execution method and device based on light control system - Google Patents

Script execution method and device based on light control system Download PDF

Info

Publication number
CN110719665B
CN110719665B CN201910967636.6A CN201910967636A CN110719665B CN 110719665 B CN110719665 B CN 110719665B CN 201910967636 A CN201910967636 A CN 201910967636A CN 110719665 B CN110719665 B CN 110719665B
Authority
CN
China
Prior art keywords
action
script
execution
area
script file
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
CN201910967636.6A
Other languages
Chinese (zh)
Other versions
CN110719665A (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.)
Perfection Av Technology Zhejiang Co ltd
Original Assignee
Perfection Av Technology Zhejiang 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 Perfection Av Technology Zhejiang Co ltd filed Critical Perfection Av Technology Zhejiang Co ltd
Priority to CN201910967636.6A priority Critical patent/CN110719665B/en
Publication of CN110719665A publication Critical patent/CN110719665A/en
Application granted granted Critical
Publication of CN110719665B publication Critical patent/CN110719665B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a script execution method and a device based on a light control system, wherein the script execution method based on the light control system comprises the following steps: responding to a script loading trigger request, and acquiring and loading a script file containing a light show execution action from a specified path; analyzing the loaded script file, acquiring a time axis in the script file and action lines associated with the time axis, and storing the action lines in an action area according to a sequence; suspending a main execution thread according to predefined time on a time axis and sequentially taking out action rows from an action area according to the time axis, and after the main execution thread is recovered, loading the taken out action rows and starting a new thread to execute each action row; and extracting each action and the corresponding parameters from the action row, distributing each action to the corresponding execution function, acquiring the parameters required by the action by the execution function, and executing the corresponding action according to the acquired parameters.

Description

Script execution method and device based on light control system
Technical Field
The present invention relates to the field of lighting control, and in particular, to a script execution method and device based on a lighting control system.
Background
The realization of the lighting functionality and economy is the main idea of urban lighting construction, but with the technical progress and the progress of urban construction concept, the expression form of urban landscape lighting is reduced from the original single floodlighting to the large-scale LED multimedia and light show in the current large area, even the multi-form night scene display such as laser, 3D and holographic projection is added in the local area, and the lighting is changed into the urban landscape. With the advance of networking and intellectualization, the application of a new generation of communication technology and a light network protocol diversifies the expression carriers of the night scenes of the cities, and gradually becomes a novel landscape of the cities through a new means of beautifying the cities and improving the image of the cities by light art deduction.
In current light show control, the executive action of every light is write into in the main program, and the main program carries out according to the time axis in proper order, issues every light parameter to corresponding terminal lamps and lanterns when carrying out music control, from the synchronization that realizes light and music control. With the continuous development of the light show technology, the existing light show system is very huge, and the number of the tail-end lamps and the parameters of each lamp are very large. This results in a very large size of the main program and a large influence on the running speed.
Disclosure of Invention
The invention provides a script execution method and device based on a light control system, which can realize high-complexity light change at an execution speed block and overcome the problems of large scale of a main program and low operation speed in the existing light show control system.
In order to achieve the above object, the present invention provides a script execution method based on a light control system, which includes:
responding to a script loading trigger request, and acquiring and loading a script file containing a light show execution action from a specified path;
analyzing the loaded script file, acquiring a time axis and action lines associated with the time axis in the script file, and storing the action lines in an action area according to a sequence;
suspending a main execution thread according to predefined time on a time axis and sequentially taking out action rows from an action area according to the time axis, and after the main execution thread is recovered, loading the taken out action rows and starting a new thread to execute each action row;
and extracting each action and the corresponding parameters from the action row, distributing each action to the corresponding execution function, acquiring the parameters required by the action by the execution function, and executing the corresponding action according to the acquired parameters.
According to an embodiment of the present invention, when the loaded script file is parsed, an action region is created according to each time axis in the script file, and an action line under the time axis is stored in the action region.
According to an embodiment of the present invention, when the loaded script file is parsed, the contents in the script file are read line by line and each line of contents is divided into a comment area, an empty line area, or an action area according to a preset condition.
According to an embodiment of the invention, the script file is packaged after the annotation area, the blank area and the action area are obtained through analysis, and the action is obtained from the packaged action area when the script is executed.
According to an embodiment of the invention, the actions include the setting of the switch, color, position and direction of the end light fixture.
According to an embodiment of the invention, when the script file is loaded based on the loading trigger request, whether the specified path exists or not and whether the format of the file executed by the specified path is the script file format or not are checked.
On the other hand, the invention also discloses a script execution device based on the light control system, which comprises a script loading module, a script analysis module, a script execution module and an action execution module. And responding to the script loading triggering request, and acquiring and loading a script file containing the light show execution action from the specified path by the script loading module. The script analysis module analyzes the loaded script file, acquires a time axis and action lines related to the time axis in the script file and stores the action lines in the action area according to the sequence. The script execution module suspends the main execution thread according to the predefined time on the time axis and sequentially takes out the action lines from the action area according to the time axis, and after the main execution thread is recovered, the taken-out action lines are loaded and each action line starts a new thread to execute. The action execution module extracts each action and the corresponding parameters from the action row, distributes each action to the corresponding execution function, and the execution function acquires the parameters required by the action and executes the corresponding action according to the acquired parameters.
According to an embodiment of the invention, the script parsing module comprises a reading module, a creating module and a packaging module. The reading module reads the contents in the script file line by line and divides each line of contents into an annotation area, an empty line area or an action area according to preset conditions. The creating module creates an action area according to each time axis in the script file and stores the action lines under the time axis in the action area. And the packaging module is used for packaging after the script file is analyzed to obtain the comment area, the blank area and the action area.
According to an embodiment of the invention, the script execution device based on the light control system further comprises a verification module, and when the script file is loaded based on the loading trigger request, the verification module verifies whether the specified path exists and whether the format of the file executed by the specified path is the script file format.
In summary, the script execution method and device based on the light control system provided by the present invention store the program required for executing the light show action in the form of a script. And when the light show is controlled, loading and analyzing the script which stores the light show action in advance based on the script loading request to form an action area. Suspending the main execution thread and sequentially taking out action rows from the action area according to a time axis; and after the main execution thread is recovered, loading the taken action lines and starting a new thread to execute each action line, thereby realizing the synchronization of the issuing of the terminal lamp action and the audio frequency in the main execution thread and realizing the control of the light show. The calling in the script form greatly simplifies the program amount of the main execution thread, reduces the use of light show system resources and greatly improves the execution speed of the program.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
Fig. 1 is a flowchart illustrating a script execution method based on a light control system according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a script execution device based on a light control system according to an embodiment of the present invention.
Detailed Description
As shown in fig. 1, the script execution method based on the light control system provided in this embodiment includes: in response to the script loading trigger request, a script file containing the action of executing the light show is obtained and loaded from within the specified path (step S10). The loaded script file is parsed, the time axis and the action lines associated with the time axis in the script file are acquired, and the action lines are sequentially stored in the action area (step S20). The main execution thread is suspended according to the predefined time on the time axis and the action rows are sequentially fetched from the action area according to the time axis, and after the main execution thread is recovered, the fetched action rows are loaded and each action row starts a new thread to execute (step S30). Each action and the parameter corresponding to the action are extracted from the action row, each action is distributed to the corresponding execution function, the execution function acquires the parameter required for the action, and the corresponding action is executed according to the acquired parameter (step S40). The script execution method based on the light control system provided in this embodiment will be described in detail below with reference to fig. 1.
The light control system-based script execution method provided by this embodiment starts in step S10, where a script loading module in the light control system-based script execution device loads a pre-formed script file storing light actions from a designated path in response to a script loading trigger request. The script loading triggering request and the specified path are both arranged in the main execution thread. In this embodiment, when loading the script file based on the loading trigger request, it is checked whether the specified path exists and whether the format of the file executed by the specified path is the script file format. And when the specified path does not exist or the format of the script file in the specified path is incorrect, displaying that the loading fails.
The script file is a program file, and the program file usually includes comment information left by a program writer, a blank line, and the like in addition to the light action information. After the script file is loaded, step S20 is executed to parse the loaded script file and obtain the time axis and the action line related to the light control from the script file. In this embodiment, the following method is adopted for parsing the script file:
Reading the content in the script file line by line;
and judging whether the line is an annotation line, an empty line or a time line according to preset conditions. If the annotation line is the annotation line, the annotation line is placed in the annotation area, and if the annotation line is the empty line, the annotation line is placed in the empty line area; if the time axis is the time axis, an action area is created, and action lines under the time axis are placed in the action area in sequence. However, the present invention is not limited thereto. As for the conditions set in advance, specifically: for the comment line, the head of "#" is used when the script is written, so the given judgment condition is that whether the initial character of the line is "#" or not; if yes, the line is judged as an annotation line. For an empty line, judging whether the initial N continuous characters are all blank spaces or not; if yes, the behavior is judged to be empty. However, the present invention is not limited thereto. In other embodiments, other predetermined conditions may be used for the determination.
In order to reduce the space for storing data and increase the speed of loading subsequent actions, in this embodiment, the script file is packaged after being analyzed to obtain the comment area, the blank area, and the action area, and the actions are obtained from the packaged action area when the script is executed.
Then, step S30 is executed, the main execution thread is suspended according to the predefined time on the time axis and the action lines are sequentially fetched from the action area according to the time axis, after the main execution thread is resumed, the fetched action lines are loaded and each action line starts a new thread to execute. Because the main execution thread contains the audio and video execution programs, in order to realize the synchronization of the light control and the audio and video, the main execution thread needs to be suspended at a preset time point when the action is loaded. During which action lines are fetched from the action zone in turn according to a time axis, the fetched action lines being loaded and each enabling a new thread to execute when the main execution thread resumes. The new thread and the main execution thread are executed synchronously, so that the synchronization of light and audio is realized.
For light show control, each action is directed to a control object, which needs to be controlled according to a parameter during control. In the script content, each action line is packaged with a certain action and the corresponding parameter of the action, and the format of the package is fixed. After loading the action line in step S30, step S40 is executed to parse the action line according to the fixed format, and to separate the action and the parameters in the action line. And inputting the separated action execution into an execution function, and calling the corresponding parameter of the action by the execution function to realize the control of the light. The actions include the setting of the switch, color, position, and direction of the end light fixture. However, the present invention is not limited thereto.
Corresponding to the script execution method based on the light control system, the present embodiment further provides a script execution device of the light control system, which includes a script loading module 10, a script parsing module 20, a script execution module 30, and an action execution module 40. In response to the script loading trigger request, the script loading module 10 obtains and loads a script file containing the action of executing the light show from the designated path. The script parsing module 20 parses the loaded script file, obtains a time axis and action lines associated with the time axis in the script file, and stores the action lines in the action area in sequence. The script execution module 30 suspends the main execution thread according to the predefined time on the time axis and sequentially fetches the action lines from the action area according to the time axis, and after the main execution thread is recovered, the fetched action lines are loaded and each action line starts a new thread to execute. The action execution module 40 extracts each action and the corresponding parameter from the action row, distributes each action to the corresponding execution function, and the execution function acquires the parameter required by the action and executes the corresponding action according to the acquired parameter.
Furthermore, the script execution device based on the light control system also comprises a verification module, and when the script file is loaded based on the loading trigger request, the verification module verifies whether the specified path exists and whether the format of the file executed by the specified path is the script file format. When the specified path does not exist or the format of the script file in the specified path is incorrect, a loading failure is displayed.
In this embodiment, the script parsing module 20 includes a reading module 21, a creating module 22, and a packaging module 23. The reading module 21 reads the contents in the script file line by line and divides each line of contents into a comment area, an empty line area or an action area according to a preset condition. The creating module 22 creates an action area according to each time axis in the script file and stores the action line in the time axis in the action area. And the packing module 23 packs the script file after analyzing the script file to obtain the comment area, the blank area and the action area.
The operation principle of the script executing apparatus of the light control system provided in this embodiment is as described in steps S10 to S40 in the script executing method of the light control system in this embodiment, and is not described herein again.
In summary, the script execution method and device based on the light control system provided by the present invention store the program required for executing the light show action in the form of a script. And when the light show is controlled, loading and analyzing the script which stores the light show action in advance based on the script loading request to form an action area. Suspending the main execution thread and sequentially taking out action rows from the action area according to a time axis; and after the main execution thread is recovered, loading the taken action lines and starting a new thread to execute each action line, thereby realizing the synchronization of the issuing of the terminal lamp action and the audio frequency in the main execution thread and realizing the control of the light show. The calling in the script form greatly simplifies the program amount of the main execution thread, reduces the use of light show system resources and greatly improves the execution speed of the program.
Although the present invention has been described with reference to the preferred embodiments, it should be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims.

Claims (9)

1. A script execution method based on a light control system is characterized by comprising the following steps:
responding to a script loading trigger request, and acquiring and loading a script file containing a light show execution action from a specified path;
analyzing the loaded script file, acquiring a time axis in the script file and action lines associated with the time axis, and storing the action lines in an action area according to a sequence;
suspending a main execution thread according to a predefined time point on a time axis, sequentially taking out action lines from an action area according to the time axis during the suspension period of the main execution thread, loading the taken out action lines after the main execution thread is recovered, starting a new thread to execute each action line, and synchronously executing the new thread and the main execution thread;
and extracting each action and the corresponding parameters from the action row, distributing each action to the corresponding execution function, acquiring the parameters required by the action by the execution function, and executing the corresponding action according to the acquired parameters.
2. The light control system-based script execution method of claim 1, wherein when parsing the loaded script file, an action area is created according to each time axis in the script file and action lines under the time axis are stored in the action area.
3. A light control system-based script execution method according to claim 1, wherein when parsing the loaded script file, reading the contents in the script file line by line and dividing each content into a comment area, a blank area, or an action area according to a preset condition.
4. The light control system-based script execution method of claim 3, wherein the script file is packaged after parsing to obtain the comment area, the blank area and the action area, and the script executes to obtain the action from the packaged action area.
5. The light control system-based script execution method of claim 1, wherein the action comprises a setting of a switch, a color, a position, and a direction of an end light fixture.
6. A light control system-based script execution method according to claim 1, wherein when loading a script file based on a load trigger request, it is checked whether the designated path exists and whether the format of the file executed by the designated path is the script file format.
7. A script execution device based on a light control system is characterized by comprising:
the script loading module is used for responding to the script loading triggering request, and acquiring and loading a script file containing the light show execution action from the specified path;
the script analysis module is used for analyzing the loaded script file, acquiring a time axis and action lines related to the time axis in the script file and storing the action lines in the action area according to the sequence;
the script execution module suspends a main execution thread according to a predefined time point on a time axis, sequentially takes out action lines from the action area according to the time axis during the suspension of the main execution thread, loads the taken out action lines after the main execution thread is recovered, starts a new thread to execute each action line, and synchronously executes the new thread and the main execution thread;
and the action execution module extracts each action and the corresponding parameter from the action row, distributes each action to the corresponding execution function, acquires the parameter required by the action by the execution function and executes the corresponding action according to the acquired parameter.
8. The light control system-based script execution apparatus of claim 7, wherein the script parsing module comprises:
The reading module reads the contents in the script file line by line and divides each line of contents into an annotation area, an empty line area or an action area according to a preset condition;
the creating module is used for creating an action area according to each time shaft in the script file and storing the action lines under the time shaft in the action area; and
and the packaging module is used for packaging after the script file is analyzed to obtain the comment area, the blank area and the action area.
9. The light control system-based script execution apparatus according to claim 7, wherein the light control system-based script execution apparatus further comprises a checking module, and when the script file is loaded based on the loading trigger request, the checking module checks whether the specified path exists and whether a format of a file executed by the specified path is a script file format.
CN201910967636.6A 2019-10-12 2019-10-12 Script execution method and device based on light control system Active CN110719665B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910967636.6A CN110719665B (en) 2019-10-12 2019-10-12 Script execution method and device based on light control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910967636.6A CN110719665B (en) 2019-10-12 2019-10-12 Script execution method and device based on light control system

Publications (2)

Publication Number Publication Date
CN110719665A CN110719665A (en) 2020-01-21
CN110719665B true CN110719665B (en) 2022-06-28

Family

ID=69212571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910967636.6A Active CN110719665B (en) 2019-10-12 2019-10-12 Script execution method and device based on light control system

Country Status (1)

Country Link
CN (1) CN110719665B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111295023B (en) * 2020-03-25 2022-05-13 众盒智能科技(上海)有限公司 timeline city level light show deduction system and method
CN112306483A (en) * 2020-10-30 2021-02-02 广州小鹏汽车科技有限公司 Data processing method and device
CN113347754B (en) * 2021-08-05 2021-11-02 杭州米芯微电子有限公司 User programmable LED light control method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107426891A (en) * 2016-05-24 2017-12-01 创新科技有限公司 For the devices and methods therefor for the light behavior for controlling multiple light elements
CN206775797U (en) * 2017-03-31 2017-12-19 星联互动文化传播(天津)有限公司 A kind of stage light control system based on time shaft
CN107666745A (en) * 2016-07-28 2018-02-06 北京百牛环球科技有限公司 A kind of new system and method for realizing electric light dance
CN108196888A (en) * 2017-12-28 2018-06-22 福建海媚数码科技有限公司 A kind of control method and system of scene lamp
CN109413825A (en) * 2018-11-16 2019-03-01 合肥惠科金扬科技有限公司 A kind of lighting control circuit, Light Control Unit and colorful lamp
CN109461430A (en) * 2018-11-20 2019-03-12 福建海媚数码科技有限公司 A kind of Autonomous role vocal accompaniment method and system based on Karaoke antiphonal singing
CN109917701A (en) * 2019-02-15 2019-06-21 苏州禹娄文化传媒有限公司 A kind of automatic control system and its control method of intelligence light of stage show

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120084737A1 (en) * 2010-10-01 2012-04-05 Flextronics Id, Llc Gesture controls for multi-screen hierarchical applications
CN106332394B (en) * 2015-06-30 2019-03-26 芋头科技(杭州)有限公司 A kind of method and system that light is interacted with specific music
US10219354B2 (en) * 2016-08-12 2019-02-26 9255-7248 Québec Inc. Method and system for synchronizing lighting to music
CN108174498A (en) * 2017-12-28 2018-06-15 福建海媚数码科技有限公司 A kind of control method and system of the scene lamp based on intelligent Matching
CN110113852A (en) * 2019-05-22 2019-08-09 苏州金螳螂文化发展股份有限公司 Scene lamp control method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107426891A (en) * 2016-05-24 2017-12-01 创新科技有限公司 For the devices and methods therefor for the light behavior for controlling multiple light elements
CN107666745A (en) * 2016-07-28 2018-02-06 北京百牛环球科技有限公司 A kind of new system and method for realizing electric light dance
CN206775797U (en) * 2017-03-31 2017-12-19 星联互动文化传播(天津)有限公司 A kind of stage light control system based on time shaft
CN108196888A (en) * 2017-12-28 2018-06-22 福建海媚数码科技有限公司 A kind of control method and system of scene lamp
CN109413825A (en) * 2018-11-16 2019-03-01 合肥惠科金扬科技有限公司 A kind of lighting control circuit, Light Control Unit and colorful lamp
CN109461430A (en) * 2018-11-20 2019-03-12 福建海媚数码科技有限公司 A kind of Autonomous role vocal accompaniment method and system based on Karaoke antiphonal singing
CN109917701A (en) * 2019-02-15 2019-06-21 苏州禹娄文化传媒有限公司 A kind of automatic control system and its control method of intelligence light of stage show

Also Published As

Publication number Publication date
CN110719665A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
CN110719665B (en) Script execution method and device based on light control system
US10871973B2 (en) Application activation method and apparatus
US9740792B2 (en) Connection paths for application topology
KR20150079867A (en) Html5-protocol-based webpage presentation method and device
WO2021037050A1 (en) Code change method and device
CN106020823A (en) Front-end Web presentation and data separation as well as page quick response mode
CN102663002A (en) Method and system for structured-document rendering
CN104407863A (en) Abstract control model programming device and method
CN111083551A (en) Barrage rendering method and device, computer readable storage medium and computer equipment
CN110688601A (en) Data processing method and device
CN111158690A (en) Desktop application framework, construction method, desktop application running method and storage medium
CN109933410B (en) Virtual instruction issuing method and system based on virtualization technology
CN109597627A (en) A kind of component mounting method, device, storage medium and processor
CN107493200B (en) Optical disc image file creating method, virtual machine deploying method and device
CN110275706A (en) Program publication and loading method, device, computer system and readable storage medium storing program for executing
CN113656006B (en) Rich text rendering method and rendering device
CN112632425A (en) Method, device, equipment and storage medium for generating offline resource file
CN111414107A (en) Scalable vector graphics processing method and system
JP4087270B2 (en) Data processing apparatus, data processing method, data processing program, and recording medium
CN102227711A (en) Device and method for updating structured information
CN110413280B (en) Android system graph display method
CN107273165B (en) System and method for realizing module dynamic calling
JP5702265B2 (en) Program automatic generation apparatus and program automatic generation method
CN110110073B (en) Character display method and device
CN113268221A (en) File matching method and device, storage medium and computer equipment

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