Data processing method and device, storage medium and computer system

By optimizing class assignment results through adaptive cluster search and combining them with synchronous class conditions, the problem of low scheduling efficiency due to limited classroom resources under the high school flexible class system was solved, and efficient scheduling processing was achieved.

CN121961792APending Publication Date: 2026-05-01HENAN UNIV OF CHINESE MEDICINE +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENAN UNIV OF CHINESE MEDICINE
Filing Date
2026-01-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Under the high school elective system, with limited classroom and teacher resources, existing automatic scheduling methods consume a lot of system time and are difficult to meet various constraints, resulting in low scheduling performance and efficiency.

Method used

An adaptive cluster search method is adopted for class allocation optimization. By combining local search and probability adjustment with synchronous class conditions, the class allocation results are optimized, and hard constraints are considered in the scheduling stage to generate an efficient schedule.

Benefits of technology

It improves the performance and efficiency of class scheduling, ensures that the class assignment results match the synchronous class conditions at the time of scheduling, and reduces system time consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121961792A_ABST
    Figure CN121961792A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a storage medium and a computer system. The method comprises an initial class grouping stage, a class grouping optimization stage and a class arrangement stage. In the initial class grouping stage, initial class grouping is carried out based on a first data set and a second data set, in the class grouping optimization stage, on the basis of an initial class grouping result and under the constraint of a synchronous class condition, adaptive cluster search is used for class grouping optimization to obtain a class grouping optimization result, and in the class arrangement stage, class arrangement and class grouping optimization is carried out based on the class grouping optimization result. According to the invention, the performance and efficiency of course arrangement processing can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing methods, apparatus, storage media and computer systems Technical Field

[0001] This application relates to the field of computer technology, and in particular to data processing methods, apparatus, storage media and computer systems. Background Technology

[0002] In university education, students typically plan their courses independently based on their interests and the requirements of their chosen major, selecting subjects from a range of options. To meet these needs, a computer system can automatically schedule courses by comprehensively analyzing and processing student course selection data along with data on available school resources such as classrooms and faculty.

[0003] With the development of personalized education, high school teaching organization is shifting from the traditional "one-size-fits-all" fixed administrative class model to a "tiered, flexible class system" based on students' personalized subject selection. Under this model, students can choose their college entrance examination subject combinations according to their interests and exam requirements. Based on these needs, the scheduling of classes under the high school flexible class system can also be automated using computer systems through data analysis.

[0004] However, due to the limited teaching resources such as classrooms and teachers in high schools, the current automatic scheduling method requires more system time and may not be able to obtain processing results that meet various constraints in some cases. As a result, the scheduling processing implemented by the computer system has relatively low performance and efficiency. Summary of the Invention

[0005] This application provides a data processing method, apparatus, storage medium, and computer system that can effectively improve the performance and efficiency of timetable processing.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] A data processing method, characterized in that it is applied to a class assignment and scheduling system with flexible class scheduling, the method includes: an initial class assignment stage, a class assignment optimization stage, and a scheduling stage; the initial class assignment stage performs initial class assignment based on a first dataset and a second dataset, the class assignment optimization stage performs class assignment optimization based on the initial class assignment results obtained in the initial class assignment stage to obtain an optimized class assignment result, and the scheduling stage schedules classes based on the optimized class assignment result.

[0008] The class allocation optimization process in the class allocation optimization stage includes:

[0009] The initial class assignment results obtained in the initial class assignment stage are subjected to deep perturbation, and K-1 class assignment results are obtained through local search. The initial class assignment results and the K-1 class assignment results are combined into a class assignment bundle. The initial class assignment results include the matching relationship between student identifiers and class identifiers and the subject selection combination corresponding to the class identifiers.

[0010] Assign a class selection probability to each class selection result in the class selection bundle. And select the current class assignment result in the class assignment cluster according to the class assignment selection probability; where p is the global class assignment probability parameter, and i is the ranking of the class assignment results in the class assignment cluster according to the order of performance from high to low;

[0011] Under the constraints of the synchronous class conditions, a deep perturbation is performed based on the current class assignment results, and a new class assignment result and its associated information are obtained through local search. If the new class assignment result is better than the optimal class assignment result in the class assignment bundle, then p is reset to the initial class assignment probability p0; otherwise, p is updated according to the decay factor α. The new class assignment result is added to the class assignment bundle, and K optimal class assignment results are retained in the class assignment bundle. The step of allocating the class assignment selection probability is returned until the class assignment optimization termination condition is met. The optimal class assignment result in the class assignment bundle is output as the class assignment optimization result.

[0012] The new class assignment results include: the matching relationship between student identifiers and class identifiers, the subject selection combination corresponding to the class identifier, each elective subject corresponding to the class identifier, and the target class identifier and student identifier corresponding to each elective subject; the association information includes the number of vacant seats in each tier of subjects in the subject selection combination corresponding to each class identifier; p0 is greater than a set first threshold, and the synchronous class condition constraints include: for any elective subject corresponding to any class identifier, the number of student identifiers for that elective subject is not greater than the number of vacant seats for that elective subject corresponding to the target class identifier.

[0013] Preferably, the synchronous class conditions further include: for any class identifier corresponding to any elective course, the shorter the elective course chain, the better;

[0014] or,

[0015] In the class allocation optimization stage, after obtaining the class allocation optimization result, it further includes: based on the class allocation optimization result, optimizing each class movement chain to make each class movement chain as short as possible, and taking the optimized result as the class allocation optimization result;

[0016] The class-hopping chain is a combination of multiple sequentially associated class identifiers, and any class identifier is sequentially associated with the target class identifier corresponding to any class-hopping subject.

[0017] Preferably, when selecting the current class assignment result, one class assignment result is selected;

[0018] or,

[0019] When selecting the current class assignment result, L selections are performed to obtain L current class assignment results. Based on the L current class assignment results, L new class assignment results and their associated information are obtained through local searches, with the L local searches performed asynchronously in parallel. When any local search obtains a new class assignment result, the operation of returning to the class assignment selection probability step is executed. When any new class assignment result obtained by any local search is better than the optimal class assignment result in the class assignment bundle, the operation of resetting p to p0 is executed. After all L local searches are completed, the operations of updating p according to the decay factor α, adding to the class assignment bundle, and retaining K optimal class assignment results are executed. L is an integer greater than 1.

[0020] Preferably, the scheduling process in the scheduling phase includes:

[0021] Based on the class division optimization results, an initial timetable that satisfies hard constraints is obtained by scheduling classes; wherein, the initial timetable includes the teachers and class times of all subjects corresponding to each class identifier, and the hard constraints include a set of matching subjects between synchronous classes to ensure time coupling;

[0022] The initial timetable is subjected to deep perturbation, and M-1 intermediate timetables are obtained through local search. The initial timetable and the M-1 intermediate timetables are then combined to form a timetable bundle.

[0023] Assign a scheduling selection probability to each timetable in the timetable bundle. And select the current timetable from the timetable bundle according to the timetable selection probability; where q is the global timetable probability parameter, and j is the ranking of the timetable in the timetable bundle according to performance from high to low;

[0024] Under the premise of satisfying the hard constraints, a deep perturbation is performed based on the current timetable, and a new timetable is obtained through local search. If the new timetable is better than the best timetable in the timetable bundle, then q is reset to the initial scheduling probability q0; otherwise, q is updated according to the decay factor β. The new timetable is added to the timetable bundle, and M best timetables are retained in the timetable bundle. The step of allocating the scheduling selection probability is returned until the scheduling termination condition is met. The best timetable in the timetable bundle is output as the final timetable.

[0025] Wherein, q0 is greater than the set second threshold.

[0026] Preferably, after selecting the current timetable and before obtaining a new timetable through local search, the method further includes: determining N neighboring timetables based on the current timetable according to N pre-set neighbor operations, and the neighboring timetables satisfy the hard constraint of time coupling; assigning a neighbor selection probability to the corresponding neighboring timetable based on the performance evaluation result of each neighboring timetable, and selecting a perturbation neighboring timetable according to the neighbor selection probability; wherein, the better the performance evaluation result of the neighboring timetable, the greater the neighbor selection probability assigned to the corresponding neighboring timetable;

[0027] The current timetable is processed by depth perturbation and local search according to the perturbation neighborhood.

[0028] Preferably, when selecting the current timetable, a timetable is selected;

[0029] or,

[0030] When selecting the current timetable, L′ selections are performed to obtain L′ current timetables. Based on the L′ current timetables, L′ new timetables are obtained through local searches, with the L′ local searches performed asynchronously and in parallel. When any local search obtains a new timetable, the operation of returning to the allocation and scheduling selection probability step is executed. When any new timetable obtained by any local search is better than the best timetable in the timetable bundle, the operation of resetting q to q0 is executed. After all L′ local searches are completed, the operations of updating q according to the decay factor α, adding to the timetable bundle, and retaining M best timetables are executed. L′ is an integer greater than 1.

[0031] Preferably, the performance evaluation result of the neighborhood timetable is determined based on the performance of the neighborhood timetable in terms of the minimum working day constraint of the subject, the class time and class interval of the subject.

[0032] Preferably, the N neighborhood operations include: obtaining a neighborhood timetable by randomly moving the class time of a single subject, obtaining a neighborhood timetable by randomly moving the class time of a matching subject in a synchronous class, obtaining a neighborhood timetable by selecting a single subject and moving its class time to satisfy the minimum workday constraint, obtaining a neighborhood timetable by moving the class time of a subject according to the recommended time, and / or obtaining a neighborhood timetable by moving the class time of a subject according to the required course interval.

[0033] Preferably, if a timetable that meets the performance requirements cannot be found during the scheduling stage, the process returns to the initial class assignment stage until a timetable that meets the performance requirements is found.

[0034] A data processing device is used in a flexible class scheduling system, the device comprising: an initial class assignment module, a class assignment optimization module, and a scheduling module;

[0035] The initial class assignment module is used to perform initial class assignment based on the first dataset and the second dataset provided by the system.

[0036] The class allocation optimization module is used to optimize the class allocation based on the initial class allocation results obtained in the initial class allocation stage, and obtain the optimized class allocation result.

[0037] The scheduling module is used to schedule classes based on the class division optimization results;

[0038] The class division optimization module includes an initial class division cluster submodule, a probability allocation submodule, a local search submodule, a class division cluster update submodule, and an output submodule;

[0039] The initial class assignment bundle submodule is used to perform deep perturbation on the initial class assignment results, obtain K-1 class assignment results through local search, and form a class assignment bundle with the initial class assignment results and the K-1 class assignment results; the initial class assignment results include the matching relationship between student identifiers and class identifiers and the subject selection combination corresponding to the class identifiers;

[0040] The probability allocation submodule is used to assign a class selection probability to each class allocation result in the class allocation cluster. Where p is the global class assignment probability parameter, and i is the ranking of the class assignment results in the class assignment cluster according to performance from high to low.

