A timetable identification method and device, computer equipment and storage medium
Patent Information
- Application Number
- CN202311162851.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-09-06
AI Technical Summary
[0003]排课准备数据是指自动排课方法之前的输入参数,总的来说,构建排课准备数据比较复杂,且流程较长
[0035]本发明一种课表识别方法、装置、计算机设备和存储介质,包括构建课表中各类元素的字典,构建课表的横坐标哈希表和纵坐标哈希表,遍历课表中的单元格,将单元格中的内容与各类元素的字典进行匹配,若单元格中的内容与标签元素匹配成功,将单元格中的坐标信息和标签信息添加至横坐标哈希表和纵坐标哈希表,若单元格中的内容与课程元素匹配成功,结合单元格中的内容和横坐标哈希表和纵坐标哈希表确定将单元格中的课程信息,将课程信息添加至课程实体结果列表集,遍历整张课表的所有单元格,得到整张课表的课程实体结果列表集;通过该方法可以自动识别旧课表中的数据,得到类别清晰的课表数据形成新课表的排课准备,简化排课过程。
Smart Images

Figure CN117217175B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of education system technology, and in particular to a timetable recognition method, device, computer equipment, and storage medium. Background Technology
[0002] Scheduling is an essential step before teaching. Currently, the scheduling methods on the market require users to manually build scheduling preparation data step by step, such as teacher data, subject data, teacher teaching data, class data, daily schedule data, class time slots, etc.
[0003] Course scheduling preparation data refers to the input parameters before an automatic course scheduling method can be implemented. Generally speaking, constructing course scheduling preparation data is quite complex and involves a lengthy process. Furthermore, different schools have diverse timetable data structures and complex course structures, making it impossible to import all timetable structures and parse them into course scheduling preparation data using a single method. Summary of the Invention
[0004] This invention provides a timetable recognition method, apparatus, computer device, and storage medium, which aims to automatically extract timetable data for scheduling preparation and simplify the scheduling process.
[0005] In a first aspect, the present invention proposes a timetable recognition method, comprising:
[0006] Construct a dictionary of all elements in the timetable;
[0007] Construct a horizontal axis hash table and a vertical axis hash table for the timetable, traverse the cells in the timetable, and match the contents of the cells with the dictionaries of the various types of elements;
[0008] If the content in the cell matches the tag element, the coordinate information and tag information in the cell are added to the horizontal coordinate hash table and the vertical coordinate hash table;
[0009] If the content in the cell matches the course element, the course information in the cell is determined by combining the content of the cell with the horizontal and vertical hash tables, and the course information is added to the course entity result list set.
[0010] Iterate through all cells of the entire timetable to obtain a list of course entities for the entire timetable.
[0011] In one embodiment, before constructing the horizontal axis hash table and the vertical axis hash table of the timetable, the method further includes:
[0012] Get the sheet containing the timetable;
[0013] Iterate through the sheet containing the timetable. If there are blank rows or columns, use Dijkstra's algorithm to split the sheet into several independent timetables.
[0014] In one embodiment, the dictionaries for various elements in the timetable include a Chinese surname dictionary, a grade dictionary, a weekday dictionary, a course dictionary, and a period dictionary.
[0015] In one embodiment, the course elements include single / double weeks and courses, and the timetable recognition method further includes:
[0016] Construct a regular expression for odd / even weeks;
[0017] Iterate through all cells in the timetable, first matching the content of the cells with the regular expression for odd / even weeks, then matching it with the dictionary of course elements, and add the matched odd / even week information and course information to the course entity result list set.
[0018] In one embodiment, after the traversal is completed and the contents of the horizontal axis hash table and the vertical axis hash table are combined to obtain the timetable data, the method further includes:
[0019] Based on the course entity result list set, a new timetable is automatically constructed in conjunction with the new scheduling information.
[0020] In one embodiment, automatically constructing a new timetable based on the timetable data and new scheduling information includes:
[0021] The course entity result list set is converted into a hash table with class names as the key and class as the value.
[0022] Reverse-extract information about various elements from the hash table;
[0023] Based on the information from these various elements, a new timetable is automatically constructed in conjunction with the new scheduling information.
[0024] In one embodiment, it further includes:
[0025] If some timetable information is missing from several independent timetables, the result set of course entity results is obtained by combining all cells in the sheet page containing the timetable;
[0026] The missing timetable information is supplemented based on the information from the course entity result list set of all cells in the sheet.
[0027] Secondly, the present invention also proposes a timetable recognition device, comprising:
[0028] Dictionary building blocks are used to construct dictionaries for various elements in the timetable;
[0029] The first traversal unit is used to construct the horizontal axis hash table and the vertical axis hash table of the timetable, traverse the cells in the timetable, and match the contents of the cells with the dictionary of the various types of elements;
[0030] The tag element matching unit is used to add the coordinate information and tag information of the cell to the horizontal coordinate hash table and the vertical coordinate hash table if the content in the cell matches the tag element successfully.
[0031] The course element matching unit is used to determine the course information in the cell by combining the content of the cell with the horizontal axis hash table and the vertical axis hash table if the content in the cell matches the course element, and add the course information to the course entity result list set.
[0032] The timetable data acquisition unit is used to traverse all cells of the entire timetable to obtain a list of course entity results for the entire timetable.
[0033] Thirdly, the present invention also proposes a computer device, the computer device including a processor and a memory, the memory storing a computer program, which, when loaded and executed by the processor, implements the method described in any of the above-mentioned embodiments.
[0034] Fourthly, the present invention also proposes a computer storage medium storing a computer program, wherein when the computer program is executed, it implements the method described in any one of the above-mentioned methods.
[0035] This invention discloses a timetable identification method, apparatus, computer device, and storage medium. The method includes constructing a dictionary of various elements in the timetable, constructing a horizontal coordinate hash table and a vertical coordinate hash table for the timetable, traversing the cells in the timetable, matching the content of each cell with the dictionary of various elements, adding the coordinate information and label information of the cell to the horizontal and vertical coordinate hash tables if the content of the cell matches a label element, determining the course information in the cell by combining the content of the cell with the horizontal and vertical coordinate hash tables, adding the course information to the course entity result list set, and traversing all cells of the entire timetable to obtain the course entity result list set for the entire timetable. This method can automatically identify data in old timetables, obtain clearly categorized timetable data to prepare for scheduling new timetables, and simplify the scheduling process. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings required for the embodiments are briefly introduced below. The accompanying drawings described below are only the drawings corresponding to some embodiments of the present invention, and those of ordinary skill in the art can obtain drawings of other embodiments based on these accompanying drawings without creative efforts.
[0037] Figure 1 is a method flowchart of a curriculum schedule recognition method in one embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of a curriculum schedule in one embodiment of the present invention;
[0039] Figure 3 is a method flowchart of a curriculum schedule recognition method in another embodiment of the present invention;
[0040] Figure 4 is a schematic structural diagram of a curriculum schedule recognition apparatus in one embodiment of the present invention. Detailed Description of the Embodiments
[0041] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by a person skilled in the art without making creative efforts shall fall within the protection scope of the present invention.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention.
[0043] Referring to Figure 1 , a curriculum schedule recognition method of the present invention, in one embodiment, includes:
[0044] Step S101: Construct dictionaries for various elements in the curriculum schedule.
[0045] Specifically, the dictionaries include a Chinese surname dictionary, a grade dictionary, a weekday dictionary, a course dictionary, a class period dictionary, and the like, and these dictionaries include characters involved in various elements.
[0046] Step S102: Construct a horizontal coordinate hash table and a vertical coordinate hash table of the curriculum schedule, traverse cells in the curriculum schedule, and match the content in the cells with the dictionaries of various elements.
[0047] Step S103: If the content in the cell is successfully matched with a label element, add the coordinate information and label information of the cell to the horizontal coordinate hash table and the vertical coordinate hash table.
[0048] Specifically, the tag elements include various categories of information, such as grade, day of the week, period, morning, afternoon, etc.
[0049] Step S104: If the content in the cell matches the course element, combine the content in the cell with the horizontal and vertical hash tables to determine the course information in the cell, and add the course information to the course entity result list set.
[0050] Course elements are course entity information, including course information for various subjects such as Chinese, mathematics, and English. The course information includes information such as course category and teacher.
[0051] See Figure 2 For example, there is a timetable for Class 7(1). Now, we parse the timetable, construct the horizontal and vertical hash tables of the timetable, get the first non-empty cell A1, and traverse in the four directions of up, down, left and right until the bottom right cell G14 is reached.
[0052] Get the content of cell A1 at the current location, which is Grade 7 (1). Identify whether the content of this cell is a tag element or a course element. If it is a tag element, match the content of cell A1 with the text in the tag element dictionary to get the element type and element content of cell A1, which include: Grade = 7, Class = 1. Add the parsing result to the horizontal axis hash table and the vertical axis hash table to get:
[0053] Horizontal axis hash table 1->[A1: Grade = 7, A1: Class = 1];
[0054] The vertical axis hash table A->[A1: Grade = 7, A1: Class = 1].
[0055] When iterating to cell B3, it identifies whether the content of that cell is a tag element or a course element, and determines it to be a tag element:
[0056] Add 3 to the horizontal axis hash table -> [B3: Day of the week = 1];
[0057] Add B->[B3:day of the week=1] to the y-axis hash table.
[0058] When iterating to cell C4, the system identifies whether the cell's content is a tag element or a course element. If it is determined to be a course element, the system combines this information with the tag information identified sequentially to determine the course information for cell C4 and adds it to the course entity result list set.
[0059] Grade = 7, Class = 1, Week = 1, Period = 2, Course = History, Teacher = Yu Zhiwu. ......
[0061] By repeating this process, the contents of all cells in the entire timetable are traversed to obtain the list of course entities for that timetable, and thus the timetable data.
[0062] Step S105: Traverse all cells of the entire timetable to obtain the course entity result list set of the entire timetable.
[0063] The timetable recognition method in this embodiment constructs a dictionary of various elements in the timetable, traverses all cells in the timetable, constructs a horizontal coordinate hash table and a vertical coordinate hash table for timetable tag elements, traverses all cells in the timetable, matches the content in the cells with the dictionary of various elements, parses out the tag elements, and combines the tag element information and course element information to determine the course information of the cell. All course entity information in the timetable is extracted to obtain the final timetable data. This method can accurately parse out the content of the old timetable, preparing data for the creation of the new timetable.
[0064] See Figure 2 In another embodiment, the present invention provides a timetable recognition method, comprising:
[0065] Step S201: Obtain the sheet containing the timetable.
[0066] In practical applications, an Excel sheet may contain multiple timetables, such as the timetable for Class 1 of Grade 7, the timetable for Class 2 of Grade 7, and the timetable for Class 3 of Grade 7. In this case, the multiple timetables can be split into multiple timetables by class before parsing.
[0067] Step S202: Traverse the sheet containing the timetable. If there are blank rows or columns, use Dijkstra's algorithm to divide the sheet into several independent timetables.
[0068] Specifically, Dijkstra's algorithm can be used to cut out blank rows or columns in the sheet to obtain multiple independent timetables.
[0069] In one embodiment, an Excel timetable file may also include multiple pages, such as timetables for seventh grade, eighth grade, and ninth grade. The sheets are split and each page of the timetable is parsed separately.
[0070] Step S203: Construct a dictionary of various elements in the timetable.
[0071] In one embodiment, the timetable elements further include odd and even weeks, and the timetable recognition method further includes:
[0072] Construct a regular expression for odd and even weeks. Specifically, the format of the regular expression can be: "odd", "even" or "odd\\", "even\\" or "[odd]", "[even]".
[0073] Iterate through all cells in the timetable, match the content of the cells with the regular expression for odd / even weeks, and if the match is successful, add the coordinate information and odd / even week information of the cell to the horizontal coordinate hash table and the vertical coordinate hash table respectively.
[0074] Step S204: Construct the horizontal axis hash table and the vertical axis hash table of the timetable, traverse all cells in the timetable, and match the contents of the cells with the dictionaries of the various types of elements.
[0075] Step S205: If the content in the cell matches the label element successfully, add the coordinate information and label information in the cell to the horizontal coordinate hash table and the vertical coordinate hash table.
[0076] Step S206: If the content in the cell matches the course element, combine the content in the cell with the horizontal and vertical hash tables to determine the course information in the cell, and add the course information to the course entity result list set.
[0077] Step S207: Traverse all cells of the entire timetable to obtain the course entity result list set of the entire timetable.
[0078] Step S208: Based on the course entity result list set timetable data, and combined with the new scheduling information, automatically construct a new timetable. Specifically, this includes:
[0079] The course entity result list set is converted into a hash table with class names as the key and class as the value.
[0080] Reverse-extract information about various elements from the hash table;
[0081] Based on the information from these various elements, a new timetable is automatically constructed in conjunction with the new scheduling information.
[0082] For example, a new semester requires a new timetable. The old timetable already contains relatively fixed course information, including the grade, class, course type, and teacher. By parsing the old timetable and extracting this information, and combining it with the new scheduling information, a new timetable can be automatically generated.
[0083] In one embodiment, if some timetable information is missing from several independent timetables, the result is a list of course entities from all cells in the sheet page containing the timetable.
[0084] The missing timetable information is supplemented based on the information from the course entity result list set of all cells in the sheet.
[0085] For example, if some of the timetables after being split are missing grade information after parsing, the grade information can be found in the parsing results of all cells on the sheet containing that timetable to supplement it, so that the timetable data of each independent timetable obtained after parsing is complete, which makes it easier to generate independent new timetables in the future.
[0086] The timetable recognition method in this embodiment divides multiple sheets in an Excel timetable file, then divides each sheet based on blank rows or columns to obtain multiple independent timetables. After parsing the content of all cells in the timetable, and combining it with new scheduling information, a new timetable for each class can be automatically generated. This method can automatically generate new timetables, greatly saving teachers' workload.
[0087] See Figure 4 The present invention also proposes a timetable recognition device, in one embodiment of which includes:
[0088] Dictionary building unit 10 is used to build dictionaries for various elements in the timetable;
[0089] The first traversal unit 20 is used to construct the horizontal axis hash table and the vertical axis hash table of the timetable, traverse the cells in the timetable, and match the contents of the cells with the dictionary of the various types of elements;
[0090] The tag element matching unit 30 is used to add the coordinate information and tag information of the cell to the horizontal coordinate hash table and the vertical coordinate hash table if the content in the cell matches the tag element successfully.
[0091] The course element matching unit 40 is used to determine the course information in the cell by combining the content of the cell with the horizontal axis hash table and the vertical axis hash table if the content in the cell matches the course element successfully, and add the course information to the course entity result list set.
[0092] The timetable data acquisition unit 50 is used to traverse all cells of the entire timetable to obtain a list of course entity results for the entire timetable.
[0093] In one embodiment, the device further includes:
[0094] The page retrieval unit is used to retrieve the sheet page containing the timetable.
[0095] The segmentation unit is used to traverse the sheet containing the timetable. If there are blank rows or columns, the Dijkstra algorithm is used to segment the sheet to obtain several independent timetables.
[0096] In one embodiment, the dictionaries for various elements in the timetable include a Chinese surname dictionary, a grade dictionary, a weekday dictionary, and a period dictionary.
[0097] In one embodiment, the timetable also includes elements of odd and even weeks, and the device further includes:
[0098] Regular expression building blocks, used to construct regular expressions for odd and even cycles;
[0099] The second traversal unit is used to traverse all cells in the timetable, first matching the content in the cell with the regular expression for odd / even weeks, then matching it with the dictionary of course elements, and adding the matched odd / even week information and course information to the course entity result list set.
[0100] In one embodiment, the device further includes:
[0101] The new timetable construction unit is used to automatically construct a new timetable based on the course entity result list set and the new scheduling information.
[0102] In one embodiment, the new timetable construction unit is specifically used for,
[0103] The course entity result list set is converted into a hash table with class names as the key and class as the value.
[0104] Reverse-extract information about various elements from the hash table;
[0105] Based on the information from these various elements, a new timetable is automatically constructed in conjunction with the new scheduling information.
[0106] In one embodiment, the device further includes:
[0107] The second timetable construction unit is used to combine the course entity result list set of all cells in the sheet page where the timetable is located if some timetable information in several independent timetables is missing.
[0108] The missing timetable information is supplemented based on the information from the course entity result list set of all cells in the sheet.
[0109] The specific process by which each unit performs the corresponding steps described above has been explained in detail in the above method embodiments, and will not be repeated here for the sake of brevity.
[0110] This invention also provides a computer device, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded and executed by the processor, it implements the method steps described in any of the above method embodiments.
[0111] This invention also provides a computer storage medium storing a computer program, which, when executed, implements the steps described in any of the above method embodiments.
[0112] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0113] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0114] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0115] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to it, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a mobile terminal, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0116] In summary, although the present invention has been disclosed above with reference to preferred embodiments, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the concept of the technical solution of the present invention, should be covered within the scope of protection of the present invention.
[0117] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A timetable recognition method, characterized in that, include: Construct a dictionary of all elements in the timetable; Construct a horizontal axis hash table and a vertical axis hash table for the timetable, traverse the cells in the timetable, and match the contents of the cells with the dictionaries of the various types of elements; If the content in the cell matches the tag element, the coordinate information and tag information in the cell are added to the horizontal coordinate hash table and the vertical coordinate hash table; If the content in the cell matches a course element, the course information in the cell is determined by combining the content of the cell with the horizontal and vertical hash tables, and the course information is added to the course entity result list set. Iterate through all cells of the entire timetable to obtain a list of course entities for the entire timetable; Based on the course entity result list set, a new timetable is automatically constructed in combination with the new scheduling information; Before constructing the horizontal and vertical hash tables for the timetable, the following steps are also included: Get the sheet containing the timetable; Traverse the sheet containing the timetable. If there are blank rows or columns, use Dijkstra's algorithm to divide the sheet into several independent timetables. The course elements include single / double weeks and courses, and the timetable recognition method further includes: Construct a regular expression for odd / even weeks; Iterate through all cells in the timetable, first matching the content of the cells with the regular expression for odd / even weeks, then matching it with the dictionary of course elements, and add the matched odd / even week information and course information to the course entity result list set.
2. The timetable recognition method according to claim 1, characterized in that, The dictionaries for various elements in the timetable include Chinese surnames, grade levels, days of the week, courses, and periods.
3. The timetable recognition method according to claim 1, characterized in that, Based on the timetable data and combined with the new scheduling information, a new timetable is automatically constructed, including: The course entity result list set is converted into a hash table with class names as the key and class as the value. Reverse-extract information about various elements from the hash table; Based on the information from these various elements, a new timetable is automatically constructed in conjunction with the new scheduling information.
4. The timetable recognition method according to claim 1, characterized in that, Also includes: If some timetable information is missing from several independent timetables, the result set of course entity results is obtained by combining all cells in the sheet page containing the timetable; The missing timetable information is supplemented based on the information from the course entity result list set of all cells in the sheet.
5. A timetable recognition device, used to implement the timetable recognition method as described in any one of claims 1-4, characterized in that, include: Dictionary building blocks are used to construct dictionaries for various elements in the timetable; The first traversal unit is used to construct the horizontal axis hash table and the vertical axis hash table of the timetable, traverse the cells in the timetable, and match the contents of the cells with the dictionary of the various types of elements; The tag element matching unit is used to add the coordinate information and tag information of the cell to the horizontal coordinate hash table and the vertical coordinate hash table if the content in the cell matches the tag element successfully. The course element matching unit is used to determine the course information in the cell by combining the content of the cell with the horizontal axis hash table and the vertical axis hash table if the content in the cell matches the course element, and add the course information to the course entity result list set. The timetable data acquisition unit is used to traverse all cells of the entire timetable to obtain a list of course entity results for the entire timetable.
6. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that, when loaded and executed by the processor, implements the method as described in any one of claims 1 to 4.
7. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed, implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Course schedule transmission method and device, equipment and storage medium
CN114548064A
Relational data storage method and device, electronic equipment and storage medium
CN114817259A
Excel table analysis method, system and equipment and storage medium
CN114970475A
Analysis method and system of Excel model
CN115310407A