CN112835681A - Front-end script construction method and device and controller - Google Patents

Front-end script construction method and device and controller Download PDF

Info

Publication number
CN112835681A
CN112835681A CN202110208255.7A CN202110208255A CN112835681A CN 112835681 A CN112835681 A CN 112835681A CN 202110208255 A CN202110208255 A CN 202110208255A CN 112835681 A CN112835681 A CN 112835681A
Authority
CN
China
Prior art keywords
task
end script
subtasks
construction
script
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.)
Pending
Application number
CN202110208255.7A
Other languages
Chinese (zh)
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.)
Beijing Dingxiang Technology Co ltd
Original Assignee
Beijing Dingxiang Technology 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 Beijing Dingxiang Technology Co ltd filed Critical Beijing Dingxiang Technology Co ltd
Priority to CN202110208255.7A priority Critical patent/CN112835681A/en
Publication of CN112835681A publication Critical patent/CN112835681A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The invention relates to a front-end script construction method, a front-end script construction device and a controller, wherein the front-end script construction method comprises the following steps: defining a subtask; determining a task queue according to actual requirements; arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task; and executing the front-end script building task. The invention provides a script construction task management method aiming at the field of front ends. The method can refine the script construction task, support the front-end script to organize towards the application scene, and subdivide into different subtasks according to the script construction task function. The scheme supports streaming management of subtasks and supports sequential execution and parallel execution of the tasks. The front-end script construction method can improve the reuse rate of the front-end script construction task, refine the front-end script construction task and improve the maintainability and sustainability of the script task.

Description