[0041] The local search submodule is configured to select the current class assignment result in the class assignment bundle according to the class assignment selection probability; it is also configured to, under the constraint of the synchronous class condition, perform deep perturbation based on the current class assignment result, obtain a new class assignment result and its associated information through local search, notify the probability allocation submodule to re-allocate the class assignment selection probability until the class assignment optimization termination condition is met, and take the optimal class assignment result in the class assignment bundle as the class assignment optimization result; it is also configured to reset p to the initial class assignment probability p0 when the new class assignment result is better than the optimal class assignment result in the class assignment bundle.

[0042] The class cluster update submodule is used to update p according to the decay factor α when the new class cluster result is not better than the best class cluster result; it is also used to add the new class cluster result to the class cluster and retain K best class cluster results in the class cluster.

[0043] The output submodule is used to output the class division optimization results;

[0044] The new class assignment results include: the matching relationship between student identifiers and class identifiers, the subject selection combination corresponding to the class identifier, each elective subject corresponding to the class identifier, and the target class identifier and student identifier corresponding to each elective subject; the association information includes the number of vacant seats in each tier of subjects in the subject selection combination corresponding to each class identifier; p0 is greater than a set first threshold, and the synchronous class condition constraints include: for any elective subject corresponding to any class identifier, the number of student identifiers for that elective subject is not greater than the number of vacant seats for that elective subject corresponding to the target class identifier.

[0045] Preferably, the synchronous class conditions further include: for any class identifier corresponding to any elective course, the shorter the elective course chain, the better;

[0046] or,

[0047] The class assignment optimization module further includes a class movement chain optimization submodule, which is used to optimize each class movement chain based on the class assignment optimization result, so that each class movement chain is as short as possible; and is also used to send the optimization result as a new class assignment optimization result to the output unit.

[0048] The class-hopping chain is a combination of multiple sequentially associated class identifiers, and any class identifier is sequentially associated with the target class identifier corresponding to any class-hopping subject.

[0049] Preferably, the class division optimization module includes a local search submodule;

[0050] or,

[0051] The class allocation optimization module includes L asynchronous parallel local search sub-modules; in the local search sub-modules, after obtaining the new class allocation result, the operation of notifying the probability allocation sub-module is executed.

[0052] The class cluster update submodule is used to perform the operation of adding the L new class division results to the class cluster and retaining the K best class division results in the class cluster after the L local search submodules have completed the same round of local search processing; where L is an integer greater than 1.

[0053] Preferably, the scheduling module includes an initial timetable bundle submodule, a probability allocation submodule, a local search submodule, a timetable bundle update submodule, and an output submodule;

[0054] The timetable bundle submodule is used to generate an initial timetable that satisfies hard constraints based on the class division optimization results; to perform deep perturbation on the initial timetable and obtain M-1 intermediate timetables through local search; and to form a timetable bundle by combining the initial timetable and the M-1 intermediate timetables; wherein, the initial timetable includes the teachers and class times of all subjects corresponding to each class identifier, and the hard constraints include a set of matching subjects between synchronous classes to ensure time coupling;

[0055] The probability allocation submodule is used to assign a selection probability to each timetable in the timetable bundle. And select the current timetable from the timetable bundle according to the timetable selection probability; where q is the global timetable probability parameter, and j is the ranking of the timetable in the timetable bundle according to performance from high to low;

[0056] The local search submodule is used to perform a deep perturbation based on the current timetable under the premise of satisfying the hard constraints, and obtain a new timetable through local search; if the new timetable is better than the best timetable in the timetable bundle, then q is reset to the initial scheduling probability q0; otherwise, q is updated according to the decay factor α; the new timetable is added to the timetable bundle, and M best timetables are retained in the timetable bundle. The probability allocation submodule is notified to reallocate the scheduling selection probability until the scheduling termination condition is met, and the best timetable in the timetable bundle is sent as the final timetable to the output submodule; wherein, q0 is greater than a set second threshold;

[0057] The output submodule is used to output the final timetable.

[0058] Preferably, the scheduling module further includes a neighborhood selection submodule, used to determine N neighborhood timetables based on the current timetable according to N preset neighborhood settings, and the neighborhood timetables satisfy the hard constraint of time coupling; it is also used to assign a neighborhood selection probability to the corresponding neighborhood based on the performance evaluation result of each neighborhood timetable, and select a perturbation neighborhood according to the neighborhood selection probability; wherein, the better the performance evaluation result of the neighborhood timetable, the greater the neighborhood selection probability assigned to the corresponding neighborhood;

[0059] The local search submodule is further configured to perform the depth perturbation and local search on the current timetable according to the perturbation neighborhood.

[0060] Preferably, the scheduling module includes a local search submodule;

[0061] or,

[0062] The scheduling module includes L′ asynchronous parallel local search submodules; in each local search submodule, after obtaining the new timetable, the operation of notifying the probability allocation submodule is executed.

[0063] The class cluster update submodule is used to perform the operation of adding L′ new timetables to the class cluster and retaining K optimal timetables in the timetable cluster after all L′ local search submodules have completed the same round of local search processing; where L′ is an integer greater than 1.

[0064] Preferably, the scheduling module further includes a timetable performance monitoring module, which, when it is determined that a timetable whose performance meets the set requirements cannot be found, notifies the initial class assignment module to perform the initial class assignment operation until a timetable whose performance meets the set requirements is found.

[0065] A computer-readable storage medium storing computer instructions thereon, characterized in that, when the instructions are executed by a processor, they can implement any of the data processing methods described above.

[0066] A computer system, the computer system including at least a computer-readable storage medium and a processor;

[0067] The processor is configured to read executable instructions from the computer-readable storage medium and execute the instructions to implement the data processing method described in any of the preceding claims.

[0068] As can be seen from the above technical solution, the data processing method in this application includes three stages: initial class assignment, class assignment optimization, and class scheduling. In the initial class assignment stage, initial class assignment is performed based on the first and second datasets provided by the database. In the class assignment optimization stage, the initial class assignment results are then optimized. Specifically, the initial class assignment result is deeply perturbed to obtain multiple class assignment results, which, together with the initial class assignment result, form a class assignment bundle, which serves as the basis for selecting the initial solution for subsequent local searches. Within the class assignment bundle, the current class assignment result is selected as the initial solution for the local search using the class assignment selection probability. Based on this, a local search is performed according to the synchronous class conditions during scheduling to obtain new class assignment results and their associated information, used to evaluate the performance of the class assignment results and select the better class assignment result to update the class assignment bundle. When the optimal class assignment result in the class assignment bundle is replaced, the initial probability parameter in the class assignment selection probability is increased, increasing the probability of the optimal class assignment result being selected, thereby increasing the depth of mining of the optimal class assignment result. When the optimal class assignment result in the class assignment bundle remains unchanged, the initial probability parameter is decreased, making it easier for the processing to escape local optima and improving processing efficiency. This process of updating the class assignment bundle and performing local search based on the initial solution is repeated cyclically until the class assignment termination condition is met, at which point the optimal class assignment result in the class assignment bundle is output as the optimized class assignment result. Finally, scheduling is performed based on the class allocation optimization results and the first dataset in the database. The above method, on the one hand, uses the constraints on synchronous classes during scheduling for local search of class allocation, thus effectively utilizing the coupling relationship between class allocation and scheduling, and improving scheduling performance through reasonable class allocation; on the other hand, through cyclical processing of class allocation bundles and updating of initial probability parameters, it effectively balances the depth mining of local optima and the timely escape from local optima, thereby improving the efficiency of class allocation and scheduling. Attached Figure Description

[0069] Figure 1 is a schematic diagram of the structure of the computer system 100 provided in this application;

[0070] Figure 2 is a basic flowchart of the data processing method for the class division and scheduling system applied to the flexible class system provided in this application;

[0071] Figure 3 is a schematic diagram of the specific flow of the data processing method in a specific embodiment of this application;

[0072] Figure 4 shows the dynamic change of the class selection probability p during the adaptive cluster search process in a specific embodiment of this application;

[0073] Figures 5a and 5b are schematic diagram 1 and schematic diagram 2 of the walking chain in a specific embodiment of this application, respectively;

[0074] Figures 5c and 5d are schematic diagram 1 and schematic diagram 2 of the optimized shift chain in a specific embodiment of this application, respectively;

[0075] Figures 6a and 6b are schematic diagram 1 and schematic diagram 2 respectively, corresponding to the timetable adjustment of the neighborhood operation N1;

[0076] Figure 7 is a schematic diagram of the basic structure of the data processing device provided in this application;

[0077] Figure 8 is a schematic diagram of the matching results for synchronous classes. Detailed Implementation

[0078] To make the objectives, technical means, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings.

[0079] In current computer-based course scheduling processes, a simple optimization method is typically used to assign classes before scheduling begins. The class assignment results are then used as fixed input for the scheduling process. During scheduling, a scheduling algorithm is employed to arrange courses based on the constraints of the specific class assignment results. In this approach, the independent class assignment process is considered unrelated to the scheduling process. However, analysis of extensive class assignment and scheduling data reveals that the quality of the class assignment results significantly impacts the difficulty of the scheduling process. Reasonable class assignment can effectively improve the performance of the scheduling results. The current independent class assignment process ignores the coupling between class assignment and scheduling, easily leading to infeasible or low-quality scheduling due to unreasonable class assignment results.

[0080] Based on the above analysis, this application performs local search processing for class division under the condition of considering scheduling constraints. At the same time, it uses an adaptive bundle search method to design the structural framework for class division processing, so as to reduce the class division processing time and thus efficiently obtain class division results that are more convenient for scheduling, effectively improving scheduling efficiency.

[0081] Figure 1 is a schematic diagram of the structure of the computer system 100 provided in this application. The computer system 100 includes a processor 130, a memory 120, and a data processing device 110. The memory 120, processor 130, and other components are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The data processing device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or embedded in the operating system (OS) of the computer system 100. The processor 130 is used to execute executable modules stored in the memory 120, such as the software function modules and computer programs included in the data processing device 110.

[0082] The computer system 100 may be, but is not limited to, a smartphone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc.

[0083] The memory 120 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 120 is used to store programs, and the processor 130 executes these programs upon receiving execution instructions.

[0084] The processor 130 may be an integrated circuit chip with signal processing capabilities. The processor 130 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0085] Figure 2 is a basic flowchart of the data processing method provided in this application applied to the computer system shown in Figure 1 (also known as a flexible class scheduling system). As shown in Figures 1 and 2, the method includes the initial class assignment stage in step 201, the class assignment optimization stage in steps 202-205, and the scheduling stage in step 206. Specifically:

[0086] Step 201: Perform initial class assignment based on the first and second datasets provided by the database.

[0087] The database is used to store the first dataset and the second dataset. The first dataset includes students' subject selection data and student identifiers, while the second dataset includes class identifiers and class size information.

[0088] In this step, initial class assignment is performed based on the first and second datasets. The specific initial class assignment process can be carried out using existing methods to obtain the initial class assignment results. These results include the matching relationship between student identifiers and class identifiers, and the subject selection combinations corresponding to the class identifiers. Specifically, the matching relationship between student identifiers and class identifiers reflects the class information of each student, i.e., which student is in which class; the subject selection combinations corresponding to the class identifiers refer to the combinations of subjects within that class that do not require students to move between classes.

