After-school business data processing method and device, electronic device and storage medium
By synchronizing the key data of the relational database to the non-relational database and using the non-relational database to process attendance data, the problem of system delay and data inaccuracy caused by the attendance business in after-school services is solved, and the real-time data processing is improved. accuracy and accuracy, improving user experience.
Patent Information
- Application Number
- CN202410133250.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-30
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-01-30
AI Technical Summary
The high-frequency operation of the attendance business in after-school services causes the system to require a large amount of computing resources in a short period of time, resulting in delayed system response and reduced data processing accuracy, affecting user experience and system stability.
Synchronize the key data of the current course schedule of the relational database to the non-relational database, obtain the attendance data in the current course schedule, generate and save the course cancellation data through the queue of the non-relational database, update the course cancellation schedule of the relational database, and update the course cancellation schedule according to the sales Course data changes key data in the non-relational database and calculates student status.
It improves the real-time and accuracy of data, extends data processing time, reduces the possibility of human error, and improves user experience and system stability.
Smart Images

Figure CN117992542B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for processing after-school business data, an electronic device, and a storage medium. Background Art
[0002] Due to the particularity of after-school services, the service time of after-school services is highly concentrated, among which the most frequent business is attendance business, and attendance business is also related to class cancellation business. Therefore, the highly concentrated business operation time causes the system to require a large amount of computing resources to support the business in a period of time, and the system will have a large delay in real-time performance, which may cause users to obtain wrong data or fail to obtain real-time data, affecting the stability and accuracy of the system. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a method and device for processing after-school business data, an electronic device and a storage medium, aiming to improve the real-time and consistency of data and enhance the user experience.
[0004] To achieve the above purpose, one aspect of an embodiment of the present application proposes a method for processing after-school business data, the method comprising:
[0005] Synchronize the key data of the current semester in the relational database course list to the non-relational database course list, including the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested;
[0006] Get attendance data;
[0007] Generate course sales data according to the attendance data through a queue of a non-relational database, and save the course sales data to a course sales table of a relational database through the queue of the non-relational database, wherein the course sales data is used to cancel the course;
[0008] According to the course sales data, the key data of the number of classes attended and the number of classes taken off in the course table of the non-relational database are changed;
[0009] The student status is calculated by reading the key data of the course schedule in the non-relational database, and the student status includes at least one of not registered, registered, completed, cancelled or owed.
[0010] In some embodiments, the method further comprises:
[0011] Synchronize the key data of the business system to the course schedule in the relational database through the distributed publish-subscribe messaging system;
[0012] The student's status, number of classes to be cancelled and number of classes in arrears are displayed on the class details page, wherein the number of classes to be cancelled is determined by the number of classes registered for the course, the number of classes withdrawn from the course, the number of classes attended and the number of classes for which leave has been requested, and the number of classes in arrears is determined by the number of classes registered for the course, the number of classes withdrawn from the course, the number of classes attended and the number of classes for which leave has been requested;
[0013] The number of classes registered, attended, pending cancellations, dropped classes, and overdue classes for the course are displayed on the details page of the course being enrolled.
[0014] In some embodiments, the method further comprises:
[0015] Updating the relational database of the course schedule in progress;
[0016] The updating of the relational database of the course schedule includes:
[0017] Obtaining order data and student code, wherein the order data includes new order data and refund data;
[0018] According to the order data and student codes, batch count the number of courses that each student has registered for and the number of courses that have been withdrawn;
[0019] The number of courses registered and the number of courses dropped are updated in the relational database course list.
[0020] In some embodiments, the attendance data includes sign-in data and leave data, the course sales data includes course sales details data and course sales balance data, and the generating of course sales data according to the attendance data by using a queue of a non-relational database includes:
[0021] Generate sales details data based on sign-in data or leave data through the queue of non-relational database;
[0022] The historical sales course balance data is obtained, and the current sales course balance data is generated according to the sales course detail data and the historical sales course balance data through a queue of a non-relational database.
[0023] In some embodiments, the course sales data includes attendance creation time, student code and class number code, and the process of saving the course sales data to a relational database course sales table through the queue of the non-relational database includes:
[0024] Check whether the current course sales data and the historical course sales data of the course sales table in the relational database are repeated through a unique index, wherein the unique index is composed of the attendance creation time, the student code and the course number code;
[0025] If the current course sales data does not overlap with the historical course sales data, the current course sales data is saved to the course sales table of the relational database;
[0026] If the current course sales data is repeated with the historical course sales data, compare the attendance creation time of the current course sales data with the attendance creation time of the historical course sales data. If the attendance creation time of the current course sales data is later than the attendance creation time of the historical course sales data, update the historical course sales data with the current course sales data.
[0027] In some embodiments, the attendance data includes a semester, a school code, an attendance type, a class number code, and a class cancellation code, and the class cancellation data includes a semester, a school code, a student code, an attendance code, an attendance type, a class number code, and a class cancellation code, and the method further includes:
[0028] Storing the attendance data in a relational database attendance sign-in sheet;
[0029] Updating the relational database course sales table;
[0030] The updating of the relational database course sales table includes:
[0031] Acquire first attendance data from the attendance sign-in table of the relational database according to the semester and school code;
[0032] Acquire first course sales data from the course sales table of the relational database according to the semester, school code, student code and attendance code;
[0033] Compare the first attendance data with the first class sales data to see if the attendance type, class number code and class sales code are consistent; if they are inconsistent, update the first class sales data;
[0034] Acquire second course sales data from the course sales table of the relational database according to the semester and school code;
[0035] Acquire second attendance data from the attendance sign-in table of the relational database according to the semester, school code and time range;
[0036] Compare the second course sales data with the second attendance data to see if the semester, student code, class number and attendance code are consistent; if they are inconsistent, update the second course sales data.
[0037] In some embodiments, the key data further includes a course code, and the step of calculating the student's status by reading the key data of the course schedule from the non-relational database includes:
[0038] When the number of registered sessions of the course is less than or equal to zero, determining the status of the current student as unregistered;
[0039] Calculate the remaining classes, the calculation formula for the remaining classes is:
[0040] Remaining classes = number of courses registered - number of courses withdrawn - number of classes attended + number of classes for which leave has been requested;
[0041] When the remaining number of classes is greater than zero, determining that the current student's status is registered;
[0042] When the remaining number of classes is less than zero, determining that the current student is in arrears;
[0043] When the number of lessons already registered for the course is greater than zero and the number of remaining lessons is equal to zero, determining that the status of the current student is completed;
[0044] The course end time is obtained according to the course code. If the current time exceeds the course end time, it is determined that the current student's status is completed.
[0045] To achieve the above purpose, another aspect of the embodiment of the present application provides an after-school service data processing device, the device comprising:
[0046] A synchronization module is used to synchronize the key data of the current semester of the relational database course schedule to the non-relational database course schedule, wherein the key data includes the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested;
[0047] Attendance acquisition module, used to obtain attendance data;
[0048] A course sales module, used to generate course sales data according to the attendance data through a queue of a non-relational database, and save the course sales data to a course sales table of a relational database through the queue of the non-relational database, and the course sales data is used to write off the course;
[0049] A change module, used for changing the key data of the number of classes attended and the number of classes taken off in the reading course table of the non-relational database according to the class sales data;
[0050] The calculation module is used to calculate the student status through the key data of the course schedule in the non-relational database, and the student status includes at least one of not registered, registered, completed, cancelled or owed.
[0051] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0052] To achieve the above objectives, a fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0053] The embodiments of the present application include at least the following beneficial effects: the present application provides an after-school business data processing method and device, an electronic device and a storage medium, which synchronizes the key data of the current semester of the relational database reading course schedule to the non-relational database reading course schedule, so that the non-relational database reading course schedule can reflect the latest and most accurate course situation; obtain attendance data; generate course sales data according to the attendance data through the queue of the non-relational database, and save the course sales data to the relational database course sales schedule through the queue of the non-relational database, which can extend the data processing time, make the course verification more automated, improve work efficiency, and reduce the possibility of human errors; change the number of classes attended and the number of classes taken leave of the key data in the non-relational database reading course schedule according to the course sales data, so as to improve the real-time and accuracy of the data; calculate the student's status through the key data of the non-relational database reading course schedule, and the student's status includes at least one of not registered, registered, finished, completed or owed, which is conducive to users understanding the student's status. The embodiments of the present application can extend the data processing time, improve the real-time and consistency of the data, and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flowchart of the after-school business data processing method provided by the embodiment of the present application;
[0055] Figure 2 is another optional flow chart of the after-school business data processing method provided in the embodiment of the present application;
[0056] Figure 3 This is a timing diagram of order payment provided in an embodiment of the present application;
[0057] Figure 4 It is a flowchart of updating the course schedule of a relational database provided by an embodiment of the present application;
[0058] Figure 5 It is a relational database course sales schedule update flow chart provided by the embodiment of the present application;
[0059] Figure 6 yes Figure 1 Flow chart of step S103 in FIG.
[0060] Figure 7 This is a data storage schematic diagram of an after-school business data processing method provided in an embodiment of the present application;
[0061] Figure 8 It is a Redis in-class course schedule synchronization flow chart provided in an embodiment of the present application;
[0062] Fig. 9 This is a schematic diagram of a class details page provided in an embodiment of the present application;
[0063] Fig.10 This is a schematic diagram of a course details page provided in an embodiment of the present application;
[0064] Fig.11 It is a structural diagram of an after-school business data processing device provided in an embodiment of the present application;
[0065] Fig.12 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0067] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0068] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0070] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0071] 1) Course cancellation, also known as course cancellation or course sales, is the process in which the institution records that students have attended the course after they have enrolled in the course.
[0072] 2) Kafka is a high-throughput distributed publish-subscribe messaging system.
[0073] 3) XXL-Job is an open source distributed task scheduling platform used to solve the scheduling needs of a large number of distributed tasks.
[0074] Since after-school services are usually concentrated in a fixed time period, the demand for use by students and teachers will reach a peak during this time period. Attendance business is one of the basic services in after-school services, mainly involving the recording and management of student attendance, which is very important for determining the student's participation in the course and the corresponding teaching services. Attendance information usually also directly affects the course sales business. Course sales business refers to the process of canceling courses, and it is necessary to accurately record the student's attendance to ensure the correctness of the course sales business.
[0075] During periods of high business operation time, such as after school, a large number of students and teachers will perform attendance operations at the same time, which will cause the backend system to process a large number of data requests in a short period of time, which may cause system resource shortages. This resource shortage may cause several problems:
[0076] (1) System response delay: A large amount of computing resources is required to process attendance data over a period of time, which may slow down the system response.
[0077] (2) Decreased data processing accuracy: The system may experience delays or errors when processing a large number of requests, resulting in inaccurate attendance data.
[0078] (3) Degraded user experience: Users (such as students and teachers) may encounter system delays or inaccurate data when trying to obtain real-time attendance information, which affects their satisfaction with after-school services.
[0079] System stability issues: Long-term high-load operation may affect system stability and increase the risk of system crash.
[0080] In view of this, an after-school business data processing method and device, an electronic device and a storage medium are provided in the embodiment of the present application. The scheme synchronizes the key data of the current semester of the relational database reading course schedule to the non-relational database reading course schedule, so that the non-relational database reading course schedule can reflect the latest and most accurate course situation; obtain attendance data; generate course sales data according to the attendance data through the queue of the non-relational database, and save the course sales data to the relational database course sales schedule through the queue of the non-relational database, which can prolong the data processing time, make the course verification more automated, improve work efficiency, and reduce the possibility of human errors; change the number of classes attended and the number of leave taken in the key data in the non-relational database reading course schedule according to the course sales data, so as to improve the real-time and accuracy of the data; calculate the student's status through the key data of the non-relational database reading course schedule, and the student's status includes at least one of not registered, registered, finished, completed or owed, which is conducive to users understanding the student's status. The embodiment of the present application can prolong the data processing time, improve the real-time and consistency of the data, and enhance the user experience.
[0081] The after-school business data processing method provided in the embodiment of the present application relates to the field of data processing technology. The after-school business data processing method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The cloud server, the server can also be a node server in the blockchain network; the software can be an application that implements the after-school business data processing method, etc., but is not limited to the above form.
[0082] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0083] Figure 1 is an optional flowchart of the after-school business data processing method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0084] Step S101, synchronizing the key data of the current semester of the course list in the relational database to the course list in the non-relational database.
[0085] Specifically, the course list is used to express the data of a student enrolling in a certain school course in a specific semester. The main fields are student code, course ID, semester code, number of courses registered, number of courses dropped, number of courses to be taken, number of courses attended, and number of courses for which leave has been requested. Key data includes the number of courses registered, number of courses dropped, number of courses attended, and number of courses for which leave has been requested.
[0086] This application does not specifically limit the relational database, and it can be flexibly selected in combination with actual processing needs. For example, a MySQL database or an Oracle database can be used.
[0087] This application does not specifically limit the non-relational database, and it can be flexibly selected in combination with actual processing needs. For example, a Redis database, a Memcached database, or a MongoDB database can be used.
[0088] In some embodiments, the key data also includes student code, course ID, semester code, and the number of classes to be taken.
[0089] It is understandable that courses can be paid for multiple times according to different numbers of classes, and refunds can also be made multiple times according to different numbers of classes. Each order payment and refund requires asynchronous notification to modify the number of courses registered and the number of courses withdrawn in the relational database. Each attendance check requires the acquisition of course cancellation data, and at the same time modifying the number of classes attended and the number of leave taken in the non-relational database course schedule.
[0090] Furthermore, the relational database reading course schedule and the non-relational database reading course schedule need to be synchronized and updated with data, so the relational database reading course schedule and the non-relational database reading course schedule are synchronized and updated with data at regular intervals.
[0091] This application does not specifically limit the update time of the relational database reading course schedule and the non-relational database reading course schedule, and can be flexibly selected in combination with actual processing needs. For example, the update time can use the system default update time or the user-set update time.
[0092] Exemplarily, the relational database reading course schedule and the non-relational database reading course schedule are uniformly updated in the early morning of each day through a scheduled task of data consistency processing.
[0093] In this embodiment, the key data of the current semester of the relational database course list is synchronized to the non-relational database course list, so that the non-relational database course list can reflect the latest and most accurate course situation.
[0094] Step S102, obtaining attendance data.
[0095] Specifically, the attendance data includes a type field, and the type field includes a sign-in type or a leave type. The attendance data can be classified into sign-in data and leave data through the type field.
[0096] The present application does not impose any specific restrictions on the acquisition of attendance data, and it can be flexibly selected in combination with actual processing needs. For example, the attendance data can be obtained from a database or generated during roll call.
[0097] In some embodiments, attendance data is generated during roll call, attendance data is generated based on student sign-in or leave, and the attendance data is written into a relational database sign-in attendance table.
[0098] It is understandable that errors may occur in the attendance data, so the erroneous data in the attendance data can be revoked or deleted. Specifically, the attendance data that has been written is modified to the deletion state, a queue deletion task is inserted into the course cancellation processing queue, the number of classes attended (sign-in minus one) and the number of leave taken (leave minus one) in Redis are incrementally changed, the latest class details are returned, and the class details are displayed through the class details page.
[0099] In this embodiment, the attendance data is obtained to prepare for the subsequent generation of class sales data based on the attendance data.
[0100] Step S103, generating course sales data according to the attendance data through the queue of the non-relational database, and saving the course sales data to the course sales table of the relational database through the queue of the non-relational database.
[0101] The present application does not specifically limit the queue of the non-relational database, and can be flexibly selected in combination with actual processing needs. For example, the queue of the non-relational database can use a redis queue or a MongoDB queue.
[0102] In some embodiments, after the attendance data is saved to the relational database sign-in attendance table, the ID will be put into the redis queue, the queue will be read regularly, the course sales data will be generated and synchronized to the relational database course sales table. Among them, the generation of course sales data is gradually completed by the delay of the Redis peak-shaving queue. Exemplarily, the generation task is placed in the Redis peak-shaving queue, and a scheduled task is established to continuously obtain data from the peak-shaving queue for batch concurrent processing.
[0103] Specifically, there are three operations that will generate corresponding queues: 1. Inserting a sign-in record; 2. Inserting a leave record; 3. Revoking a sign-in or leave record.
[0104] It is understandable that the use of a non-relational database queue to generate course sales data and synchronize it to the relational database course sales table is mainly to extend the data processing time. Improving the consistency of synchronized data requires ensuring consistent processing order. Since the data to be processed is relatively large, there will be serious performance issues if it is processed one by one.
[0105] In some embodiments, the relational database course sales table adopts a database design of sub-library and sub-table. According to the sub-library and sub-table rules, multiple non-relational database peak-cutting queues are used to improve the asynchronous processing speed, and batch query and batch save operations are used as much as possible. The attendance information can be dispersed to multiple peak-cutting queues for batch processing by taking the model of the student code in the semester.
[0106] In some embodiments, attendance data includes sign-in data and leave data, and course sales data includes course sales detail data and course sales balance data. The course sales detail data is generated according to the sign-in data or leave data through a queue of a non-relational database; historical course sales balance data is obtained, and current course sales balance data is generated according to the course sales detail data and historical course sales balance data through a queue of a non-relational database.
[0107] Specifically, each sign-in data or leave data will generate a course sales detail data. If the student has a consumable course sales balance, the course sales detail data will be associated with a course sales balance data. If not, the data is in arrears. A course sales balance data records the actual consumable classes of an order (minus the refunded classes), and is associated with multiple course sales detail data. Among them, the consumable classes minus the total number of course sales detail items is its course sales balance. When the course sales detail table is generated, it will find a course sales balance data with a balance in chronological order according to the course and the student, and associate and deduct it.
[0108] Specifically, the operation of using the peak-shaving queue processing database of the non-relational database to write the course cancellation table of the relational database includes:
[0109] 1. Take 100 attendance records from the peak-shaving queue each time and check whether there are any cancellation records in the course cancellation table; if there are, execute the batch update logic; if not, execute the batch save logic;
[0110] 2. Batch update and batch save are executed asynchronously;
[0111] 3. For batch saving, it is necessary to check whether the same batch of data is data that violates the unique index. This can be determined by "Attendance Creation Time" + "Student Code" + "Course ID", and only the latest attendance record is retained;
[0112] Among them, asynchronous execution needs to improve data consistency. When inserting sales data, if it is found that there is an existing record, the time is compared. If the attendance creation time is greater than the attendance time of the sales record, it is updated; otherwise, the processing is skipped to avoid dirty data.
[0113] In this embodiment, course sales data is generated according to attendance data through a queue of a non-relational database, and the course sales data is saved to a relational database course sales table through the queue of the non-relational database. This can extend the data processing time, make course cancellation more automated, improve data consistency, improve work efficiency, and reduce the possibility of human errors.
[0114] Step S104, modifying the key data of the number of classes attended and the number of classes taken off in the course table of the non-relational database according to the class cancellation data.
[0115] Specifically, the course sales details include a type field, and the type field includes a sign-in type or a leave type.
[0116] In some embodiments, the data in the non-relational database is calculated incrementally, that is, the number of classes attended increases by one when signing in once, decreases by one when signing in is cancelled, increases by one when taking a leave once, and decreases by one when taking a leave is cancelled. Incremental calculation may have certain errors in abnormal situations, so there is a process of synchronizing the non-relational database's course schedule from the relational database's course schedule once a day.
[0117] In some embodiments, the number of classes attended and the number of classes taken for leave, which are key data in the course table of the non-relational database, are changed according to the class cancellation data through the queue of the non-relational database.
[0118] Specifically, the background inserts a queue creation task in the course cancellation processing queue, and incrementally changes the number of classes attended (sign-in plus one) and the number of leave taken (leave plus one) in the course table read by the non-relational database.
[0119] In this embodiment, the key data of the number of classes attended and the number of classes taken off in the course table in the non-relational database is changed according to the class sales data, thereby improving the real-time and accuracy of the data.
[0120] Step S105, calculating the student's status by reading the key data of the course schedule through the non-relational database.
[0121] Specifically, the student's status includes at least one of not registered, registered, completed, cancelled, or in arrears.
[0122] Optionally, the current student is determined by a student code, and the number of courses the current student has registered for, the number of courses he has dropped, the number of classes he has attended, and the number of classes he has taken leave for is obtained through the student code.
[0123] In some embodiments, when the number of registered classes for a course is less than or equal to zero, the current student status is determined to be unregistered; the remaining classes are calculated, and the calculation formula for the remaining classes is:
[0124] Remaining classes = number of courses registered - number of courses withdrawn - number of classes attended + number of classes for which leave has been requested;
[0125] Among them, when the remaining classes are greater than zero, the current student's status is determined to be registered; when the remaining classes are less than zero, the current student's status is determined to be in arrears; when the number of registered classes is greater than zero and the remaining classes are equal to zero, the current student's status is determined to be completed; the course end time is obtained according to the course code. If the current time exceeds the course end time, the current student's status is determined to be ended.
[0126] In this embodiment, the student's status is calculated by reading the key data of the course schedule in a non-relational database, which helps users understand the student's status.
[0127] Steps S101 to S105 shown in the embodiment of the present application, by synchronizing the key data of the current semester of the relational database course schedule to the non-relational database course schedule, the non-relational database course schedule can reflect the latest and most accurate course situation; obtain attendance data; generate course sales data according to the attendance data through the queue of the non-relational database, and save the course sales data to the relational database course sales schedule through the queue of the non-relational database, which can extend the data processing time, make the course verification more efficient and automated, improve work efficiency, and reduce the possibility of human errors; change the number of classes attended and the number of leave taken in the key data in the non-relational database course schedule according to the course sales data, improve the real-time and accuracy of the data; calculate the student's status through the key data of the non-relational database course schedule, and the student's status includes at least one of not registered, registered, finished, completed or owed, which is conducive to users understanding the student's status. The embodiment of the present application can extend the data processing time, improve the real-time and consistency of data, and enhance the user experience.
[0128] Figure 2 is another optional flowchart of the after-school business data processing method provided in the embodiment of the present application, Figure 2 The method may include but is not limited to steps S201 to S207.
[0129] Step S201, synchronizing the key data of the business system to the course schedule in the relational database through the distributed publish-subscribe messaging system.
[0130] This application does not make any specific limitation on the business system, and it can be flexibly selected in combination with actual processing needs. For example, the business system may include an order system, and the business system may also include a course product system.
[0131] It is understandable that in order to reflect the students' registration, attendance, completion and renewal of courses in real time, the order system needs to have the number of courses registered and the number of courses withdrawn, and the course commodity system needs the number of courses to be taken. This application method can be applied to the attendance and course sales system. The attendance and course sales system counts the number of classes attended and the number of leave taken in the course sales data. Only through these operations can the students' registration, completion, renewal and arrears be calculated.
[0132] In step S201 of some embodiments, each payment and refund of an order requires asynchronous notification to modify the number of courses registered, the number of courses withdrawn, the number of courses attended, and the number of courses requested for leave in the course table of the relational database. Figure 3 As shown, it can be understood that the present application method can be applied to the attendance and course sales system. When the user successfully places an order in the order system, the attendance and course sales system updates the number of courses registered in the course schedule in the relational database.
[0133] Specifically, a course schedule is constructed using student ID, course ID, and semester as unique identifiers, and the number of courses registered, the number of courses dropped, the number of courses due, the number of courses attended, and the number of courses taken for leave as key field attributes. Data changes in the business system will be notified to the course schedule for synchronous changes through Kafka messages.
[0134] In some embodiments, a scheduled task of data consistency processing at early morning every day is used to update the relational database based on the course cancellation data to uniformly update the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested in the course schedule.
[0135] In this embodiment, the key data of the business system is synchronized to the course schedule in the relational database through a distributed publish-subscribe message system, thereby ensuring the real-time and accuracy of the data.
[0136] Step S202: Synchronize the key data of the current semester in the relational database's on-going course list to the non-relational database's on-going course list.
[0137] In step S202 of some embodiments, a new daily scheduled task is created through a distributed task scheduling system to obtain the current semester, and synchronize the key data of the current semester in the relational database reading course schedule to the non-relational database reading course schedule. The data of the current semester is read at dawn every day, and the data of other semesters are lazily loaded when they are used.
[0138] For example, use XXL-Job as a distributed task scheduling system, create a scheduled task at midnight, obtain the current semester, and traverse the data of the course schedule for each page of the semester, obtaining 1,000 entries per page. Use four different key prefixes and then combine the key student code and course ID to save the four values of the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested:
[0139] Key1: SchoolStudentCourse:OrderQuantity:{Course ID}:{Student Code};
[0140] value1:{number of courses registered};
[0141] Key2: SchoolStudentCourse:RefundQuantity:{Course ID}:{Student Code};
[0142] value2:{Number of courses dropped};
[0143] Key3: SchoolStudentCourse:DoneQuantity:{Course ID}:{Student Code};
[0144] value3:{number of classes completed};
[0145] Key4: SchoolStudentCourse:LeaveQuantity:{Course ID}:{Student Code};
[0146] value4:{number of leave periods taken}.
[0147] In this embodiment, the key data of the current semester in the relational database reading course list is synchronized to the non-relational database reading course list, which ensures the real-time and accuracy of the data and optimizes the reading performance.
[0148] Step S203, acquiring attendance data, generating class cancellation data according to the attendance data through a queue of a non-relational database, and storing the attendance data into an attendance sign-in table of a relational database.
[0149] Step S204, the key data of the number of classes attended and the number of classes for which leave has been requested in the non-relational database course schedule are modified according to the course cancellation data, and the student status is calculated through the key data of the non-relational database course schedule.
[0150] Step S205, display the student's status, number of classes to be cancelled and number of classes in arrears through the class details page, and display the number of classes registered for, number of classes attended, number of classes to be cancelled, number of classes withdrawn and number of classes in arrears through the current course details page.
[0151] In step S205 of some embodiments, the display data returned to the parents and teachers is calculated by reading the fields of the curriculum.
[0152] Specifically, the student's status, number of classes to be cancelled, and number of classes in arrears are displayed through the class details page, and the number of classes registered for, number of classes attended, number of classes to be cancelled, number of classes withdrawn, and number of classes in arrears are displayed through the current course details page.
[0153] In this embodiment, the student's status, number of classes to be cancelled, and number of classes in arrears are displayed on the class details page, and the number of classes registered for, number of classes attended, number of classes to be cancelled, number of classes withdrawn, and number of classes in arrears are displayed on the current course details page, providing an intuitive data display, which is conducive to users viewing class and course status.
[0154] Step S206, updating the relational database of the course schedule in progress.
[0155] Specifically, order data includes new order data and refund data.
[0156] In step S206 of some embodiments, order data and student codes are obtained, and the number of courses registered and dropped for each student is batch counted based on the order data and student codes, and the number of courses registered and dropped is updated in the course table in the relational database.
[0157] In some embodiments, the class cancellation data is generated again every day based on all the attendance data recorded on the day, thereby generating the number of classes attended and the number of classes left, and updating the number of classes attended and the number of classes left in the course table of the current course in the Mysql database.
[0158] Specifically, XXL-Job is used as a distributed task scheduling system. A new scheduled task is created at midnight. The schools that conduct business in the current semester are traversed to generate a task queue with school ID. The student ID is obtained based on the school ID and the order data changes of the day (including order data and refund data). The data of the number of courses that students have registered for and the number of courses that have been withdrawn are counted in batches. The latest number of courses that have been registered and the number of courses that have been withdrawn are updated to the Mysql course list. For example, the relational database course list update flow chart is as follows: Figure 4 shown.
[0159] In this embodiment, the course schedule in the relational database is updated to ensure the consistency and accuracy of the data.
[0160] Step S207, updating the relational database course sales table.
[0161] In step S207 of some embodiments, first attendance data is obtained from the relational database attendance sign-in table according to the semester and school code; first course sales data is obtained from the relational database course sales table according to the semester, school code, student code and attendance code; the first attendance data is compared with the first course sales data to see if the attendance type, class number code and course sales code are consistent; if not, the first course sales data is updated. Further, second course sales data is obtained from the relational database course sales table according to the semester and school code; second attendance data is obtained from the relational database attendance sign-in table according to the semester, school code and time range; the second course sales data is compared with the second attendance data to see if the semester, student code, class number and attendance code are consistent; if not, the second course sales data is updated.
[0162] Specifically, XXL-Job, as a distributed task scheduling system, creates a scheduled task for the early morning hours, traverses the schools that conduct business in the current semester to generate a task queue with a school ID (i.e., school code), and obtains the most recently updated attendance data based on the current semester and school ID page, and obtains the course sales data based on the semester + school + student ID (i.e., student code) + attendance ID (i.e., attendance code); compares the attendance type, class ID (i.e., class code), and course sales ID (i.e., course sales code) one by one to see if they are consistent. Further, obtain the most recently updated course sales data based on the current semester and school ID page, and then obtain the attendance data based on the semester + school + time range; compare the semester student ID, class number, and attendance ID one by one, and resynchronize the abnormal data after the comparison by correcting the queue. Exemplarily, the relational database course sales table update flow chart is as follows: Figure 5 shown.
[0163] In this embodiment, the relational database course sales table is updated to ensure the consistency and accuracy of the data.
[0164] See also Figure 6 In some embodiments, step S103 may include but is not limited to the following steps:
[0165] Take the module based on the student ID and put the attendance information into the queue;
[0166] Specifically, the queue can adopt a peak queue. Modulo refers to taking the remainder after dividing the student ID by another number.
[0167] Determine whether the attendance record has been deleted or cancelled. If so, delete the cancellation records in batches; otherwise, save the cancellation records in batches.
[0168] Save the cancellation records in batches, determine whether the cancellation records already exist, if not, insert the cancellation records in batches, filter the cancellation records with unique index conflicts, save the cancellation records in batches, if yes, determine whether the attendance time is greater than the cancellation time, if yes, update the cancellation records in batches.
[0169] Among them, batch update and batch save are executed asynchronously.
[0170] In some embodiments, 100 attendance records are taken from the peak shaving queue to check whether there are any cancellation records; if there are, batch update logic is used; if not, batch save logic is used.
[0171] Specifically, for batch saving, it is necessary to check whether the same batch of data violates the unique index. This can be judged by "Attendance Creation Time" + "Student ID" + "Class ID", and only the latest attendance data is retained.
[0172] It should be noted that asynchronous execution needs to ensure data consistency. When inserting sales data, if an existing record is found, the time is compared. If the attendance creation time is greater than the attendance time of the sales record, it is updated; otherwise, the processing is skipped to avoid dirty data.
[0173] Below, in conjunction with a specific attendance and class cancellation scenario, the solution of the embodiment of the present invention is described in detail and explained:
[0174] Reference Figure 7 , Figure 7 A data storage schematic diagram of an after-school business data processing method provided in an embodiment of the present application is shown; the method comprises the following steps:
[0175] Synchronize the key data of the business system to the MySQL course list through Kafka;
[0176] Specifically, the student ID, course ID, and semester are used as unique identifiers, and the number of courses registered, the number of courses dropped, the number of courses to be taken, the number of courses attended, and the number of courses for which leave has been requested are used as key field attributes to construct the current course table.
[0177] Every morning, according to the redundant fields in the MySQL course cancellation table, the key data in the MySQL course table will be changed according to the number of classes attended and the number of leave taken;
[0178] Every morning, a scheduled task is used to synchronize the key data of the current semester in the MySQL course list to the Redis course list.
[0179] For example, the Redis course schedule synchronization flow chart is as follows: Figure 8 shown.
[0180] Every morning, a scheduled task is used to synchronize the data of the MySQL course details student list to the Redis course schedule course details student list;
[0181] Specifically, the data of the class details student list includes class information and student list information. The class information includes the class name, number of students, class time, etc. The student list information includes each student's name, class attendance, registration and cancellation status, etc.
[0182] The teacher takes attendance and rolls the roll, generates attendance data based on the sign-in and leave status, stores the attendance data in the MySQL attendance sign-in table, and calculates the attendance data increment to change the Redis course table;
[0183] Generate sales details data based on sign-in data or leave data through Redis asynchronous queue;
[0184] Get the historical sales balance data, and generate the current sales balance data based on the sales details data and the historical sales balance data through the Redis asynchronous queue;
[0185] Check whether the current course sales data is repeated with the historical course sales data in the MySQL course sales table through a unique index. The unique index consists of the attendance creation time, student code, and course code.
[0186] If the current course sales data does not overlap with the historical course sales data, the current course sales data will be saved to the MySQL course sales table through the Redis asynchronous queue;
[0187] If the current course sales data is repeated with the historical course sales data, compare the attendance creation time of the current course sales data with the attendance creation time of the historical course sales data. If the attendance creation time of the current course sales data is later than the attendance creation time of the historical course sales data, update the historical course sales data according to the current course sales data through the asynchronous queue of Redis.
[0188] Specifically, the course sales data is used to write off courses, and the course sales data includes course sales detail data and course sales balance data.
[0189] According to the course cancellation data, the key data of the Redis course table, the number of classes attended and the number of leave taken, are changed;
[0190] When the number of registered courses is less than or equal to zero, the current student's status is determined to be unregistered;
[0191] Calculate the remaining classes. The calculation formula for the remaining classes is:
[0192] Remaining classes = number of courses registered - number of courses withdrawn - number of classes attended + number of classes for which leave has been requested;
[0193] When the remaining number of classes is greater than zero, the current student's status is determined to be registered;
[0194] When the remaining number of classes is less than zero, the current student is determined to be in arrears;
[0195] When the number of lessons registered for a course is greater than zero and the number of remaining lessons is equal to zero, the current student's status is determined to be completed;
[0196] Get the course end time according to the course code. If the current time exceeds the course end time, determine that the current student's status is ended.
[0197] The student status includes at least one of not registered, registered, completed, cancelled or in arrears.
[0198] The class details page displays the student's status, number of classes to be cancelled, and number of classes in arrears;
[0199] For example, the class details page diagram is as follows Fig. 9 As shown, the class details page lists the teacher's upcoming class information and student list. The student list should show the registration and arrears status of each student, so that the teacher can understand the student's class cancellation status in real time while taking attendance and calling the roll, to meet business needs.
[0200] The number of classes to be cancelled is determined by the number of classes registered, the number of classes withdrawn, the number of classes attended and the number of classes for which leave has been requested. The number of classes in arrears is determined by the number of classes registered, the number of classes withdrawn, the number of classes attended and the number of classes for which leave has been requested.
[0201] By displaying the number of courses registered, attended, pending, withdrawn and owed on the course details page;
[0202] For example, the diagram of the details page of the enrolled course is as follows: Fig.10 shown.
[0203] Get order data and student code. Order data includes new order data and refund data.
[0204] According to order data and student codes, batch count the number of courses each student has registered for and the number of courses they have dropped;
[0205] Update the number of courses registered and dropped to the MySQL course table;
[0206] Get the first attendance data from the MySQL attendance sign-in table according to the semester and school code;
[0207] Get the first course sales data from the MySQL course sales table according to the semester, school code, student code and attendance code;
[0208] Compare the attendance type, class number code and class sales code of the first attendance data and the first class sales data to see if they are consistent; if they are inconsistent, update the first class sales data;
[0209] Get the second course sales data from the MySQL course sales table according to the semester and school code;
[0210] Get the second attendance data from the MySQL attendance sign-in table according to the semester, school code and time range;
[0211] Compare the second course sales data with the second attendance data to see if the semester, student code, class number and attendance code are consistent; if they are inconsistent, update the second course sales data.
[0212] See also Fig.11 The embodiment of the present application further provides an after-school service data processing device, which can implement the above-mentioned after-school service data processing method, and the device includes:
[0213] Synchronization module 1101, used to synchronize key data of the current semester of the relational database course list to the non-relational database course list, the key data including the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested;
[0214] Attendance acquisition module 1102, used to obtain attendance data;
[0215] The course cancellation module 1103 is used to generate course cancellation data according to the attendance data through the queue of the non-relational database, and save the course cancellation data to the course cancellation table of the relational database through the queue of the non-relational database. The course cancellation data is used to cancel the course;
[0216] The changing module 1104 is used to change the key data of the number of classes attended and the number of classes taken off in the reading course table of the non-relational database according to the class cancellation data;
[0217] The calculation module 1105 is used to calculate the student status through the key data of the course schedule in the non-relational database. The student status includes at least one of not registered, registered, completed, cancelled or owed.
[0218] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0219] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned after-school business data processing method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0220] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0221] See also Fig.12 , Fig.12 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0222] The processor 1201 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0223] The memory 1202 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1202 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1202, and the processor 1201 calls and executes the after-school business data processing method of the embodiment of this application;
[0224] Input / output interface 1203, used to implement information input and output;
[0225] The communication interface 1204 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0226] A bus 1205 that transmits information between the various components of the device (e.g., the processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204);
[0227] The processor 1201 , the memory 1202 , the input / output interface 1203 and the communication interface 1204 are connected to each other in communication within the device via the bus 1205 .
[0228] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned after-school business data processing method is implemented.
[0229] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0230] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0231] The after-school business data processing method, after-school business data processing device, electronic device and storage medium provided by the embodiment of the present application synchronize the key data of the current semester of the relational database reading course schedule to the non-relational database reading course schedule, so that the non-relational database reading course schedule can reflect the latest and most accurate course situation; obtain attendance data; generate course sales data according to the attendance data through the queue of the non-relational database, and save the course sales data to the relational database course sales schedule through the queue of the non-relational database, which can prolong the data processing time, make the course verification more automated, improve work efficiency, and reduce the possibility of human errors; change the number of classes attended and the number of classes taken leave of the key data in the non-relational database reading course schedule according to the course sales data, so as to improve the real-time and accuracy of the data; calculate the student's status through the key data of the non-relational database reading course schedule, and the student's status includes at least one of not registered, registered, finished, completed or owed, which is conducive to users understanding the student's status. The embodiment of the present application can prolong the data processing time, improve the real-time and consistency of the data, and enhance the user experience.
[0232] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0233] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0234] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0235] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0236] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable in an appropriate state, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0237] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0238] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0239] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0240] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0241] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0242] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for processing after-school business data, characterized in that: The method comprises: Synchronize the key data of the current semester in the relational database course list to the non-relational database course list, including the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested; Get attendance data; Generate course sales data according to the attendance data through a queue of a non-relational database, and save the course sales data to a course sales table of a relational database through the queue of the non-relational database, wherein the course sales data is used to cancel the course; According to the course sales data, the key data of the number of classes attended and the number of classes taken off in the course table of the non-relational database are changed; Calculating the student's status through the key data of the course schedule in the non-relational database, the student's status including at least one of unregistered, registered, completed, cancelled or in arrears; The course sales data includes attendance creation time, student code and class number code, and the course sales data is saved to the relational database course sales table through the queue of the non-relational database, including: Check whether the current course sales data and the historical course sales data of the course sales table in the relational database are repeated through a unique index, wherein the unique index is composed of the attendance creation time, the student code and the course number code; If the current course sales data does not overlap with the historical course sales data, the current course sales data is saved to the course sales table of the relational database; If the current class sales data and the historical class sales data are repeated, compare the attendance creation time of the current class sales data with the attendance creation time of the historical class sales data. If the attendance creation time of the current class sales data is later than the attendance creation time of the historical class sales data, update the historical class sales data with the current class sales data; The attendance data includes a semester, a school code, an attendance type, a class number code, and a class cancellation code; the class cancellation data includes a semester, a school code, a student code, an attendance code, an attendance type, a class number code, and a class cancellation code; the method further includes: Storing the attendance data in a relational database attendance sign-in sheet; Updating the relational database course sales table; The updating of the relational database course sales table includes: Acquire first attendance data from the attendance sign-in table of the relational database according to the semester and school code; Acquire first course sales data from the course sales table of the relational database according to the semester, school code, student code and attendance code; Compare the first attendance data with the first class sales data to see if the attendance type, class number code and class sales code are consistent; if they are inconsistent, update the first class sales data; Acquire second course sales data from the course sales table of the relational database according to the semester and school code; Acquire second attendance data from the attendance sign-in table of the relational database according to the semester, school code and time range; Compare the second course sales data with the second attendance data to see if the semester, student code, class number and attendance code are consistent; if they are inconsistent, update the second course sales data.
2. The method according to claim 1, characterized in that The method further comprises: Synchronize the key data of the business system to the course schedule in the relational database through the distributed publish-subscribe messaging system; The student's status, number of classes to be cancelled and number of classes in arrears are displayed on the class details page, wherein the number of classes to be cancelled is determined by the number of classes registered for the course, the number of classes withdrawn from the course, the number of classes attended and the number of classes for which leave has been requested, and the number of classes in arrears is determined by the number of classes registered for the course, the number of classes withdrawn from the course, the number of classes attended and the number of classes for which leave has been requested; The number of classes registered, attended, pending cancellations, dropped classes, and overdue classes for the course are displayed on the details page of the course being enrolled.
3. The method according to claim 1, characterized in that: The method further comprises: Updating the relational database of the course schedule in progress; The updating of the relational database course schedule includes: Obtaining order data and student code, wherein the order data includes new order data and refund data; According to the order data and student codes, batch count the number of courses that each student has registered for and the number of courses that have been withdrawn; The number of courses registered and the number of courses dropped are updated in the relational database course list.
4. The method according to claim 1, characterized in that: The attendance data includes sign-in data and leave data, the course sales data includes course sales detail data and course sales balance data, and the process of generating the course sales data according to the attendance data through the queue of the non-relational database includes: Generate sales details data based on sign-in data or leave data through the queue of non-relational database; The historical sales course balance data is obtained, and the current sales course balance data is generated according to the sales course detail data and the historical sales course balance data through a queue of a non-relational database.
5. The method according to any one of claims 1 to 4, characterized in that: The key data also includes a course code, and the student status is calculated by reading the key data of the course schedule from the non-relational database, including: When the number of registered sessions of the course is less than or equal to zero, determining the status of the current student as unregistered; Calculate the remaining classes, the calculation formula for the remaining classes is: Remaining classes = number of courses registered - number of courses withdrawn - number of classes attended + number of classes for which leave has been requested; When the remaining number of classes is greater than zero, determining that the current student's status is registered; When the remaining number of classes is less than zero, determining that the current student is in arrears; When the number of lessons already registered for the course is greater than zero and the number of remaining lessons is equal to zero, determining that the current student's status is completed; The course end time is obtained according to the course code. If the current time exceeds the course end time, it is determined that the current student's status is completed.
6. An after-school business data processing device, characterized in that: The device comprises: A synchronization module is used to synchronize the key data of the current semester of the relational database course schedule to the non-relational database course schedule, wherein the key data includes the number of courses registered, the number of courses withdrawn, the number of classes attended, and the number of classes for which leave has been requested; Attendance acquisition module, used to obtain attendance data; A course sales module, used to generate course sales data according to the attendance data through a queue of a non-relational database, and save the course sales data to a course sales table of a relational database through the queue of the non-relational database, and the course sales data is used to write off the course; A change module, used for changing the key data of the number of classes attended and the number of classes taken off in the reading course table of the non-relational database according to the class sales data; A calculation module, used to calculate the status of the student through the key data of the course schedule in the non-relational database, wherein the status of the student includes at least one of not registered, registered, completed, cancelled or owed fees; The course sales data includes attendance creation time, student code and class number code. The course sales module is also used for: Check whether the current course sales data and the historical course sales data of the course sales table in the relational database are repeated through a unique index, wherein the unique index is composed of the attendance creation time, the student code and the course number code; If the current course sales data does not overlap with the historical course sales data, the current course sales data is saved to the course sales table of the relational database; If the current class sales data and the historical class sales data are repeated, compare the attendance creation time of the current class sales data with the attendance creation time of the historical class sales data. If the attendance creation time of the current class sales data is later than the attendance creation time of the historical class sales data, update the historical class sales data with the current class sales data; The attendance data includes the semester, school code, attendance type, class number code and class cancellation code, and the class cancellation data includes the semester, school code, student code, attendance code, attendance type, class number code and class cancellation code. The device is also used for: Storing the attendance data in a relational database attendance sign-in sheet; Updating the relational database course sales table; The updating of the relational database course sales table includes: Acquire first attendance data from the attendance sign-in table of the relational database according to the semester and school code; Acquire first course sales data from the course sales table of the relational database according to the semester, school code, student code and attendance code; Compare the first attendance data with the first class sales data to see if the attendance type, class number code and class sales code are consistent; if they are inconsistent, update the first class sales data; Acquire second course sales data from the course sales table of the relational database according to the semester and school code; Acquire second attendance data from the attendance sign-in table of the relational database according to the semester, school code and time range; Compare the second course sales data with the second attendance data to see if the semester, student code, class number and attendance code are consistent; if they are inconsistent, update the second course sales data.
7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
