Disclosure of Invention
in view of this, the present invention provides a device and a method for making and analyzing courseware, which implement effective protection of courseware contents by customizing a stream file format of courseware.
in order to achieve the purpose, the invention provides the following technical scheme:
an apparatus for producing courseware, the apparatus for generating courseware of the streaming file type, the apparatus comprising:
The head information generating module is used for converting courseware information configured by a user into head information of the streaming file according to a preset coding strategy, and the head information comprises fixed-length integer data and variable-length character strings; the fixed-length integer data comprises a length integer used for representing the length of the variable-length character string;
And the courseware forming module is used for packaging the multimedia data corresponding to the courseware content after the header information to form a courseware of a stream file type.
Further, the fixed-length integer data is a fixed-length integer variable or byte.
Furthermore, the multimedia data is a multimedia file which adopts an XML file and an organization thereof.
Further, the multimedia data is compressed multimedia data.
an apparatus for parsing courseware of a streaming file type, the apparatus comprising:
The header information analysis module is used for analyzing fixed-length integer data in the header information of the stream file, acquiring courseware information and length integers, acquiring the length of the variable-length character string according to the length integers and calculating the total length of the header information;
And the courseware analyzing module is used for analyzing the multimedia data in the stream file according to the total length of the header information to obtain courseware contents.
based on the same concept, the invention also provides a courseware making method, which is used for generating courseware of a stream file type and comprises the following steps:
Converting courseware information configured by a user into header information of the stream file according to a preset coding strategy, wherein the header information comprises fixed-length integer data and variable-length character strings; the fixed-length integer data is used for representing a length integer of the length of the variable-length character string;
And packaging the multimedia data corresponding to the courseware content after the header information to form the courseware of the stream file type.
further, the fixed-length integer data is a fixed-length integer variable or byte.
Furthermore, the multimedia data is a multimedia file which adopts an XML file and an organization thereof.
Further, the multimedia data is compressed multimedia data.
a courseware parsing method for parsing a courseware of a streaming file type, the method comprising:
Analyzing fixed-length integer data in the header information of the stream file, acquiring courseware information and length integers, acquiring the length of the variable-length character string according to the length integers, and calculating the total length of the header information;
and analyzing the multimedia data in the stream file according to the total length of the header information to obtain courseware contents.
compared with the prior art, the invention can customize the format of the header information part of the stream file, make the header information length unfixed, and add the multimedia data after the header information to form the courseware of the stream file type. When the courseware is analyzed, fixed-length integer data in the header information of the stream file is analyzed, and courseware information and length integers are obtained. Therefore, the length of the variable-length character string is obtained according to the length integer, and the total length of the header information is calculated. The invention can acquire the multimedia data after the header information only after acquiring the length of the header information, so that illegal merchants can not acquire the multimedia data and steal the contents of the electronic courseware, thereby realizing the effective protection of the contents of the electronic courseware in the streaming file type.
Detailed Description
In order to solve the problems, the invention provides a courseware making and analyzing device and a courseware making and analyzing method, which realize effective protection of courseware contents by customizing the format of a stream file.
Referring to fig. 1, it is a schematic structural diagram of a courseware making apparatus provided in the present invention, the apparatus is used for generating courseware of a streaming file type, a basic operating environment of the apparatus includes a CPU, a non-volatile memory, a memory and other hardware, and from a logic level, the apparatus includes:
the head information generating module is used for converting courseware information (such as subjects, applicable grades, teaching material versions and the like) configured by a user into head information of the streaming file according to a preset coding strategy, wherein the head information comprises fixed-length integer data and variable-length character strings; wherein the fixed-length integer data includes a length integer for indicating the length of the variable-length character string.
And the courseware forming module is used for packaging the multimedia data corresponding to the courseware content after the header information to form a courseware of a stream file type.
therefore, the invention improves the conventional stream file format, and adds the multimedia data directly after the header information, which is different from the prior art that the multimedia data is added at the specified position after the header information, so that the position of the first frame data of the multimedia data depends on the length of the header information. In addition, the invention adds the variable-length character string into the header information, so that the length of the header information is not fixed, therefore, under the condition of not knowing the length of the header information, which byte the multimedia data starts from cannot be determined, thereby not acquiring the complete multimedia data and realizing the effective protection of the content of the stream file in the courseware.
in a preferred embodiment of the present invention, the preset encoding policy may be a custom encoding format, and generally some abstractable courseware information such as a grade, a subject, a textbook version, etc. is encoded into fixed-length integer data according to an encoding rule, where the fixed-length integer data may be a fixed-length integer variable (whose type specifier is int) or a byte (whose type specifier is byte). For example, in the 'grade' term, a grade can be represented by an integer variable '1', a grade can be represented by an integer variable '2', and so on; for another example, in the 'subjects' item, the language can be represented by an integer variable '1', the mathematics can be represented by an integer variable '2', and the English can be represented by an integer variable '3'; other items are processed in the same way; and other text content parts in the courseware information are coded into variable-length character strings (the type specifiers of which are string), such as courseware titles, author names, content introduction and the like. The header information obtained in the above manner is shown in fig. 2, and assuming that the order of header storage in the stream is grade, subject, title length, and title, and the grade is represented by a fixed-length integer variable, the integer variable '1' is 'grade one'; the subjects are also represented by fixed-length integer variables, and then the integer variable '1' is 'language'; the title is represented as 'my home' by a variable-length character string, and the storage format is:
[1] [1] [8] [ My host ]
int int int string
Wherein '8' is the length of the character string 'my country', generally one Chinese character occupies two bytes, and the length integer '8' itself also occupies the position of a fixed-length integer variable.
the courseware information is converted into the header information of the streaming file in the mode, the information such as the grade, the subject and the like is coded into integer variables or characters, the occupation of storage space of the streaming file is reduced, the contents of the courseware information are effectively protected through a self-defined coding strategy, and the effect of encrypting the header information can be achieved.
in the invention, multimedia data is added behind the header information, and the multimedia data can be one or a combination of several of multimedia type data such as characters, pictures, animation, audio, video and the like. In a preferred embodiment, the multimedia data is a multimedia file using an XML file and its organization. XML (extensible markup language) is a markup language for marking electronic documents to be structured. It can be used to mark data, define data types, and is a source language that allows a user to define his or her own markup language. Because XML can mark various types of multimedia files such as characters, images, audios, videos, animations and the like, and the marking process is simple, the XML is very suitable for making electronic courseware with rich contents. Compared with the traditional word or PPT courseware, the multimedia file organized by the XML file can be added with files such as pictures, animations, audios and videos, and information in various forms is blended, so that courseware contents are more rich and colorful.
Preferably, the multimedia data can be compressed multimedia data, the capacity of the compressed multimedia data is relatively reduced, and the capacity of the whole courseware is reduced, so that the occupation of network bandwidth is reduced, and the online transmission of files is facilitated.
according to the above courseware making apparatus, the present invention also provides a courseware parsing apparatus, the apparatus is configured to parse a courseware of a streaming file type, as shown in fig. 3, a basic operating environment of the apparatus includes a CPU, a non-volatile memory, a memory, and other hardware, and from a logical aspect, the apparatus includes:
the header information analysis module analyzes fixed-length integer data in the header information of the stream file according to the preset coding strategy, obtains courseware information and length integers in the fixed-length integer data, and obtains the length of the variable-length character string according to the length integers, so that the total length of the header information (namely the sum of the length of the fixed-length integer data and the length of the variable-length character string) is calculated;
The courseware analyzing module can analyze the multimedia data in the stream file according to the total length of the header information, so as to obtain courseware content.
Because the total length of the header information can be determined only by knowing the length of the variable-length character string, the length of the variable-length character string expressed by the length integer in the header information cannot be analyzed under the condition that the encoding rule of the fixed-length integer data in the header information is not known, and the complete multimedia data cannot be obtained by calculating the length of the header information, thereby realizing the effective protection of the stream file content.
Based on the same inventive concept, the invention also provides a courseware making and analyzing method, which realizes effective protection of courseware contents through customizing the data format of the stream file. Since the principle is the same, the description is omitted.
The following describes in detail a specific embodiment of the courseware making and analyzing device provided by the present invention with reference to the accompanying drawings.
fig. 4 is a schematic view of an application of the courseware making and analyzing device according to the present invention. The courseware making device is actually applied to a courseware editor, courseware of the stream file type is made according to courseware content (assumed to be character content, illustration and reading audio of a teacher's chart), courseware information (assumed to be ' first grade ', ' language ', ' people education publisher ', ' book-up ', ' teacher ' and ' Zhuge ' corresponding to the courseware content) configured by courseware making personnel, and the courseware format of the stream file type is shown in fig. 5. The manufacturing method is shown in fig. 6, which comprises the following steps:
101. Converting the configured courseware information into header information of a streaming file according to a preset encoding strategy;
assume that the preset encoding strategy is shown in table 1:
In table 1, an encoding strategy of the fixed-length integer data corresponding to the courseware information is exemplarily shown, and four courseware information of the above grade, subject, teaching material, category, etc. are encoded into the corresponding fixed-length integer data according to the encoding strategy (in this embodiment, the fixed-length integer data takes integer variables as an example). Therefore, the 'one grade' in the 'grade' item in the 'one grade', 'language', 'education press', 'book up', 'teacher' and 'Zhuge' items, the 'one grade' in the 'grade' item, the 'language' in the 'subject' item, the 'education press' in the 'textbook' item, the '2' and the 'book up' in the 'category' item are coded as '1' according to the above coding strategy.
In addition, the title content 'teacher' and the name 'Zhuge Liang' of the author are expressed by two variable-length character strings; since the lengths of the two variable-length character strings of the 'teacher' and the 'Zhuge Liang' are both 6 bytes, two integer variables '6' are used to represent the length integers corresponding to the lengths of the variable-length character strings, and each length integer also occupies the position of one fixed-length integer data (the fixed-length integer data in this embodiment is the integer variable int, so each fixed-length integer data occupies 4 bytes).
102. Organizing a multimedia file containing the courseware content by using an XML file;
in this embodiment, the multimedia file containing the courseware content includes the text content, illustration and reading audio of the teacher's chart, so the multimedia file is marked by the XML file, and is structured, thereby the multimedia file is better organized.
103. Compressing the XML file and the organized multimedia file thereof;
after the multimedia file is organized by using the XML file, the XML file and the organized multimedia file thereof may be compressed into multimedia data by using an open element compression algorithm (Zlib), and in general, a Zlib data header is used for data compression, so that a caller of decompression software does not know where the compressed data ends, and thus the content of the compressed data can be protected, and the compressed multimedia data can save occupied space. In this embodiment, only one of the compression algorithms is exemplified, and other eligible compression algorithms may be used.
104. Compressed multimedia data is added behind the header information to make courseware of a stream file type. The multimedia data is the XML file and multimedia files organized by the XML file (including character contents of a teacher table, illustration and reading audio).
Referring to fig. 4, the courseware editor publishes the manufactured courseware of the stream file type to the website server and the corresponding database thereof through a publishing tool, and adds the courseware as a downloadable resource into a download list of the website server. And the user using the electronic terminal can access the website server through the Internet and download the courseware of the stream file type in the download list.
The courseware analyzing device of the present invention is applied to the electronic terminal, and after the courseware analyzing device obtains the courseware of the stream file type, the analyzing method is as shown in fig. 7, which includes the following steps:
201. Analyzing fixed-length integer data in header information of the stream file to obtain courseware information and length integers;
the electronic terminal can know the preset coding strategy in advance, and the coding strategy is shown in table 1; the courseware analyzing device analyzes the fixed-length integer variable in the header information of the stream file shown in fig. 5 according to the coding strategy, so that four courseware information such as 'first grade', 'language', 'people education publisher', 'book-up', and the like, and a length integer '6' representing 'title length' and a length integer '6' representing 'name length' can be correspondingly obtained; analyzing the title content as a 'go-to-teacher table' according to the 'title length'; the name of the author is analyzed to be 'Zhuge Liang' according to the 'name length'.
202. calculating the total length of the header information;
The courseware analysis device adds the length of each analyzed integer variable and the length of the variable-length character string, and calculates the total length of the header information (namely 4+4+4+4+6+4+6 is 36 bytes).
203. analyzing the multimedia data according to the total length of the header information;
The position of the first frame of the multimedia data can be determined according to the total length (36 bytes) of the header information, so that the multimedia data in the stream file can be analyzed.
204. and decompressing the multimedia data to acquire courseware content.
Because the multimedia data is data after Zlib compression, corresponding decompression operation is performed after the multimedia data is acquired, so as to acquire text contents, illustrations, reading audios and other courseware contents organized by XML files about a teacher table. And then the courseware content is displayed on the electronic terminal, thereby realizing the teaching purpose.
compared with the prior art, the method and the device can customize the format of the header information part of the stream file to ensure that the header information length is not fixed, and then add the multimedia data behind the header information to form the courseware of the stream file type. When the courseware is analyzed, fixed-length integer data in the header information of the stream file is analyzed, and courseware information and length integers are obtained. Therefore, the length of the variable-length character string is obtained according to the length integer, and the total length of the header information is calculated. The invention can acquire the multimedia data information after the header information only after acquiring the length of the header information, and illegal merchants can not acquire the multimedia data information and steal the contents of the electronic courseware, thereby realizing the effective protection of the contents of the electronic courseware in the streaming file type.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.