[0089] This step can be performed in the processor 130 shown in Figure 1.

[0090] Step 202: Deeply perturb the initial class assignment results, obtain K-1 class assignment results through local search, and combine the initial class assignment results and K-1 class assignment results into a class assignment bundle.

[0091] This application maintains a class assignment bundle, comprising a set of K optimal class assignment results. Through iterative processes, class assignment results are continuously selected from the bundle for deep perturbation and local search to obtain better assignment results. The bundle is then updated to find the globally optimal class assignment result. This method of searching for the optimal class assignment result is called the adaptive bundle search method in this application.

[0092] This step is used to obtain the initial set of class division clusters. Specifically, based on the initial class division results, a deep perturbation is applied, and K-1 new class division results are obtained through local search. The specific deep perturbation and local search processing can be implemented using existing methods.

[0093] Step 203: Assign a class selection probability to each class assignment result in the class assignment bundle. And select the current class assignment result in the class assignment cluster according to the class assignment selection probability.

[0094] Step 204: Under the constraint of synchronous class conditions, perform deep perturbation based on the current class assignment results, and obtain new class assignment results and their related information through local search; if the new class assignment results are better than the best class assignment results in the class assignment bundle, then reset p to the initial class assignment probability p0, otherwise, update p according to the decay factor α; add the new class assignment results to the class assignment bundle, and retain K best class assignment results in the class assignment bundle.

[0095] Step 205: Repeat step 203 until the class division termination condition is met, and output the optimal class division result in the class division cluster as the class division optimization result.

[0096] As mentioned earlier, this application uses an adaptive bundle search method to perform multiple rounds of iterative search to obtain the class division optimization result. Steps 203-204 above describe the specific processing of a single round in the adaptive bundle search method.

[0097] Specifically, in step 203, a subset of class results are selected from all class results in the class cluster as initial solutions for the local search; these are referred to here as the current class results. The selection of the current class results is based on the selection probability assigned to each class result. To distinguish it from subsequent selection probabilities, the selection probability assigned to each class result is referred to here as the class selection probability. The class selection probability represents the probability that the given class result is selected as the current class result. After determining the class selection probability of each class result, the current class result is selected according to this probability using a common selection method (such as roulette wheel selection).

[0098] In the class assignment cluster, the class assignment results are ranked from highest to lowest performance. For the i-th ranked class assignment result, the assigned class selection probability is specifically as follows: Where p is the global class assignment probability parameter, and i is the ranking of the class assignment results in the class assignment cluster according to performance from high to low.

[0099] In the above processing, this application employs a state-aware probabilistic selection mechanism when choosing the current class assignment result. In each iteration of the class assignment cluster, it does not always select the best assignment result as the initial solution for deep perturbation expansion of the local search, but rather selects the current class assignment result based on a probability distribution. The probability p of the i-th ranked class assignment result being selected is... i It follows a geometric distribution with parameter p.

[0100] In step 204, the p-value is dynamically adjusted based on the search status. When a new globally optimal class assignment result is found through a round of local search, p is reset to a higher initial value p0. When the p-value is higher, the higher the ranking of the class assignment result, the greater its probability of being selected, thus prompting the adaptive bundle search method to focus on mining the vicinity of the currently better-performing class assignment result. If no new globally optimal class assignment result is found, p is gradually reduced by a decay factor α, eventually making the probability of class assignment selected by different class assignment results uniform, encouraging the adaptive bundle search method to explore based on the lower-ranked and more diverse class assignment results in the class assignment bundle, thereby escaping local optima. The initial value p0 of p is higher than a set first threshold.

[0101] Furthermore, after selecting the current class assignment result in step 203, in step 204, a new class assignment result is generated by performing a deep perturbation based on the current class assignment result through a local search process (such as simulated annealing). The new class assignment result is added to the old class assignment bundle, and then sorted according to the performance of each class assignment result. Only the K best class assignment results in the class assignment bundle are retained to form a new generation of class assignment bundles.

[0102] Considering the coupling between class assignment and scheduling, to improve the performance and efficiency of scheduling results, the local search based on the current class assignment results in this application is performed under the constraint of synchronous class conditions in scheduling. Because of the introduction of synchronous class conditions, the performance evaluation of the class assignment results also considers the requirements of synchronous classes. Therefore, the new class assignment results, based on the initial class assignment results, further include each elective course corresponding to the class identifier, and the target class identifier and student identifier corresponding to each elective course.

[0103] Specifically, according to the subject selection requirements of the college entrance examination, some subjects are taught in a tiered manner during high school, such as physics, chemistry, biology, geography, and history. These subjects are usually divided into different levels, such as physics for the college entrance examination and physics for the high school graduation examination. The subjects formed after these tiers are called tiered subjects. Students can choose appropriate tiered subjects according to their own interests and form a subject combination with the compulsory subjects for the college entrance examination, such as Chinese, mathematics, and English + physics, chemistry, and biology for the college entrance examination + history, geography, and politics for the high school graduation examination.

[0104] When the subject combinations chosen by all students in a class do not match the subject combinations corresponding to the class identifier, the tiered subjects not included in the subject combinations corresponding to the class identifier are called the elective subjects corresponding to the class identifier. For example, if the subject combination of this class is Chinese, Mathematics, and English + Physics, Chemistry, and Biology for the College Entrance Examination + History, Geography, and Politics for the High School Graduation Examination, and some students in this class have the same subject combination as this class, while the subject combination of the remaining students is Chinese, Mathematics, and English + Physics, Chemistry, and Geography for the College Entrance Examination + History, Biology, and Politics for the High School Graduation Examination, then the elective subjects corresponding to this class identifier include Geography for the College Entrance Examination and Biology for the High School Graduation Examination. Therefore, students in this class whose subject combination is "Chinese, Mathematics, and English + Physics, Chemistry, and Geography for the College Entrance Examination + History, Biology, and Politics for the High School Graduation Examination" will need to attend classes in other classes for the elective subjects of Geography for the College Entrance Examination and Biology for the High School Graduation Examination.

[0105] Students who choose to take a elective course within this class need to attend other classes that include that subject. This class that includes the subject is called the target class, and its identifier is the target class identifier corresponding to the elective course in this class. The student identifier for the elective course is called the student identifier corresponding to that elective course.

[0106] The specific constraints of the synchronous class conditions are as follows: For a certain elective subject B in class A, all students elective to this subject must be assigned to the same class C (the subject selection combination corresponding to class C includes subject B), and the number of empty seats in class C for subject B must be sufficient to accommodate all students from class A in elective subject B. Thus, class A and class C constitute a synchronous class under elective subject B, and class C is called the target class of class A under elective subject B. To introduce the above synchronous class conditions, when generating new class assignment results, the associated information of the class assignment results is further generated, namely, the number of empty seats in each tier of subjects in the subject selection combination corresponding to the class identifier. Here, the number of empty seats refers to: when a certain tier of subject is taught, the number of remaining seats excluding students from the class who have chosen that tier of subject; these empty seats may be seats vacated by students in the class who have not chosen that tier of subject, or seats vacated because the number of students in the class is less than the maximum capacity of the class.

[0107] Based on this, in step 204 above, the specific condition for synchronous classes is: for any class identifier corresponding to any elective course, the number of student identifiers for that elective course is not greater than the number of vacant seats for that elective course corresponding to the target class identifier under that elective course.

[0108] The new class assignment results obtained by local search under the above constraints can better meet the conditions of synchronous classes, so as to facilitate subsequent class scheduling and effectively improve scheduling efficiency.

[0109] The local search process can employ various existing local search methods, such as simulated annealing, which will not be elaborated upon here.

[0110] As described above, steps 203-204 complete one round of the adaptive bundle search method, resulting in an updated class assignment bundle. Next, step 205 initiates the next round of search processing, returning to and re-executing steps 203-204. This process is repeated multiple times until a pre-defined class assignment optimization termination condition is met. This termination condition can be that the optimal class assignment result in the bundle meets pre-defined performance requirements, or that the number of rounds in the adaptive bundle search reaches a set threshold. In practical applications, the termination condition can be set according to requirements. When the termination condition is met, the adaptive bundle search ends, and the optimal class assignment result in the bundle is output as the final class assignment optimization result.

[0111] The class allocation optimization process described in steps 202-205 can be executed in the processor 130 shown in Figure 1. The class allocation optimization results can be stored in the memory 120 or output to a database or text file.

[0112] Step 206: Perform class scheduling based on the optimized class division results.

[0113] This step involves specific scheduling processing based on the class allocation optimization results obtained in step 205. Various existing scheduling methods can be used for the specific scheduling. Because the class allocation optimization results, which form the basis of the scheduling, take into account the conditions of synchronous classes at the time of scheduling, the optimized results can better adapt to the requirements of synchronous classes at the time of scheduling, effectively improving scheduling efficiency and performance.

[0114] The scheduling process in step 206 can be executed in the processor 130 shown in Figure 1. The timetable obtained from the scheduling process can be stored in the memory 120 shown in Figure 1, or it can be output to a database or a text file.

[0115] This concludes the data processing flow shown in Figure 2. The aforementioned data processing method, on the one hand, utilizes the constraints on synchronous classes during scheduling for local search of class division, thereby effectively leveraging the coupling relationship between class division and scheduling to improve scheduling performance through reasonable class division; on the other hand, through cyclical processing of class clusters and updating of initial probability parameters, it effectively balances the processing of in-depth mining of local optima with the processing of timely escape from local optima, thus improving the efficiency of class division and scheduling processing.

[0116] The following specific embodiments illustrate the implementation of the data processing method applied to the class division and scheduling system in this application. Figure 3 is a schematic diagram of the specific flow of the data processing method in a specific embodiment of this application. This flow is implemented in the application environment of the National Natural Science Foundation of China (Project Approval No.: 62207010) project, applied to the computer system shown in Figure 1, and the computer system further includes a database for storing the first dataset. The specific hardware configuration of the computer system includes: a processor using an Intel Core i7-10510U with 4 cores and 8 threads, a main frequency of 2.3GHz, DDR5 memory of 8GB, and a PCIe 4.0 SSD of 1TB. The processor loads and executes the executable modules stored in the memory, specifically the software function modules and computer programs included in the data processing device. As shown in Figure 3, the corresponding data processing method flow specifically includes:

[0117] Step 301: Perform initial class assignment based on the first and second datasets.

[0118] This step involves the initial class assignment phase, based on both the first and second datasets. Typically, the goal of the initial class assignment is to determine the subject selection combination for each administrative class and allocate students within hard constraints such as the total number of classes and classroom capacity, in order to minimize the overall scale of the flexible class scheduling. The subject selection combination can be any combination of all college entrance examination subjects, or it can be any combination of the remaining elective subjects after excluding the compulsory subjects.