Front-end script construction method and device and controller
Technical Field
The invention relates to the technical field of browser front-end development, in particular to a front-end script construction method and device and a controller.
Background
As the information contained in web pages becomes richer, the front-end script program for building web pages also becomes more complex. At present, in order to improve the development efficiency of front-end JavaScript programs, a modular development mode is generally adopted to reduce the complexity of editing. However, in the prior art, developers need to create corresponding front-end script building schemes according to each specific requirement, the reuse rate of the front-end script building schemes is low, and the maintainability and the continuity of script tasks are poor.
Disclosure of Invention
In view of the above, the present invention provides a front-end script constructing method, apparatus and controller to overcome the disadvantages of the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme: a front-end script construction method, comprising:
defining a subtask;
determining a task queue according to actual requirements;
arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and executing the front-end script building task.
Optionally, the defining the subtasks includes:
and defining the subtasks by a JavaScript module mode.
Optionally, all subtasks follow the public API settings;
the defining of the subtasks specifically includes:
specifying a task name, task options, and a task callback function.
Optionally, the parameter of the task callback function is compatible with the signature of the node.js callback function; js is the operating environment of the front-end script construction task.
Optionally, the task queue includes:
a first task queue for sequential execution, and a plurality of second task queues for parallel execution.
Optionally, the arranging and organizing the corresponding subtasks according to the task queue includes:
and performing sequential arrangement and/or parallel arrangement on the corresponding subtasks according to the task queue.
Optionally, the executing the front-end script building task includes:
the first task queue is executed sequentially and/or a designated plurality of second task queues are executed in parallel.
The invention also provides a front-end script constructing device, which comprises:
the definition module is used for defining the subtasks;
the determining module is used for determining the task queue according to the actual requirement;
the task arranging module is used for arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and the task execution module is used for executing the front-end script construction task.
The invention also provides a controller for executing the front-end script building method.
The present invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, performing a front-end script construction method, comprising:
defining a subtask;
determining a task queue according to actual requirements;
arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and executing the front-end script building task.
By adopting the technical scheme, the front-end script construction method comprises the following steps: defining a subtask; determining a task queue according to actual requirements; arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task; and executing the front-end script building task. The invention provides a script construction task management method aiming at the field of front ends. The method can refine the script construction task, support the front-end script to organize towards the application scene, and subdivide into different subtasks according to the script construction task function. The scheme supports streaming management of subtasks and supports sequential execution and parallel execution of the tasks. The front-end script construction method can improve the reuse rate of the front-end script construction task, refine the front-end script construction task and improve the maintainability and sustainability of the script task.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a front-end script construction method of the present invention;
fig. 2 is a schematic structural diagram provided by a front-end script constructing apparatus of the present invention.
In the figure: 1. a definition module; 2. a determination module; 3. a task arrangement module; 4. and a task execution module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
Fig. 1 is a schematic flow chart provided by a front-end script construction method according to the present invention.
As shown in fig. 1, a front-end script construction method according to the present invention includes:
s11: defining a subtask;
further, the defining of the subtasks includes:
and defining the subtasks by a JavaScript module mode.
Further, all subtasks follow the public API settings;
the defining of the subtasks specifically includes:
specifying a task name, task options, and a task callback function.
Furthermore, the parameter of the task callback function is compatible with the signature of the node.js callback function; js is the operating environment of the front-end script construction task.
S12: determining a task queue according to actual requirements;
further, the task queue includes:
a first task queue for sequential execution, and a plurality of second task queues for parallel execution.
S13: arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
further, the arranging and organizing the corresponding subtasks according to the task queue includes:
and performing sequential arrangement and/or parallel arrangement on the corresponding subtasks according to the task queue.
S14: and executing the front-end script building task.
Further, the executing the front-end script building task includes:
the first task queue is executed sequentially and/or a designated plurality of second task queues are executed in parallel.
When the front-end script construction method is actually executed, the subtasks are defined in a JavaScript module mode, and all the subtasks follow the public API setting. Defining a subtask requires specifying a task name, task options, and a task callback function.
It should be noted that, in order to be compatible with node.js (i.e., the operating environment when the front-end script constructs a task), the parameter of the task callback function is compatible with the signature of the node.js callback function.
Orchestration and organization of tasks: organizing front-end script construction tasks through a task queue according to actual requirements and sequentially executing the tasks; if parallel execution is required, a subtask queue may be specified, as well as a parallel execution task queue.
The method of the invention can effectively refine each front-end terminal task by supporting task refinement and task arrangement, and the subtasks can be flexibly arranged and reused. The method determines the task queue according to the actual requirement, arranges and organizes the corresponding subtasks according to the task queue, supports the sequential arrangement and the parallel arrangement of the subtasks, can meet the requirements of actual application scenes constructed by various front-end scripts, can reduce the maintenance cost of the constructed scripts and is beneficial to improving the code reuse rate.
The front-end script construction method provided by the invention supports streaming management on subtasks and sequential execution and parallel execution of the tasks, can improve the reuse rate of the front-end script construction tasks, refines the front-end script construction tasks and can also improve the maintainability and sustainability of the script tasks.
Fig. 2 is a schematic structural diagram provided by a front-end script constructing apparatus of the present invention.
As shown in fig. 2, the front-end script constructing apparatus according to the present invention includes:
the definition module 1 is used for defining subtasks;
the determining module 2 is used for determining a task queue according to actual requirements;
the task arranging module 3 is used for arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and the task execution module 4 is used for executing the front-end script construction task.
The working principle of the front-end script constructing apparatus described in this embodiment is the same as that of the front-end script constructing method described in fig. 1, and is not described herein again.
The front-end script constructing device provided by the invention supports streaming management on subtasks and sequential execution and parallel execution of the tasks, can improve the reuse rate of the front-end script constructing task, refines the front-end script constructing task and simultaneously can improve the maintainability and sustainability of the script task.
The invention also provides a controller for executing the front-end script building method described in fig. 1.
Furthermore, the present invention provides a computer-readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform a front-end script construction method, including:
defining a subtask;
determining a task queue according to actual requirements;
arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and executing the front-end script building task.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A front-end script construction method is characterized by comprising the following steps:
defining a subtask;
determining a task queue according to actual requirements;
arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and executing the front-end script building task.
2. The front-end script building method of claim 1, wherein said defining a subtask comprises:
and defining the subtasks by a JavaScript module mode.
3. The front-end script building method according to claim 1,
all subtasks follow the published API settings;
the defining of the subtasks specifically includes:
specifying a task name, task options, and a task callback function.
4. The front-end script building method according to claim 3,
the parameter of the task callback function is compatible with the signature of the node.js callback function; js is the operating environment of the front-end script construction task.
5. The front-end script building method according to any one of claims 1 to 4, wherein the task queue comprises:
a first task queue for sequential execution, and a plurality of second task queues for parallel execution.
6. The front-end script building method according to any one of claims 1 to 4, wherein the arranging and organizing the corresponding subtasks according to the task queue comprises:
and performing sequential arrangement and/or parallel arrangement on the corresponding subtasks according to the task queue.
7. The front-end script building method of claim 5, wherein said performing the front-end script building task comprises:
the first task queue is executed sequentially and/or a designated plurality of second task queues are executed in parallel.
8. A front-end script building apparatus, comprising:
the definition module is used for defining the subtasks;
the determining module is used for determining the task queue according to the actual requirement;
the task arranging module is used for arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and the task execution module is used for executing the front-end script construction task.
9. A controller configured to perform the front-end script construction method of any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, performing a front-end script construction method, comprising:
defining a subtask;
determining a task queue according to actual requirements;
arranging and organizing corresponding subtasks according to the task queue to form a front-end script construction task;
and executing the front-end script building task.
CN202110208255.7A 2021-02-25 2021-02-25 Front-end script construction method and device and controller Pending CN112835681A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110208255.7A CN112835681A (en) 2021-02-25 2021-02-25 Front-end script construction method and device and controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110208255.7A CN112835681A (en) 2021-02-25 2021-02-25 Front-end script construction method and device and controller

