Courseware running method, configuration method, device, electronic device and storage medium
Through the decoupling of the business side and development side in online education through DSL language, efficient configuration and logical reuse of interactive courseware are realized, problems of high development difficulty and technology stack dependence are solved, and flexible technology stack switching is supported.
Patent Information
- Application Number
- CN202110883348.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-02
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-08-02
AI Technical Summary
In the field of online education, the development of interactive courses is difficult, and the business side and the development side are highly coupled, making it difficult to reuse the courseware logic, and the coding needs to be zero-coded when replacing the technology stack.
The domain-specific language (DSL) is used as the intermediate bridge. The business side configures the courseware configuration file through DSL, and the runtime is resolved into a technology stack language to achieve decoupling between the business side and the development side, and executes the logic through component objects, variables and event monitoring.
It reduces development difficulty, improves development efficiency, realizes the reuse of courseware logic and flexible switching of the technology stack without the need for zero coding.
Smart Images

Figure CN113568709B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology. Specifically, it relates to a method for running a courseware, a method for configuring a courseware configuration file, a device, an electronic device, and a computer-readable storage medium. Background Art
[0002] Currently, in the field of online education, the production method of interactive courses is that, according to the material package, the interactive script logic and gameplay logic of the courseware, software developers use technologies such as cocos2d to customize the development for the above content.
[0003] In this method, all the interaction logic and gameplay logic are implemented by the customized code developed by developers. In this way, in the program implementation, the business side and the development side need to be highly coupled, which requires developers to fully understand the business intentions of the business side personnel, and the development difficulty is relatively high. Moreover, in this method, the courseware interaction logic completely depends on the adopted technology stack. When it is desired to use other technology stacks for implementation, it is necessary to code from scratch, and the courseware logic on the business side cannot be reused. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a method for running a courseware, a method for configuring a courseware configuration file, a device, an electronic device, and a computer-readable storage medium, so as to achieve the decoupling of the business side and the development side, reduce the development difficulty, improve the development efficiency, and reduce the dependence on the technology stack.
[0005] The embodiments of this application provide a method for running a courseware, including: when receiving a courseware learning instruction, obtaining the courseware configuration file corresponding to the courseware learning instruction; the courseware configuration file is configured according to the set DSL (domain-specific language) semantic specification; parsing the courseware configuration file into a technical stack language description according to the DSL semantic specification, and executing it.
[0006] In the above implementation process, the DSL language is used as an intermediate bridge, enabling the business side to configure the courseware configuration file through the DSL language. At runtime, the courseware configuration file is parsed into a technology stack language description and executed according to the DSL semantic specification. This allows the business side to only need to configure the courseware configuration file based on the more general DSL language, and at runtime, only need to parse the courseware configuration file into a technology stack language description according to the defined DSL semantic specification. Thus, for the development side, only the DSL language and the required language parser need to be defined, effectively achieving the decoupling of the business side and the development side, reducing the development difficulty, and improving the development efficiency. At the same time, due to the decoupling of the business side and the development side, when it is necessary to replace the new technology stack to run the courseware, only the courseware configuration file needs to be parsed into the technology stack language description of the new technology stack according to the DSL semantic specification, without having to code from scratch, and the courseware logic on the business side can be reused.
[0007] Further, the content of the courseware configuration file includes: component objects, which are the smallest granularity objects used to describe the courseware content; variables, which are used to describe the data generated when the component objects are executed; event listening, which determines whether a certain event in the courseware is triggered by listening to the data of the variables; and syntax logic, which is used to describe the execution logic of the component objects under different events.
[0008] Correspondingly, the process of executing the courseware configuration file described in the technology stack language includes: loading and rendering the component objects that are played by default; listening to the variable data generated during the rendering process; the variable data is the data corresponding to the variables defined in the courseware configuration file; when it is monitored that the variable data meets the preset event trigger condition, parsing the syntax logic of the event triggered by the event trigger condition, and executing the component objects called in the syntax logic.
[0009] In the above implementation process, by defining the component objects, variables, and syntax logic of each event, and by listening to the variables generated during the execution of the component objects to determine the triggered events, and then executing the component objects called in the syntax logic according to the syntax logic of the triggered events, the content of the entire courseware can be executed according to the requirements. And in this process, by taking the component objects as the basis and the events as the basic trigger units of the entire execution process, the actual characteristics of the courseware in the online education field can be effectively adapted. When developing new courseware, various existing component objects can be flexibly configured and used without the need for additional re-development.
[0010] Further, the component objects include at least one of the following: video, audio, picture, and question.
[0011] In the above implementation process, by using at least one of video, audio, picture, and test questions as component objects, the smallest granularity description of the courseware content can be achieved. On the one hand, it is convenient for the business side to configure the courseware configuration file, and on the other hand, it is also convenient for the interpretation end (i.e., the device running the courseware) to parse and execute.
[0012] Further, the content of the courseware configuration file further includes: custom functions; the custom functions are functions obtained by functionalizing the same logical parts in the syntax logics of at least two different events; in the syntax logics of the at least two different events, there is a call relationship of the custom functions.
[0013] In the above implementation process, by abstracting the same logical parts in the syntax logics of at least two different events and processing them functionally into custom functions. In this way, in the syntax logics of these abstracted events, only the call relationship of the custom function needs to be written, and there is no need to repeatedly configure this part of the shared logic for each event's syntax logic, thereby reducing the size of the courseware configuration file and achieving effective resource reuse.
[0014] The embodiment of the present application further provides a method for configuring a courseware configuration file, including: determining the materials required for the courseware to be configured; determining the events existing in the courseware to be configured; configuring the component objects and syntax logics of each event in the courseware configuration file according to the materials; the syntax logic is used to describe the execution logic of each component object of the event; configuring the variables existing in the courseware to be configured in the courseware configuration file; the variables are used to describe the data generated when the component object is executed; configuring event listening in the courseware configuration file to listen to the data of the variables when the courseware configuration file is executed to determine whether a certain event in the courseware is triggered.
[0015] In the above implementation process, by configuring component objects, variables, and the syntax logics of each event, and by listening to the variables generated during the execution of the component objects to determine the triggered event, the component objects called in the syntax logic can be executed according to the syntax logic of the triggered event, so that the content of the entire courseware can be executed according to the requirements. And in this solution, by taking the component object as the basis and the event as the basic trigger unit of the entire execution process, it can effectively adapt to the actual characteristics of the courseware in the online education field. When developing new courseware, various existing component objects can be flexibly configured and used without additional re-development.
[0016] An embodiment of the present application further provides a courseware running device, including: an acquisition module, configured to acquire a courseware configuration file corresponding to the courseware learning instruction when receiving the courseware learning instruction; the courseware configuration file is configured according to the set domain-specific language (DSL) semantic specification; a running module, configured to parse the courseware configuration file into a technology stack language description according to the DSL semantic specification and execute it.
[0017] Further, the content of the courseware configuration file includes: a component object, which is the smallest granularity object for describing courseware content; a variable, which is used to describe the data generated when the component object is executed; an event listener, which determines whether a certain event in the courseware is triggered by listening to the data of the variable; a syntax logic, which is used to describe the execution logic of the component object under different events; the running module is specifically configured to execute the courseware configuration file described in the technology stack language in the following manner: load and render the component object that is played by default; listen to the variable data generated during the rendering process; the variable data is the data corresponding to the variable defined in the courseware configuration file; when it is monitored that the variable data meets the preset event trigger condition, parse the syntax logic of the event triggered by the event trigger condition, and execute the component object called in the syntax logic.
[0018] Further, the component object includes at least one of the following: video, audio, picture, test question.
[0019] An embodiment of the present application further provides an electronic device, including a processor, a memory, and a communication bus; the communication bus is used to realize the connection and communication between the processor and the memory; the processor is configured to execute one or more programs stored in the memory to implement the courseware running method of any one of the above.
[0020] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the courseware running method of any one of the above. Description of the Drawings
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0022] Figure 1 It is a schematic flowchart of a configuration method for a courseware configuration file provided by an embodiment of the present application;
[0023] Figure 2 Schematic diagram of a DSL language structure provided by an embodiment of the present application;
[0024] Figure 3 More specific schematic diagram of a DSL language structure provided by an embodiment of the present application;
[0025] Figure 4 Schematic flow chart of a courseware running method provided by an embodiment of the present application;
[0026] Figure 5 Schematic diagram of an overall development architecture provided by an embodiment of the present application;
[0027] Figure 6 Schematic diagram of the structure of a courseware running device provided by an embodiment of the present application;
[0028] Figure 7 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Specific implementation manners
[0029] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
[0030] Embodiment 1:
[0031] In order to achieve decoupling between the service side and the development side, reduce the development difficulty, improve the development efficiency, and reduce the dependence on the technology stack, an embodiment of the present application provides a configuration method for a courseware configuration file and a courseware running method.
[0032] Reference may be made to Figure 1 as shown in Figure 1 Schematic flow chart of a configuration method for a courseware configuration file provided by an embodiment of the present application, including:
[0033] S101: Determine the materials required for the courseware to be configured.
[0034] It should be noted that the materials described in the embodiments of the present application refer to the basic materials used to configure the courseware, which may be one or more of resources such as videos, audios, pictures, test questions, etc.
[0035] It should be noted that the videos described in the embodiments of the present application include, but are not limited to, continuous image signals in which each frame of image is obtained by real-time capturing of natural scenes or moving objects, or continuous image signals in which each frame of image is generated manually or by a computer (such as animations), or continuous image signals mixed with image signals obtained by real-time capturing of natural scenes or moving objects and image signals generated manually or by a computer.
[0036] In the embodiments of the present application, animations may include content such as teaching animations and transition animations.
[0037] In the embodiments of the present application, the audio may include contents such as dialogues, teaching voices, etc.
[0038] In the embodiments of the present application, the pictures may include animated pictures made by humans or computers, and may also include photos obtained by capturing natural scenes or moving objects in real time.
[0039] In the embodiments of the present application, the materials required for the courseware to be configured can be pre-determined by the personnel on the business side.
[0040] In the embodiments of the present application, the personnel on the business side include, but are not limited to, teachers, courseware designers, material managers, etc.
[0041] S102: Determine the events existing in the courseware to be configured.
[0042] In the embodiments of the present application, during the operation of the courseware, it is often necessary to complete multiple different goals, and the completion of each goal requires different materials to be executed according to different logics. In the embodiments of the present application, the corresponding events can be determined based on the goals to be completed.
[0043] For example, during an interactive class, after watching a certain video, it may be necessary to further provide some questions to the user for testing. Then watching the video is a goal and can be defined as an event, and providing questions to the user is another goal and can be defined as an event.
[0044] It should be understood that the specific division granularity of the events can be combined or independently divided by the course configurator for components according to the course. For example, in the above example, watching the video and providing questions to the user can also be regarded as a learning event. Also, for example, each required behavior can be defined as an event. For example, behaviors such as playing, stopping, and clicking can generate an event. The specific event division method is not limited in the embodiments of the present application.
[0045] It should be noted that step S102 can be determined by the personnel on the business side themselves. It can be reflected in a specific form, such as being recorded on paper or on a computer, but it can also not be reflected in a specific form and only be determined in the mind. It should be understood that whether it is reflected in a specific form or not, as long as the component objects and syntax logics are configured in units of events subsequently, then undoubtedly, the personnel on the business side actually execute this step.
[0046] It should be noted that in the embodiments of the present application, when configuring the courseware configuration file, it needs to be configured in the manner of DSL language. It should be understood that the DSL language is a language that views code more from the perspective of customers and defines functions, and it can be implemented by defining new language structures through languages such as C, C++, and JAVA.
[0047] In the embodiments of the present application, in order to configure the courseware configuration file in the manner of DSL language, it is necessary to first define the DSL language structure applicable to the present application.
[0048] Please refer to Figure 2 as shown Figure 2 The language structure of the DSL provided by the embodiments of the present application includes:
[0049] Component objects, which are the smallest granularity objects used to describe the courseware content; for example, they can be video, audio, spine animation, etc.
[0050] Variables, which are used to describe the data generated when the component object is executed. It should be understood that variables will be generated when the component object runs. For example, when a video is clicked, variables such as click position and other data will be generated.
[0051] Event listening, which determines whether a certain event in the courseware is triggered by listening to the data of the variable. It should be understood that in the embodiments of the present application, the dependencies between events in the courseware are driven by listening to variable data.
[0052] Syntax logic, which is used to describe the execution logic of component objects under different events. In the embodiments of the present application, the syntax logic can include one or more of sequential execution syntax, parallel execution syntax, judge determination syntax, if else syntax, case when syntax, conditional expression syntax, system commands, etc., so as to describe the execution logic of each component object for events through these syntaxes.
[0053] Based on the above DSL language structure (also referred to as the DSL semantic specification later), the subsequent specific configuration process can be carried out.
[0054] It should be understood that the DSL language structure can be defined before step S101 and step S102.
[0055] S103: Configure the component objects and syntax logic of each event in the courseware configuration file according to the materials.
[0056] It should be noted that in the embodiments of the present application, the component object can be one or more of the materials, that is, it can be one or more of resources such as video, audio, picture, test questions, etc. as materials.
[0057] In step S103, by configuring the component objects and syntax logic for each event, it is possible to effectively define in the courseware configuration file which component objects need to be executed when each event in the courseware is executed, and what the execution logic of each component object is.
[0058] For example, for a video viewing event, assuming it includes 3 component objects, namely Video 1, Video 2, and Video 3, through the syntax logic, it can be defined to play Video 1 first, then play Video 2 after Video 1 is played, and then play Video 3 after Video 2 is played. In this way, when subsequently parsing and executing the courseware configuration file, for this video viewing event, Video 1 will be played first, then Video 2 after Video 1 is played, and then Video 3 after Video 2 is played.
[0059] It should be noted that in the actual application process, there may be the same logical parts in the syntax logics of different events. In the embodiments of the present application, as shown in Figure 3 When defining the language structure of the DSL, custom functions can also be defined, so as to abstract the same logical parts in the syntax logics of at least two different events. This part can be used as the common logical part in the syntax logics of these different events. Then, through the functional operation, this common logical part is converted into a function (i.e., the custom function described in the present application). Furthermore, in the corresponding syntax logic, only the call relationship of this custom function needs to be written (such as writing the function name of the custom function to be called by calling the function).
[0060] It should be noted that the functional operation refers to expressing according to the logic of this common logical part in the form of a function. In the embodiments of the present application, the custom function can be obtained by the developer after abstraction and then performing the functional operation.
[0061] S104: Configure the variables existing in the courseware to be configured in the courseware configuration file.
[0062] It should be understood that some variable data will be generated when the component object runs. In the embodiments of the present application, these variables can be predefined to cooperate with the execution of the component object.
[0063] S105: Configure event listening in the courseware configuration file to listen to the data of the variables when the courseware configuration file is executed, so as to determine whether a certain event in the courseware is triggered.
[0064] In the embodiments of the present application, the types of variables to be listened to and the corresponding trigger conditions of each variable can be configured, so as to implement the event listening configuration, and thus determine whether to trigger a new event according to the data of the listened variables.
[0065] It should be noted that in the embodiments of the present application, when configuring variables, variable specifications can be predefined, so that variables can be configured according to the defined variable specifications. For example, for a position variable, the position change range of the variable can be predefined in advance, and then the trigger condition of the variable can be configured within the position change range. It should be understood that the so-called variable specification refers to the rules for restricting the usage of variables. In the previous example, it is the numerical range of the variable that is restricted.
[0066] It should be noted that in the embodiments of the present application, by using the above configuration method to configure the courseware configuration file, the configurator only needs to focus on the dependency relationships between the events of the courseware, the component objects required for each event, and the execution order of each component object, which is more user-friendly for business-side personnel.
[0067] In the embodiments of the present application, refer to Figure 4 as shown in Figure 4 which shows the courseware running method provided by the embodiments of the present application, including:
[0068] S401: When receiving a courseware learning instruction, obtain the courseware configuration file corresponding to the courseware learning instruction.
[0069] It should be noted that in the embodiments of the present application, the courseware configuration file should be configured according to the set domain-specific language DSL semantic specification. Its specific configuration method can be implemented by using the configuration method of the courseware configuration file described above.
[0070] It should also be noted that in the embodiments of the present application, the above courseware running method can run on the device held by the user. At this time, the courseware learning instruction can be sent by the user through the corresponding APP (Application) interface and then received by the device.
[0071] In addition, in the embodiments of the present application, the above courseware running method can run on the server. At this time, the user sends a courseware learning instruction for a certain courseware to the server through the device held by himself / herself. Then the server executes the courseware running method of the present application and returns the latest playback content to the device held by the user in real time during the parsing process.
[0072] S402: Parse the courseware configuration file into a technology stack language description according to the DSL semantic specification and execute it.
[0073] In the embodiments of the present application, according to the technology stack adopted by the device running the courseware running method, a corresponding syntax parser can be used to parse the courseware configuration file, so as to translate the DSL language into the technology stack language that can be recognized by the technology stack of the device itself, and then execute it.
[0074] In the embodiments of the present application, when executing the courseware configuration file described in the technology stack language, the component objects for default playback can be loaded and rendered, and then the variable data generated during the rendering process is listened to. When it is monitored that the variable data meets the preset event trigger conditions, the syntax logic of the event triggered by the event trigger conditions is parsed, and the component objects called in the syntax logic are executed.
[0075] It should be understood that when the component objects called in the syntax logic are executed, these component objects will also generate variable data, and continue to listen to these variable data, so as to repeat the foregoing process until the entire parsing and execution process of the courseware configuration file ends after encountering the scene end command.
[0076] It should be understood that in the embodiments of the present application, executing the component objects called in the syntax logic means loading and rendering the component objects, so as to realize the continuous operation of the courseware and achieve the effect of playing the courseware.
[0077] It should be noted that the component objects for default playback described in the embodiments of the present application may include background pictures, background content, initial state positions of NPCs (Non Player Characters), dialogues, videos, etc., but are not limited thereto. The specific component objects for default playback can be preset by engineers. Exemplarily, the component objects for default playback and the syntax logic of these component objects can be defined in the courseware configuration file as the component objects and syntax logic of the initial events directly triggered by default.
[0078] The configuration method of the courseware configuration file and the courseware running method provided by the embodiments of the present application configure the component objects, variables, and syntax logic of each event, and determine the triggered events by listening to the variables generated during the execution process of the component objects. Thus, the component objects called in the syntax logic can be executed according to the syntax logic of the triggered events, so that the content of the entire courseware can be executed according to the requirements. And in this solution, by taking the component objects as the basis and the events as the basic trigger units of the entire execution process, it can effectively adapt to the actual characteristics of the courseware in the field of online education. When new courseware needs to be developed, various existing component objects can be flexibly configured and used without additional re-development.
[0079] In addition, in this application, the DSL language is used as an intermediate bridge, allowing the business side to configure the courseware configuration file through the DSL language. During runtime, the courseware configuration file is parsed into a technology stack language description and executed according to the DSL semantic specification. This enables the business side to only need to configure the courseware configuration file according to the more general DSL language, and only need to parse the courseware configuration file into a technology stack language description according to the defined DSL semantic specification during runtime. Therefore, for the development side, only the DSL language and the required language parser need to be defined, effectively achieving the decoupling of the business side and the development side, reducing the development difficulty, and improving the development efficiency. At the same time, due to the decoupling of the business side and the development side, when a new technology stack needs to be replaced to run the courseware, only the courseware configuration file needs to be parsed into a technology stack language description of the new technology stack according to the DSL semantic specification, without coding from scratch, and the courseware logic on the business side can be reused.
[0080] Embodiment 2:
[0081] Based on Embodiment 1, taking the Figure 3 language structure of the DSL shown as an example, the solution of the embodiment of this application will be further illustrated by examples.
[0082] In the embodiment of this application, first, with an object-oriented thinking, definitions such as component objects, variables of component objects, event listeners, and logical syntax are abstracted, as shown in Figure 3 shown.
[0083] As shown in Figure 5 shown, both the course production end (static) and the course interpretation end (dynamic at runtime) take the DSL as the core, and the two ends interact and transform through the DSL, converting the original compilation time into runtime.
[0084] The course production end is responsible for the production of courseware configuration, mainly for business-side personnel. The business-side personnel configure it according to the Figure 3 definitions shown, and produce a courseware configuration file that conforms to the DSL semantic specification (its format can be in json format, xml format, etc., which is not limited in the embodiment of this application).
[0085] The course interpretation end is responsible for the presentation of the courseware, mainly for students. The course interpretation end parses the courseware configuration file into a technology stack language that can be recognized by the technology stack on the course interpretation end according to the DSL semantic specification. The specific process is as follows:
[0086] During the period when students are having classes, the course interpretation end first obtains the courseware configuration file, and then parses the courseware configuration file according to the DSL semantic specification, so that the courseware configuration file can be described by a technology stack language that can be recognized by the technology stack of the course interpretation end.
[0087] After that, the default playback components (such as background images, background content, NPC initial state position, dialogues, videos, etc.) are loaded and rendered first. During the rendering and loading process, runtime variable data (such as dialogue playback completion, video playback completion, NPC movement completion, etc.) will be generated and stored in the memory of the course interpretation end.
[0088] When the variable data is generated, the monitoring of this variable will be triggered. At this time, if it is found that the monitored variable data meets the preset event triggering condition, the event corresponding to this event triggering condition will be triggered.
[0089] Parse the grammatical logic in the event and execute the component objects called in the grammatical logic (such as executing video playback, audio playback, etc.). After the students finish watching the video or audio, or answering the test questions, variable data will continue to be generated. The variable data is stored in the memory of the course interpretation end. Repeat the aforementioned monitoring trigger process until the scene end command is encountered and exit.
[0090] Through the above solution, the underlying technology is decoupled from the business model. No matter what technology stack the underlying technology adopts (for example, it can be ios, android, h5, cocos2d, etc.), it is only necessary to translate the courseware configuration file into the corresponding technology stack language description according to the DSL semantic specification. In this way, the generated courseware configuration file can be reused on multiple terminals without paying attention to the underlying implementation technology and equipment.
[0091] At the same time, through the solution of this application, when developing courseware, it is no longer entirely implemented by developers through customized code development based on the technology stack, which redefines the development architecture of the courseware.
[0092] At the same time, when new courseware needs to be developed, the various existing component objects can be flexibly configured and used without the need for additional redevelopment.
[0093] Embodiment three:
[0094] Based on the same inventive concept, the present application also provides a courseware running device 600. Figure 6 As shown, Figure 6 Shows the use of Figure 4 The courseware running device of the method shown. It should be understood that the specific functions of the device 600 can be referred to the description above, and the detailed description is appropriately omitted here to avoid repetition. The device 600 includes at least one software function module that can be stored in the memory in the form of software or firmware or fixed in the operating system of the device 600. Specifically:
[0095] See also Figure 6 As shown, the device 600 includes: an acquisition module 601 and an operation module 602. Among them:
[0096] An acquisition module 601, configured to acquire a courseware configuration file corresponding to the courseware learning instruction when receiving the courseware learning instruction; the courseware configuration file is configured according to a set domain-specific language (DSL) semantic specification;
[0097] An operation module 602, configured to parse the courseware configuration file into a technology stack language description according to the DSL semantic specification and execute it.
[0098] In a feasible implementation manner of the embodiment of the present application, the content of the courseware configuration file includes:
[0099] A component object, which is the smallest granularity object for describing courseware content;
[0100] A variable, which is used to describe the data generated when the component object is executed;
[0101] An event listener, which determines whether a certain event in the courseware is triggered by listening to the data of the variable;
[0102] A syntax logic, which is used to describe the execution logic of the component object under different events;
[0103] The operation module 602 is specifically configured to execute the courseware configuration file described in the technology stack language in the following manner:
[0104] Load and render the component object that is played by default;
[0105] Listen to the variable data generated during the rendering process; the variable data is the data corresponding to the variable defined in the courseware configuration file;
[0106] When it is monitored that the variable data meets the preset event trigger condition, parse the syntax logic of the event triggered by the event trigger condition, and execute the component object called in the syntax logic.
[0107] In the embodiment of the present application, the component object includes at least one of the following: video, audio, picture, and question.
[0108] In the embodiment of the present application, the content of the courseware configuration file further includes: a custom function; the custom function is a function obtained by functionalizing the same logical part in the syntax logics of at least two different events; in the syntax logics of the at least two different events, there is a call relationship of the custom function.
[0109] It should be understood that, for the sake of concise description, some content described in Embodiment 1 is not repeated in this embodiment.
[0110] Embodiment 4:
[0111] This embodiment provides an electronic device. Refer to Figure 7 as shown, which includes a processor 701, a memory 702, and a communication bus 703. Among them:
[0112] The communication bus 703 is used to implement the connection and communication between the processor 701 and the memory 702.
[0113] The processor 701 is used to execute one or more programs stored in the memory 702 to implement the courseware running method in the first embodiment and / or the second embodiment above.
[0114] It can be understood that Figure 7 the structure shown is only schematic. The electronic device may further include more or fewer components than those shown Figure 7 in it, or have a different configuration from that shown Figure 7 in it.
[0115] In the embodiments of the present application, the electronic device may be a client device held by a user, such as a mobile phone, a computer, etc. In addition, it may also be a server device, such as a server, etc. There is no limitation in the embodiments of the present application.
[0116] This embodiment also provides a computer-readable storage medium, such as a floppy disk, an optical disc, a hard disk, a flash memory, a USB flash drive, an SD (Secure Digital Memory Card) card, an MMC (Multimedia Card) card, etc. One or more programs for implementing the above steps are stored in the computer-readable storage medium. These one or more programs can be executed by one or more processors to implement the courseware running method in the first embodiment and / or the second embodiment above. Details are not described herein again.
[0117] In the embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0118] In addition, the unit described as a separate component may or may not be physically separated, and the component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] Furthermore, in each embodiment of the present application, the various functional modules may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
[0120] In this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0121] In this document, "a plurality of" means two or more.
[0122] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for running a courseware, characterized in that including: When receiving a courseware learning instruction, obtaining a courseware configuration file corresponding to the courseware learning instruction; The courseware configuration file is configured by the business side according to the set domain-specific language (DSL) semantic specification; Parsing the courseware configuration file into a technology stack language description according to the DSL semantic specification through a language parser and executing it; The language parser is defined by the development side; The courseware configuration file includes: Component objects, which are the smallest granularity objects for describing courseware content; Variables, which are used to describe the data generated when the component objects are executed; Event listening, which determines whether a certain event in the courseware is triggered by listening to the data of the variables; Syntax logic, which is used to describe the execution logic of component objects under different events; Correspondingly, the process of executing the courseware configuration file of the technology stack language description includes: Loading and rendering the component objects for default playback; Listening to the variable data generated during the rendering process; the variable data is the data corresponding to the variables defined in the courseware configuration file; When it is monitored that the variable data meets the preset event trigger condition, parsing the syntax logic of the event triggered by the event trigger condition and executing the component objects called in the syntax logic; The content of the courseware configuration file further includes: custom functions; the custom functions are functions obtained by functionalizing the same logical parts in the syntax logics of at least two different events; In the syntax logics of the at least two different events, there is a call relationship of the custom functions.
2. The courseware running method according to claim 1, wherein The component objects include at least one of the following: Videos, audios, pictures, test questions.
3. A courseware running device, characterized in that, including: An acquisition module, which is used to obtain a courseware configuration file corresponding to the courseware learning instruction when receiving the courseware learning instruction; The courseware configuration file is configured by the business side according to the set domain-specific language (DSL) semantic specification; An operation module, which is used to parse the courseware configuration file into a technology stack language description according to the DSL semantic specification through a language parser and execute it; The language parser is defined by the development side; The content of the courseware configuration file includes: Component objects, which are the smallest granularity objects for describing courseware content; Variables, which are used to describe the data generated when the component objects are executed; Event listening, which determines whether a certain event in the courseware is triggered by listening to the data of the variables; Syntax logic, which is used to describe the execution logic of component objects under different events; The operation module is specifically used to execute the courseware configuration file of the technology stack language description in the following manner: Loading and rendering the component objects for default playback; Listening to the variable data generated during the rendering process; the variable data is the data corresponding to the variables defined in the courseware configuration file; When it is monitored that the variable data meets the preset event trigger condition, parsing the syntax logic of the event triggered by the event trigger condition and executing the component objects called in the syntax logic; The content of the courseware configuration file further includes: custom functions; the custom functions are functions obtained by functionalizing the same logical parts in the syntax logics of at least two different events; In the syntax logic of the at least two different events, there is a call relationship of the custom function.
4. The courseware running device according to claim 3, wherein The component object includes at least one of the following: Video, audio, picture, test questions.
5. An electronic device, characterized in that, Comprising: A processor, a memory, and a communication bus; The communication bus is used to implement connection communication between the processor and the memory; The processor is configured to execute one or more programs stored in the memory to implement the courseware running method according to any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the courseware running method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Graphical online interactive teaching content creation system and method
CN110704152A