[0119] The initial class assignment can be done using existing methods, such as a greedy strategy: First, obtain the first dataset, which is the distribution of all students' subject combinations. Then, using a greedy algorithm, iteratively select the subject combination with the largest number of currently unassigned students for each new class, and assign the students who selected this combination to that class (not exceeding the maximum class capacity). This initial class assignment ensures that, macroscopically, the subject combinations offered in the classes match the students' overall subject selection preferences to the greatest extent possible.

[0120] Of course, in practical applications, other existing methods can also be used for initial class assignment, such as using clustering algorithms (such as K-means) to perform preliminary class assignment based on students' subject selection data.

[0121] Step 302: Assign a class selection probability to each class assignment result in the class assignment bundle, and select a current class assignment result in the class assignment bundle according to the class selection probability.

[0122] When step 302 is executed for the first time, there is only one initial class assignment result. Therefore, the probability of selecting the class assignment result is 1, that is, the initial class assignment result is selected as the current class assignment result.

[0123] When step 302 is executed again in a subsequent iteration, new class assignment results have been added to the class assignment cluster. Therefore, a class assignment selection probability is assigned to each class assignment result. K1 represents the number of class division results in the class division bundle.

[0124] In this application, after obtaining the initial class assignment results, existing search methods can be used to obtain K-1 class assignment results, which, together with the initial class assignment results, form the initial set of class assignment bundles. New class assignment results are then generated based on this initial set, and the class assignment bundles are continuously updated. Alternatively, based on the initial class assignment results, the adaptive bundle search method provided in this application can be directly used to obtain new class assignment results. K-1 rounds of adaptive bundle search are used to obtain K-1 class assignment results. During this process, all generated class assignment results are combined into class assignment bundles. After accumulating K class assignment results, the class assignment bundles are updated. This embodiment adopts the second method. Since the number of classes in a class assignment bundle may be less than or equal to K, the allocation of class assignment selection probabilities is based on the number of class assignment results K1 in the class assignment bundle. When the number of class assignment results in the class assignment bundle reaches K, the allocation method is essentially the same as in step 203.

[0125] Step 303: Under the constraints of the synchronous class conditions, perform deep perturbation based on the current class assignment results, and obtain new class assignment results and their related information through local search.

[0126] The local search can be performed using existing methods such as simulated annealing, tabu search, iterative local search, or other metaheuristic algorithms. In a single local search, there may be tens of thousands of neighborhood moves based on the current class division result. Each move can yield an intermediate class division result. After performance evaluation of the intermediate class division result, it is determined whether to accept the move and continue to the next move.

[0127] The performance evaluation of intermediate class placement results typically assesses the degree to which various soft constraints are met; the higher the degree of satisfaction, the better the performance evaluation result. Specific soft constraints may include: minimizing the number of students unable to find their target class, minimizing the number of students participating in class-hopping, minimizing the number of subjects offered in class-hopping, and minimizing the concentration of these subjects in a single class.

[0128] In the soft constraint "the fewer the number of target classes that cannot be found, the better," the definition of a target class corresponds to the constraint of the synchronous class condition. Specifically, a target class is defined as follows: if all students from class A in a certain elective course B attend class C, and class C has enough available seats in elective course B to accommodate all students from class A attending class B, then class C is called the target class of class A in elective course B. As mentioned earlier, the synchronous class condition constraint means that for any elective course corresponding to any class identifier, the number of student identifiers in that elective course is not greater than the number of available seats in that elective course corresponding to the target class identifier. In other words, if a class can find a target class in a certain elective course, then it has found a target class that satisfies the synchronous class condition constraint. In this embodiment, the synchronous class condition constraint is transformed into a soft constraint of "the fewer the number of students who cannot find their target class, the better" because obtaining a class assignment result is the primary requirement in the class assignment process. If the synchronous class condition constraint is treated as a hard constraint, there might be situations where no class assignment result can be found under extreme conditions. Furthermore, even if high school classroom resources are scarce, a small number of classrooms may be reserved for students who cannot find their target class. Therefore, the synchronous class condition constraint is not treated as a hard constraint, but rather a soft constraint of "the fewer the number of students who cannot find their target class, the better".

[0129] However, to ensure that the conditions for synchronous classes are met first, the weight of the soft constraint "the fewer the number of students who cannot find the target class, the better" is set to the maximum. This prioritizes ensuring that all classes can find the target class for their elective courses. This way, there is no need to open separate classrooms for students who can switch classes. Especially when classroom resources are scarce, this constraint can effectively improve the utilization rate of classroom resources and reduce the occupation of classroom resources.

[0130] Matching target classes for each subject in a flexible class scheduling system can be done using various existing matching algorithms. Below is a simple example of a matching method using a single tiered subject X:

[0131] First, the number of available places for each class in the tiered subject X is counted (i.e., the correlation information is statistically analyzed). Then, for each tiered subject X, the classes whose subject selection combinations include tiered subject X are identified, and these classes are sorted in descending order of the number of available places. Simultaneously, for each tiered subject X, the classes that use tiered subject X as their elective course are identified, and these classes are sorted in descending order of the number of students using elective course X. Finally, based on the first and second sorts, the number of available places and the number of students using elective course X are matched to determine the target class for each class using tiered subject X as its elective course.

[0132] Furthermore, in the process of class allocation using a flexible class scheduling system, it is generally better to have as few students and subjects as possible that require flexible scheduling, as this is conducive to the stability of students' learning. At the same time, the subjects for flexible scheduling should be distributed as evenly as possible among the classes to avoid concentrating them in a single class and to ensure the fairness of the allocation of teaching resources among students. Of course, in practical applications, appropriate soft constraints can be set as needed to evaluate the performance of the class allocation results.

[0133] After the local search is completed, the intermediate class assignment result with the best performance in that local search is saved as the new class assignment result, for example, it can be saved in memory. In the above local search process, the correlation information is used to evaluate the performance of the intermediate class assignment result. After the new class assignment result is determined, the correlation information is no longer needed and does not need to be saved.

[0134] Step 304: Determine whether the conditions for ending the class division optimization are met. If yes, proceed to step 307; otherwise, proceed to step 305.

[0135] In this embodiment, two conditions are set for the end of class allocation optimization: Condition 1: The optimal class allocation result in the class allocation bundle meets the preset performance requirements (i.e., the performance evaluation result meets the preset requirements); Condition 2: The number of rounds of adaptive bundle search reaches the set round threshold. When either of the above two conditions is met, the end of class allocation optimization is considered to be satisfied.

[0136] Step 305: Determine whether the new class assignment result is better than the optimal class assignment result in the class assignment cluster. If so, reset p to the initial class assignment probability p0. Otherwise, update p according to the decay factor α.

[0137] The performance evaluation results of the new class assignment are compared with those of the best class assignment in the class assignment bundle to determine whether the new class assignment is superior to the best class assignment in the class assignment bundle, and the parameter p is updated accordingly. Figure 4 shows the dynamic change of p during the adaptive bundle search process. The blue, orange, and gray curves represent the class assignment probabilities corresponding to the 1st, 2nd, and 3rd ranked class assignments, respectively. As shown in Figure 4, the probability of selecting a higher-ranked candidate solution does not change monotonically but adjusts intelligently with the search progress. In most iterations, the selection probability gradually decreases, driving the entire process to shift from focusing on the current optimal solution to exploring more diverse regions, effectively avoiding premature convergence in complex solution spaces. The key design lies in the reset point in Figure 4 (marked as a diamond symbol): whenever a new global optimum is found, the class assignment selection probability immediately recovers to a higher initial value. If no new global optimum is found for a long time, the selection probability decays to 1 / k (k=3) and remains there (marked as a triangle symbol), eventually searching uniformly in the bundle pool. This mechanism forms an intelligent cycle of "exploration-discovery-focus": first, it deeply explores the newly discovered optimal solution; as its neighborhood is fully searched, it proactively increases its exploratory activity to find new potential areas; once a breakthrough is achieved, it quickly reverts to focus resources. This dynamic balancing ability is something that fixed-probability or monotonic annealing strategies lack.

[0138] Step 306: Update the class clusters and return to step 302.

[0139] Add the new class assignment results to the class assignment cluster.

[0140] If the class assignment result in the class assignment bundle is not greater than K, return directly to step 302; if the class assignment result in the class assignment bundle is greater than K, select K optimal class assignment results from the class assignment bundle based on the performance evaluation results of each class assignment result in the class assignment bundle and retain them.

[0141] In other words, when a new class division result is added, if the number of class division results in the class division bundle does not exceed the required number K, the performance comparison of the class division results can be omitted, and all class division results in the class division bundle can be retained; if the number of class division results in the class division bundle exceeds the required number K, the performance comparison of the class division results is required, and the K class division results with the best performance are selected and retained. In this way, the subsequent local search is always based on the optimal group of class division results.

[0142] Step 307: Based on the class allocation optimization results, optimize each class movement chain to make each class movement chain as short as possible, and take the optimized result as the final class allocation optimization result.

[0143] In this context, the "flexible class chain" is a combination of multiple sequentially associated class identifiers, where any class identifier is sequentially associated with the target class identifier corresponding to any flexible class subject. Specifically, as shown in Figures 5a and 5b, tiered subject X and tiered subject Y are different levels of the same subject, and the two are called a set of matching subjects. For example, tiered subject X is college entrance examination physics, and tiered subject Y is high school graduation examination physics; the two belong to different levels of the physics subject. In Figure 5a, C1, C2, and C3 are class identifiers. The subject selection combinations for classes C1 and C3 include tiered subject X, and the subject selection combination for class C2 includes tiered subject Y. The arrows between the classes represent sequential relationships. The arrow from class C1 to class C2 indicates that students in class C1 who choose tiered subject Y will move to class C2 to take the course of tiered subject Y. That is, the target class identifier for the course of course Y for class C1 is C2, and C1 and C2 are sequentially related. The arrow from class C2 to class C3 indicates that students in class C2 who choose tiered subject X will move to class C3 to take the course of tiered subject X. That is, the target class identifier for the course of course X for class C2 is C3, and C2 and C3 are sequentially related. The combination of C1, C2, and C3 forms a course-hopping chain. In Figure 5b, C4 is the class identifier. The subject selection combination of class C4 includes the tiered subject Y. The meanings of the other symbols are the same as in Figure 5a. The arrow pointing from class C3 to class C4 indicates that students in class C3 who select tiered subject Y will move to class C4 to take the course of tiered subject Y. That is, the target class identifier for the course Y corresponding to class C3 is C4, and C3 and C4 are sequentially related. The arrow pointing from class C4 to class C1 indicates that students in class C4 who select tiered subject X will move to class C1 to take the course of tiered subject X. That is, the target class identifier for the course X corresponding to class C4 is C1, and C4 and C1 are sequentially related. The combination of C1, C2, C3 and C4 constitutes a course chain.