Publications (1)

Publication Number Publication Date
CN112835681A true CN112835681A (en) 2021-05-25

Family

ID=75933397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110208255.7A Pending CN112835681A (en) 2021-02-25 2021-02-25 Front-end script construction method and device and controller

Country Status (1)

Country Link
CN (1) CN112835681A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043390A (en) * 2007-04-20 2007-09-26 北京航空航天大学 Grid system performance detection process and grid system performance detection control device
CN106569783A (en) * 2015-10-08 2017-04-19 腾讯科技(深圳)有限公司 Task script executing method and apparatus
US10095539B2 (en) * 2016-07-25 2018-10-09 International Business Machines Corporation Automated data structure-driven orchestration of complex server provisioning tasks
CN111930421A (en) * 2020-07-31 2020-11-13 中电鸿信信息科技有限公司 DevOps-based free layout monitoring system and using method thereof
CN112231040A (en) * 2020-10-30 2021-01-15 中国科学院空天信息创新研究院 Method and device for editing time sequence task in software system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043390A (en) * 2007-04-20 2007-09-26 北京航空航天大学 Grid system performance detection process and grid system performance detection control device
CN106569783A (en) * 2015-10-08 2017-04-19 腾讯科技(深圳)有限公司 Task script executing method and apparatus
US10095539B2 (en) * 2016-07-25 2018-10-09 International Business Machines Corporation Automated data structure-driven orchestration of complex server provisioning tasks
CN111930421A (en) * 2020-07-31 2020-11-13 中电鸿信信息科技有限公司 DevOps-based free layout monitoring system and using method thereof
CN112231040A (en) * 2020-10-30 2021-01-15 中国科学院空天信息创新研究院 Method and device for editing time sequence task in software system

Similar Documents

Publication Publication Date Title
US10761899B2 (en) Framework to improve parallel job workflow
CN111142867A (en) Service visual arrangement system and method under micro-service architecture
US5448735A (en) Task organization for execution using linked records referencing code modules
US7752189B2 (en) Signal processing apparatus and method thereof
US20110131329A1 (en) Application processing allocation in a computing system
WO2013110966A1 (en) Parameterized dynamic model for cloud migration
CN111897633A (en) Task processing method and device
CN113885945B (en) Calculation acceleration method, equipment and medium
AU2018324192A1 (en) Scalable techniques for executing custom algorithms on media items
CN110083417B (en) User interface response method and device
CN111737275A (en) Database update event processing method and device and computer readable storage medium
CN111736950A (en) Accelerator resource adding method of virtual machine and related device
CN111338769A (en) Data processing method and device and computer readable storage medium
CN111158800A (en) Method and device for constructing task DAG based on mapping relation
CN112835681A (en) Front-end script construction method and device and controller
CN113010280A (en) Distributed task processing method, system, device, equipment and medium
US20220229689A1 (en) Virtualization platform control device, virtualization platform control method, and virtualization platform control program
CN111310638A (en) Data processing method and device and computer readable storage medium
US20160112480A1 (en) Streaming data on data processes
KR101984635B1 (en) Arithmetic processing apparatus and method for high speed processing to application
CN110599112A (en) Method and device for developing and maintaining network page
CN110109747B (en) Apache Spark-based data exchange method, system and server
CN110445874B (en) Session processing method, device, equipment and storage medium
CN113347263B (en) Message cluster management method and system
CN116795440A (en) Multi-type display card driving adaptation method, device and equipment based on virtualization technology

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