A classroom course selection conflict checking method, system, device and storage medium
Patent Information
- Application Number
- CN202311048101.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-08-18
AI Technical Summary
[0003]传统的学生可选课堂选课与已选课堂选课冲突的检查算法,主要是通过不断轮询数据库的方式,每一次检查都需要连接一次数据库,造成巨大的资源浪费;并且其他采用缓存方式的方法提升效果不明显
[0011] This method constructs a matrix based on the usage frequency of each element, storing frequently used elements in a single matrix. Querying this matrix increases the probability of a match and reduces query time. Then, all constructed matrix sets are prioritized to obtain a sorted set. Finally, class selection conflict checks are performed based on this sorted set. Since the query time for each matrix set differs, prioritizing the matrix sets ensures that the matrix with the highest probability of a match and the shortest query time is queried first. Therefore, this method improves the efficiency of class selection conflict checking in high-concurrency scenarios.
Smart Images

Figure CN117196561B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of classroom course selection conflict detection technology, and in particular to a method, system, device and storage medium for classroom course selection conflict detection. Background Technology
[0002] Currently, course selection is a crucial part of university teaching activities, especially in comprehensive universities. The course selection module of academic affairs management software is a key module supporting this process. The challenges of course selection generally stem from two aspects: firstly, the module's performance cannot support a large number of users; secondly, the processing of course selection data under high traffic and high concurrency scenarios cannot meet the consistency requirements of the business. These two factors lead to a poor user experience for students during course selection. In classroom course selection, especially in the scenario of university-wide elective courses, students have high real-time requirements for resolving conflicts between available and already selected classes in terms of time, location, and classroom, resulting in large data interactions and concentrated decision-making time. Solving the problem of resolving classroom conflict judgments in high-concurrency scenarios is key to ensuring a smooth course selection process for students.
[0003] Traditional algorithms for detecting conflicts between student-selectable and already-selected course choices primarily rely on continuously polling the database. Each check requires a database connection, resulting in significant resource waste. Furthermore, other caching methods do not offer substantial improvements. Summary of the Invention
[0004] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a method, system, device, and storage medium for checking class course selection conflicts, which can improve the efficiency of checking class course selection conflicts in high-concurrency scenarios.
[0005] In a first aspect, embodiments of the present invention provide a method for checking class course selection conflicts, the method comprising:
[0006] Multiple first matrix sets are constructed according to the occupancy of each class, and multiple second matrix sets are constructed according to the occupancy of all classes each day based on the multiple first matrix sets;
[0007] Within a first preset time period, multiple third matrix sets are constructed based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used; and multiple fourth matrix sets are constructed based on the multiple third matrix sets according to the daily occupancy of all classes;
[0008] The first matrix set, the second matrix set, the third matrix set, and the fourth matrix set are sorted by priority to obtain a sorted matrix set;
[0009] Classroom course selection conflict checks are performed based on the sorted set of matrices.
[0010] Compared with the prior art, the first aspect of the present invention has the following beneficial effects:
[0011] This method constructs a matrix based on the usage frequency of each element, storing frequently used elements in a single matrix. Querying this matrix increases the probability of a match and reduces query time. Then, all constructed matrix sets are prioritized to obtain a sorted set. Finally, class selection conflict checks are performed based on this sorted set. Since the query time for each matrix set differs, prioritizing the matrix sets ensures that the matrix with the highest probability of a match and the shortest query time is queried first. Therefore, this method improves the efficiency of class selection conflict checking in high-concurrency scenarios.
[0012] According to some embodiments of the present invention, constructing multiple first matrix sets according to the occupancy of each class period includes:
[0013] Multiple first matrices are constructed based on the daily and class occupancy data throughout the week; wherein, the daily and class occupancy data includes the daily and class occupancy data of each class, the daily and class occupancy data of each teacher, and the daily and class occupancy data of each classroom.
[0014] Construct multiple sets of first matrices by using multiple first matrices corresponding to the class occupancy status for each class per day, multiple first matrices corresponding to the teacher occupancy status for each class per day, and multiple first matrices corresponding to the classroom occupancy status for each class per day.
[0015] According to some embodiments of the present invention, constructing multiple second matrix sets based on the multiple first matrix sets according to the daily occupancy of all classes includes:
[0016] Based on the multiple sets of first matrices, multiple second matrices are constructed from the daily class occupancy information of a week; wherein, the daily class occupancy information includes the daily class occupancy information, the daily teacher occupancy information, and the daily classroom occupancy information.
[0017] Construct multiple sets of second matrices by using multiple second matrices corresponding to the daily class occupancy status, multiple second matrices corresponding to the daily teacher occupancy status, and multiple second matrices corresponding to the daily classroom occupancy status.
[0018] According to some embodiments of the present invention, the step of constructing multiple third matrix sets within a first preset time period, based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used, includes:
[0019] Within a first preset time period, the ratio between the number of times each element in each first matrix in the plurality of first matrix sets is used and the number of times all elements in each first matrix are used is calculated to obtain a plurality of first ratio results;
[0020] If each of the first ratio results is greater than the first preset value, then the corresponding element in the first matrix is stored in the third matrix to obtain a set of multiple third matrices.
[0021] According to some embodiments of the present invention, the step of prioritizing the first matrix set, the second matrix set, the third matrix set, and the fourth matrix set to obtain a sorted matrix set includes:
[0022] The first matrix set, the second matrix set, the third matrix set, and the fourth matrix set are sorted by priority according to the query time, resulting in a matrix set sorted in the order of the fourth matrix set, the third matrix set, the second matrix set, and the first matrix set.
[0023] According to some embodiments of the present invention, the step of performing class selection conflict checking based on the sorted matrix set includes:
[0024] Initialize the hit count for each element in the fourth matrix set and the third matrix set;
[0025] Within a second preset time period, the fourth matrix set is searched first based on the sorted matrix set. If a class selection conflict is found in the fourth matrix set, the hit count of the corresponding element in the fourth matrix set is updated, and the next element is searched based on the sorted matrix set.
[0026] If no class selection conflict is found in the fourth matrix set, then the third matrix set is searched.
[0027] If a class selection conflict is found in the third matrix set, the hit count of the corresponding element in the third matrix set is updated, and the next element is searched according to the sorted matrix set.
[0028] If no class selection conflict is found in the third matrix set, then the second matrix set is searched; if a class selection conflict is found in the second matrix set, then the next element is searched according to the sorted matrix set.
[0029] If no class selection conflict is found in the second matrix set, then search the first matrix set;
[0030] If a class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set; if no class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set until all elements have been searched.
[0031] According to some embodiments of the present invention, the hit count of the corresponding element is updated in the following manner:
[0032] H(x,k)=Time(M x (k+2))
[0033] Where H(x,k) represents the number of hits for the corresponding element, x represents the corresponding element, k represents the original number of hits for the corresponding element, and M... x This represents the matrix containing the corresponding element, and Time represents the second preset time.
[0034] Secondly, embodiments of the present invention also provide a classroom course selection conflict checking system, the classroom course selection conflict checking system comprising:
[0035] The first construction unit is used to construct multiple first matrix sets according to the occupancy of each class, and to construct multiple second matrix sets according to the occupancy of all classes each day based on the multiple first matrix sets.
[0036] The second construction unit is used to construct multiple third matrix sets within a first preset time period, based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used; and to construct multiple fourth matrix sets based on the multiple third matrix sets according to the daily occupancy of all classes.
[0037] The set sorting unit is used to sort the first matrix set, the second matrix set, the third matrix set and the fourth matrix set by priority to obtain a sorted matrix set;
[0038] The conflict checking unit is used to check for class selection conflicts based on the sorted set of matrices.
[0039] Thirdly, embodiments of the present invention also provide a classroom course selection conflict checking device, including at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform a classroom course selection conflict checking method as described above.
[0040] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to execute a classroom course selection conflict checking method as described above.
[0041] It is understood that the beneficial effects of the second to fourth aspects compared with the related technologies are the same as the beneficial effects of the first aspect compared with the related technologies. Please refer to the relevant description in the first aspect above, which will not be repeated here. Attached Figure Description
[0042] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0043] Figure 1 This is a flowchart of a classroom course selection conflict checking method according to an embodiment of the present invention;
[0044] Figure 2 This is a schematic diagram illustrating the construction of classroom matrix set CMSn and classroom matrix set CMn according to an embodiment of the present invention;
[0045] Figure 3 This is a schematic diagram illustrating the construction of classroom matrix set CMSStackn and classroom matrix set CMStackn according to an embodiment of the present invention;
[0046] Figure 4 This is a schematic diagram of a classroom conflict query according to an embodiment of the present invention;
[0047] Figure 5 This is a structural diagram of a classroom course selection conflict checking system according to an embodiment of the present invention;
[0048] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0049] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0050] In the description of this invention, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or implicitly indicating the order of the technical features indicated.
[0051] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the drawings and are only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0052] In the description of this invention, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0053] The challenges of course selection generally stem from two aspects: firstly, the course selection module's performance cannot support a large number of users; secondly, the processing of course selection data in high-traffic, high-concurrency scenarios cannot meet the business consistency requirements. These two factors lead to a poor user experience for students during course selection. In classroom course selection, especially in the scenario of grabbing elective courses across the entire university, students have high real-time requirements for resolving conflicts between available and already selected classes in terms of time, location, and classroom, resulting in large data interactions and concentrated decision-making time. Solving the problem of resolving classroom conflict judgments in high-concurrency scenarios is key to ensuring a smooth course selection process for students.
[0054] However, the traditional algorithm for checking conflicts between student-selectable and already-selected class selections mainly relies on continuously polling the database. Each check requires a database connection, resulting in a huge waste of resources. Furthermore, other methods that use caching do not significantly improve performance.
[0055] To address the aforementioned issues, this invention constructs a matrix based on the frequency of use of each element. This allows frequently used elements to be stored in a single matrix, ensuring a high probability of being matched and a short query time when that matrix is queried. Then, all constructed matrix sets are prioritized to obtain a sorted set. Finally, class selection conflict checks are performed based on this sorted set. Since the query time for each matrix set differs, prioritizing all matrix sets prioritizes queries on matrices with a high probability of being matched and short query times, thus improving the efficiency of class selection conflict checking in high-concurrency scenarios.
[0056] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:
[0057] A stack is a linear data structure with restricted operations. Insertion and deletion operations are limited to the end of the list. This end is called the top of the stack, and the other end is called the bottom of the stack. Inserting a new element into a stack is called pushing, which places the new element on top of the existing top element. Deleting an element from a stack is called popping, which removes the top element and makes its adjacent element the new top element.
[0058] Reference Figure 1 This invention provides a method for checking class course selection conflicts. This method includes, but is not limited to, steps S100 to S400, wherein:
[0059] Step S100: Construct multiple first matrix sets according to the usage of each class, and construct multiple second matrix sets according to the usage of all classes each day based on the multiple first matrix sets;
[0060] Step S200: Within a first preset time period, construct multiple third matrix sets based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used; and construct multiple fourth matrix sets based on the multiple third matrix sets according to the daily course occupancy status.
[0061] Step S300: Sort the first set of matrices, the second set of matrices, the third set of matrices, and the fourth set of matrices by priority to obtain a sorted set of matrices;
[0062] Step S400: Perform a class selection conflict check based on the sorted matrix set.
[0063] In this embodiment, multiple first matrix sets are constructed according to the usage of each class, and multiple second matrix sets are constructed according to the usage of all classes each day. Within a first preset time period, multiple third matrix sets are constructed based on the number of times each element in each first matrix in each first matrix set is used and the total number of times all elements in each first matrix are used. Constructing matrices based on the usage of each element allows frequently used elements to be stored in one matrix, resulting in a high probability of being hit and a short query time when querying that matrix. Multiple fourth matrix sets are constructed based on the usage of all classes each day from the multiple third matrix sets. The first, second, third, and fourth matrix sets are prioritized to obtain a sorted matrix set. Class selection conflict checks are performed based on the sorted matrix set. Since the query time for each matrix set is different, prioritizing all matrix sets will prioritize querying the matrix with a high probability of being hit and a short query time. Therefore, the efficiency of class selection conflict checks can be improved in high-concurrency scenarios.
[0064] In some embodiments, multiple sets of first matrices are constructed according to the occupancy of each class period, including:
[0065] Multiple first matrices are constructed based on the daily and class occupancy data throughout the week; the daily and class occupancy data includes the daily and class occupancy data for each class, the daily and class occupancy data for each teacher, and the daily and class occupancy data for each classroom.
[0066] Construct multiple sets of first matrices by taking multiple first matrices corresponding to the class occupancy status for each class, the teacher occupancy status for each class, and the classroom occupancy status for each class.
[0067] In this embodiment, since there are conflicts in class selection, such as the same class not being able to attend classes in two places at the same time, the same teacher not being able to teach in two places at the same time, and the same classroom not being able to teach two different courses at the same time, a matrix is constructed to identify class selection conflicts more effectively and accurately by recording the class occupancy, teacher occupancy, and classroom occupancy for each class every day.
[0068] In some embodiments, multiple second matrix sets are constructed based on multiple first matrix sets according to the daily occupancy of all classes, including:
[0069] Based on multiple sets of first matrices, construct multiple second matrices based on the daily class occupancy data for each day of the week; where the daily class occupancy data includes the daily class occupancy data, the daily teacher occupancy data, and the daily classroom occupancy data.
[0070] Construct multiple sets of second matrices by taking multiple second matrices corresponding to the daily class occupancy status, multiple second matrices corresponding to the daily teacher occupancy status, and multiple second matrices corresponding to the daily classroom occupancy status.
[0071] In this embodiment, multiple second matrices are constructed based on the daily class occupancy information of a week using multiple first matrix sets. When prioritizing the search of the second matrix sets, if a conflict can be found in the second matrix sets, it will be much faster than directly searching the first matrix sets, thus saving query time.
[0072] In some embodiments, within a first preset time period, multiple third matrix sets are constructed based on the number of times each element in each first matrix in each first matrix set is used and the total number of times all elements in each first matrix are used, including:
[0073] Within a first preset time period, the ratio between the number of times each element in each first matrix in the multiple first matrix sets is used and the number of times all elements in each first matrix are used is calculated to obtain multiple first ratio results;
[0074] If each first ratio result is greater than the first preset value, then the corresponding element in the first matrix is stored in the third matrix to obtain a set of multiple third matrices.
[0075] In this embodiment, by calculating the ratio between the number of times each element is used and the total number of times all elements are used, and then constructing a matrix based on the ratio, frequently used elements can be stored in a matrix. When frequently used elements are stored in a matrix, the probability of being hit is high and the query time is short when querying this matrix first.
[0076] In some embodiments, the first matrix set, the second matrix set, the third matrix set, and the fourth matrix set are sorted by priority to obtain a sorted matrix set, including:
[0077] The first, second, third, and fourth matrix sets are sorted by priority according to the query time, resulting in a matrix set sorted in the order of the fourth, third, second, and first matrix sets.
[0078] In this embodiment, since the query time for each matrix set is different, all matrix sets are prioritized and the matrix with a high probability of being hit and a short query time is queried first. Therefore, the efficiency of checking class selection conflicts can be improved in high-concurrency scenarios.
[0079] In some embodiments, class selection conflict checking is performed based on a sorted set of matrices, including:
[0080] Initialize the hit count for each element in the fourth matrix set and the third matrix set;
[0081] Within the second preset time period, the fourth matrix set is searched first based on the sorted matrix set. If a class selection conflict is found in the fourth matrix set, the hit count of the corresponding element in the fourth matrix set is updated, and the next element is searched based on the sorted matrix set.
[0082] If no class selection conflict is found in the fourth matrix set, then search the third matrix set;
[0083] If a class selection conflict is found in the third matrix set, the hit count of the corresponding element in the third matrix set is updated, and the next element is searched according to the sorted matrix set.
[0084] If no class selection conflict is found in the third matrix set, then search the second matrix set; if a class selection conflict is found in the second matrix set, then search for the next element according to the sorted matrix set.
[0085] If no class selection conflict is found in the second matrix set, then search the first matrix set;
[0086] If a class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set; if no class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set until all elements have been searched.
[0087] In this embodiment, prioritizing the search for matrices with a high probability of being hit and a short query time can greatly reduce the data query range and calculation range, as well as greatly reduce the network bandwidth requirements, and reduce the number of classroom course selection servers and hardware requirements.
[0088] In some embodiments, the hit count of the corresponding element is updated in the following manner:
[0089] H(x,k)=Time(M x (k+2))
[0090] Where H(x,k) represents the number of hits for the corresponding element, x represents the corresponding element, k represents the original number of hits for the corresponding element, and M... x This indicates the matrix containing the corresponding element, and Time indicates the second preset time.
[0091] In this embodiment, if a class selection conflict is found in the fourth matrix set or the third matrix set, the hit count of the corresponding element is updated. This ensures that frequently hit elements remain in the fourth matrix set or the third matrix set, thereby increasing the hit rate of elements, reducing query time, and improving query efficiency.
[0092] To facilitate understanding by those skilled in the art, a set of preferred embodiments is provided below:
[0093] 1. Initialize multiple matrix sets.
[0094] Two types of matrix sets are constructed based on the sets of classes, teachers, and classrooms, and the sets of days of the week / periods (i.e., each class). One set consists of multiple first matrix sets representing the week and the occupancy of each class per day within the week, including the class matrix set SMSn, the teacher matrix set TMSn, and the classroom matrix set CMSn. The other set consists of multiple second matrix sets representing the week and the occupancy of all classes per day within the week, including the class matrix set SMn, the teacher matrix set TMn, and the classroom matrix set CMn, for a total of six matrix sets. Each matrix set consists of n[1,...,n] x*y matrices, where x represents the occupancy of all classes in a day or the occupancy of each class per day, and y represents a week (i.e., Monday to Sunday). Each matrix in the matrix set takes values of [-1, 0, 1]; where 1 represents fully available (i.e., completely occupied), -1 represents partially available (when -1 is taken, the specific week set Wi, where i ranges from [1,..., 22], representing a total of 22 weeks; for example, if some elements corresponding to the first class on each Monday in 22 weeks are not occupied, the value is -1), and 0 represents unavailable (not fully occupied or not occupied at all). See reference. Figure 2 Taking classrooms as an example, we construct classroom matrix set CMSn and classroom matrix set CMn. Figure 2 In CMSn, 'n' represents n classrooms (c1, c2, ..., cn), 'w1, w2, ..., w7' represents Monday to Sunday, 's1, s2, ..., s12' represents 12 classes, and 'sign' indicates the occupancy status of the 12 classes corresponding to 'w1, w2, ..., w7'. For example, if 'w1' and 'sign' are both 1 in CMSn, it means that all 12 classes in 'w1' of CMSn are occupied. Therefore, it can be seen that the query time for CMSn is much shorter than that for CMSn.
[0095] 2. Construct multiple matrix sets using a matrix and probability-based hit method.
[0096] A high-level cache stack, CacheStack, is constructed for each class, teacher, and classroom, totaling six high-level cache stacks (stored in a matrix format). One set consists of multiple third-level matrix sets representing the usage of each class and each day of the week, including the class matrix set SMStackn, the teacher matrix set TMStackn, and the classroom matrix set CMStackn. The other set consists of multiple fourth-level matrix sets representing the usage of all classes and each day of the week, including the class matrix set SMSStackn, the teacher matrix set TMSStackn, and the classroom matrix set CMSStackn. Each stack is sorted by the most recent access time, and data is moved to the top of the stack. When the stack is full, the last data item is popped.
[0097] The elements pushed onto the stack are calculated as follows:
[0098]
[0099] Where Time represents the calculation time per unit of time, typically set to 200ms; x represents matrix M in the initial set of 6 matrices. x The individual element, c1 represents the number of times the individual element x is used per unit time, and p represents the matrix M. p The total number of elements in M, c2 represents the matrix M per unit time. p The number of times each element is used.
[0100] Reference Figure 3 Taking CMSStackn and CMStackn as examples, Time represents the unit of time, Classid represents the class number, week represents the day of the week, Section represents the class number, occupy represents whether the cache is occupied (1 indicates occupied, 0 indicates not occupied), and hit represents the number of hits. The calculated F is sorted, and the highest priority is pushed into the higher-level cache stack CacheStack (i.e., CMSStackn and CMStackn). The number of entries is generally 1 / 10 of the stack length, and the initial value of the hit count hit t is 1.
[0101] The function for calculating the hit count of the high-level cache stack (CacheStack) is:
[0102] H(x,k)=Time(M x (k+2))
[0103] Wherein, Time represents the calculation within a unit of time, and is generally set to 150ms; in order to save the data that is directly hit in the high-level cache stack CacheStack, when performing a course selection conflict query, if the high-level cache stack CacheStack is directly hit, the hit count is directly increased by 2 from the original hit count k, and the latest time is updated.
[0104] 3. Classroom course selection conflict query.
[0105] Based on the matrix set obtained in steps 1 and 2 above, refer to... Figure 4 , Figure 4 This example demonstrates a class selection conflict check performed when students choose a classroom, checking for conflicts between the currently selected classroom and other previously selected classrooms. The conflict check first searches the advanced cache, then queries the initial matrix set, specifically the classroom matrix set CMn in the first matrix set and the classroom matrix set CMSn in the second matrix set.
[0106] It should be noted that the conflict query for classes and teachers in this embodiment is the same as the conflict query for classrooms described above, and will not be described in detail in this embodiment.
[0107] This embodiment uses a matrix and probability-based hit method to quickly incorporate hot data from the initial class, classroom, and teacher matrix sets into a faster, high-level cache stack, CacheStack. Low-hot data is popped out within a unit of time, providing high-speed support for querying data in the three dimensions (i.e., class, classroom, and teacher). This addresses the key to smooth student course selection in high-concurrency scenarios by resolving class selection conflict judgments.
[0108] This embodiment verifies through experiments that, with the same scale of student course selection data, the matrix and probability-based matching method of this embodiment reduces the average time for checking course selection conflicts to half of the original time. Because it uses a probability-based matching method, this method significantly reduces the data query and calculation scope, and also greatly reduces the requirements for network bandwidth, the number of course selection servers, and hardware requirements.
[0109] Reference Figure 5 This invention also provides a classroom course selection conflict checking system, which includes a first construction unit 100, a second construction unit 200, a set sorting unit 300, and a conflict checking unit 400, wherein:
[0110] The first building unit 100 is used to build multiple first matrix sets according to the occupancy of each class, and to build multiple second matrix sets according to the occupancy of all classes each day based on the multiple first matrix sets;
[0111] The second construction unit 200 is used to construct multiple third matrix sets within a first preset time period, based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used; and to construct multiple fourth matrix sets based on the multiple third matrix sets according to the daily occupancy of all classes.
[0112] Set sorting unit 300 is used to sort the first matrix set, the second matrix set, the third matrix set and the fourth matrix set by priority to obtain a sorted matrix set;
[0113] The conflict checking unit 400 is used to check for class selection conflicts based on the sorted set of matrices.
[0114] It should be noted that since the classroom course selection conflict checking system in this embodiment is based on the same inventive concept as the classroom course selection conflict checking method described above, the corresponding content in the method embodiment is also applicable to this system embodiment, and will not be described in detail here.
[0115] See Figure 6 This application also provides a classroom course selection conflict checking device, which includes:
[0116] At least one memory;
[0117] At least one processor;
[0118] At least one program;
[0119] The program is stored in memory, and the processor executes at least one program to implement the above-described method for checking class selection conflicts.
[0120] This electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0121] The electronic devices according to embodiments of this application will now be described in detail.
[0122] The processor 1600 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure.
[0123] The memory 1700 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1700 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1700 and is called and executed by the processor 1600 using the classroom course selection conflict checking method of the embodiments of this disclosure.
[0124] The input / output interface 1800 is used to implement information input and output.
[0125] The communication interface 1900 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0126] Bus 2000 transmits information between various components of the device (e.g., processor 1600, memory 1700, input / output interface 1800, and communication interface 1900);
[0127] The processor 1600, memory 1700, input / output interface 1800 and communication interface 1900 are connected to each other within the device via bus 2000.
[0128] This disclosure also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above-described class selection conflict checking method.
[0129] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0130] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.
[0131] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0132] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0133] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0134] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0135] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed apparatus 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 through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0137] 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.
[0138] 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.
[0139] 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. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, 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 multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. The embodiments of this application have been described in detail above with reference to the accompanying drawings, but this application is not limited to the above embodiments. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of this application.
Claims
1. A method for checking for class scheduling conflicts, the method comprising: The methods for checking class selection conflicts include: Multiple first matrix sets are constructed according to the occupancy of each class, and multiple second matrix sets are constructed according to the occupancy of all classes each day based on the multiple first matrix sets; Within a first preset time period, multiple third matrix sets are constructed based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used; and multiple fourth matrix sets are constructed based on the multiple third matrix sets according to the daily occupancy of all classes; The first matrix set, the second matrix set, the third matrix set, and the fourth matrix set are sorted by priority to obtain a sorted matrix set; Based on the sorted set of matrices, a course selection conflict check is performed, including: Initialize the hit count for each element in the fourth matrix set and the third matrix set; Within a second preset time period, the fourth matrix set is searched first based on the sorted matrix set. If a class selection conflict is found in the fourth matrix set, the hit count of the corresponding element in the fourth matrix set is updated, and the next element is searched based on the sorted matrix set. The hit count of the corresponding element is updated in the following way: wherein, represents the hit number of the corresponding element, represents the corresponding element, represents the original hit number of the corresponding element, represents the matrix where the corresponding element is located, represents the second preset time; If no class selection conflict is found in the fourth matrix set, then the third matrix set is searched. If a class selection conflict is found in the third matrix set, the hit count of the corresponding element in the third matrix set is updated, and the next element is searched according to the sorted matrix set. If no class selection conflict is found in the third matrix set, then the second matrix set is searched; if a class selection conflict is found in the second matrix set, then the next element is searched according to the sorted matrix set. If no class selection conflict is found in the second matrix set, then search the first matrix set; If a class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set; if no class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set until all elements have been searched.
2. The method for checking class selection conflicts according to claim 1, characterized in that, The construction of multiple first matrix sets based on the usage of each class period includes: Multiple first matrices are constructed based on the daily and class occupancy data throughout the week; wherein, the daily and class occupancy data includes the daily and class occupancy data of each class, the daily and class occupancy data of each teacher, and the daily and class occupancy data of each classroom. Construct multiple sets of first matrices by using multiple first matrices corresponding to the class occupancy status for each class per day, multiple first matrices corresponding to the teacher occupancy status for each class per day, and multiple first matrices corresponding to the classroom occupancy status for each class per day.
3. The method for checking class selection conflicts according to claim 1, characterized in that, The construction of multiple second matrix sets based on the multiple first matrix sets according to the daily course occupancy status includes: Based on the multiple sets of first matrices, multiple second matrices are constructed from the daily class occupancy information of a week; wherein, the daily class occupancy information includes the daily class occupancy information, the daily teacher occupancy information, and the daily classroom occupancy information. Construct multiple sets of second matrices by using multiple second matrices corresponding to the daily class occupancy status, multiple second matrices corresponding to the daily teacher occupancy status, and multiple second matrices corresponding to the daily classroom occupancy status.
4. The method for checking class selection conflicts according to claim 1, characterized in that, Within a first preset time period, multiple third matrix sets are constructed based on the number of times each element in each first matrix in each first matrix set is used and the total number of times all elements in each first matrix are used, including: Within a first preset time period, the ratio between the number of times each element in each first matrix in the plurality of first matrix sets is used and the number of times all elements in each first matrix are used is calculated to obtain a plurality of first ratio results; If each of the first ratio results is greater than the first preset value, then the corresponding element in the first matrix is stored in the third matrix to obtain a set of multiple third matrices.
5. The method for checking class selection conflicts according to claim 1, characterized in that, The step of prioritizing the first matrix set, the second matrix set, the third matrix set, and the fourth matrix set to obtain a sorted matrix set includes: The first matrix set, the second matrix set, the third matrix set, and the fourth matrix set are sorted by priority according to the query time, resulting in a matrix set sorted in the order of the fourth matrix set, the third matrix set, the second matrix set, and the first matrix set.
6. A classroom course selection conflict detection system, characterized in that, The classroom course selection conflict detection system includes: The first construction unit is used to construct multiple first matrix sets according to the occupancy of each class, and to construct multiple second matrix sets according to the occupancy of all classes each day based on the multiple first matrix sets. The second construction unit is used to construct multiple third matrix sets within a first preset time period, based on the number of times each element in each first matrix in each first matrix set is used and the number of times all elements in each first matrix are used; and to construct multiple fourth matrix sets based on the multiple third matrix sets according to the daily occupancy of all classes. The set sorting unit is used to sort the first matrix set, the second matrix set, the third matrix set and the fourth matrix set by priority to obtain a sorted matrix set; The conflict checking unit is used to perform class selection conflict checks based on the sorted matrix set, including: Initialize the hit count for each element in the fourth matrix set and the third matrix set; Within a second preset time period, the fourth matrix set is searched first based on the sorted matrix set. If a class selection conflict is found in the fourth matrix set, the hit count of the corresponding element in the fourth matrix set is updated, and the next element is searched based on the sorted matrix set. The hit count of the corresponding element is updated in the following way: in, This indicates the number of times the corresponding element was hit. Indicates the corresponding element. This indicates the original number of hits for the corresponding element. This represents the matrix containing the corresponding element. This indicates the second preset time; If no class selection conflict is found in the fourth matrix set, then the third matrix set is searched. If a class selection conflict is found in the third matrix set, the hit count of the corresponding element in the third matrix set is updated, and the next element is searched according to the sorted matrix set. If no class selection conflict is found in the third matrix set, then the second matrix set is searched; if a class selection conflict is found in the second matrix set, then the next element is searched according to the sorted matrix set. If no class selection conflict is found in the second matrix set, then search the first matrix set; If a class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set; if no class selection conflict is found in the first matrix set, the search continues for the next element based on the sorted matrix set until all elements have been searched.
7. A classroom course selection conflict detection device, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform the classroom course selection conflict checking method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the classroom course selection conflict checking method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Student time priority course selection high-concurrency processing method and system
CN110223203A
College course arrangement method based on urgency degree and backtracking algorithm
CN113269532A