[0144] During the course scheduling phase, to facilitate students' course arrangements, the matching subjects between synchronous classes must meet time coupling constraints. That is, for any class and its target class under any elective subject forming a synchronous class, the class time for any class in the tiered subject matched with any elective subject must be the same as the class time for the target class in that elective subject. For example, if class A's target class under elective subject B is class C, and classes A and C form a synchronous class, and elective subject B matches tiered subject D (i.e., elective subject B and tiered subject D are different levels of the same subject), then the class time for elective subject B in class C should be the same as the class time for tiered subject D in class A. To give a simple example, if class A's subject selection includes college entrance examination physics, and class C's subject selection includes high school graduation examination physics, and high school graduation examination physics is a elective subject for class A, and the target class is class C, then the class time for college entrance examination physics in class A must be the same as the time for high school graduation examination physics in class B.

[0145] In this embodiment, based on the class allocation optimization results, the class movement chain is further optimized in step 307 to make each class movement chain as short as possible. This is because, in order to ensure that the matching subjects between synchronous classes meet the time coupling constraint, all classes in the class movement chain need to be considered. If the class movement chain is too long, the processing to meet the time coupling constraint becomes more complicated.

[0146] Based on this, this embodiment optimizes the class-hopping chain. The goal is to break the long class-hopping chain and decompose the complex class-hopping relationship involving multiple classes into multiple independent, pairwise pairs (for example, the bidirectional arrow relationship between class C1 and class C2 in Figure 5c, i.e., class C2 moves to class C2 in subject Y, and class C2 moves to class C1 in subject X). Such paired classes are referred to as dual classes. If they cannot be split into dual classes, the length of the class-hopping chain should be reduced as much as possible, thereby greatly reducing the number of matching subjects that need to meet the time coupling constraints in the subsequent scheduling stage and improving the scheduling flexibility.

[0147] For example, in Figure 5c, before optimization, the shift chain includes C1, C2, and C3. Through optimization, the shift chain is simplified to C1 and C2, or one shift chain is split into two shift chains: one consisting of C1 and C4, and the other consisting of C2 and C3. In Figure 5d, before optimization, the shift chain includes C1, C2, C3, and C4. Through optimization, the shift chain is split into two shift chains: one consisting of C1 and C2, and the other consisting of C3 and C4. Alternatively, the two split shift chains may also be one consisting of C1 and C4, and the other consisting of C2 and C3.

[0148] The above-described shift-based optimization process further updates the shift allocation results, outputting the optimized results as the final shift allocation outcome. Specifically, the output can be to a database or a pre-defined text file.

[0149] As mentioned above, the class allocation optimization phase ends with the optimization of the class movement chain. Alternatively, the constraints of the synchronous class conditions can be further included: for any class identifier and any subject in the class movement chain, the shorter the chain, the better. This way, the class allocation results optimized by the class movement chain can also be obtained through local search.

[0150] The class allocation optimization phase is now complete. Next, based on the optimized class allocation results, we will proceed to the scheduling phase to process class schedules.

[0151] Step 308: Based on the output class division optimization results, schedule classes to obtain an initial timetable that satisfies the hard constraints.

[0152] The timetable includes the teachers and class times for all subjects corresponding to each class. The hard constraints include: matching subjects between synchronous classes ensure time coupling, that is, matching subjects between synchronous classes ensure consistent class times.

[0153] In this embodiment, a "relaxation-repair" strategy is used to obtain the initial timetable. First, the conflict constraints of teacher resources are ignored. Under the premise of strictly adhering to other hard constraints such as the time coupling constraints of matching subjects in synchronous classes, a timetable is randomly generated. Then, local search methods such as hill climbing are used to specifically repair the teacher resource conflicts, and a fully feasible initial timetable is quickly obtained.

[0154] The above method for obtaining the initial timetable is just an example. In practical applications, various existing methods can be selected to obtain an initial timetable that satisfies hard constraints, such as backtracking search based on constraint satisfaction problems.

[0155] Step 309: Perform a deep perturbation on the initial timetable, obtain M-1 intermediate timetables through local search, and combine the initial timetable and the M-1 intermediate timetables into a timetable bundle.

[0156] Step 310: Assign a scheduling selection probability to each timetable in the timetable bundle, and select a current timetable in the timetable bundle according to the scheduling selection probability.

[0157] Where q is the global timetable probability parameter, and j is the ranking of the timetable in the timetable bundle according to its performance from high to low.

[0158] Step 311: Under the premise of satisfying the hard constraints, perform a deep perturbation based on the current timetable and obtain a new timetable through local search. If the new timetable is better than the best timetable in the timetable bundle, reset q to the initial scheduling probability q0. Otherwise, update q according to the decay factor β. Add the new timetable to the timetable bundle and retain K best timetables in the timetable bundle. Return to step 310 until the scheduling end condition is met. Output the best timetable in the timetable bundle as the final timetable.

[0159] In this embodiment, the processing of steps 309 to 311 above also adopts the architecture of adaptive bundle search and the state-aware probabilistic selection mechanism to determine the initial solution of the local search, i.e. the current timetable; the architecture of this adaptive bundle search and the state-aware probabilistic selection mechanism are the same as the architecture of the adaptive bundle search and the state placement probabilistic selection mechanism in the aforementioned class division process, only the parameter representation and value of the selection probability are different, which will not be described again here.

[0160] In addition, in step 311, the local search can be performed using existing methods. This embodiment also provides a local search process based on multiple neighborhoods. Specifically:

[0161] Before each local search in step 311 begins, N neighboring timetables are determined based on the current timetable according to N pre-designed neighboring operations, and the neighboring timetables satisfy the hard constraint of time coupling of the matching subjects of the synchronous class; based on the performance evaluation result of each neighboring timetable, a neighboring selection probability is assigned to the corresponding neighboring region, and the perturbation neighboring region for this local search is selected according to the neighboring selection probability; wherein, the better the performance evaluation result of the neighboring timetable, the greater the neighborhood selection probability assigned to it;

[0162] The current timetable is processed using the depth perturbation and local search steps in step 311 based on the selected perturbation neighborhood.

[0163] More specifically, N neighborhood operations for local search in scheduling can be pre-designed, and all neighborhood operations have built-in time coupling constraints on the matching subjects of the synchronous classes, ensuring that any movement will not violate the hard constraint that the matching subjects of the synchronous classes must be taught simultaneously; this embodiment designs five neighborhood operations, divided into two categories:

[0164] a. Random movement (used to expand the search): such as N1 (randomly move the class time of a single subject, that is, randomly select a subject in a class and modify its class time), N2 (randomly move the class time of the matching subjects of the dual class, that is, randomly select a pair of dual classes and modify the class time of the corresponding set of matching subjects).

[0165] Here, for neighborhood operation N1, to satisfy the aforementioned hard constraint of time coupling, when the randomly moved single subject is a matching subject A in the synchronous class, another matching subject B in the same group as matching subject A needs to move together. If the original subject C moved to the target time is also a matching subject in the synchronous class, then another matching subject D in the same group as C also needs to move together with C, and so on. This may result in a large number of related moves, reducing system efficiency. To avoid this situation, it can be stipulated that the single subject A moved by neighborhood operation N1 cannot be a matching subject in the synchronous class. At the same time, if the original subject B moved by single subject A to the target time is a matching subject in the synchronous class, then another matching subject C in the same group as subject B needs to move together with B to the original class time of subject A. Then, the original subject D moved by subject C to the target time is not allowed to be a matching subject in the synchronous class. If subject D is also a matching subject in the synchronous class, then the current neighborhood operation N1 is rejected, and another subject is selected to perform neighborhood operation N1. For example, in the timetables shown in Figures 6a and 6b, Timeslot a and Timeslot b represent class time a and class time b, Class i~Class i m represents different class identifiers, and Course1 to Course6 represent different subject identifiers. Subjects with the same identifier represent the same set of matching subjects. The double-headed arrows indicate the swapping of class times for subjects. As shown in Figure 6a, for Class i, the class times of Course1 and Course2 are swapped to achieve a single shift in class time. As shown in Figure 6a, the neighborhood operation N1 triggers a series of related shifts. Such a neighborhood operation N1 is rejected. As shown in Figure 6b, the neighborhood operation N1 has only one related shift due to the matching subject and is a allowed neighborhood operation.

[0166] b. Directional movement (used to accelerate convergence): such as N3 (movement based on minimum working day constraint, i.e., selecting a single subject to modify the class time, and the modified class time satisfies the minimum working day constraint), N4 (movement based on recommended time period, i.e., moving the class time of the subject according to the recommended time), and N5 (movement based on course interval, i.e., moving the class time of the subject according to the required course interval).

[0167] Here, the minimum working day constraint means that the number of days a subject has classes within a week should not be less than the minimum working day constraint for that subject. For example, the minimum working day constraint for Chinese class is 5 days. If the number of days for Chinese class in a week is less than 5, then the minimum working day constraint is not met. Neighborhood operation N3 ensures that the minimum working day constraint is still met after the class time of the subject is moved. Different subjects have different recommended class times. For example, the recommended class time for Chinese class is usually in the morning, and the recommended class time for art class is usually in the afternoon. Neighborhood operation N4 means that when moving the class time of a subject, the class time of the subject is moved to within the recommended class time. Different subjects have corresponding course intervals. For example, the course interval for Chinese class is greater than 1 day. Neighborhood operation N5 means that when moving the class time of a subject, the class time of the subject after the move meets the course interval requirement for that subject.

[0168] All of the above neighborhood operations have a built-in time-sharing update mechanism for paired courses. Therefore, all neighborhood operations can ensure that any movement will not break the hard constraint that the matched subjects of the synchronous class must be taken at the same time.

[0169] The above are just some examples of neighborhood operations. In practical applications, other neighborhood operations can be designed according to requirements, such as other directional neighborhood operations for specific soft constraints.

[0170] Before each local search begins, a "ranking competition" is conducted: sampling tests are performed on each neighborhood operation to obtain a neighborhood schedule for each operation. Based on the performance evaluation results of each neighborhood schedule, the probability of each neighborhood operation being selected in this round of local search (i.e., the neighborhood selection probability) is dynamically calculated. In this embodiment, the performance evaluation results are sorted from high to low. The neighborhood operation corresponding to the neighborhood timetable of a given bit has a neighborhood selection probability of . In this embodiment, N=5, and i is the index of the neighborhood operation. Subsequently, in the local search loop, the neighborhood operation used for this local search is selected according to the neighborhood selection probability. Finally, depth perturbation and local search are performed according to the selected operation.

[0171] In the local search of this embodiment, multiple moves are performed according to the selected neighborhood operation. After each move, a neighborhood timetable is obtained. The performance of the neighborhood timetable is evaluated. Specifically, the performance evaluation result of the neighborhood timetable can be determined based on its performance in terms of the minimum working day constraint of the subject, the class time of the subject, and the course interval. A hybrid strategy combining greedy acceptance and simulated annealing Metropolis criterion is adopted to determine whether to accept each move, so as to balance the convergence speed and the ability to escape local optima.

[0172] A local optimal neighborhood timetable can be obtained through one round of local search. This neighborhood timetable is used as the new timetable, and its performance evaluation result is saved. Then, under the adaptive bundle search architecture, the performance evaluation result of this new timetable is compared with the performance evaluation results of each timetable in the timetable bundle, thereby updating the timetable bundle and the global timetable probability parameter q. The next round of current timetable selection, neighborhood operation selection, and the next round of local search are then performed until the timetable termination condition is met, at which point the optimal timetable in the timetable bundle is output as the final timetable. Specifically, the output can be to a database, storage, or text file, etc.

