A data processing method, apparatus, device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]目前,在线上直播课中进行互动答题等业务交互时,尤其是参与人数过多,在多个人或多个班级的人同时进行答题等业务提交时,后台接收到的业务数据量大,并发业务量高,不利于对接收到的大量数据进行安全处理,易出现业务处理卡顿,甚至导致系统崩溃,降低系统稳定性
[0055] This disclosure also provides an electronic device, including a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-described data processing method are performed.
Smart Images

Figure CN116028546B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and more specifically, to a data processing method, apparatus, device, and storage medium. Background Technology
[0002] With the advancement and development of science and technology, internet technology has become increasingly mature and is gradually being applied in various fields, such as online education live classes. Through online classrooms, teachers and students can communicate remotely, and students can also interact and answer questions raised by teachers online through the live interface.
[0003] Currently, when conducting interactive Q&A sessions in online live classes, especially when there are too many participants, such as multiple individuals or students from multiple classes submitting answers simultaneously, the backend receives a large amount of business data with high concurrency. This makes it difficult to securely process the large amount of data received, which can easily lead to business processing delays, system crashes, and reduced system stability. Summary of the Invention
[0004] This disclosure provides at least one data processing method, apparatus, device, and storage medium.
[0005] This disclosure provides a data processing method, the method comprising:
[0006] During the live interactive quiz, the system receives quiz data from multiple users.
[0007] Determine whether the amount of the answer data exceeds a preset threshold;
[0008] If the amount of data is greater than the preset threshold, the answer data is written into a first database for temporarily storing the answer data;
[0009] When the data processing pressure of the second database used to store the answer data is less than a preset condition, the answer data stored in the first database is written into the second database.
[0010] In one optional implementation, the step of writing the answer data into a first database for temporarily storing the answer data if the data volume exceeds the preset threshold includes:
[0011] If the amount of data is greater than the preset threshold, determine the first data in the answer data that meets the preset threshold and the second data that exceeds the preset threshold;
[0012] Write the first data into the second database;
[0013] Write the second data into the first database.
[0014] In one optional implementation, writing the answer data stored in the first database into the second database includes:
[0015] Retrieve the second data from the first database;
[0016] Write the second data into the second database.
[0017] In one optional implementation, the second database is a document database. The first data and the second data are used as target data, and the target data is written into the second database, including:
[0018] The target data is parsed to obtain user information and answer information for each user;
[0019] Based on the user information, the answer information is written into the second database at the location corresponding to the answering user, wherein the user information includes at least one of the user name, user class ID, and the answering time when the user answers the question;
[0020] If writing the target data into the second database fails, the failed data from the target data is written into the first database.
[0021] In one optional implementation, after receiving answer data sent by multiple clients during the live interactive quiz process, the method includes:
[0022] The answer data is written into a third database, wherein the third database is used to calculate the user's cumulative score based on the user's answer score, and the answer data indicates the user's answer information including the answer score;
[0023] Retrieve the user's cumulative score from the third database;
[0024] The cumulative score is sent to the user.
[0025] In one optional implementation, after writing the answer data into the third database, the method includes:
[0026] After the live interactive quiz ends, a score ranking list under the target ranking dimension is obtained from the third database, wherein the score ranking list is calculated by the third database based on the cumulative score of each user;
[0027] The score leaderboard is sent to the user.
[0028] In one optional implementation, after retrieving the score ranking list under the target ranking dimension from the third database after the live interactive quiz ends, the method includes:
[0029] The score ranking list is written into the second database for storage.
[0030] This disclosure also provides a data processing apparatus, the apparatus comprising:
[0031] The data receiving module is used to receive answer data sent by multiple users during the live interactive quiz.
[0032] The data determination module is used to determine whether the amount of the answer data is greater than a preset threshold.
[0033] The first data storage module is used to write the answer data into a first database for temporarily storing the answer data if the amount of data is greater than the preset threshold.
[0034] The second data storage module is used to write the answer data stored in the first database into the second database when the data processing pressure of the second database used to store the answer data is less than a preset condition.
[0035] In one optional implementation, the first data storage module is specifically used for:
[0036] If the amount of data is greater than the preset threshold, determine the first data in the answer data that meets the preset threshold and the second data that exceeds the preset threshold;
[0037] Write the first data into the second database;
[0038] Write the second data into the first database.
[0039] In one optional implementation, the second data storage module is specifically used for:
[0040] Retrieve the second data from the first database;
[0041] Write the second data into the second database.
[0042] In one optional implementation, the second database is a document database, and the first data and the second data are used as target data. The first data storage module and the second data storage module are used to write the target data into the second database, specifically for:
[0043] The target data is parsed to obtain user information and answer information for each user;
[0044] Based on the user information, the answer information is written into the second database at the location corresponding to the answering user, wherein the user information includes at least one of the user name, user class ID, and the answering time when the user answers the question;
[0045] If writing the target data into the second database fails, the failed data from the target data is written into the first database.
[0046] In one optional embodiment, the apparatus further includes a third data storage module, the third data storage module being used for:
[0047] The answer data is written into a third database, wherein the third database is used to calculate the user's cumulative score based on the user's answer score, and the answer data indicates the user's answer information including the answer score;
[0048] Retrieve the user's cumulative score from the third database;
[0049] The cumulative score is sent to the user.
[0050] In one optional embodiment, the apparatus further includes a data ranking module, the data ranking module being used for:
[0051] After the live interactive quiz ends, a score ranking list under the target ranking dimension is obtained from the third database, wherein the score ranking list is calculated by the third database based on the cumulative score of each user;
[0052] The score leaderboard is sent to the user.
[0053] In one optional implementation, the second data storage module is further configured to:
[0054] The score ranking list is written into the second database for storage.
[0055] This disclosure also provides an electronic device, including a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-described data processing method are performed.
[0056] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described data processing method.
[0057] The data processing method, apparatus, device, and storage medium provided in this disclosure receive answer data sent by multiple users during a live interactive quiz; determine whether the amount of the answer data is greater than a preset threshold; if the amount of data is greater than the preset threshold, write the answer data into a first database for temporary storage of the answer data; and when the data processing pressure of a second database for storing the answer data is less than a preset condition, write the answer data stored in the first database into the second database.
[0058] In this way, when the amount of received data is large and exceeds the set threshold, the excess data can be temporarily stored in the first database. When the data processing pressure of the second database, which is used for permanent data storage, decreases, the data temporarily stored in the first database can be processed through parsing and classification before being stored in the second database. This can alleviate the problem of large concurrent data volume in the background, reduce the data processing pressure of the second database, and ensure the security of data processing, thus achieving secure storage of information.
[0059] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0060] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0061] Figure 1 A schematic diagram illustrating an application scenario provided by an embodiment of this disclosure;
[0062] Figure 2 A flowchart of a data processing method provided in an embodiment of this disclosure;
[0063] Figure 3 A flowchart of another data processing method provided in this disclosure embodiment;
[0064] Figure 4 This is one of the structural schematic diagrams of a data processing apparatus provided in an embodiment of the present disclosure;
[0065] Figure 5 This is a second schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure;
[0066] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0068] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0069] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0070] Research has found that during interactive Q&A sessions in online live classes, especially when there are too many participants, such as multiple individuals or students from multiple classes submitting answers simultaneously, the backend receives a large amount of business data and experiences high concurrency. This makes it difficult to securely process the large amount of data received, which can easily lead to business processing delays, system crashes, and reduced system stability.
[0071] Based on the above research, this disclosure provides a data processing method. During a live interactive quiz, the method receives quiz data sent by multiple users; determines whether the amount of quiz data exceeds a preset threshold; if the amount exceeds the preset threshold, the quiz data is written into a first database for temporary storage; and when the data processing pressure of a second database for storing the quiz data is less than a preset condition, the quiz data stored in the first database is written into the second database. This method alleviates the problem of large backend concurrent data volume and reduces the data processing pressure on the database, while ensuring data processing security and achieving secure information storage, even under conditions of large received business data volume and high business concurrency.
[0072] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. For example... Figure 1 As shown, the online education live streaming system includes a backend server, a live streaming client connected to the backend server, multiple user clients connected to the backend server, and multiple databases connected to the backend server (this embodiment uses three databases as an example). Teachers can initiate a live stream through the live streaming client, sending the live streaming data stream to the backend server. The backend server can then send the live streaming data stream obtained from the live streaming client to the user clients, allowing students to watch the online course through their user clients. During the online course viewing, students can interact with the teacher, such as through Q&A or answering questions. For example, when answering questions online, students can send their answer-related data to the backend server in real-time, or after answering multiple questions, for storage. The backend server can save the received answer data to multiple databases. Specifically, the multiple databases may include a first database, ... The second and third databases are as follows: the first database can be a message queue database for temporary data storage, such as RocketMQ; the second database can be a document database for long-term data storage and archiving, such as MongoDB; and the third database can be a distributed in-memory database, such as Redis, which can perform real-time data statistics. Specifically, after receiving the answer data, the backend server can write the answer data to the second database for archiving and permanent storage. Correspondingly, when the amount of concurrent data received is large, the backend server can temporarily store the answer data in the first database. When the pressure on the second database for concurrent data volume decreases, the data can be transferred to the second database. Furthermore, the backend server can also write the answer data to the third database to perform statistics on students' answers.
[0073] Please see Figure 2 , Figure 2This is a flowchart illustrating a data processing method provided in an embodiment of this disclosure. Figure 2 As shown in the embodiments of this disclosure, the data processing method includes:
[0074] S201: During the live interactive quiz, receive quiz data sent by multiple users.
[0075] In this step, during the live interactive Q&A session, the backend server can receive the answer data sent by multiple users participating in the live course in real time.
[0076] The received answer data can be submitted in real time after each question is answered by a user participating in the live course, or after all questions have been answered, or it can be submitted at regular intervals.
[0077] The answer data may include answer information, such as question information, answer, correct answer, and score, and may also include user information of the answerer, such as user name, user class ID, and answer time.
[0078] S202: Determine whether the amount of the answer data is greater than a preset threshold.
[0079] In this step, after receiving the answer data, the received answer data can be written into the second database for archiving. At the same time, in order to avoid the second database having a large amount of concurrent data and high data processing pressure, the amount of the answer data can be detected to determine whether the amount of the answer data is greater than a preset threshold. If it is less than the preset threshold, the answer data can be directly written into the second database.
[0080] The preset threshold can be pre-set based on the performance of offline machines and can be dynamically adjusted according to different needs and time periods.
[0081] S203: If the amount of data is greater than the preset threshold, the answer data is written into a first database for temporarily storing the answer data.
[0082] In this step, after determining that the amount of answer data sent by the user is greater than the preset threshold, it can be considered that if the answer data is written to the second database, the data processing pressure of the second database will be too great and problems may easily occur. Therefore, the answer data can be written to the first database used to temporarily store the answer data.
[0083] The process of writing the answer data into the first database can involve writing all of the answer data into the first database, which can minimize the data processing pressure on the second database. However, this may also result in the second database being idle. Therefore, it is also possible to write a portion of the answer data into the first database and another portion into the second database to balance the data pressure on each database.
[0084] Specifically, writing the answer data into the first database can be done by determining that the amount of data is greater than the preset threshold, identifying first data that meets the preset threshold and second data that exceeds the preset threshold in the answer data, thereby splitting the answer data into first data that the second database can handle and redundant second data. Then, the first data can be written into the second database and the second data can be written into the first database.
[0085] In this embodiment, the answer data is split using the preset threshold, but it is not limited to this. In other embodiments, the current data processing volume of the second database can be obtained, and the amount of answer data that the second database can process can be evaluated based on the current data processing volume. Thus, the first data that the second database can process can be split based on the amount of answer data that the second database can process, and the remainder can be used as the second data.
[0086] S204: When the data processing pressure of the second database used to store the answer data is less than a preset condition, the answer data stored in the first database is written into the second database.
[0087] In this step, after the answer data is temporarily stored in the first database, the data processing status of the second database can be monitored in real time to determine when the answer data can be written to the second database. When the data processing pressure of the second database is detected to be less than a preset condition, such as when the second database is idle or the data processing volume of the second database is less than the preset threshold, the answer data stored in the first database can be written to the second database.
[0088] Furthermore, after splitting the answer data into the first data and the second data, and storing them in the second database and the first database respectively, that is, when the answer data written to the first database is the second data, the second data can be retrieved from the first database first, and then the second data can be written into the second database.
[0089] When retrieving the second data from the first database, it can be determined whether the retrieved second data meets the preset threshold. If the second data meets the preset threshold, it can be considered that the amount of the second data is small and will not affect the performance of the second database, and the second data can be directly written into the second database. If the second data retrieved from the first database is still greater than the preset threshold, the second data can be further split, such as splitting out the third data that meets the preset threshold, writing the third data into the second database, and writing the remaining fourth data that exceeds the preset threshold back into the first database. When the data processing pressure of the second database is less than the preset condition, the fourth data is retrieved again to be written into the second database. The above steps are repeated until all the answer data in the first database is written into the second database.
[0090] When writing the first data and the second data into the second database, the data can be written according to the requirements of each field of the second data. In some possible embodiments, the second database is a document database, and the first data and the second data can be used as target data. Accordingly, writing the first data and the second data into the second database is equivalent to writing the target data into the second database.
[0091] Specifically, writing the target data into the second database may include:
[0092] The target data is parsed to obtain user information and answer information for each user; based on the user information, the answer information is written into the second database at the position corresponding to the answering user, wherein the user information includes at least one of user name, user class ID, and answering time when the user answers the questions; if writing the target data into the second database fails, the failed data in the target data is written into the first database.
[0093] In this step, during the parsing and processing of the target data, user information and answer information for each user can be obtained. The user information includes at least one of the following: user name, user class ID, and the time taken to answer the questions. The answer information includes at least one of the following: the question information, the answer choices, the answer content, and the score received. Then, based on the fields corresponding to each piece of information, the answer information of the corresponding user can be found and written into the second database. Furthermore, if writing the target data into the second database fails, the failed data from the target data is written into the first database.
[0094] For example, when a user answers a question, their user name is "A", their class ID is "Class B", and the time they answer the question is "11:30". The question information includes the question "What is one plus two?", the answer options are "one, two, three", the answer content is "three", and the score is "one point". Based on the user name "A", all the answer information for user A is written into the second database and stored at the location corresponding to the user name "A".
[0095] The data processing method provided in this embodiment receives answer data sent by multiple users during a live interactive quiz; determines whether the amount of the answer data is greater than a preset threshold; if the amount of data is greater than the preset threshold, writes the answer data into a first database for temporary storage of the answer data; and when the data processing pressure of a second database for storing the answer data is less than a preset condition, writes the answer data stored in the first database into the second database.
[0096] In this way, when the amount of received data is large and exceeds the set threshold, the excess data can be temporarily written to the first database. When the data processing pressure of the second database, which is used for permanent data storage, is reduced, the data temporarily stored in the first database can be processed through parsing and classification before being stored in the second database. This can alleviate the problem of large concurrent data volume in the background, reduce the data processing pressure of the second database, and ensure the security of data processing, thus achieving secure storage of information.
[0097] Please see Figure 3 , Figure 3 A flowchart illustrating another data processing method provided in this disclosure embodiment. (See flowchart for example.) Figure 3 As shown in the embodiments of this disclosure, the data processing method includes:
[0098] S301: During the live interactive quiz, receive quiz data sent by multiple users.
[0099] S302: Determine whether the amount of the answer data is greater than a preset threshold.
[0100] S303: If the amount of data is greater than the preset threshold, the answer data is written into a first database for temporarily storing the answer data.
[0101] S304: When the data processing pressure of the second database used to store the answer data is less than a preset condition, the answer data stored in the first database is written into the second database.
[0102] The descriptions of steps S301 to S304 can be referred to the descriptions of steps S201 to S204, and can achieve the same technical effect and solve the same technical problem, so they will not be repeated here.
[0103] S305: Write the answer data into the third database.
[0104] In this step, after receiving the answer data sent by the user, the answer information in the answer data can be obtained, and then the user information in the answer information and the user's score at the end of the question are written into the third database to calculate the user's cumulative score in real time.
[0105] The third database is used to calculate the user's cumulative score based on the user's answer scores, and the answer data indicates that the user's answer information includes the answer scores.
[0106] For example, the user's score at the end of the question in the obtained user answer information is "one point"; the user's name in the user information is "A", the user's class ID is "Class B", and the answering time of the user is "11:30". The answer information and user information are written into the third database.
[0107] S306: Obtain the user's cumulative score from the third database.
[0108] The third database is an in-memory database, which can accumulate user scores by writing them into the database.
[0109] S307: Send the cumulative score to the user.
[0110] In this step, after obtaining the user's cumulative score from the third database, the cumulative score can be sent to the user.
[0111] In one optional implementation, after step S305, the method includes:
[0112] After the live interactive quiz ends, a score ranking list under the target ranking dimension is obtained from the third database, wherein the score ranking list is calculated by the third database based on the cumulative score of each user; the score ranking list is then sent to the user.
[0113] In this step, user information is ranked in the third database based on the obtained cumulative user scores, thereby obtaining the score ranking list.
[0114] The resulting score ranking list can be viewed by users at any time.
[0115] In an optional real-time approach, after retrieving the score ranking list under the target ranking dimension from the third database following the conclusion of the live interactive quiz, the method includes:
[0116] The score ranking list is written into the second database for storage.
[0117] This allows the leaderboard scores to be saved permanently.
[0118] The data processing method provided in this embodiment involves receiving answer data sent by multiple users during a live interactive quiz; determining whether the amount of the answer data exceeds a preset threshold; if the amount of data exceeds the preset threshold, writing the answer data into a first database for temporary storage; when the data processing pressure of a second database for storing the answer data is less than a preset condition, writing the answer data stored in the first database into the second database; writing the answer data into a third database; obtaining the user's cumulative score from the third database; and writing the score ranking list into the second database for storage.
[0119] In this way, when the amount of received data is large and exceeds the set threshold, the excess data, or all of it, can be temporarily stored in the first database. When the data processing pressure of the second database, which is used for permanent data storage, decreases, the data temporarily stored in the first database is then processed through parsing and classification before being stored in the second database. This can alleviate the problem of large concurrent data volume in the background, reduce the data processing pressure on the second database, and ensure the security of data processing, achieving secure storage of information. At the same time, the answer data is written to the third database to obtain the cumulative score of the answers, enabling real-time score statistics for convenient user viewing.
[0120] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0121] Based on the same inventive concept, this disclosure also provides a data processing device corresponding to the data processing method. Since the principle of the device in this disclosure for solving the problem is similar to that of the data processing method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0122] Please see Figure 4 and Figure 5 , Figure 4 This is one of the structural schematic diagrams of a data processing apparatus provided in an embodiment of the present disclosure. Figure 5 This is a second schematic diagram of a data processing apparatus provided in an embodiment of this disclosure. Figure 4 As shown in the illustration, the data processing apparatus 400 provided in this embodiment includes:
[0123] The data receiving module 410 is used to receive answer data sent by multiple users during the live interactive quiz process.
[0124] The data determination module 420 is used to determine whether the amount of the answer data is greater than a preset threshold.
[0125] The first data storage module 430 is used to write the answer data into a first database for temporarily storing the answer data if the amount of data is greater than the preset threshold.
[0126] The second data storage module 440 is used to write the answer data stored in the first database into the second database when the data processing pressure of the second database used to store the answer data is less than a preset condition.
[0127] In one optional implementation, the first data storage module 430 is specifically used for:
[0128] If the amount of data is greater than the preset threshold, determine the first data in the answer data that meets the preset threshold and the second data that exceeds the preset threshold;
[0129] Write the first data into the second database;
[0130] Write the second data into the first database.
[0131] In one optional implementation, the second data storage module 440 is specifically used for:
[0132] Retrieve the second data from the first database;
[0133] Write the second data into the second database.
[0134] In an optional implementation, when the second data storage module 440 is used for writing the first data and the second data as target data into the second database, which is a document database, it is specifically used for:
[0135] The target data is parsed to obtain user information and answer information for each user;
[0136] Based on the user information, the answer information is written into the second database at the location corresponding to the answering user, wherein the user information includes at least one of the user name, user class ID, and the answering time when the user answers the question;
[0137] If writing the target data into the second database fails, the failed data from the target data is written into the first database.
[0138] In one alternative implementation, such as Figure 5 As shown, the data processing device 400 further includes a third data storage module 450, which is used for:
[0139] The answer data is written into a third database, wherein the third database is used to calculate the user's cumulative score based on the user's answer score, and the answer data indicates the user's answer information including the answer score;
[0140] Retrieve the user's cumulative score from the third database;
[0141] The cumulative score is sent to the user.
[0142] In one alternative implementation, such as Figure 5 As shown, the data device 400 further includes a data ranking module 460, which is used for:
[0143] After the live interactive quiz ends, a score ranking list under the target ranking dimension is obtained from the third database, wherein the score ranking list is calculated by the third database based on the cumulative score of each user;
[0144] The score leaderboard is sent to the user.
[0145] In an optional implementation, the second data storage module 440 is further configured to:
[0146] The score ranking list is written into the second database for storage.
[0147] The data processing apparatus provided in this embodiment receives answer data sent by multiple users during a live interactive quiz; determines whether the amount of the answer data is greater than a preset threshold; if the amount of data is greater than the preset threshold, writes the answer data into a first database for temporarily storing the answer data; and when the data processing pressure of a second database for storing the answer data is less than a preset condition, writes the answer data stored in the first database into the second database.
[0148] In this way, when the amount of received data is large and exceeds the set threshold, the excess data can be temporarily stored in the first database. When the data processing pressure of the second database, which is used for permanent data storage, decreases, the data temporarily stored in the first database can be processed through parsing and classification before being stored in the second database. This can alleviate the problem of large concurrent data volume in the background, reduce the data processing pressure of the second database, and ensure the security of data processing, thus achieving secure storage of information.
[0149] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0150] correspond Figure 2 and Figure 3 In addition to the data processing methods described in this disclosure, this embodiment also provides an electronic device 600, such as... Figure 6 The diagram shown is a structural schematic of an electronic device 600 provided in an embodiment of this disclosure, including:
[0151] The system includes a processor 610, a memory 620, and a bus 630. The memory 620 stores execution instructions and includes main memory 621 and external memory 622. Main memory 621, also called internal memory, temporarily stores computational data from the processor 610, as well as data exchanged with external memory such as a hard disk 622. The processor 610 exchanges data with external memory 622 through main memory 621. When the electronic device 600 is running, the processor 610 and the memory 620 communicate via the bus 630, enabling the processor 620 to execute instructions such as... Figure 2 and Figure 3 The steps of the data processing method in the example method shown.
[0152] This disclosure also provides a computer-readable storage medium storing a computer program, which is executed by a processor. Figure 2 and Figure 3The steps of the data processing method in the illustrated embodiment are shown. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0153] This disclosure also provides a computer program product carrying program code, the program code including instructions that can be used to implement the above. Figure 2 and Figure 3 The steps of the travel positioning method in the illustrated embodiment are shown. The computer program product described above can be implemented specifically through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0154] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A data processing method, characterized in that, The method includes: During the live interactive quiz, the system receives quiz data from multiple users. Determine whether the amount of the answer data exceeds a preset threshold; If the amount of data is greater than the preset threshold, the answer data is written into a first database for temporarily storing the answer data, wherein the first database is a message queue database; When the data processing pressure of the second database used to store the answer data is less than a preset condition, the answer data stored in the first database is written into the second database, wherein the second database is a document database for long-term data storage and archiving. After receiving answer data sent by multiple clients during the live interactive quiz process, the method includes: The answer data is written into a third database, wherein the third database is used to calculate the user's cumulative score based on the user's answer score, and the answer data indicates the user's answer information including the answer score, and the third database is a distributed memory database; Retrieve the user's cumulative score from the third database; The cumulative score is sent to the user.
2. The method according to claim 1, characterized in that, If the amount of data exceeds the preset threshold, the step of writing the answer data into a first database for temporarily storing the answer data includes: If the amount of data is greater than the preset threshold, determine the first data in the answer data that meets the preset threshold and the second data that exceeds the preset threshold; Write the first data into the second database; Write the second data into the first database.
3. The method according to claim 2, characterized in that, The step of writing the answer data stored in the first database into the second database includes: Retrieve the second data from the first database; Write the second data into the second database.
4. The method according to claim 3, characterized in that, The second database is a document database. The first data and the second data are used as target data, and the target data is written into the second database, including: The target data is parsed to obtain user information and answer information for each user; Based on the user information, the answer information is written into the second database at the location corresponding to the answering user, wherein the user information includes at least one of the user name, user class ID, and the answering time when the user answers the question; If writing the target data into the second database fails, the failed data from the target data is written into the first database.
5. The method according to claim 1, characterized in that, After writing the answer data into the third database, the method includes: After the live interactive quiz ends, a score ranking list under the target ranking dimension is obtained from the third database, wherein the score ranking list is calculated by the third database based on the cumulative score of each user; The score leaderboard is sent to the user.
6. The method according to claim 1, characterized in that, After the live interactive quiz ends and the score ranking list under the target ranking dimension is obtained from the third database, the method includes: The score ranking list is written into the second database for storage.
7. A data processing apparatus, characterized in that, The device includes: The data receiving module is used to receive answer data sent by multiple users during the live interactive quiz. The data determination module is used to determine whether the amount of the answer data is greater than a preset threshold. The first data storage module is used to write the answer data into a first database for temporarily storing the answer data if the data volume is greater than the preset threshold, wherein the first database is a message queue database; The second data storage module is used to write the answer data stored in the first database into the second database when the data processing pressure of the second database used to store the answer data is less than a preset condition. The second database is a document database for long-term storage and archiving of data. The third data storage module is used to write the answer data into a third database, wherein the third database is used to calculate the user's cumulative score based on the user's answer score, and the answer data indicates the user's answer information including the answer score, and the third database is a distributed memory database; Retrieve the user's cumulative score from the third database; The cumulative score is sent to the user.
8. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the data processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the data processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and device, storage medium and terminal
CN110941653A
Write-in method and device for database, computing equipment and medium
CN113553372A