Courseware element adding method and device, storage medium and computer device
By setting up a code execution container with the same functionality on the client side, the problem of redundant development caused by different client code formats is solved, and the efficient development and execution of courseware elements is achieved.
Patent Information
- Application Number
- CN202210664320.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-06-13
AI Technical Summary
In existing technologies, the development of courseware elements requires repeated development due to the different code formats supported by different clients, resulting in low efficiency. Furthermore, the server needs to store element codes in different code formats, which increases data storage volume and the speed of retrieving element codes.
Set up identical code execution containers in both the first and second clients to perform security scanning and performance identification before sending element code to the server, and run it directly after the client receives the element code, avoiding redundant development and format conventions.
The development of the same courseware element can be completed in one development cycle, which improves the development and operation efficiency of courseware elements, reduces development steps, and saves server storage space.
Smart Images

Figure CN117272943B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a courseware element adding method and device, a storage medium and a computer device. BACKGROUND
[0002] With the development of computer technology, multimedia devices have become very common as an auxiliary teaching tool, and electronic courseware has become an essential teaching material in teaching activities. Due to the convenience and powerful production function of the online courseware production platform, teachers often choose to make courseware through the tools provided by the online courseware production platform when making electronic courseware. SUMMARY
[0003] The present application provides a courseware element adding method and device, a storage medium and a computer device, which can solve the technical problem of how to improve the development efficiency of courseware elements.
[0004] In a first aspect, the present application provides a courseware element adding method applied to a courseware element adding system, the courseware element adding system comprising a first client, a second client and a server, the first client and the second client each being provided with a functionally identical code running container, the code running container being configured to perform security scanning and performance identification on element code having a set code format before the element code is sent to the server, and the code running container being further configured to run element code having the set code format sent by the server, the method comprising:
[0005] The server receives and associates saves a first element identifier and a first element code of a first courseware element sent by the first client;
[0006] The server updates the element identifier set based on the first element identifier;
[0007] The server provides the element identifier set to the second client;
[0008] The second client receives the element identifier set, acquires a first element identifier in an element selection instruction generated based on the element identifier set, and generates a code acquisition request based on the first element identifier, and sends the code acquisition request carrying the first element identifier to the server, the code acquisition request being configured to request a first element code corresponding to the first element identifier;
[0009] The server receives the code obtaining request, and obtains a first element code corresponding to a first element identifier based on the first element identifier in the code obtaining request, and sends the first element code corresponding to the first element identifier to the second client, wherein the code format of the element code stored in the server is the set code format.
[0010] The second client receives the first element code, and runs the first element code by using a code running container to add a first courseware element corresponding to the first element identifier into a courseware making page.
[0011] In a second aspect, an embodiment of the present application provides a courseware element adding method applied to a courseware element adding device, wherein the courseware element adding device is provided with a code running container, the code running container is used to perform security scanning and performance identification on an element code having a set code format before the element code is sent to a server, and the code running container is also used to run an element code having the set code format sent by the server. The method comprises the following steps of:
[0012] Obtaining an element identifier set provided by a courseware element storage device;
[0013] In response to an element selection instruction generated based on the element identifier set, obtaining a first element identifier in the element selection instruction, and generating a code obtaining request based on the first element identifier to request a first element code corresponding to the first element identifier from the courseware element storage device; the code format of the element code stored in the courseware element storage device is the set code format;
[0014] Running the first element code by using a code running container to add a first courseware element corresponding to the first element identifier into a courseware making page.
[0015] In a third aspect, an embodiment of the present application provides a courseware element adding method applied to a courseware element storage device, and the method comprises the following steps of:
[0016] Sending an element identifier set to a courseware element adding device;
[0017] If a code obtaining request carrying a first element identifier sent by the courseware element adding device is received, obtaining a first element code corresponding to the first element identifier, and the code format of the element code stored in the courseware element storage device is a set code format;
[0018] The first element code corresponding to the first element identifier is sent to the courseware element adding device, and the first element code corresponding to the first element identifier is used to add the first courseware element corresponding to the first element identifier to a courseware production page of the courseware element adding device.
[0019] In a fourth aspect, an embodiment of the present application provides a courseware element adding device, comprising:
[0020] An obtaining module is configured to obtain an element identifier set provided by a courseware element storage device.
[0021] A requesting module is configured to, in response to an element selection instruction generated based on the element identifier set, obtain a first element identifier in the element selection instruction, generate a code obtaining request based on the first element identifier, and request the first element code corresponding to the first element identifier from the courseware element storage device, wherein a code format of the element code stored in the courseware element storage device is a set code format.
[0022] An adding module is configured to run the first element code by using a code running container, so as to add a first courseware element corresponding to the first element identifier to a courseware production page.
[0023] In a fifth aspect, an embodiment of the present application provides a courseware element adding device, comprising:
[0024] A list sending module is configured to send an element identifier set to a courseware element adding device.
[0025] An obtaining module is configured to, if a code obtaining request carrying a first element identifier sent by the courseware element adding device is received, obtain a first element code corresponding to the first element identifier, wherein a code format of the element code stored in the courseware element storage device is a set code format.
[0026] A code sending module is configured to send the first element code corresponding to the first element identifier to the courseware element adding device, and the first element code corresponding to the first element identifier is used to add a first courseware element corresponding to the first element identifier to a courseware production page of the courseware element adding device.
[0027] In a sixth aspect, an embodiment of the present application provides a storage medium, which stores a computer program, and the computer program is adapted to be loaded by a processor and execute steps of the above method.
[0028] In a seventh aspect, an embodiment of the present application provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement steps of the above method.
[0029] In the embodiment of the present application, by setting the functionally same code running container in the first client and the second client, the second client can directly run the element code by using the code running container after obtaining the element code uploaded by the first client, avoiding the repeated development of the same courseware element in different code formats due to the different code formats supported by different clients, and meanwhile, the code formats of the courseware elements do not need to be agreed between the clients. For the same courseware element, the development of the courseware element can be completed by one-time development in one code format, reducing the development steps of the courseware element and improving the development efficiency and running efficiency of the courseware element. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0031] Figure 1 A system architecture diagram of a courseware element adding system provided by the embodiment of the present application;
[0032] Figure 2 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0033] Figure 3 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0034] Figure 4 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0035] Figure 5 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0036] Figure 6 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0037] Figure 7 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0038] Figure 8 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0039] Figure 9 A flowchart of a courseware element adding method provided by the embodiment of the present application;
[0040] Figure 10 A flowchart of a courseware element adding method provided by an embodiment of the present application is shown in FIG. 1.
[0041] Figure 11 A structural diagram of a courseware element adding device provided by an embodiment of the present application is shown in FIG. 2.
[0042] Figure 12 A structural diagram of a courseware element storage device provided by an embodiment of the present application is shown in FIG. 3.
[0043] Figure 13 A structural diagram of a courseware element storage device provided by an embodiment of the present application is shown in FIG. 4.
[0044] Figure 14 A structural diagram of a courseware element adding device provided by an embodiment of the present application is shown in FIG. 5.
[0045] Figure 15 A structural diagram of a computer device provided by an embodiment of the present application is shown in FIG. 6. DETAILED DESCRIPTION
[0046] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0047] The following description refers to the accompanying drawings. Unless otherwise noted, like elements in different drawings represent the same or similar elements. The following examples are illustrative of specific embodiments and do not limit the scope of the application. One of ordinary skill in the art will recognize many variations that fall within the scope of the application. The present application is directed to all such variations. The flow diagrams depicted herein are examples only and are not meant to limit the scope of the application. One of ordinary skill in the art will recognize that the steps in the flow diagrams can be performed in a different order, or that some steps can be performed in parallel. Additionally, the terms "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth" are used only for the purpose of distinguishing between different elements, and are not meant to limit the scope of the present disclosure.
[0048] The existing courseware element adding manner is that the client requests the element code of the courseware element from the server based on the code format supported by the client, the server determines the code set corresponding to the selected courseware element after receiving the request of the courseware element, then obtains the element code of the code format supported by the client in the code set, and finally sends the found element code to the client, the client directly runs the element code after receiving the element code, so as to add the courseware element corresponding to the element code. Since the code formats supported by different clients are different, the developers need to repeatedly develop the element code of the same courseware element for different code formats, which is time-consuming, laborious and low in efficiency. In addition, the server needs to store the element codes corresponding to different code formats for the same courseware element, which increases the data storage amount of the server, reduces the speed of obtaining the courseware element code corresponding to the element request, and reduces the adding efficiency of the courseware element.
[0049] In order to better improve the development efficiency and adding efficiency of the courseware element, please refer to Figure 1 , a system architecture diagram of a courseware element adding system provided by the embodiment of the present application.
[0050] As Figure 1 shown, the system architecture can include at least one client 10 and at least one server 20, wherein the client 10 includes a code running container 30 and a courseware making page 40.
[0051] It should be noted that the client 10 in the embodiment can receive the element code of the courseware element from the server 20, or generate the element code of the courseware element and upload it to the server 20. The client 10 can include a first client and a second client. It should be noted that the first client and the second client can be the same client, or can be different clients. The description of "first" and "second" is only used to distinguish the execution subject corresponding to the different processes of the client in executing the generation of the element code and the reception of the element code. Optionally, the first client can be a WEB (browser) end, and the second client can be a PC (personal computer) end.
[0052] Optionally, one client 10 is in communication connection with one server 20, and one server 20 is in communication connection with at least one client 10.
[0053] The client 10 can be an electronic device of various applications of different operating systems, including but not limited to a smart phone, a tablet computer, a laptop computer and a desktop computer, and the like. It should be noted that the program running environment applied by different operating systems is different. The code running container 30 has functions of code analysis, protocol conversion, isolation processing, security scanning and performance identification. The code analysis is to analyze the element code, and the element code analyzed can run on the client 10. The protocol conversion is to convert the data format of the element data corresponding to the courseware element. The isolation processing means that the element code corresponding to the courseware element runs in a relatively independent space. The security scanning is to scan the element code for security problems. The performance identification is to scan the element code for performance problems. The element code corresponding to the courseware element runs through the code running container 30.
[0054] The server 20 can be various electronic devices, including but not limited to a smart phone, a tablet computer, a laptop computer and a desktop computer, and the like, which are not specifically limited herein.
[0055] The client 10 will be divided into a first client and a second client, and the implementation process of the system architecture of the embodiment of the application will be described.
[0056] The first client obtains the first element code of the generated first courseware element and the first element identifier corresponding to the first courseware element, wherein the code format of the first element code is a set code format. The first client uses the code running container to perform performance identification and security scanning on the first element code, and obtains a performance identification result and a security scanning result. If the performance identification result is qualified and the security scanning result is qualified, the first client sends the first element identifier and the first element code corresponding to the first element identifier to the server 20.
[0057] The server 20 receives and saves the first element identifier and the first element code of the first courseware element sent by the first client. The server 20 updates the element identifier set based on the first element identifier.
[0058] If the second client detects that it enters the courseware editing state, the second client requests the element identifier set from the server.
[0059] If the server 20 receives the element identifier set acquisition request sent by the second client, the server 20 sends the element identifier set to the second client.
[0060] The second client receives the set of element identifiers, responds to the element selection instruction generated based on the set of element identifiers, obtains the first element identifier in the element selection instruction, generates a code retrieval request based on the first element identifier, and sends a code retrieval request carrying the first element identifier to the server 20. The code retrieval request is used to request the first element code corresponding to the first element identifier.
[0061] Server 20 receives a code retrieval request, and based on the first element identifier in the code retrieval request, retrieves the first element code corresponding to the first element identifier, and sends the first element code corresponding to the first element identifier to the second client. The code format of the element code stored in server 20 is a set code format.
[0062] The second client receives the first element code and uses the code execution container 30 to perform code preprocessing on the first element code to obtain the target element code. The code preprocessing includes code parsing and isolation processing. The second client uses the code execution container 30 to run the target element code to add the first courseware element corresponding to the first element identifier to the courseware creation page 40.
[0063] The second client uses the first courseware element to create courseware to obtain the first courseware, and obtains the first element data in the first courseware; if the second client receives a courseware save instruction for the first courseware, the second client uses code execution container 30 to perform format conversion on the first element data; the second client generates the second courseware based on the format-converted first element data and saves the second courseware.
[0064] The second client obtains the second element data from the third courseware to be displayed; the second client uses code execution container 30 to perform format conversion on the second element data; the second client generates the fourth courseware based on the format-converted second element data, loads the fourth courseware, and displays the fourth courseware on the courseware creation page 40.
[0065] It should be noted that, Figure 1The number of clients, servers, code execution containers, and courseware creation pages shown is merely illustrative. Depending on implementation needs, there can be any number of clients, servers, code execution containers, and courseware creation pages. The code execution containers in the first client and the second client are functionally identical, meaning they can both perform code parsing, protocol conversion, isolation processing, security scanning, and performance identification. The functions performed by the code execution containers differ depending on whether they are generating or receiving element code. For example, before sending the element code to the server, the code execution container in the first client can perform security scanning and performance identification on the element code; after receiving the element code, the code execution container in the second client can run the element code, and so on.
[0066] based on Figure 1 The system framework shown here sets up code execution containers with identical functions in both the first and second clients. This allows the second client to directly run the element code uploaded by the first client using the code execution container. This avoids the need for repeated development of the same courseware element using different code formats due to different clients supporting different code formats. At the same time, there is no need for clients to agree on the code format of the courseware element. For the same courseware element, the development work can be completed once using one code format, reducing the development steps of the courseware element and improving the development and running efficiency of the courseware element.
[0067] based on Figure 1 The system architecture shown below will be combined with... Figures 2-10 This application provides a detailed description of the method for adding courseware elements in its embodiments.
[0068] Please see Figure 2 This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 2 As shown in the embodiments of this application, the specific process of the courseware element addition method is illustrated from the perspectives of the first client, the second client, and the server. It can be understood that the first client and the second client in the courseware element addition system can both be courseware element addition devices, and the server can be a courseware element storage device. The method is applied to the courseware element addition system, which includes the first client, the second client, and the server. The method in the embodiments of this application can include the following steps S101-S106.
[0069] S101, the server receives and associates the first element identifier and the first element code of the first courseware element sent by the first client.
[0070] In one implementation, the server receives the first element identifier and the first element code of the first courseware element sent by the first client, and then stores the first element identifier and the first element code together in the storage module. It is understood that the first courseware element includes a first element identifier and a first element code.
[0071] Optionally, the server first determines whether there is a target element identifier in the storage module that matches the first element identifier. If there is a target element identifier in the storage module that matches the first element identifier, the element code corresponding to the target element identifier is replaced with the first element code. If there is no target element identifier that matches the first element identifier, the first courseware element is saved as a new courseware element in the storage module, that is, the first element identifier and the first element code are saved together to obtain a new set of stored data.
[0072] S102, the server updates the element identifier set based on the first element identifier.
[0073] In one implementation, the element identifier set includes the element identifier of at least one courseware element. This means the element identifier set is the collection of element identifiers for all courseware elements present on the server. It should be noted that courseware elements are stored on the server by associating element codes with element identifiers. For example, the element identifiers in the element identifier set can be stored in list format. Courseware elements refer to materials used to create courseware, such as triangle molds, quadrilateral molds, font materials, etc.
[0074] The server retrieves a pre-stored set of element identifiers and determines whether there is a target element identifier in the pre-stored set that matches the first element identifier. If there is no target element identifier in the set that matches the first element identifier, the first element identifier is added to the set of element identifiers to update the set of element identifiers.
[0075] Optionally, the server retrieves all element identifiers from the storage module and then generates an element identifier set based on all element identifiers.
[0076] S103, the server provides the second client with a set of element identifiers.
[0077] In one implementation, the second client in the courseware element adding system can be a courseware element adding device, used to request relevant data of courseware elements from the server, and can also be used to provide relevant data of courseware elements to the server; the server in the courseware element adding system can be a courseware element storage device, used to provide courseware-related data to the second client.
[0078] After receiving the request instruction from the second client for the set of element identifiers, the server sends the set of element identifiers to the second client.
[0079] Optionally, the server can also periodically broadcast a set of element identifiers to each client corresponding to the server.
[0080] S104, the second client receives the element identifier set, responds to the element selection instruction generated based on the element identifier set, obtains the first element identifier in the element selection instruction, generates a code acquisition request based on the first element identifier, and sends a code acquisition request carrying the first element identifier to the server. The code acquisition request is used to request the first element code corresponding to the first element identifier.
[0081] In one implementation, the second client receives a set of element identifiers sent by the server, and then displays multiple element identifiers from the set on a courseware creation page, allowing the user to select from the displayed element identifiers and trigger an element selection instruction based on the page. The second client obtains the element selection instruction generated by the user based on the courseware creation page, and then, in response, parses the instruction to obtain the first element identifier carried in the instruction—the element identifier selected by the user from the multiple element identifiers. Based on the first element identifier selected by the user, the client generates a code retrieval request for the first element code, which carries the selected first element identifier. This code retrieval request is then sent to the server to request the first element code corresponding to the first element identifier.
[0082] S105, the server receives the code acquisition request, and based on the first element identifier in the code acquisition request, acquires the first element code corresponding to the first element identifier, and sends the first element code corresponding to the first element identifier to the second client, wherein the code format of the element code stored in the server is the set code format.
[0083] In one implementation, the server receives a code retrieval request from a second client, retrieves the first element identifier carried in the request, determines the first element code corresponding to the first element identifier in the storage module, and retrieves the first element code. The code format of the element code stored on the server is a predefined code format. The server then sends the first element code corresponding to the first element identifier to the second client.
[0084] Understandably, the code format is a pre-defined code format for the code execution container. The code format of the element code generated by the first client is the pre-defined code format. After the first client uploads the element code with the pre-defined code format to the server for storage, any second client can directly run the element code using its own code execution container when it retrieves the element code from the server. Thus, even if different clients support different code formats, element code with the pre-defined code format can run without obstacles through the code execution container. At the same time, the server only needs to store one code format for each courseware element, which not only saves server storage space but also improves the development and running efficiency of element code.
[0085] S106, the second client receives the first element code and runs the first element code using a code execution container to add the first courseware element corresponding to the first element identifier to the courseware production page.
[0086] In one implementation, the code execution container is a code parser. This container can perform code parsing, code execution, security scanning, isolation processing, and performance identification on element code with a specific format (i.e., a defined code format). It can also perform data format conversion on element data. It should be noted that the specific format refers to the code format defined by the server, which can be Hypertext Markup Language (HTML) code, Java code, Python code, etc., without limitation. It is important to emphasize that both the first and second clients have functionally identical code execution containers. More specifically, all clients in the courseware element adding system have functionally identical code execution containers. When a client uploads courseware elements to the server, this code execution container performs security scanning and performance identification on the element code before sending it to the server. When a client downloads courseware elements from the server, this code execution container also runs the element code with the defined code format sent by the server.
[0087] The second client receives the first element code corresponding to the first element identifier sent by the server, then compiles the first element code through a code execution container, and then runs the compiled first element code to obtain the courseware element corresponding to the first element identifier selected by the user. Finally, the obtained courseware element is added to the courseware creation page of the second client.
[0088] In this embodiment, by setting up code execution containers with identical functions in both the first and second clients, the second client can directly run the element code using the code execution container after obtaining the element code uploaded by the first client. This avoids the need for repeated development of the same courseware element using different code formats due to the different code formats supported by different clients. At the same time, there is no need for clients to agree on the code format of the courseware element. For the same courseware element, the development work can be completed once using one code format, reducing the development steps of the courseware element and improving the development and running efficiency of the courseware element.
[0089] Please see Figure 3 This is a flowchart illustrating the timing of a method for adding courseware elements, as provided in this embodiment of the application. Figure 3 As shown in the embodiments of this application, the specific process of adding courseware elements is explained from the perspectives of the first client, the second client, and the server. It can be understood that the first client and the second client in the courseware element adding system can both be courseware element adding devices, and the server can be a courseware element storage device. The method described in the embodiments of this application can include the following steps S201-S218.
[0090] S201, the first client obtains the first element code of the generated first courseware element and the first element identifier corresponding to the first courseware element, wherein the code format of the first element code is the set code format.
[0091] In one implementation, when a user develops courseware elements through a first client, the first client receives the first element code and first element identifier of the first courseware element input by the user. The received first element code and first element identifier are associated with each other. It is understood that when the user inputs the first element code and first element identifier of the first courseware element, the user can write the first element code and first element identifier through an input device; or obtain the code file by inserting a portable storage device (such as a USB flash drive); or directly receive code files sent by other devices to obtain the first element code and first element identifier of the first courseware element.
[0092] S202, the first client uses a code execution container to perform performance identification and security scanning on the code of the first element, and obtains performance identification results and security scanning results.
[0093] In one implementation, performance identification refers to identifying the performance parameters used during the execution of the first element code, such as the CPU memory and memory fluctuation value, which are not limited here; security scanning refers to performing a security scan on the element code in the code execution container to identify security issues in the element code in order to avoid malicious attacks such as cross-site script injection.
[0094] The first client obtains at least one performance parameter of the first element code through the code execution container, and obtains the performance threshold corresponding to each performance parameter. Based on each performance parameter and the corresponding performance threshold, the client determines the target performance parameter that exceeds the threshold. If the number of parameters of the target performance parameter is greater than or equal to the parameter threshold, the performance identification result of the first element code is determined to be unqualified. If the number of parameters of the target performance parameter is less than the parameter threshold, the performance identification result of the first element code is determined to be qualified.
[0095] The first client performs a security scan on the first element's code through a code execution container. If it determines that the first element's code does not have any security issues, the security scan result of the first element's code is deemed acceptable; if it determines that the first element's code has security issues, the security scan result of the first element's code is deemed unacceptable.
[0096] S203, if the performance identification result is qualified and the security scan result is qualified, the first client sends the first element identifier and the first element code corresponding to the first element identifier to the server.
[0097] In one implementation, when both the performance identification result and the security scan result are satisfactory, the first client generates a courseware element update package based on the associated first element code and first element identifier, and sends the courseware element update package to the server. The server then performs the courseware element update operation based on the received courseware element update package.
[0098] Optionally, when the performance identification result is unqualified, the first client outputs a prompt message indicating that the performance of the first courseware element is unqualified and has failed the element review, so that the developers can optimize the code of the first element of the first courseware element after receiving the prompt message.
[0099] Optionally, when the security scan result is unqualified, the first client determines the security issue type of the first element code and outputs a prompt message indicating that the first courseware element is unqualified and has not passed the element review. It can also output the specific security issue type so that the developers can optimize the first element code of the first courseware element after receiving the prompt message.
[0100] By identifying performance and security issues in the code of the first courseware element before its release, and only allowing the release of first courseware elements that pass both performance identification and security scans, problems such as runtime failures and system crashes that occur when the second client runs unqualified first courseware elements are avoided. This ensures the operational security of the first client downloading the first element code from the server, preventing performance failures such as lag during the second client's operation and thus improving the second client's operational efficiency. At the same time, by performing security scans on the element code to identify malicious code, the execution process of malicious code can be intercepted in a timely manner, thereby improving the security of the second client.
[0101] S204, the server receives and associates the first element identifier and the first element code of the first courseware element sent by the first client.
[0102] In one implementation, the server receives the first element identifier and the first element code of the first courseware element sent by the first client, and then stores the first element identifier and the first element code together in the storage module.
[0103] Optionally, the server first determines whether there is a target element identifier in the storage module that matches the first element identifier. If there is a target element identifier in the storage module that matches the first element identifier, the element code corresponding to the target element identifier is replaced with the first element code. If there is no target element identifier that matches the first element identifier, the first courseware element is saved as a new courseware element in the storage module, that is, the first element identifier and the first element code are saved together to obtain a new set of stored data.
[0104] S205, the server updates the element identifier set based on the first element identifier.
[0105] In one implementation, the element identifier set includes the element identifier of at least one courseware element. This means the element identifier set is the collection of element identifiers for all courseware elements present on the server. It should be noted that courseware elements are stored on the server by associating element codes with element identifiers. For example, the element identifiers in the element identifier set can be stored in list format. Courseware elements refer to materials used to create courseware, such as triangle molds, quadrilateral molds, font materials, etc.
[0106] The server retrieves a pre-stored set of element identifiers and determines whether there is a target element identifier in the pre-stored set that matches the first element identifier. If there is no target element identifier in the set that matches the first element identifier, the first element identifier is added to the set of element identifiers to update the set of element identifiers.
[0107] Optionally, the server retrieves all element identifiers from the storage module and then generates an element identifier set based on all element identifiers.
[0108] S206, the server provides a set of element identifiers to the second client.
[0109] In one implementation, the second client in the courseware element adding system can be a courseware element adding device, used to request relevant data of courseware elements from the server, and can also be used to provide relevant data of courseware elements to the server; the server in the courseware element adding system can be a courseware element storage device, used to provide courseware-related data to the second client.
[0110] After receiving the request instruction from the second client for the set of element identifiers, the server sends the set of element identifiers to the second client.
[0111] Optionally, the server can also periodically broadcast a set of element identifiers to each client corresponding to the server.
[0112] S207, if the second client detects that it has entered the courseware editing state, the second client requests the set of element identifiers from the server.
[0113] In one implementation, the courseware editing state refers to the state in which the second client creates courseware. The second client can enter the courseware editing state by opening courseware creation software or other means.
[0114] When the second client enters the courseware editing state, it generates a request to obtain the element identifier set of the courseware elements and sends the request to the server so that the server can obtain the element identifier set and send the element identifier set to the second client.
[0115] Optionally, the request to obtain the element identifier set can carry the device identifier or device type of the second client. When obtaining the element identifier set, the server can determine the courseware element corresponding to the second client based on the device identifier or device type of the second client, and then generate the element identifier set based on the courseware element corresponding to the second client.
[0116] Optionally, when the second client exits the courseware editing state, it can switch the working state of the second client to the closed state and release the set of element identifiers in the storage module.
[0117] S208, if the server receives an element identifier set acquisition request sent by the second client, the server sends the element identifier set to the second client.
[0118] In one implementation, the server receives a request from the second client to obtain a set of element identifiers, determines the set of element identifiers to obtain, and sends the set of element identifiers to the second client.
[0119] Optionally, the server can first determine the courseware elements it possesses, then obtain the element identifiers corresponding to each courseware element, and then generate an element identifier set based on the element identifiers corresponding to multiple courseware elements.
[0120] Optionally, the server may obtain the device identifier or device type carried in the request based on the element identifier set, determine at least one courseware element corresponding to the second client, obtain the element identifier corresponding to the at least one courseware element, and finally generate an element identifier set based on the obtained element identifier corresponding to the at least one courseware element.
[0121] By detecting whether the second client is in the courseware editing state, the second client only obtains the element identifier set when in the courseware editing state, avoiding the waste of resources (such as communication resources, storage space, etc.) caused by frequently obtaining the element identifier set, thereby improving the resource utilization rate of the courseware element adding device.
[0122] S209, the second client receives the element identifier set, responds to the element selection instruction generated based on the element identifier set, obtains the first element identifier in the element selection instruction, generates a code acquisition request based on the first element identifier, and sends a code acquisition request carrying the first element identifier to the server. The code acquisition request is used to request the first element code corresponding to the first element identifier.
[0123] In one implementation, the second client receives a set of element identifiers sent by the server, and then displays multiple element identifiers from the set on a courseware creation page, allowing the user to select from the displayed element identifiers and trigger an element selection instruction based on the page. The second client obtains the element selection instruction generated by the user based on the courseware creation page, and then, in response, parses the instruction to obtain the first element identifier carried in the instruction—the element identifier selected by the user from the multiple element identifiers. Based on the first element identifier selected by the user, the client generates a code retrieval request for the first element code, which carries the selected first element identifier. This code retrieval request is then sent to the server to request the first element code corresponding to the first element identifier.
[0124] S210, the server receives the code acquisition request, and based on the first element identifier in the code acquisition request, acquires the first element code corresponding to the first element identifier, and sends the first element code corresponding to the first element identifier to the second client, wherein the code format of the element code stored in the server is a set code format.
[0125] In one implementation, the server receives a code retrieval request from a second client, retrieves the first element identifier carried in the request, determines the first element code corresponding to the first element identifier in the storage module, and retrieves the first element code. The code format of the element code stored on the server is a predefined code format. The server then sends the first element code corresponding to the first element identifier to the second client.
[0126] S211, the second client receives the first element code and uses the code execution container to perform code preprocessing on the first element code to obtain the target element code. The code preprocessing includes code parsing and isolation processing.
[0127] In one implementation, code parsing refers to the process of translating the element code in the code execution container from bytecode into machine code. It should be noted that during actual execution, the code implements its corresponding function by executing machine code. Isolation processing refers to providing a relatively independent code execution space for the element code in the code execution container.
[0128] The second client receives the first element code corresponding to the first element identifier sent by the server, and then provides a relatively independent running space for the first element code through the code execution container. In the running space corresponding to the first element code, the first element code is parsed to obtain the code preprocessing result of the code execution container, that is, the target element code, which is machine code.
[0129] S212, the second client uses the code execution container to run the target element code, so as to add the first courseware element corresponding to the first element identifier to the courseware production page.
[0130] In one implementation, the second client runs the container through code and then runs the target element code to obtain the courseware element corresponding to the first element selected by the user, and then adds the obtained courseware element to the courseware creation page of the second client.
[0131] For example, the function of the element corresponding to the first courseware element can be added to the courseware production page. To better display the effect, the element icon of the first courseware element can also be added to the courseware production page.
[0132] By isolating the element codes, mutual interference between them is avoided, ensuring the normal operation of the element codes and thus improving the running efficiency of the second client. By parsing the element codes, the underlying code for the second client to run is obtained, thereby enabling the element codes to run and improving the running efficiency of the second client.
[0133] S213, the second client creates courseware based on the first courseware element to obtain the first courseware, and obtains the first element data corresponding to the first courseware element in the first courseware.
[0134] In one implementation, the courseware creation page includes at least one courseware element; courseware creation refers to the process by which a user selects a courseware element and then inputs the corresponding element data. It should be noted that the element data corresponding to the courseware element may include, but is not limited to, element identifier, element size, element color, element shape, element position on the courseware creation page, element rotation angle, etc., which are not limited here.
[0135] The second client selects the first courseware element on the courseware creation page, and then inputs the first element data corresponding to the first courseware element through touch control, mouse control, keyboard control, etc. The selected first courseware element is then displayed on the canvas on the courseware creation page according to the corresponding first element data. When the save button is triggered, all element data corresponding to the canvas on the courseware creation page are retrieved. It should be noted that the first courseware includes all element data corresponding to the canvas on the courseware creation page, and the first element data is contained within all element data.
[0136] S214, if the second client receives a courseware saving instruction for the first courseware, the second client uses the code execution container to perform format conversion on the first element data.
[0137] In one implementation, when the second client is in courseware editing mode, it opens a courseware creation page. This page includes a save button to trigger a save command. It's understood that when the save button is triggered, a save command is generated for the first courseware being created on the page. In this embodiment, the format conversion refers to converting the first data format of the element data into the courseware storage format. The first data format is the data format of the element data when the courseware creation page generates the element data, while the courseware storage format is the data storage format supported by the client itself, i.e., the data storage format set by the second client.
[0138] When the second client receives the save button for the courseware, it runs the code to convert all element data corresponding to the first courseware from the first data format to the courseware storage format.
[0139] S215, the second client generates a second courseware based on the first element data after format conversion, and saves the second courseware.
[0140] In one implementation, the second client associates the data of each first element after format conversion, then records each first element data into the same file to obtain the second courseware, and finally saves the second courseware in the storage module of the second client.
[0141] During the courseware creation process, the element code of the courseware elements is directly executed through a code execution container, allowing the courseware elements to be added directly to the canvas. By having the user adjust the attributes of the courseware elements to obtain the related element data, the data format of the element data is not a data format that can be supported locally on the client side. Therefore, when storing the courseware, the element data is further converted through the code execution container, so that the converted element data can be stored and recognized locally on the client side, ensuring the usability of the courseware.
[0142] Meanwhile, by converting the format of the first element data to generate and save a second courseware with a unified data format (i.e., courseware storage format), different second clients can generate second courseware with the same data format, thus ensuring that the second courseware can be displayed on all second clients and improving the compatibility of the second courseware.
[0143] S216, the second client obtains the data of the second element in the third courseware to be displayed.
[0144] In one implementation, the element data corresponding to the courseware element can be: element identifier, element size, element color, element shape, element position on the courseware creation page, element rotation angle, etc., which are not limited here.
[0145] The second client receives the third courseware to be displayed from other devices (such as other clients, portable storage devices, etc.), or retrieves the third courseware to be displayed from the storage module based on the user's display command; then it retrieves the second element data in the third courseware. It is understood that the data format of the second element data is the courseware storage format. It is understood that the third courseware may include at least one element data, and the second element data is any element data among the at least one element data included in the third courseware. When loading and displaying the third courseware, at least one element data included in the third courseware will be retrieved. This application embodiment describes the loading process of a single element data.
[0146] S217, the second client uses the code to run the container and performs format conversion on the second element data.
[0147] In one implementation, the second client uses code to run a container to convert the second element data from the courseware storage format into a set data format that can be read by the courseware creation page.
[0148] Optionally, since different second clients have different operating systems, such as Android, iOS, Windows, Harmony OS, etc., the applications used for adding courseware elements differ. Specifically, the application's runtime environment differs, and therefore, different runtime environments require different data reading formats. It should be noted that the application for adding courseware elements refers to the application in the second client that processes the courseware elements, including the courseware creation page. This application can be a system-specific application or a web browser; there is no limitation here. The second client determines the program type corresponding to the currently running application for adding courseware elements. If the application is a web browser, it obtains the environment type corresponding to the web browser; if it is a system-specific application, it obtains the environment type corresponding to the operating system's runtime environment. Then, it obtains the data format corresponding to that environment type and converts the data format of the second element data to the data format corresponding to that environment type. The data format corresponding to the environment type refers to the data format that the application for adding courseware elements in the second client can read and recognize; the courseware storage format is a template data format, that is, the data storage format set by the courseware element adding system.
[0149] S218, the second client generates a fourth courseware based on the format-converted second element data, loads the fourth courseware, and displays the fourth courseware on the courseware creation page.
[0150] In one implementation, the second client associates the data of each second element after format conversion, then records the data of each second element into the same file to obtain the fourth courseware. Finally, the application is added through the courseware element, and the fourth courseware is displayed on the courseware creation page where the application is added to the courseware element.
[0151] By converting the format of the second element data, a fourth courseware that can be recognized by the application can be added to the courseware elements in the second client. This ensures that the prepared courseware can be displayed on different second clients, thus improving the compatibility of the third courseware.
[0152] It is important to emphasize that, in this embodiment, the second courseware stored by the second client and the third courseware that the second client needs to display can be the same courseware. In this case, the second element data is the first element data after format conversion. The execution order of the second client is unrelated to the execution order of the first client. That is, the server can first update the element identifier set based on the element code and element identifier sent by the first client, and then interact with the second client, without being limited to the execution order shown in the flow sequence diagram.
[0153] Please see Figure 4 This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 4 As shown, the method is applied to a courseware element adding device, which can be either a first client or a second client of the courseware element adding system. The method in this embodiment may include steps S301-S303.
[0154] S301, Obtain the set of element identifiers provided by the courseware element storage device.
[0155] In one implementation, the element identifier set includes the element identifier of at least one courseware element. This means the element identifier set is the collection of element identifiers for all courseware elements present in the courseware element storage device. It should be noted that courseware elements are stored in the courseware element storage device by associating element codes with element identifiers. For example, the element identifiers in the element identifier set can be stored in a list format. Courseware elements refer to materials used to create courseware, such as triangle molds, quadrilateral molds, font materials, etc.
[0156] The courseware element adding device receives a set of element identifiers sent by the courseware element storage device, and then displays multiple element identifiers from the set on the courseware creation page.
[0157] S302, in response to the element selection instruction generated based on the element identifier set, the first element identifier in the element selection instruction is obtained, and a code acquisition request is generated based on the first element identifier. The first element code corresponding to the first element identifier is requested from the courseware element storage device, and the code format of the element code stored in the courseware element storage device is the set code format.
[0158] In one implementation, the courseware element adding device receives a set of element identifiers sent by the courseware element storage device, and then displays multiple element identifiers from the set on a courseware creation page, allowing the user to select from the multiple element identifiers displayed on the courseware creation page and triggering an element selection instruction based on the element identifiers. The courseware element adding device obtains the element selection instruction generated by the user based on the courseware creation page, and then, in response to the user's element selection instruction generated based on the set of element identifiers, parses the element selection instruction to obtain the first element identifier carried in the element selection instruction, i.e., the element identifier selected by the user from the multiple element identifiers. Then, based on the first element identifier selected by the user, it generates a code retrieval request for the first element code, wherein the code retrieval request for the first element code carries the first element identifier selected by the user, and then sends the code retrieval request for the first element code to the courseware element storage device. This code retrieval request is used to request the first element code corresponding to the first element identifier.
[0159] S303, the code of the first element is run using a code execution container to add the first courseware element corresponding to the first element identifier to the courseware production page.
[0160] In one implementation, the code execution container is a code parser. This container can perform code parsing, code execution, security scanning, isolation processing, and performance identification on element code of a specific format (i.e., a defined code format). It can also perform data format conversion on element data. It should be noted that the specific format refers to the defined code format corresponding to the courseware element storage device, which can be Hypertext Markup Language (HTML) code, Java code, Python code, etc., and is not limited here.
[0161] The courseware element adding device receives the first element code corresponding to the first element identifier sent by the courseware element storage device, then compiles the first element code through the code execution container, and then runs the compiled first element code to obtain the courseware element corresponding to the first element identifier selected by the user, and then adds the obtained courseware element to the courseware production page of the courseware element adding device.
[0162] In this embodiment, by setting a code execution container in the courseware element adding device, the courseware element adding device can directly run the element code uploaded by the developer after obtaining it from the courseware element storage device. This avoids the situation where different courseware element adding devices support different code formats, requiring repeated development of the same courseware element using different code formats. At the same time, developers do not need to agree on the code format supported by the courseware element adding device. For the same courseware element, the development work can be completed once using one code format, reducing the development steps of the courseware element and improving the development and running efficiency of the courseware element.
[0163] In some possible embodiments, before obtaining the element identifier set, it is necessary to determine the working status of the courseware element adding device, or when adding courseware elements, it is necessary to control the code execution container to preprocess the element code corresponding to the courseware element, or it is necessary to save the courseware obtained during the courseware production process. The following embodiments focus on how to obtain the element identifier set, how to preprocess the element code, and how to save the courseware.
[0164] Please see Figure 5 This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 5 As shown, the method is applied to a courseware element adding device, which is equipped with a code running container. The code running container is used to perform security scanning and performance identification on the element code before sending the element code with a set code format to the server. The code running container is also used to run the element code with a set code format sent by the server. The method of this application embodiment may include the following steps S401-S408.
[0165] S401, if it is detected that the courseware editing state has been entered, then request the set of element identifiers from the courseware element storage device.
[0166] In one implementation, the courseware editing state refers to the state in which the courseware element adding device is creating courseware. The courseware element adding device can enter the courseware editing state by opening courseware creation software, etc.
[0167] When the courseware element adding device enters the courseware editing state, it generates a request to obtain the element identifier set of the courseware elements and sends the request to the courseware element storage device so that the courseware element storage device can obtain the element identifier set and send the element identifier set to the courseware element adding device.
[0168] Optionally, the request to obtain the element identifier set can carry the device identifier or device type of the courseware element adding device. Then, when the courseware element storage device obtains the element identifier set, it can determine the courseware element corresponding to the courseware element adding device based on the device identifier or device type of the courseware element adding device, and then generate the element identifier set based on the courseware element corresponding to the courseware element adding device.
[0169] Optionally, when exiting the courseware editing state, the courseware element adding device can switch its working state to the off state and release the set of element identifiers in the storage module.
[0170] By detecting whether the current state is courseware editing, the courseware element adding device only obtains the element identifier set when the courseware is in the courseware editing state. This avoids the waste of resources (such as communication resources, storage space, etc.) caused by frequently obtaining the element identifier set, thereby improving the resource utilization rate of the courseware element adding device.
[0171] S402, Obtain the set of element identifiers provided by the courseware element storage device.
[0172] In one implementation, within the courseware element adding system, the courseware element adding device can be a device that requests courseware-related data from the courseware element storage device to implement the courseware-related functions of the adding device; the courseware element storage device can be a device that provides courseware-related data to the adding device. The element identifier set includes the element identifier of at least one courseware element. It can be understood that the element identifier set is the set of element identifiers for all courseware elements present in the courseware element storage device. It should be noted that courseware elements are stored in the courseware element storage device by associating element codes with element identifiers. For example, the element identifiers in the element identifier set can be stored in a list format. Courseware elements refer to materials used to create courseware, such as triangle molds, quadrilateral molds, font materials, etc.
[0173] The courseware element adding device receives a set of element identifiers sent by the courseware element storage device, and then displays multiple element identifiers from the set on the courseware creation page.
[0174] S403, in response to the element selection instruction generated based on the element identifier set, the first element identifier in the element selection instruction is obtained, and a code acquisition request is generated based on the first element identifier. The first element code corresponding to the first element identifier is requested from the courseware element storage device, and the code format of the element code stored in the courseware element storage device is the set code format.
[0175] In one implementation, the courseware element adding device receives a set of element identifiers sent by the courseware element storage device, and then displays multiple element identifiers from the set on a courseware creation page, allowing the user to select from the multiple element identifiers displayed on the courseware creation page and triggering an element selection instruction based on the element identifiers. The courseware element adding device obtains the element selection instruction generated by the user based on the courseware creation page, and then, in response to the user's element selection instruction generated based on the set of element identifiers, parses the element selection instruction to obtain the first element identifier carried in the element selection instruction, i.e., the element identifier selected by the user from the multiple element identifiers. Then, based on the first element identifier selected by the user, it generates a code retrieval request for the first element code, wherein the code retrieval request for the first element code carries the first element identifier selected by the user, and then sends the code retrieval request for the first element code to the courseware element storage device. This code retrieval request is used to request the first element code corresponding to the first element identifier.
[0176] S404, the code execution container is used to perform code preprocessing on the first element code to obtain the target element code. The code preprocessing includes code parsing and isolation processing.
[0177] In one implementation, code parsing refers to the process of translating the element code in the code execution container from bytecode into machine code. It should be noted that during actual execution, the code implements its corresponding function by executing machine code. Isolation processing refers to providing a relatively independent code execution space for the element code in the code execution container.
[0178] The courseware element adding device receives the first element code corresponding to the first element identifier sent by the courseware element storage device, and then provides a relatively independent running space for the first element code through the code running container. Then, in the running space corresponding to the first element code, the first element code is parsed to obtain the code preprocessing result of the code running container, that is, the target element code, which is machine code.
[0179] S405, the code execution container is used to run the target element code to add the first courseware element corresponding to the first element identifier to the courseware production page.
[0180] In one implementation, the courseware element adding device runs a code container and then runs the target element code to obtain the courseware element corresponding to the first element identifier selected by the user, and then adds the obtained courseware element to the courseware creation page of the courseware element adding device.
[0181] For example, the function of the element corresponding to the first courseware element can be added to the courseware production page. To better display the effect, the element icon of the first courseware element can also be added to the courseware production page.
[0182] By isolating the element codes, mutual interference between them is avoided, ensuring the normal operation of the element codes and thus improving the operating efficiency of the courseware element adding device. By parsing the element codes, the underlying code for the operation of the courseware element adding device is obtained, thereby realizing the operation of the element codes and improving the operating efficiency of the courseware element adding device.
[0183] S406, Based on the first courseware element, courseware is created to obtain the first courseware, and the first element data corresponding to the first courseware element in the first courseware is obtained.
[0184] In one implementation, the courseware creation page includes at least one courseware element; courseware creation refers to the process by which a user selects a courseware element and then inputs the corresponding element data. It should be noted that the element data corresponding to the courseware element may include, but is not limited to, element identifier, element size, element color, element shape, element position on the courseware creation page, element rotation angle, etc., which are not limited here.
[0185] The courseware element adding device allows users to select the first courseware element on the courseware creation page. Then, through touch, mouse, or keyboard controls, users input the corresponding first element data. The selected first courseware element is then displayed on the canvas of the courseware creation page according to its corresponding first element data. When the save button is triggered, all first element data corresponding to the canvas on the courseware creation page are retrieved. It should be noted that the first courseware element includes all first element data corresponding to the canvas on the courseware creation page; the first element data is contained within all element data.
[0186] S407, if a courseware save instruction for the first courseware is received, the code execution container is used to perform format conversion on the first element data.
[0187] In one implementation, when the courseware element adding device is in courseware editing mode, it opens a courseware creation page. This page includes a save button to trigger a save command. It is understood that when the save button is triggered, a save command is generated for the first courseware being created on the page. In this embodiment, the format conversion refers to converting the element data's first data format to the courseware storage format. The first data format is the data format of the element data when the courseware creation page generates the element data, while the courseware storage format is the data storage format supported by the client itself, i.e., the data storage format set by the second client.
[0188] When the courseware element adding device receives a save button for the courseware, it uses code to run a container to convert all element data corresponding to the first courseware from the first data format to the courseware storage format.
[0189] S408, Generate a second courseware based on the first element data after format conversion, and save the second courseware.
[0190] In one implementation, the courseware element adding device associates the data of each first element after format conversion, records each first element data into the same file to obtain the second courseware, and finally saves the second courseware in the storage module of the courseware element adding device.
[0191] During the courseware creation process, the element code of the courseware elements is directly executed through a code execution container, allowing the courseware elements to be directly added to the canvas. By having the user adjust the attributes of the courseware elements to obtain the related element data, the data format of the element data is not a data format that the courseware element adding device can support locally. Therefore, when storing the courseware, the element data is further converted through the code execution container, so that the converted element data can be stored and recognized locally on the courseware element adding device, ensuring the usability of the courseware.
[0192] Meanwhile, by converting the format of the first element data to generate and save a second courseware with a unified data format (i.e., courseware storage format), different courseware element adding devices can generate courseware with the same data format, thereby ensuring that the courseware can be displayed on all courseware element adding devices and improving the compatibility of the courseware.
[0193] In some possible implementations, users need to directly display pre-prepared courseware. The following embodiments focus on how to display pre-prepared courseware.
[0194] Please see Figure 6This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 6 As shown, the method may include the following steps S501-S503.
[0195] S501, retrieve the data of the second element in the third courseware that needs to be displayed.
[0196] In one implementation, the element data corresponding to the courseware element can be: element identifier, element size, element color, element shape, element position on the courseware creation page, element rotation angle, etc., which are not limited here.
[0197] The courseware element adding device receives a third courseware to be displayed from other devices (such as other clients, portable storage devices, etc.), or retrieves the third courseware to be displayed from the storage module based on the user's display command; then it retrieves the second element data in the third courseware. It is understood that the data format of the second element data is the courseware storage format. It is understood that the third courseware may include at least one element data, and the second element data is any element data among the at least one element data included in the third courseware. When loading and displaying the third courseware, at least one element data included in the third courseware will be retrieved. This application embodiment describes the loading process of a single element data.
[0198] S502, the container is run using the code to perform format conversion on the second element data.
[0199] In one implementation, the courseware element adding device converts the second element data from the courseware storage format into a set data format that can be read by the courseware creation page through a code execution container.
[0200] Optionally, since different courseware element adding devices have different operating systems, such as Android, iOS, Windows, Harmony OS, etc., different operating systems use different courseware element adding applications. Specifically, the application's program execution environment is different, and different program execution environments require different data reading formats. It should be noted that the courseware element adding application refers to the application in the courseware element adding device that processes the courseware elements, including the courseware creation page. The courseware element adding application can be an application corresponding to each system or a web browser; there is no limitation here. The courseware element adding device determines the program type corresponding to the currently running courseware element adding application. If the courseware element adding application is a web browser, it obtains the environment type corresponding to the web browser; if the courseware element adding application is a system-specific application, it obtains the environment type corresponding to the operating system's program execution environment. Then, it obtains the data format corresponding to that environment type and converts the data format of the second element data to the data format corresponding to the environment type. Among them, the data format corresponding to the environment type refers to the data format that the courseware element adding application in the courseware element adding device can read and identify the element data; the courseware storage format is the template data format, that is, the data storage format set by the courseware element adding system.
[0201] S503, generate a fourth courseware based on the second element data after format conversion, load the fourth courseware, and display the fourth courseware on the courseware creation page.
[0202] In one implementation, the courseware element adding device associates at least one element data after format conversion, and then loads the at least one element data after format conversion into the same file to obtain a fourth courseware. The at least one element data after format conversion includes the second element data after format conversion. Finally, the fourth courseware is displayed on the courseware creation page of the courseware element adding application through the courseware element adding application.
[0203] In this embodiment of the application, by converting the format of the second element data, a fourth courseware that can be recognized by the courseware element adding application in the courseware element adding device is obtained, so that the courseware that has been made can be displayed on different courseware element adding devices, that is, the courseware can be displayed on all courseware element adding devices, further improving the compatibility of the courseware.
[0204] In some possible embodiments, developers need to develop courseware elements using a courseware element adding device. The following embodiments focus on how to develop courseware elements using a courseware element adding device.
[0205] Please see Figure 7This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 7 As shown, the method may include the following steps S601-S603.
[0206] S601, obtain the first element code of the generated first courseware element and the first element identifier corresponding to the first courseware element, wherein the code format of the first element code is the set code format.
[0207] In one implementation, when a user develops courseware elements using a courseware element adding device, the device receives the first element code and the corresponding first element identifier of the first courseware element input by the user, and associates the first element code and the first element identifier. It is understood that when the user inputs the first element code and the corresponding first element identifier, the user can either write the first element code and the first element identifier using the input device; obtain the code file by inserting a portable storage device (such as a USB flash drive); or directly receive a code file sent by another device to obtain the first element code and the first element identifier.
[0208] S602, using a code execution container, performs performance identification and security scanning on the code of the first element, and obtains performance identification results and security scanning results.
[0209] In one implementation, performance identification refers to identifying the performance parameters used during the execution of the first element code, such as CPU memory and memory fluctuation values, which are not limited here; security scanning refers to performing a security scan on the element code in the code execution container to identify security issues in the element code in order to avoid malicious attacks such as cross-site script injection.
[0210] The courseware element adding device obtains at least one performance parameter of the first element code through the code execution container, and obtains the performance threshold corresponding to each performance parameter. Based on each performance parameter and the corresponding performance threshold, it determines the target performance parameter that exceeds the threshold. If the number of parameters of the target performance parameter is greater than or equal to the parameter threshold, the performance identification result of the first element code is determined to be unqualified. If the number of parameters of the target performance parameter is less than the parameter threshold, the performance identification result of the first element code is determined to be qualified.
[0211] The courseware element adding device performs a security scan on the first element code through a code execution container. If it determines that the first element code does not have any security issues, the security scan result of the first element code is deemed qualified; if it determines that the first element code has security issues, the security scan result of the first element code is deemed unqualified.
[0212] S603, if the performance identification result is qualified and the security scan result is qualified, then the first element identifier and the first element code corresponding to the first element identifier are sent to the courseware element storage device.
[0213] In one implementation, when both the performance identification result and the security scan result are satisfactory, the courseware element adding device generates a courseware element update package based on the associated first element code and first element identifier, and sends the courseware element update package to the courseware element storage device. The courseware element storage device then performs an update operation on the courseware elements based on the received courseware element update package.
[0214] Optionally, when the performance identification result is unqualified, the courseware element adding device outputs a prompt message indicating that the performance of the first courseware element is unqualified and has not passed the element review, so that the developers can optimize the code of the first element of the first courseware element after receiving the prompt message.
[0215] Optionally, when the security scan result is unqualified, the courseware element adding device determines the security issue type of the first element code and outputs a prompt message indicating that the first courseware element is unqualified and has not passed the element review. It can also output the specific security issue type so that developers can optimize the first element code of the first courseware element after receiving the prompt message.
[0216] It should be noted that the first element code of the first courseware element can be developed by the same courseware element adding device and sent to the courseware element storage device for storage, and the same courseware element adding device can request and load the courseware element storage device. Of course, the first element code of the first courseware element can also be developed by other courseware element adding devices and sent to the courseware element storage device for storage. The specific implementation can be based on actual needs.
[0217] In this embodiment, before the first courseware element is published, performance and security issues of the first element code are identified, and only the first courseware element with qualified performance identification and security scan results is allowed to be published. This avoids operational failures and system crashes that may occur when the courseware element adding device runs unqualified courseware elements, ensuring the operational security of the element code and thus improving the operational efficiency of the element code. At the same time, by performing a security scan on the element code to identify malicious code, the code execution process of malicious code is intercepted in a timely manner, thereby improving the security of the element code operation.
[0218] In some possible embodiments, the courseware element storage device needs to provide the courseware element adding device with the relevant data requested by the courseware element adding device. The following embodiments focus on how the courseware element storage device provides the requested data to the courseware element adding device. It is understood that the courseware element storage device can be a server in the courseware element adding system.
[0219] Please see Figure 8 This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 8 As shown, the method is applied to a courseware element storage device and may include steps S701-S703.
[0220] S701, Send a set of element identifiers to the courseware element adding device.
[0221] In one implementation, within the courseware element adding system, the courseware element adding device can be a device that requests courseware-related data from the courseware element storage device to implement the courseware-related functions of the adding device; the courseware element storage device can be a device that provides courseware-related data to the adding device. The element identifier set includes the element identifier of at least one courseware element. It can be understood that the element identifier set is the set of element identifiers for all courseware elements present in the courseware element storage device. It should be noted that courseware elements are stored in the courseware element storage device by associating element codes with element identifiers. For example, the element identifiers in the element identifier set can be stored in a list format. Courseware elements refer to materials used to create courseware, such as triangle molds, quadrilateral molds, font materials, etc.
[0222] The courseware element storage device determines the courseware elements stored in the courseware element storage device, then obtains the element identifier corresponding to each courseware element, generates an element identifier set based on each element identifier, and then sends the element identifier set to the courseware element adding device.
[0223] S702, if a code acquisition request carrying a first element identifier is received from the courseware element adding device, the first element code corresponding to the first element identifier is acquired, and the code format of the element code stored in the courseware element storage device is a set code format.
[0224] In one implementation, the courseware element storage device receives a code retrieval request sent by the courseware element adding device, then retrieves the first element identifier carried in the code retrieval request. The first element identifier is the element identifier corresponding to the first courseware element requested by the courseware element adding device. Then, the device determines the first element code corresponding to the first element identifier and retrieves the first element code corresponding to the first element identifier.
[0225] S703, the first element code corresponding to the first element identifier is sent to the courseware element adding device. The first element code corresponding to the first element identifier is used to add the first courseware element corresponding to the first element identifier to the courseware production page of the courseware element adding device.
[0226] In one implementation, the courseware element storage device sends the first element code corresponding to the first element identifier to the courseware element adding device.
[0227] In this embodiment, by sending a set of element identifiers to the courseware element adding device, the courseware element adding device can select the courseware elements to be added. Based on the code acquisition request of the courseware element sent by the courseware element adding device, the first element code corresponding to the code acquisition request is sent to the courseware element adding device. The courseware element corresponding to the first element identifier can be added to the courseware production page of the courseware element adding device. Since the element code can be run directly through the code execution container, it is only necessary to store the element code in the code format supported by the code execution container to meet the running requirements of different courseware element adding devices for element code, which greatly reduces the amount of data to be stored for the element code of the courseware element.
[0228] In some possible embodiments, the courseware element storage device needs to determine when to send the element identifier set. The following embodiments focus on how the courseware element storage device sends the element identifier set.
[0229] Please see Figure 9 This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 9 As shown, the method may include the following steps S801-S803.
[0230] S801, if a request to obtain an element identifier set is received from the courseware element adding device, then the element identifier set is sent to the courseware element adding device.
[0231] In one implementation, the courseware element storage device receives an element identifier set retrieval request sent by the courseware element adding device, then determines the element identifier set to be retrieved, and sends the element identifier set to the courseware element adding device.
[0232] Optionally, the courseware element storage device can first determine the courseware elements it possesses, then obtain the element identifier corresponding to each courseware element, and then generate an element identifier set based on the element identifiers corresponding to multiple courseware elements.
[0233] Optionally, the courseware element storage device may determine at least one courseware element corresponding to the courseware element adding device based on the device identifier or device type carried in the request according to the element identifier set, then obtain the element identifier corresponding to the at least one courseware element, and finally generate an element identifier set based on the obtained element identifier corresponding to the at least one courseware element.
[0234] S802, if a code acquisition request carrying a first element identifier is received from the courseware element adding device, then the first element code corresponding to the first element identifier is acquired, and the code format of the element code stored in the courseware element storage device is a set code format.
[0235] In one implementation, the courseware element storage device receives a code retrieval request sent by the courseware element adding device, then retrieves the first element identifier carried in the code retrieval request. The first element identifier is the element identifier corresponding to the first courseware element requested by the courseware element adding device. Then, the device determines the first element code corresponding to the first element identifier and retrieves the first element code corresponding to the first element identifier.
[0236] S803, the first element code corresponding to the first element identifier is sent to the courseware element adding device. The first element code corresponding to the first element identifier is used to add the first courseware element corresponding to the first element identifier to the courseware production page of the courseware element adding device.
[0237] In one implementation, the courseware element storage device sends the first element code corresponding to the first element identifier to the courseware element adding device.
[0238] In this embodiment of the application, by sending the element identifier set to the courseware element adding device only when a request to obtain the element identifier set is received, the waste of communication resources or communication congestion caused by frequent sending of the element identifier set is avoided, thereby improving the data transmission efficiency of the courseware element storage device and thus improving the efficiency of adding courseware elements.
[0239] In some possible embodiments, developers need to develop courseware elements in the courseware element adding device. The following embodiments focus on how to store newly developed courseware elements.
[0240] Please see Figure 10 This is a flowchart illustrating a method for adding courseware elements, as provided in an embodiment of this application. Figure 10 As shown, the method may include the following steps S901-S902.
[0241] S901, Receive and associate the second element identifier and the second element code sent by the courseware element adding device.
[0242] In one implementation, the courseware element storage device receives a second element identifier and a second element code sent by the courseware element adding device, and then associates and saves the second element identifier and the second element code in the storage module.
[0243] Optionally, the courseware element storage device first determines whether there is a target element identifier in the storage module that matches the second element identifier. If there is a target element identifier that matches the second element identifier, the element code corresponding to the target element identifier is replaced with the second element code. If there is no target element identifier that matches the second element identifier, the second element identifier and the second element code are directly associated and saved.
[0244] S902, Update the element identifier set based on the second element identifier.
[0245] In one implementation, the courseware element storage device updates the element identifier set based on the identifiers of each second element in the storage module.
[0246] In this embodiment of the application, by updating the second element identifier and the second element code in the courseware element storage device, the courseware elements provided by the courseware element storage device are updated, thereby realizing the development function of courseware elements.
[0247] The following will be combined with the appendix Figure 11 - Appendix Figure 14 This application provides a detailed description of the courseware element adding device according to its embodiments. It should be noted that... Figure 11 - Appendix Figure 14 Courseware element adding device, used to perform this application Figures 2-10 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figures 2-10 The example shown.
[0248] Please see Figure 11 This is a schematic diagram of the structure of a courseware element adding device provided in an embodiment of this application. Figure 11 As shown, the courseware element adding device 1 in this embodiment of the application may include an acquisition module 11, a request module 12, and an adding module 13.
[0249] Module 11 is used to obtain the set of element identifiers provided by the courseware element storage device;
[0250] The request module 12 is used to respond to the element selection instruction generated based on the element identifier set, obtain the first element identifier in the element selection instruction, generate a code acquisition request based on the first element identifier, and request the first element code corresponding to the first element identifier from the courseware element storage device. The code format of the element code stored in the courseware element storage device is a set code format.
[0251] Add module 13, which is used to run the code of the first element using a code execution container, so as to add the first courseware element corresponding to the first element identifier to the courseware creation page.
[0252] In this embodiment, by setting a code execution container in the courseware element adding device, the courseware element adding device can directly run the element code uploaded by the developer after obtaining it from the courseware element storage device. This avoids the situation where different courseware element adding devices support different code formats, requiring repeated development of the same courseware element using different code formats. At the same time, developers do not need to agree on the code format supported by the courseware element adding device. For the same courseware element, the development work can be completed once using one code format, reducing the development steps of the courseware element and improving the development and running efficiency of the courseware element.
[0253] Optional, please see Figure 12 This is a schematic diagram of the structure of a courseware element adding device provided in an embodiment of this application. Figure 12 As shown, the courseware element adding device 1 in this embodiment of the application may include an acquisition module 11, a request module 12, an adding module 13, a saving module 14, a loading module 15, and an adding module 16.
[0254] In one implementation, module 11 is specifically used for:
[0255] If the system detects that the program has entered the courseware editing state, it requests a set of element identifiers from the courseware element storage device.
[0256] In one implementation, module 13 is specifically used for:
[0257] The code execution container is used to preprocess the code of the first element to obtain the code of the target element. The code preprocessing includes code parsing and isolation processing.
[0258] The code execution container is used to run the target element code to add the first courseware element corresponding to the first element identifier to the courseware creation page.
[0259] In one implementation, the storage module 14 is specifically used for:
[0260] Based on the first courseware element, courseware is created to obtain the first courseware, and the first element data corresponding to the first courseware element in the first courseware is obtained;
[0261] If a courseware save instruction is received for the first courseware, the code execution container is used to perform format conversion on the first element data;
[0262] The second courseware is generated based on the first element data after format conversion, and the second courseware is saved.
[0263] In one implementation, module 15 is loaded, specifically for:
[0264] Retrieve the data of the second element from the third presentation slide that needs to be displayed;
[0265] The container is run using the code described above to perform format conversion on the second element data;
[0266] The fourth courseware is generated based on the second element data after format conversion, and the fourth courseware is loaded to be displayed on the courseware creation page.
[0267] In one implementation, module 16 is added, specifically for:
[0268] Obtain the first element code of the generated first courseware element and the first element identifier corresponding to the first courseware element, wherein the code format of the first element code is the set code format;
[0269] Using a code execution container, the code of the first element is subjected to performance identification and security scanning to obtain performance identification results and security scanning results.
[0270] If the performance identification result is qualified and the security scan result is qualified, then the first element identifier and the first element code corresponding to the first element identifier are sent to the courseware element storage device.
[0271] Please see Figure 13 This is a schematic diagram of the structure of a courseware element storage device provided in an embodiment of this application. Figure 13 As shown, the courseware element storage device 2 in this embodiment may include a list sending module 21, an acquisition module 22, and a code sending module 23.
[0272] List sending module 21 is used to send a set of element identifiers to the courseware element adding device;
[0273] The acquisition module 22 is used to acquire the first element code corresponding to the first element identifier if it receives a code acquisition request carrying the first element identifier sent by the courseware element adding device. The code format of the element code stored in the courseware element storage device is a set code format.
[0274] The code sending module 23 is used to send the first element code corresponding to the first element identifier to the courseware element adding device. The first element code corresponding to the first element identifier is used to add the first courseware element corresponding to the first element identifier to the courseware production page of the courseware element adding device.
[0275] In this embodiment, by sending a set of element identifiers to the courseware element adding device, the courseware element adding device can select the courseware elements to be added. Based on the code acquisition request of the courseware element sent by the courseware element adding device, the first element code corresponding to the code acquisition request is sent to the courseware element adding device. The courseware element corresponding to the first element identifier can be added to the courseware production page of the courseware element adding device. Since the element code can be run directly through the code execution container, it is only necessary to store the element code in the code format supported by the code execution container to meet the running requirements of different courseware element adding devices for element code, which greatly reduces the amount of data to be stored for the element code of the courseware element.
[0276] Optional, please see Figure 14 This is a schematic diagram of the structure of a courseware element storage device provided in an embodiment of this application. Figure 14 As shown, the courseware element storage device 2 in this embodiment of the application may include a list sending module 21, an acquisition module 22, a code sending module 23, and an update module 24.
[0277] In one implementation, the list sending module 21 is specifically used for:
[0278] If a request to obtain an element identifier set is received from the courseware element adding device, then the element identifier set is sent to the courseware element adding device.
[0279] In one implementation, update module 24 is specifically used for:
[0280] Receive and associate the second element identifier and the second element code sent by the courseware element adding device;
[0281] Update the set of element identifiers based on the second element identifier.
[0282] This application embodiment also provides a storage medium that can store multiple program instructions, which are adapted to be loaded and executed by a processor as described above. Figures 2-10The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figures 2-10 The specific details of the illustrated embodiments will not be elaborated here.
[0283] Please see Figure 15 This document provides a schematic diagram of the structure of a computer device according to an embodiment of this application. Figure 15 As shown, the computer device 1000 may include: at least one processor 1001, at least one memory 1005, at least one communication bus 1002, at least one input / output interface 1003, and at least one network interface 1004. The processor 1001 may include one or more processing cores. The processor 1001 connects various parts within the computer device 1000 using various interfaces and lines, and performs various functions of the terminal 1000 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the processor 1001. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The communication bus 1002 is used to implement communication between these components. Figure 15 As shown, the memory 1005, which serves as a storage medium for a terminal device, may include an operating system, a network communication module, an input / output interface module, and a courseware element addition program.
[0284] exist Figure 15 In the computer device 1000 shown, the input / output interface 1003 is mainly used to provide an input interface for users and access devices to obtain data input by users and access devices.
[0285] In one implementation method.
[0286] The processor 1001 can be used to call the courseware element adding program stored in the memory 1005, and specifically perform the following operations:
[0287] Obtain the set of element identifiers provided by the courseware element storage device;
[0288] In response to an element selection instruction generated based on the set of element identifiers, a first element identifier in the element selection instruction is obtained, and a code acquisition request is generated based on the first element identifier. A first element code corresponding to the first element identifier is requested from the courseware element storage device. The code format of the element code stored in the courseware element storage device is the set code format.
[0289] The code of the first element is run using a code execution container to add the first courseware element corresponding to the first element identifier to the courseware creation page.
[0290] Optionally, before executing the process of acquiring the set of element identifiers provided by the courseware element storage device, the processor 1001 further performs the following operations:
[0291] If the system detects that the program has entered the courseware editing state, it requests a set of element identifiers from the courseware element storage device.
[0292] Optionally, when the processor 1001 executes the code of the first element using the code execution container to add the first courseware element corresponding to the first element identifier to the courseware creation page, it specifically performs the following operations:
[0293] The code execution container is used to preprocess the code of the first element to obtain the code of the target element. The code preprocessing includes code parsing and isolation processing.
[0294] The code execution container is used to run the target element code to add the first courseware element corresponding to the first element identifier to the courseware creation page.
[0295] Optionally, the processor 1001 can also be used to call the courseware element adding program stored in the memory 1005, and specifically perform the following operations:
[0296] Based on the first courseware element, courseware is created to obtain the first courseware, and the first element data corresponding to the first courseware element in the first courseware is obtained;
[0297] If a courseware save instruction is received for the first courseware, the code execution container is used to perform format conversion on the first element data;
[0298] The second courseware is generated based on the first element data after format conversion, and the second courseware is saved.
[0299] Optionally, the processor 1001 can also be used to call the courseware element adding program stored in the memory 1005, and specifically perform the following operations:
[0300] Retrieve the data of the second element from the third presentation slide that needs to be displayed;
[0301] The container is run using the code described above to perform format conversion on the second element data;
[0302] The fourth courseware is generated based on the second element data after format conversion, and the fourth courseware is loaded to be displayed on the courseware creation page.
[0303] Optionally, the processor 1001 can also be used to call the courseware element adding program stored in the memory 1005, and specifically perform the following operations:
[0304] Obtain the first element code of the generated first courseware element and the first element identifier corresponding to the first courseware element, wherein the code format of the first element code is the set code format;
[0305] Using a code execution container, the code of the first element is subjected to performance identification and security scanning to obtain performance identification results and security scanning results.
[0306] If the performance identification result is qualified and the security scan result is qualified, then the first element identifier and the first element code corresponding to the first element identifier are sent to the courseware element storage device.
[0307] In this embodiment, by setting a code execution container in the courseware element adding device, the courseware element adding device can directly run the element code uploaded by the developer after obtaining it from the courseware element storage device. This avoids the situation where different courseware element adding devices support different code formats, requiring repeated development of the same courseware element using different code formats. At the same time, developers do not need to agree on the code format supported by the courseware element adding device. For the same courseware element, the development work can be completed once using one code format, reducing the development steps of the courseware element and improving the development and running efficiency of the courseware element.
[0308] In one embodiment.
[0309] The processor 1001 can be used to call the courseware element adding program stored in the memory 1005, and specifically perform the following operations:
[0310] Send a set of element identifiers to the courseware element adding device;
[0311] If a code retrieval request carrying a first element identifier is received from the courseware element adding device, then the first element code corresponding to the first element identifier is retrieved, and the code format of the element code stored in the courseware element storage device is a set code format;
[0312] The first element code corresponding to the first element identifier is sent to the courseware element adding device. The first element code corresponding to the first element identifier is used to add the first courseware element corresponding to the first element identifier to the courseware production page of the courseware element adding device.
[0313] Optionally, when the processor 1001 executes the step of sending the set of element identifiers to the courseware element adding device, it specifically performs the following operations:
[0314] If a request to obtain an element identifier set is received from the courseware element adding device, then the element identifier set is sent to the courseware element adding device.
[0315] Optionally, the processor 1001 can also be used to call the courseware element adding program stored in the memory 1005, and specifically perform the following operations:
[0316] Receive and associate the second element identifier and the second element code sent by the courseware element adding device;
[0317] Update the set of element identifiers based on the second element identifier.
[0318] In this embodiment, by sending a set of element identifiers to the courseware element adding device, allowing the device to select the courseware elements to be added, and based on the code retrieval request sent by the device, sending the first element code corresponding to the code retrieval request, the courseware element corresponding to the first element identifier can be added to the courseware creation page of the device. Since the element code can be directly executed through the code execution container, only the element code in the code execution container's supported code format needs to be stored, thus satisfying the execution requirements of different courseware element adding devices and significantly reducing the amount of stored data for the courseware element code.
[0319] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0320] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0321] The above is a description of a method for adding courseware elements, a device for adding courseware elements, a storage device for courseware elements, a storage medium, and an equipment provided in this application. For those skilled in the art, based on the ideas of the embodiments of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for adding a courseware element, characterized in that, The application is applied to a courseware element adding system, the courseware element adding system comprises a first client, a second client and a server, the first client and the second client are provided with functionally identical code running containers, the code running containers are used for performing security scanning and performance identification on element codes with a set code format before the element codes are sent to the server, and the code running containers are also used for running element codes with the set code format sent by the server, and the method comprises the following steps of: The server receives and saves a first element identifier and a first element code of a first courseware element sent by the first client in association; The server updates an element identifier set based on the first element identifier; The server provides the second client with the element identifier set; The second client receives the element identifier set, acquires a first element identifier in an element selection instruction generated based on the element identifier set, generates a code acquisition request based on the first element identifier, sends the code acquisition request carrying the first element identifier to the server, and the code acquisition request is used for requesting a first element code corresponding to the first element identifier; The server receives the code acquisition request, acquires the first element code corresponding to the first element identifier based on the first element identifier in the code acquisition request, and sends the first element code corresponding to the first element identifier to the second client, wherein the code format of the element code stored in the server is the set code format; The second client receives the first element code, runs the first element code by using the code running container, and adds a first courseware element corresponding to the first element identifier to a courseware production page.
2. The method of claim 1, wherein, Before the server provides the second client with the element identifier set, the following further steps are included: If the second client detects that it enters a courseware editing state, the second client requests the element identifier set from the server; The server provides the second client with the element identifier set, including: If the server receives an element identifier set acquisition request sent by the second client, the server sends the element identifier set to the second client.
3. The method according to any of claims 1-2, characterized in that, The second client receives the first element code, runs the first element code by using the code running container, and adds a first courseware element corresponding to the first element identifier to a courseware production page, including: The second client receives the first element code, and performs code preprocessing on the first element code by using the code running container to obtain a target element code, the code preprocessing includes code analysis and isolation processing; The second client runs the target element code by using the code running container to add the first courseware element corresponding to the first element identifier to the courseware production page.
4. The method of claim 3, wherein, Further comprising: The second client performs courseware production based on the first courseware element to obtain a first courseware, and acquires first element data corresponding to the first courseware element in the first courseware. If the second client receives a courseware saving instruction for the first courseware, the second client uses the code running container to format convert the first element data; The second client generates a second courseware based on the formatted first element data, and saves the second courseware.
5. The method of claim 3, wherein, Further comprising: The second client obtains second element data in a third courseware to be displayed; The second client uses the code running container to format convert the second element data; The second client generates a fourth courseware based on the formatted second element data, loads the fourth courseware, and displays the fourth courseware in the courseware production page.
6. The method of claim 1, wherein, Before the server receives and associates the first element identifier and the first element code of the first courseware element sent by the first client, further comprising: The first client obtains the first element code of the generated first courseware element and the first element identifier corresponding to the first courseware element, and the code format of the first element code is the set code format; The first client uses the code running container to perform performance identification and security scanning on the first element code to obtain performance identification results and security scanning results; If the performance identification result is qualified and the security scanning result is qualified, the first client sends the first element identifier and the first element code corresponding to the first element identifier to the server.
7. A method for adding a courseware element, characterized by, Applied to a courseware element adding device, the courseware element adding device is provided with a code running container, the code running container is used to perform security scanning and performance identification on element code with a set code format before the element code is sent to a server, and the code running container is also used to run element code with the set code format sent by the server, and the method comprises: Obtain an element identifier set provided by a courseware element storage device; In response to an element selection instruction generated based on the element identifier set, obtain a first element identifier in the element selection instruction, and generate a code acquisition request based on the first element identifier, and request the first element code corresponding to the first element identifier from the courseware element storage device; the code format of the element code stored in the courseware element storage device is the set code format; Use the code running container to run the first element code to add a first courseware element corresponding to the first element identifier to a courseware production page.
8. The method of claim 7, wherein, Before the element identifier set provided by the courseware element storage device is obtained, further comprising: If it is detected that the courseware editing state is entered, the element identifier set is requested from the courseware element storage device.
9. The method according to any of claims 7-8, characterized in that, The first element code is run by the code running container to add the first courseware element corresponding to the first element identifier to the courseware production page, comprising: The code running container is used to pre-process the first element code to obtain target element code, and the code pre-processing includes code parsing and isolation processing; The code running container is used to pre-process the first element code to obtain target element code, and the code pre-processing includes code parsing and isolation processing; The target element code is run by using the code running container to add the first element identification corresponding first courseware element into the courseware production page.
10. The method of claim 8, wherein, Further comprising: Based on the first courseware element, courseware production is performed to obtain a first courseware, and first element data corresponding to the first courseware element in the first courseware is acquired; If a courseware saving instruction for the first courseware is received, the first element data is format-converted by using the code running container; Based on the format-converted first element data, a second courseware is generated, and the second courseware is saved.
11. The method of claim 7, wherein, Further comprising: Acquire second element data in a third courseware that needs to be displayed; The second element data is format-converted by using the code running container; Based on the format-converted second element data, a fourth courseware is generated, and the fourth courseware is loaded to display the fourth courseware in the courseware production page.
12. The method of claim 7, wherein, Further comprising: Acquire the first element code of the generated first courseware element and the first element identification corresponding to the first courseware element, and the code format of the first element code is the set code format; The performance identification result and the security scanning result are obtained by performing performance identification and security scanning on the first element code by using the code running container. If the performance identification result is qualified and the security scanning result is qualified, the first element identification and the first element code corresponding to the first element identification are sent to the courseware element storage device.
13. A method for adding a courseware element, characterized by, Applied to a courseware element storage device, the method comprises: Send an element identification set to a courseware element adding device; If a code acquisition request carrying a first element identification sent by the courseware element adding device is received, acquire the first element code corresponding to the first element identification, and the code format of the element code stored in the courseware element storage device is a set code format; Send the first element code corresponding to the first element identification to the courseware element adding device, and the first element code corresponding to the first element identification is used to add the first courseware element corresponding to the first element identification to the courseware production page of the courseware element adding device; The code running container is arranged in the courseware element adding device, and the code running container is used to perform security scanning and performance identification on the element code before the element code with the set code format is sent to a server, and the code running container is also used to run the element code with the set code format sent by the server.
14. The method of claim 13, wherein, The element identification set is sent to the courseware element adding device, comprising: If an element identification set acquisition request sent by the courseware element adding device is received, the element identification set is sent to the courseware element adding device.
15. The method of claim 14, wherein, Further comprising: Receive and associate save the second element identification and the second element code sent by the courseware element adding device; Based on the second element identification, update the element identification set. Further comprising: Receive and associate save the second element identification and the second element code sent by the courseware element adding device; Based on the second element identification, update the element identification set.
16. An apparatus for adding a courseware element, characterized by: The courseware element adding device is provided with a code running container, which is used for performing security scanning and performance identification on the element code with the set code format before the element code is sent to the server, and is also used for running the element code with the set code format sent by the server, and the code running container comprises: The acquisition module is configured to acquire the element identifier set provided by the courseware element storage device. The request module is configured to acquire a first element identifier in an element selection instruction generated based on the element identifier set, generate a code acquisition request based on the first element identifier, and request the courseware element storage device for a first element code corresponding to the first element identifier, wherein the code format of the element code stored in the courseware element storage device is a set code format. The adding module is configured to run the first element code by using the code running container, so as to add a first courseware element corresponding to the first element identifier to a courseware production page.
17. A course element storage device, characterized by The list sending module is configured to send the element identifier set to the courseware element adding device. The acquisition module is configured to acquire a first element code corresponding to a first element identifier if a code acquisition request carrying the first element identifier is received from the courseware element adding device, wherein the code format of the element code stored in the courseware element storage device is a set code format. The code sending module is configured to send the first element code corresponding to the first element identifier to the courseware element adding device, and the first element code corresponding to the first element identifier is used to add a first courseware element corresponding to the first element identifier to a courseware production page of the courseware element adding device. The computer program is executed by the processor to implement the courseware element adding method in any one of claims 7-15.
18. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the courseware element adding method in any one of claims 7-15.
19. A computer device, comprising: The computer program is executed by the processor to implement the courseware element adding method in any one of claims 7-15.
Citation Information
Patent Citations
Layout generation method and apparatus
CN105446951A
Interface element display method and device, computer equipment and storage medium
CN110841285A