[0173] This concludes the course scheduling phase. The data processing method in the specific embodiment shown in Figure 3 is now complete.

[0174] In the adaptive bundle search of the above embodiments, an initial solution for a local search is selected from the bundle according to the selection probability each time, that is, a current class assignment result and a current timetable are selected. To further improve the system processing efficiency, multiple initial solutions can be selected to perform multiple local searches in parallel.

[0175] For example, in the class assignment optimization phase, L selections can be made when choosing the current class assignment result, resulting in L current class assignment results. Through parallel processing of L threads, L new class assignment results and their associated information are obtained through local search based on the L current class assignment results. The L local searches can be performed asynchronously and in parallel. When a new class assignment result obtained by any local search is better than the best class assignment result in the class assignment bundle, the operation of resetting p to p0 is executed. After all L local searches are completed, the operations of updating p according to the decay factor α, adding it to the class assignment bundle, and retaining K best class assignment results are executed.

[0176] More specifically, when L threads are used for parallel asynchronous updates, each parallel local search thread, upon discovering a new globally optimal solution, directly updates the top-ranked optimal class assignment result in the class assignment cluster pool. When a thread finishes, without waiting for other threads to finish, it directly selects the current class assignment result for the next round based on the current class assignment cluster pool and class selection probability, and enters the next iteration. The updated class assignment cluster pool and class selection probability after all L parallel threads have finished in one round affect the parallel local search threads that have not yet started.

[0177] Since each thread discovers the global optimal solution and terminates at a different time, there is virtually no waiting caused by shared conflicts, and the parallel efficiency is almost linear.

[0178] For example, during the scheduling phase, L′ selections can be made when choosing the current timetable, resulting in L′ current timetables. Through parallel processing of L′ threads, L new timetables are obtained by local search based on the L′ current timetables. The L local searches can be performed asynchronously and in parallel. When a new timetable obtained by any local search is better than the optimal class assignment result in the class assignment cluster, the operation of resetting q to q0 is executed. After all L local searches are completed, the operations of updating q according to the decay factor β, adding it to the class assignment cluster, and retaining M optimal timetables are executed.

[0179] Furthermore, in the above embodiments, multiple neighborhood operations are designed during the scheduling phase. A selection mechanism for these operations determines the neighborhood operations used in each round of local search. In practical applications, an adaptive hyperheuristic approach can also be used to dynamically combine or generate the neighborhood operations used in specific searches. The hyperheuristic algorithm uses a high-level heuristic algorithm to manage multiple heuristic algorithms, working together to complete the optimization process. For example, the ranking of performance evaluation results for each neighborhood in a ranking competition can be considered a high-level heuristic algorithm (or any heuristic algorithm can be used to achieve a similar function), while the sampling test of each neighborhood (i.e., a small number of iterative heuristic local search processes) serves as the low-level heuristic algorithm. Thus, the process of generating a neighborhood timetable can be described as a hyperheuristic algorithm, which is then used to generate neighborhood operations.

[0180] In the above embodiments, the performance of all generated timetables can be monitored in real time during the scheduling phase. If it is found that a timetable that meets the performance requirements cannot be obtained within the set time under the current class division optimization results, the initial class division phase and class division optimization phase can be re-executed to obtain other class division optimization results, and then the scheduling process can be carried out again. This process is repeated until a timetable that meets the performance requirements is found, and the scheduling process can be completed.

[0181] In the data processing method described in this application, the scheduling process is transformed into a tightly coupled optimization problem involving two stages: dynamic class allocation (including synchronous class constraints) and strongly constrained scheduling. Through two-stage collaborative optimization, an integrated design is implemented from the initial class allocation to the final scheduling process. Compared to existing fragmented processing methods, this approach generates a globally high-quality timetable with smaller class sizes, better synchronous class matching, and fewer scheduling conflicts. Simultaneously, a state-aware adaptive cluster search framework is introduced. This framework incorporates a probability selection mechanism that dynamically resets or decays based on whether a new optimal solution is found, enabling adaptive switching between "utilization" and "exploration" of the search strategy. Furthermore, during the scheduling stage, the overall timetable is integrated. The combination of adaptive cluster selection and adaptive micro-neighborhood operations allows for strategy adjustments based on real-time search feedback, effectively balancing breadth exploration and depth mining. Compared to traditional fixed-strategy metaheuristic algorithms, this significantly improves search efficiency in complex solution spaces, finding higher-quality and more stable solutions within the same timeframe, thus enhancing search efficiency and the robustness of search results. Furthermore, it rationally embeds synchronous class constraints, optimizing and decomposing the class-hopping chain during or after class-segmentation optimization, and incorporating a time-coupling constraint satisfaction mechanism in the scheduling neighborhood operations. This ensures that the search process always operates within a space that satisfies the key rigid constraint of time coupling, significantly improving the success rate of generating feasible timetables.

[0182] The above describes the specific implementation of the data processing method in this application. This application also provides a data processing device corresponding to the above data processing method, applied to a flexible class scheduling system. A basic structural diagram of the data processing device is shown in Figure 7, including: an initial class assignment module, a class assignment optimization module, and a scheduling module.

[0183] The initial class assignment module is used to perform initial class assignment based on the first and second datasets provided by the system; the class assignment optimization module is used to optimize the class assignment based on the initial class assignment results obtained in the initial class assignment stage, and obtain the optimized class assignment results; the class scheduling module is used to schedule classes based on the optimized class assignment results.

[0184] The class assignment optimization module includes an initial class assignment cluster submodule, a probability allocation submodule, a local search submodule, a class assignment cluster update submodule, and an output submodule;

[0185] The initial class assignment bundle submodule is used to deeply perturb the initial class assignment results, obtain K-1 class assignment results through local search, and combine the initial class assignment results and K-1 class assignment results into a class assignment bundle; the initial class assignment results include the matching relationship between student identifiers and class identifiers and the subject selection combination corresponding to the class identifiers;

[0186] The probability allocation submodule is used to assign a class selection probability to each class selection result in the class selection bundle. Where p is the global class assignment probability parameter, and i is the ranking of the class assignment results in the class assignment cluster according to performance from high to low.

[0187] The local search submodule is used to select the current class assignment result in the class assignment bundle according to the class assignment selection probability; it is also used to perform deep perturbation based on the current class assignment result under the constraint of synchronous class conditions, obtain a new class assignment result and its associated information through local search, and notify the probability allocation submodule to re-allocate the class assignment selection probability until the class assignment optimization termination condition is met, and take the best class assignment result in the class assignment bundle as the class assignment optimization result; it is also used to reset p to the initial class assignment probability p0 when the new class assignment result is better than the best class assignment result in the class assignment bundle.

[0188] The class grouping cluster update submodule is used to update p according to the decay factor α when the new class grouping result is not better than the best class grouping result in the class grouping cluster; it is also used to add the new class grouping result to the class grouping cluster and retain K best class grouping results in the class grouping cluster.

[0189] The output submodule is used to output the class division optimization results;

[0190] The new class assignment results include: the matching relationship between student identifiers and class identifiers, the subject combination corresponding to the class identifier, each elective subject corresponding to the class identifier, and the target class identifier and student identifier corresponding to each elective subject; the associated information includes the number of vacant seats in each tier of subjects in the subject combination corresponding to each class identifier; p0 is greater than the set first threshold, and the synchronous class condition constraints include: for any elective subject corresponding to any class identifier, the number of student identifiers for that elective subject is not greater than the number of vacant seats for that elective subject corresponding to the target class identifier.

[0191] Optionally, the synchronous class conditions further include: for any class identifier corresponding to any elective course, the shorter the elective course chain it belongs to, the better;

[0192] or,

[0193] The class assignment optimization module further includes a class movement chain optimization submodule, which is used to optimize each class movement chain based on the class assignment optimization results, so that each class movement chain is as short as possible; it is also used to send the optimization results as new class assignment optimization results to the output unit.

[0194] Among them, the class chain is a combination of multiple class identifiers that are sequentially associated, and any class identifier is sequentially associated with the target class identifier corresponding to any class subject.

[0195] Optionally, the class division optimization module includes a local search submodule;

[0196] or,

[0197] The class assignment optimization module includes L asynchronous parallel local search submodules; in the local search submodules, after obtaining the new class assignment results, the operation of the notification probability allocation submodule is executed.

[0198] The class cluster update submodule is used to perform the operation of adding L new class cluster results to the class cluster and retaining K optimal class cluster results in the class cluster after all L local search submodules have completed the same round of local search processing; L is an integer greater than 1.

[0199] Optionally, the scheduling module includes an initial timetable bundle submodule, a probability allocation submodule, a local search submodule, a timetable bundle update submodule, and an output submodule;

[0200] The timetable bundle submodule is used to generate an initial timetable that satisfies hard constraints based on the class division optimization results. The initial timetable is subjected to deep perturbation, and M-1 intermediate timetables are obtained through local search. The initial timetable and the M-1 intermediate timetables are combined into a timetable bundle. The initial timetable includes the teachers and class times of all subjects corresponding to each class identifier. The hard constraints include a set of matching subjects between synchronous classes to ensure time coupling.

[0201] The probability allocation submodule is used to assign selection probabilities to each timetable in the timetable bundle. And select the current timetable from the timetable bundle according to the timetable selection probability; where q is the global timetable probability parameter, and j is the ranking of the timetable in the timetable bundle according to performance from high to low;

[0202] The local search submodule is used to perform deep perturbation based on the current timetable under the premise of satisfying hard constraints, and obtain a new timetable through local search. If the new timetable is better than the best timetable in the timetable bundle, q is reset to the initial scheduling probability q0; otherwise, q is updated according to the decay factor α. The new timetable is added to the timetable bundle, and M best timetables are retained in the timetable bundle. The probability allocation submodule is notified to reallocate the scheduling selection probability until the scheduling termination condition is met. The best timetable in the timetable bundle is sent as the final timetable to the output submodule. Here, q0 is greater than the set second threshold.

[0203] The output submodule is used to output the final timetable.

[0204] Optionally, the scheduling module further includes a neighborhood selection submodule, used to determine N neighborhood timetables based on the current timetable according to N preset neighborhood settings, and the neighborhood timetables satisfy the hard constraint of time coupling. It is also used to assign a neighborhood selection probability to the corresponding neighborhood based on the performance evaluation result of each neighborhood timetable, and select a perturbation neighborhood according to the neighborhood selection probability; wherein, the better the performance evaluation result of the neighborhood timetable, the greater the neighborhood selection probability assigned to the corresponding neighborhood.

[0205] The local search submodule is further used to perform deep perturbation and local search on the current timetable according to the perturbation neighborhood.

[0206] The performance evaluation result of the neighborhood timetable can be determined based on its performance in terms of the minimum workday constraint for subjects, subject class time, and class interval. The N neighborhood operations can include: obtaining a neighborhood timetable by randomly moving the class time of a single subject; obtaining a neighborhood timetable by randomly selecting a pair of classes and moving the class time of their corresponding matching subjects; obtaining a neighborhood timetable by moving the class time of a single subject to satisfy the minimum workday constraint; obtaining a neighborhood timetable by moving the class time of subjects according to the recommended time; and / or obtaining a neighborhood timetable by moving the class time of subjects according to the required class interval.

[0207] Optionally, the scheduling module includes a local search submodule;

[0208] or,

[0209] The scheduling module includes L′ asynchronous parallel local search submodules; in the local search submodules, after obtaining the new timetable, the operation of the notification probability allocation submodule is executed;

[0210] The class cluster update submodule is used to perform the operation of adding L′ new timetables to the class cluster and retaining K optimal timetables in the timetable cluster after all L′ local search submodules have completed the same round of local search processing; L′ is an integer greater than 1.

[0211] Optionally, the scheduling module may further include a timetable performance monitoring submodule, which, if it is determined that a timetable whose performance meets the set requirements cannot be found, notifies the initial class assignment module to perform the initial class assignment operation until a timetable whose performance meets the set requirements is found.

[0212] The effectiveness of the data processing method, data processing device, and class scheduling system of this application was evaluated and compared with existing manual scheduling and various automatic scheduling methods. The following are the evaluation and comparison results in several aspects.

[0213] I. Comparison of Overall Performance

[0214] To ensure fairness in the comparison, the running time of all automatic time scheduling methods was limited to within 3600 seconds. Given the randomness of the automatic time scheduling methods, except for the manual time scheduling method, each automatic time scheduling method was run independently 30 times, and its statistical results are presented. Table 1 summarizes the statistical results of the manual time scheduling method, four existing automatic time scheduling methods, and the data processing method (ABS) of this application, including the optimal timetable score (f...). min ), the average score of 30 runs (f) ave30The values ​​are 1) and 100% (σ). Detailed information on violations of all soft constraints (S1-S8), the costs of class assignment and scheduling, and resource usage are included, with the best mean highlighted in bold.

[0215] In Table 1, Hard Violations represent hard constraints, and the corresponding scores indicate the degree of violation of these hard constraints. As shown in Table 1, all scheduling methods satisfy the hard constraints. For simplicity, Table 1 integrates the initial class formation stage and the class formation optimization stage into a single Class Formation stage. In this stage, soft constraints S1 represent the number of students using the flexible class system, S2 represent the number of subjects using the flexible class system, S3 represent the number of classes with fewer than the minimum number of students, S4 represent the degree to which flexible classes are concentrated in a single class, and S5 represent the number of flexible classes for which no target class can be found. The performance evaluation result (Formation Cost) of the class formation stage is obtained by summing the violations of S1 to S5. In the Timetabling stage, soft constraints S6 represent the minimum working day constraint, S7 represent the recommended class time slot constraint, and S8 represent the class interval constraint. The performance evaluation result (Timetabling Cost) of the timetable is obtained by summing the violations of S6 to S8. Table 1 also provides two overall attribute information (Schedule Properties): the number of co-timing pairs and the number of classrooms used, and gives the time(s) for running various methods.

[0216]

[0217] Table 1

[0218] As shown in Table 1, the ABS data processing method of this application achieves the best average performance on all eight soft constraints. Its class division and scheduling costs are significantly lower than manual methods and other existing automatic scheduling methods, which proves the effectiveness of the method in overall optimization. Regarding resource utilization, this application and all existing automatic scheduling methods successfully control the required number of classrooms to within 16, while manual scheduling methods require 18, demonstrating the advantage of automatic scheduling methods in satisfying resource constraints. It is worth noting that, under the same time constraints, the average performance of the population-based genetic algorithm (GE) is slightly inferior to that of single-point-based simulated annealing (SA) and tabu search (TS). This phenomenon may indicate that in such complex scheduling problems, a strategy of deeply cultivating a local region within a limited time is more likely to obtain a high-quality solution than extensive exploration. This also reflects the important value of the adaptive mechanism in the ABS method of this application in balancing exploration and utilization.

[0219] This is because the Local Search (SA) process in the adaptive bundle search of this application starts from an initial solution and deeply searches for better solutions in the neighborhood of that initial solution, which is also a single-point-based method. Furthermore, the adaptive bundle search of this application also includes generating multiple initial solutions using class-based bundles and switching to other lower-ranked initial solutions for searching. These processes are methods for exploring other search directions and expanding the search range, similar to population-based methods. By using a complete adaptive bundle search strategy to select initial solutions in the class-based bundles according to class selection probabilities, it ensures both deep utilization of advantageous solutions and automatically increases the exploration of other initial solutions when the search reaches a bottleneck, thus achieving a balance between broader exploration and current utilization.

[0220] II. Comparative Analysis of the Impact of Class Division on Scheduling Effectiveness

[0221] To further analyze the direct impact of class assignment quality on scheduling results, the applicant designed an ablation experiment: based on the optimal class assignment result generated by the ABS method of this application (class assignment cost of 390, and only 7 synchronous classes), this class assignment result was fixed, and each automated scheduling method was rerun. This aims to isolate the influence of the class assignment stage, thereby comparing the performance of each scheduling method purely from a fair starting point. The scheduling time for all methods was individually limited to 400 seconds, and the results are shown in Table 3.

[0222]

[0223] Table 2

[0224] Comparing Tables 2 and 1 reveals two key phenomena: First, based on high-quality class placement results, the scheduling costs of all existing scheduling methods are significantly reduced (e.g., the cost of the SA algorithm decreases from 71.8 in Table 1 to 65.5 in Table 2), indicating that a good class placement result can greatly alleviate the difficulty of subsequent scheduling. Second, in this fair comparison environment, the performance of various scheduling methods is more similar, and even the ranking order changes (e.g., the average performance of the GE algorithm exceeds that of TS). This confirms that the output quality at the class placement stage is a key bottleneck factor determining the quality of the final timetable, and also highlights the necessity of collaborative optimization of class placement and scheduling—rather than relying on scheduling algorithms to overcome the difficulties caused by poor class placement, it is better to coordinate optimization from the source, demonstrating the effective improvement of overall scheduling efficiency by the data processing method in this application.

[0225] III. Comparison of Optimization Aspects of Synchronous Classes

[0226] By further comparing the method of this application with various existing automatic scheduling and class assignment methods, it can be found that the class assignment results generated by the method of this application effectively balance the contradiction between students' personalized subject selection and the school's fixed class type. This ensures that the proportion of classes offered for each college entrance examination subject is highly consistent with the overall subject selection proportion of students, and successfully arranges 94.3% of students' major subjects in their respective administrative classes, significantly reducing the potential number of students moving between classes from the source. On this basis, the method of this application further optimizes the matching scheme of synchronous classes (Table 3), integrating the subjects that must move between classes into only 7 paired classes (i.e., the class moving chain only includes 2 classes), thereby greatly simplifying the time coupling constraints of synchronous classes that need to be coordinated in the subsequent scheduling stage and reducing the scheduling complexity.

[0227] Specifically, in Figure 8, Subject A represents the subjects for the college entrance examination, Subject B represents the subjects for the high school graduation examination, the numbers in the table represent the number of students in a class who choose a certain subject, the underline represents that students who choose the corresponding subject need to move between classes, and the same color represents paired classes and synchronous classes. Assuming each class can accommodate a maximum of 55 students, through optimized matching of synchronous classes, classes 1-6, 9-12, and 15 do not require students to move between classes. Four students from class 8 (who will take the high school entrance exam in Chemistry) will move to class 4, and nine students from class 14 (who will take the college entrance exam in Chemistry) will move to class 8. Thus, classes 8 and 14 form paired classes, with their corresponding matched subjects being College Entrance Exam Chemistry and High School Entrance Exam Chemistry. Similarly, classes 8 and 13 form paired classes (corresponding to College Entrance Exam Biology and High School Entrance Exam Biology), classes 8 and 15 form paired classes (corresponding to College Entrance Exam Politics and High School Entrance Exam Politics), classes 13 and 15 form paired classes (corresponding to College Entrance Exam Chemistry and High School Entrance Exam Chemistry), classes 14 and 15 form paired classes (corresponding to two sets of matched subjects: College Entrance Exam Biology and High School Entrance Exam Biology, and College Entrance Exam Geography and High School Entrance Exam Geography), and classes 7 and 14 form synchronous classes (corresponding to College Entrance Exam Politics and High School Entrance Exam Politics). The matched subjects for each of the paired and synchronous classes must have the same class schedule to facilitate student movement.

[0228] IV. Performance Analysis of Parallel Local Searches

[0229] To further explore the advantages of parallel local search in determining the search direction and improving search capability, this paper compares the differences in search results between the serial search method (i.e., the method that runs only one local search at a time) and the parallel search method (i.e., the method that performs multiple local searches in parallel using multiple threads) applied to the data processing method of this application, under a given number of iterations. Table 3 shows the average results of 30 independent runs under a given number of iterations during the class division stage. In the table, columns represent the number of parallel threads (P), rows represent the number of iterations in the local search (Iters), and underlined numbers represent the number of iterations. Results when the number of parallel iterations is the same. Bold numbers indicate better results when the number of iterations and the number of parallel iterations are the same; if the results are the same, they are indicated in italics.

[0230]

[0231] Table 3

[0232] As shown in Table 3, in each iteration, starting multiple threads simultaneously from a single starting point for parallel searching is equivalent to running one iteration serially, thus performing N iterations in parallel within the same timeframe. Given a fixed number of iterations, simply increasing the scale of the parallel search can significantly improve the quality of the final solution. With 32 iterations and 32 threads computing in parallel, it can be guaranteed that each search will yield the globally optimal solution. This has significant implications for practical applications in class assignment and scheduling.

[0233] Utilizing parallel threads to call more processor cores in the optimal solution search essentially trades more computation for better performance; its value lies in improving the utilization of processor resources. When further examining the same total computation (number of iterations)... When comparing the performance of serial and parallel algorithms under parallel processing conditions, it can be seen that, apart from 16 iterations... One thread outperformed 16 parallel threads in one iteration, 2I 1P, 4I 1P, 8I 1P, 32I 1P is weaker than the corresponding 1I. 2P, 1I 4P, 1I 8P, 1I 32P. This shows that parallel algorithms share optimal solution information more quickly during the search process, thus guiding the search towards more valuable directions at any time. Compared to serial search methods that perform depth-first search in one direction, parallel search methods are more like performing breadth-first search in multiple directions simultaneously. To obtain the best search results, the best choice is a balanced search of depth and breadth. This can be demonstrated in Table 3; with the same total computational cost, the optimal solution always appears near the diagonal. For example, 4I. 4P is better than 2I 8P or 8I 2P. This suggests that even with only a single processor core, the parallelism of threads can be used to improve algorithm performance.

[0234] In a multi-core environment, the method of running multiple local searches in parallel also performs well in terms of runtime, as shown in Table 4, which gives the runtime of the method in this application in an 8-core environment.

[0235]

[0236] Table 4

[0237] Because each iteration's local search process is independent, it is well-suited for coarse-grained parallelism. When the number of parallel processes is less than the actual number of processor cores, the runtime remains largely unchanged before and after increasing parallelism. When the number of parallel processes equals the number of processors, the runtime increases due to factors such as thread scheduling. When the number of parallel processes exceeds the number of processors, the system uses time-sharing to reuse processor resources, and the runtime increases proportionally to the number of parallel processes, with the rate of increase comparable to the impact of increasing the number of iterations.

[0238] As can be seen from the performance analysis and comparison from the above multiple aspects and perspectives, the data processing method of this application effectively improves the efficiency and performance of course scheduling. Compared with other existing course scheduling methods, it effectively reduces the course scheduling time while achieving the same course scheduling effect; and effectively improves the performance of the course scheduling results while using the same course scheduling time.

[0239] This application also provides a computer-readable storage medium that stores instructions, which, when executed by a processor, can perform the steps in the data processing method described above. In practical applications, the computer-readable medium may be included in the devices / apparatus / systems of the above embodiments, or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium stores instructions, which, when executed by a processor, can perform the steps in the data processing method described above.

[0240] According to the embodiments disclosed in this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof, but not intended to limit the scope of protection of this application. In the embodiments disclosed in this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0241] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A data processing method, characterized in that, A method for class assignment and scheduling in a flexible class scheduling system includes: an initial class assignment phase, a class assignment optimization phase, and a scheduling phase. The initial class assignment phase performs initial class assignment based on a first dataset and a second dataset. The class assignment optimization phase optimizes the class assignment based on the initial class assignment results obtained in the initial class assignment phase, resulting in an optimized class assignment result. The scheduling phase schedules classes based on the optimized class assignment result. The class assignment optimization process in the initial class assignment optimization phase includes: performing a deep perturbation on the initial class assignment results obtained in the initial class assignment phase, obtaining K-1 class assignment results through local search, and forming a class assignment bundle with the initial class assignment results and the K-1 class assignment results. The initial class assignment results include the matching relationship between student identifiers and class identifiers and the subject selection combination corresponding to the class identifiers. A class assignment selection probability is assigned to each class assignment result in the class assignment bundle. The process involves selecting a current class assignment result within the assigned class cluster according to the assigned class selection probability; where p is the global assigned class probability parameter, and i is the ranking of the assigned class result in the assigned class cluster according to performance from high to low; under the constraint of the synchronous class condition, a deep perturbation is performed based on the current assigned class result, and a new assigned class result and its associated information are obtained through local search; if the new assigned class result is better than the optimal assigned class result in the assigned class cluster, then p is reset to the initial assigned class probability p0; otherwise, p is updated according to the decay factor α; the new assigned class result is added to the assigned class cluster, and K optimal assigned class results are retained in the assigned class cluster, returning to the step of allocating the assigned class selection probability. The process continues until the class allocation optimization termination condition is met, at which point the optimal class allocation result in the allocated class bundle is output as the class allocation optimization result. The new class allocation result includes: the matching relationship between student identifiers and class identifiers, the subject selection combination corresponding to the class identifier, each elective subject corresponding to the class identifier, and the target class identifier and student identifier corresponding to each elective subject. The associated information includes the number of vacant spots in each tier of subjects within the subject selection combination corresponding to each class identifier. p0 is greater than a set first threshold. The synchronous class condition constraint includes: for any elective subject corresponding to any class identifier, the number of student identifiers for that elective subject is not greater than the number of vacant spots for that elective subject corresponding to the target class identifier.

2. The method according to claim 1, characterized in that, The synchronous class conditions further include: for any class identifier corresponding to any elective subject, the shorter the elective chain it belongs to, the better; or, in the class allocation optimization stage, after obtaining the class allocation optimization result, it further includes: based on the class allocation optimization result, optimizing each elective chain to make each elective chain as short as possible, and using the optimized result as the class allocation optimization result; wherein, the elective chain is a combination of multiple sequentially associated class identifiers, and any class identifier and the target class identifier corresponding to any elective subject are sequentially associated.

3. The method according to claim 1, characterized in that, When selecting the current class assignment result, one class assignment result is selected; or, when selecting the current class assignment result, L selections are performed to obtain L current class assignment results; based on the L current class assignment results, L new class assignment results and their associated information are obtained through local search, and the L local searches are performed asynchronously in parallel; when any local search obtains the new class assignment result, the operation of returning to the class assignment selection probability step is executed; when any new class assignment result obtained by any local search is better than the optimal class assignment result in the class assignment bundle, the operation of resetting p to p0 is executed; after all L local searches are completed, the operations of updating p according to the decay factor α, adding to the class assignment bundle, and retaining K optimal class assignment results are executed; where L is an integer greater than 1.

4. The method according to claim 1, characterized in that, The scheduling process in the scheduling phase includes: obtaining an initial timetable that satisfies hard constraints based on the class division optimization results; wherein, the initial timetable includes the teachers and class times for all subjects corresponding to each class identifier, and the hard constraints include a set of matching subjects between synchronous classes to ensure time coupling; performing deep perturbation on the initial timetable, obtaining M-1 intermediate timetables through local search, and forming a timetable bundle from the initial timetable and the M-1 intermediate timetables; assigning a scheduling selection probability to each timetable in the timetable bundle. The process involves selecting the current timetable from the timetable bundle according to the scheduling selection probability; where q is the global timetable probability parameter, and j is the ranking of the timetable in the timetable bundle according to performance from high to low; under the premise of satisfying the hard constraint, a deep perturbation is performed based on the current timetable, and a new timetable is obtained through local search; if the new timetable is better than the best timetable in the timetable bundle, then q is reset to the initial scheduling probability q0, otherwise, q is updated according to the decay factor β; the new timetable is added to the timetable bundle, and M best timetables are retained in the timetable bundle, and the process returns to the step of allocating the scheduling selection probability until the scheduling termination condition is met, and the best timetable in the timetable bundle is output as the final timetable; where q0 is greater than the set second threshold.

5. The method according to claim 4, characterized in that, After selecting the current timetable and before obtaining a new timetable through local search, the method further includes: determining N neighboring timetables based on the current timetable according to N pre-set neighbor operations, wherein the neighboring timetables satisfy the hard constraint of time coupling; assigning a neighbor selection probability to the corresponding neighboring timetable based on the performance evaluation result of each neighboring timetable, and selecting a perturbed neighboring timetable according to the neighbor selection probability; wherein, the better the performance evaluation result of the neighboring timetable, the greater the neighbor selection probability assigned to the corresponding neighboring timetable; and performing the deep perturbation and local search processing on the current timetable according to the perturbed neighboring timetable.

6. The method according to claim 4 or 5, characterized in that, When selecting the current timetable, one timetable is selected; or, when selecting the current timetable, L′ selections are performed to obtain L′ current timetables; based on the L′ current timetables, L′ new timetables are obtained through local searches, and the L′ local searches are performed asynchronously in parallel; when any local search obtains a new timetable, the operation of returning to the allocation and scheduling probability step is executed; when any new timetable obtained by any local search is better than the best timetable in the timetable bundle, the operation of resetting q to q0 is executed; after all L′ local searches are completed, the operations of updating q according to the decay factor α, adding to the timetable bundle, and retaining the M best timetables are executed; where L′ is an integer greater than 1.

7. The method according to claim 5, characterized in that, Based on the performance of the neighborhood timetable in terms of the minimum working day constraint of the subject, the class time and class interval of the subject, the performance evaluation result of the neighborhood timetable is determined.

8. The method according to claim 5, characterized in that, The N neighborhood operations include: obtaining a neighborhood timetable by randomly moving the class time of a single subject, obtaining a neighborhood timetable by randomly moving the class time of a matching subject in a synchronous class, obtaining a neighborhood timetable by selecting a single subject and moving its class time to meet the minimum workday constraint, obtaining a neighborhood timetable by moving the class time of a subject according to the recommended time, and / or obtaining a neighborhood timetable by moving the class time of a subject according to the required course interval.

9. The method according to claim 1, characterized in that, If a timetable that meets the performance requirements cannot be found during the scheduling phase, the process returns to the initial class assignment phase until a timetable that meets the performance requirements is found.

10. A data processing apparatus, characterized in that, A class assignment and scheduling system for a flexible class scheduling system includes: an initial class assignment module, a class assignment optimization module, and a scheduling module. The initial class assignment module performs initial class assignment based on a first dataset and a second dataset provided by the system. The class assignment optimization module optimizes the class assignment based on the initial assignment results obtained in the initial class assignment phase, yielding an optimized class assignment result. The scheduling module schedules classes based on the optimized class assignment result. The class assignment optimization module includes an initial class assignment bundle submodule, a probability allocation submodule, a local search submodule, a class assignment bundle update submodule, and an output submodule. The initial class assignment bundle submodule performs deep perturbation on the initial class assignment results, obtains K-1 class assignment results through local search, and combines the initial class assignment results and the K-1 class assignment results into a class assignment bundle. The initial class assignment results include the matching relationship between student identifiers and class identifiers and the subject selection combination corresponding to the class identifiers. The probability allocation submodule assigns a class assignment probability to each class assignment result in the class assignment bundle. Where p is the global class assignment probability parameter, and i is the ranking of the class assignment results in the class assignment bundle according to performance from high to low; the local search submodule is used to select the current class assignment result in the class assignment bundle according to the class assignment selection probability; it is also used to perform deep perturbation based on the current class assignment result under the constraint of the synchronous class condition, obtain a new class assignment result and its associated information through local search, and notify the probability allocation submodule to re-allocate the class assignment selection probability until the class assignment optimization termination condition is met, and take the optimal class assignment result in the class assignment bundle as the class assignment optimization result; it is also used to reset p to the initial class assignment probability p0 when the new class assignment result is better than the optimal class assignment result in the class assignment bundle; the class assignment bundle update submodule is used to update p when the new class assignment result fails to be better than the optimal class assignment result in the class assignment bundle. When determining the optimal class assignment result in the class cluster, p is updated according to the decay factor α; it is also used to add the new class assignment result to the class cluster and retain K optimal class assignment results in the class cluster; the output submodule is used to output the class assignment optimization result; wherein, the new class assignment result includes: the matching relationship between student identifier and class identifier, the subject combination corresponding to the class identifier, each elective subject corresponding to the class identifier, the target class identifier and student identifier corresponding to each elective subject; the association information includes the number of vacant positions in each tier of subjects in the subject combination corresponding to each class identifier; p0 is greater than a set first threshold, and the synchronous class condition constraint includes: for any elective subject corresponding to any class identifier, the number of student identifiers for that elective subject is not greater than the number of vacant positions for that elective subject corresponding to the target class identifier.

11. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the instructions are executed by the processor, they can implement the data processing method according to any one of claims 1 to 9.

12. A computer system, characterized in that, The computer system includes at least a computer-readable storage medium and a processor; the processor is configured to read executable instructions from the computer-readable storage medium and execute the instructions to implement the data processing method according to any one of claims 1 to 9.