Course data synchronization method and apparatus, electronic device, and storage medium

By acquiring and processing the course data list from the remote platform in distance education, and judging and updating the course data in the local database, the resource waste and real-time issues of course data synchronization are solved, and efficient data synchronization and consistency management are achieved.

CN116340421BActive Publication Date: 2026-03-27SHENZHEN HONGHE INNOVATION INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In distance education, there are problems with the real-time performance and smoothness of course data synchronization, which can easily lead to a waste of resources.

Method used

By obtaining the course data list from the remote platform and storing it in local memory, determining whether the list is empty, looping through the remote course data and obtaining identification information, querying the local database to see if the local course data is empty, and updating or adding course data to the local database based on the identification information, the accuracy of synchronization is ensured.

Benefits of technology

It improved the accuracy of course data synchronization, avoided resource waste, ensured the accuracy and consistency of course data in the local database, and improved the real-time performance and smoothness of course data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340421B_ABST
    Figure CN116340421B_ABST
Patent Text Reader

Abstract

The present disclosure provides a course data synchronization method and device, electronic equipment and storage medium. The method comprises: obtaining a course data list of a remote platform and storing it in a local memory; determining that the course data list is not empty, and iteratively traversing the course data list, taking out the remote course data in the course data list, and obtaining the identification information of the remote course data; querying whether the local course data in the local database is empty according to the identification information; in response to the local course data not being empty, determining the download state of the local course data, synchronizing the remote course data to the local course data to obtain first target course data, updating the first target course data and the download state to the local database; in response to determining that the local course data is empty, constructing a local course data object, and obtaining the remote course data corresponding to the local course data in the local memory as second target course data and adding it to the local database.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of data processing, and particularly relates to a course data synchronization method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the development of network education, distance education develops accordingly. However, when directly accessing course data through distance education, real-time and smoothness of course data access is poor, and when synchronizing course data through distance education, the local already stored course data is easily synchronized to the local database again, causing waste of resources.

[0003] Therefore, how to improve the accuracy of course data synchronization and avoid waste of resources has become a problem to be solved. SUMMARY

[0004] The present disclosure aims to provide a course data synchronization method and device, electronic equipment and storage medium to solve or partially solve the above technical problems.

[0005] To achieve the above purpose, the first aspect of the present disclosure provides a course data synchronization method, comprising:

[0006] Obtaining a course data list of a remote platform and storing the course data list in a local memory;

[0007] Judging whether the course data list is empty;

[0008] If the course data list is determined to be not empty, the course data list is looped and traversed, remote course data in the course data list is taken out, and identification information of the remote course data is obtained;

[0009] According to the identification information, it is determined whether the local course data in the local database is empty;

[0010] If the local course data is determined to be not empty, a download state of the local course data is determined, the remote course data is synchronized to the local course data to obtain first target course data, and the first target course data and the download state are updated to the local database;

[0011] If the local course data is determined to be empty, a local course data object is constructed, remote course data corresponding to the local course data in the local memory is obtained as second target course data, and the second target course data is added to the local database.

[0012] Based on the same inventive concept, the second aspect of the present disclosure provides a course data synchronization device, comprising:

[0013] The list obtaining module is configured to obtain a course data list of a remote platform and store the course data list into a local memory;

[0014] The judging module is configured to judge whether the course data list is empty or not.

[0015] The requesting module is configured to determine that the course data list is not empty, loop through the course data list, take out remote course data in the course data list, and obtain identification information of the remote course data.

[0016] The querying module is configured to query whether local course data in a local database is empty or not according to the identification information.

[0017] The updating module is configured to, in response to the local course data not being empty, determine a download state of the local course data, synchronize the remote course data to the local course data to obtain first target course data, and update the first target course data and the download state to the local database.

[0018] The adding module is configured to, in response to the local course data being empty, construct a local course data object, obtain remote course data corresponding to the local course data in the local memory as second target course data, and add the second target course data to the local database.

[0019] Based on the same inventive concept, a third aspect of the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.

[0020] Based on the same inventive concept, a fourth aspect of the present disclosure provides a non-transitory computer readable storage medium, which stores computer instructions for causing a computer to execute the method as described above.

[0021] It can be seen from the above that the course data synchronization method, device, electronic equipment and storage medium provided by the present disclosure. The course data list of the remote platform and the local course data are respectively judged, the remote course data to be synchronized in the remote platform and the local course data stored in the local database can be accurately determined, and then according to the remote course data to be synchronized and the local course data stored in the local database, the course data in the remote course data to be synchronized which is not completed synchronization is determined as target course data, and the target course data is synchronized to the local database, which can improve the accuracy of course data synchronization, ensure the accuracy and consistency of course data in the local database, and avoid the waste of resources caused by synchronizing the remote course data stored in the local to the local database again. The course data is played after being synchronized to the local, which avoids the problem of poor real-time performance and smoothness caused by directly accessing the course data. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the present disclosure or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.

[0023] Figure 1 The flowchart of the course data synchronization method of the embodiment of the present disclosure;

[0024] Figure 2A The schematic diagram of the course structure of the embodiment of the present disclosure;

[0025] Figure 2B The flowchart of the course synchronization of the embodiment of the present disclosure;

[0026] Figure 2C The flowchart of the course download state synchronization of the embodiment of the present disclosure;

[0027] Figure 2D The flowchart of the directory synchronization of the embodiment of the present disclosure;

[0028] Figure 2E The flowchart of the directory download state synchronization of the embodiment of the present disclosure;

[0029] Figure 2F The flowchart of the courseware synchronization of the embodiment of the present disclosure;

[0030] Figure 2G The flowchart of processing courseware data of the embodiment of the present disclosure;

[0031] Figure 2H The flowchart of matching local files of the embodiment of the present disclosure;

[0032] Figure 2I A flowchart of deleting courseware according to an embodiment of the present disclosure;

[0033] Figure 2J A flowchart of deleting directory according to an embodiment of the present disclosure;

[0034] Figure 2K A flowchart of deleting course according to an embodiment of the present disclosure;

[0035] Figure 3 A structural schematic diagram of a course data synchronization device according to an embodiment of the present disclosure;

[0036] Figure 4 A structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0037] In order to make the objects, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the embodiments and the accompanying drawings.

[0038] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood as the common meanings understood by those skilled in the art to which the present disclosure belongs. The terms "first", "second", and similar terms used in the embodiments of the present disclosure do not represent any order, number, or importance, but are only used to distinguish different components. The terms "include", "contain", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar terms do not mean physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "upper", "lower", "left", "right", and the like only represent relative positional relationships, and when the absolute positions of the described objects change, the relative positional relationships may also change accordingly.

[0039] As described above, how to improve the accuracy of course data synchronization and avoid waste of resources has become an important research problem.

[0040] Based on the above description, as shown in the method for synchronizing course data according to the present embodiment, the method comprises: Figure 1

[0041] In step 101, the course data list of the remote platform is acquired and stored in the local memory.

[0042] ​In implementation, the remote platform is an Internet server, and the remote platform stores course data. The terminal acquires a course data list of the remote platform and stores the course data list in a local memory, and waits for synchronizing the course data from the local memory to a local database. The terminal is a remote classroom terminal.

[0043] The course data includes at least one of the following: a course, a directory, and a courseware. The course data is sequentially arranged according to the levels of the course structure: a course, a directory, and a courseware.

[0044] In step 102, it is determined whether the course data list is empty.

[0045] In implementation, the acquired course data list of the remote platform is determined, and it is determined whether the course data list stores course data by determining whether the course list is empty, and it is further determined whether to synchronize the course data and the content of the synchronized course data.

[0046] In step 103, it is determined that the course data list is not empty, the course data list is looped and traversed, the remote course data in the course data list is taken out, and the identification information of the remote course data is acquired.

[0047] In implementation, when the course data list in the local memory is not empty, it is indicated that the course data list stores course data that can be synchronized. The course data list is looped and traversed, the remote course data in the course data list is taken out, and the identification information of the remote course data is acquired.

[0048] In step 104, it is determined whether the local course data in the local database is empty according to the identification information.

[0049] In implementation, it is determined whether the corresponding local course data in the local database is empty according to the identification information (Identity document, ID) of the remote course data, and it is determined whether the course data in the local database is synchronized according to the query result.

[0050] In step 105, in response to the local course data not being empty, the download state of the local course data is determined, the remote course data is synchronized to the local course data to obtain first target course data, and the first target course data and the download state are updated to the local database.

[0051] In a specific implementation, when the local course data in the local database is not empty, it indicates that there is previously synchronized course data in the local database, and the local course data is updated. The local course data updating process is: synchronizing the remote course data to the local course data, updating the local course data to obtain first target course data, and synchronizing the first target course data to the local database. In addition, the download state of the local course data is also synchronized to the local database.

[0052] The process of comparing and judging the remote course data list in the remote platform and the local course data in the local database is: judging the next level local course data of the local course data, judging whether the next level remote course data obtained from the remote course data is empty, then querying the total number and the number of unsuccessful downloads of the next level course data in the local database according to the ID, and determining the download state of the local course data according to the judgment results of the three, and further determining whether the local course data is downloaded successfully.

[0053] According to the download state, the remote course data is updated to the local database: when the course data is not downloaded successfully, the remote course data is updated to the local database to realize the synchronization of the course data.

[0054] Step 106, in response to determining that the local course data is empty, constructing a local course data object, and obtaining the remote course data corresponding to the local course data in the local memory as second target course data, and adding the second target course data to the local database.

[0055] In a specific implementation, when the course data in the local database is empty, it indicates that there is no synchronized course data in the local database. Therefore, by constructing a course data object, the remote course data that has not been synchronized is taken as the second target course data, and the second target course data is synchronized to the local database.

[0056] In the above embodiment, the course data list of the remote platform and the local course data are respectively judged, the remote course data to be synchronized in the remote platform and the local course data stored in the local database can be accurately determined, and then the course data that has not been synchronized in the remote course data to be synchronized is taken as the target course data according to the remote course data to be synchronized and the local course data stored in the local database, and the target course data is synchronized to the local database, which can improve the accuracy of course data synchronization, ensure the accuracy and consistency of the course data in the local database, and avoid the waste of resources caused by synchronizing the remote course data stored in the local database to the local database again. After the course data is synchronized to the local database, it is played, which avoids the problems of poor real-time performance and smoothness caused by directly accessing the course data.

[0057] In some embodiments, step 101 comprises:

[0058] Step 1011, obtaining site data.

[0059] Step 1012, determining whether the target site switches according to the site data.

[0060] Step 1013, in response to determining that the target site switches, stopping the download task and emptying the local course data in the local database.

[0061] Step 1014, in response to determining that the target site does not switch, obtaining the current time.

[0062] Step 1015, determining whether the current time is within the preset synchronization time.

[0063] Step 1016, in response to determining that the current time is within the synchronization time, obtaining the course data list of the remote platform.

[0064] Step 1017, in response to determining that the current time is not within the synchronization time, setting a trigger strategy of the course data synchronization, and obtaining the course data list of the remote platform according to the trigger strategy.

[0065] In specific implementation, by judging whether the target site (for example, a target school) switches and whether the current time is within the synchronization time, it is determined whether to trigger the synchronization of the course data, and then the course data list of the remote platform is obtained to synchronize the course data.

[0066] In the above scheme, by judging whether the course data synchronization is triggered, the course data synchronization can be performed after the course data synchronization is triggered, and the problem of random triggering of the course data synchronization operation is avoided.

[0067] In some embodiments, step 105 comprises:

[0068] Step 1051, determining whether the next level remote course data in the remote course data is empty, to obtain a determination result.

[0069] Step 1052, querying the total number of the next level remote course data as a first number in the local database according to the identification information of the remote course data.

[0070] Step 1053, querying whether the next level remote course data is completed in the local database according to the identification information of the remote course data, and counting the second number of the next level remote course data that is not completed.

[0071] Step 1054, determining the download state of the local course data by comparing and judging the judgment result, the first quantity and the second quantity.

[0072] In specific implementation, the next level local course data of the local course data is judged, whether the next level remote course data obtained from the remote course data is empty is judged, the total quantity and the quantity of the un-downloaded successfully of the next level course data in the local database are queried according to the ID, and the download state of the local course data is determined according to the judgment results of the three, and whether the local course data is downloaded successfully is determined.

[0073] In the above scheme, by judging the next level local course data, whether the next level local course data is downloaded successfully can be determined, and the download state of the current level local course data can be accurately determined.

[0074] In some embodiments, the method further comprises:

[0075] Step 105A, receiving the deletion instruction of the local course data, and judging the remote course data list.

[0076] Step 105B, in response to determining that the remote course data list is empty, deleting the local course data in the local database, and emptying the next level local course data of the local course data.

[0077] Step 105C, in response to determining that the remote course data list is not empty, double-looping the local course data, obtaining the course data to be deleted in the local course data, determining that the course data to be deleted is not empty, and deleting the course data to be deleted.

[0078] In specific implementation, whether the course data list is empty is judged, and it is determined whether all the course data in the local database is deleted or the course data to be deleted is obtained for deletion.

[0079] In the above scheme, by judging whether the course data list is empty, the deleted course data is more accurate, and the situations of missing deletion and multiple deletion are avoided. The course data in the local database which does not exist in the remote platform is deleted, and the consistency of the course data in the local database and the course data in the remote platform is ensured.

[0080] In some embodiments, the method further comprises:

[0081] Step 105D, obtaining the page code of the remote course data, and sequentially requesting the remote course data according to the page code.

[0082] Step 105E, in response to determining that the remote course data request fails, stopping the request.

[0083] Step 105F, in response to determining that the remote course data request is successful, obtaining the current page number and the total page number of the remote course data.

[0084] Step 105G, comparing the current page number with the total page number.

[0085] Step 105H, in response to determining that the current page number and the total page number are inconsistent, recursively obtaining the next page number of the current page number of the remote course data.

[0086] Step 105I, in response to determining that the current page number and the total page number are consistent, matching the local course data in the local database with the remote course data table in the remote platform, and deleting redundant local course data.

[0087] In the above scheme, the course data is sequentially requested by recursion according to the page number of the course data. The matching of the course data in the local database and the remote platform can be realized, the redundant course data can be deleted, and the acquisition and synchronization of the offline course data can be completed.

[0088] In some embodiments, the course data includes courseware; and the method further comprises:

[0089] Step 1051, obtaining the storage absolute path of the local courseware.

[0090] Step 1052, determining whether the storage absolute path is empty.

[0091] Step 1053, in response to determining that the storage absolute path is not empty, creating a file object of the local courseware, determining that the file object is a program package file, obtaining the package name of the program package file, and uninstalling the program package file according to the package name.

[0092] In specific implementation, after the courseware is completed synchronization storage, the courseware data is processed by judging the storage absolute path of the courseware. The processing of the courseware data includes uninstalling the program package file of the courseware and deleting the file object of the courseware.

[0093] Step 1053 is to uninstall the program package file of the courseware. When the storage absolute path of the local courseware is not empty, the file object of the local courseware is created. According to the extension name of the file object, it is determined whether the file is a program package file. After determining that the program package file is not empty, the package name of the program package file is obtained and the number of local coursewares is queried according to the package name. When the number is less than 1, the program package file is uninstalled according to the package name.

[0094] Step 1054, in response to determining that the storage absolute path is empty, querying the storage absolute path of the local courseware, creating a file object of the local courseware, determining that the file object exists, and deleting the file object according to the storage absolute path.

[0095] Step 1054 is to delete the file object of the courseware. When the storage absolute path of the local courseware is empty, the storage absolute path of the local courseware is queried, and the file object of the local courseware is created. Whether the local courseware is a file and whether the file exists are judged, and when the local courseware is a file and the file exists, the file object is deleted according to the storage absolute path.

[0096] Step 1055, updating the package name of the program package file to be empty, and updating the storage absolute path of the local courseware to be empty.

[0097] Step 1056, matching the local file for the local courseware.

[0098] In the above scheme, by processing the courseware data, the management of the courseware is realized, and the consistency of the courseware in the local database and the courseware in the remote platform is ensured.

[0099] In some embodiments, step 1056 includes:

[0100] Step 10561, obtaining a digital digest of the local courseware.

[0101] Step 10562, obtaining a download mode of the local courseware in the remote platform and a storage address of the local database.

[0102] Step 10563, determining whether the association relationship between the download mode and the storage address is empty according to the digital digest.

[0103] Step 10564, in response to determining that the association relationship is empty, setting the download state of the local courseware to not started.

[0104] Step 10565, in response to determining that the association relationship is not empty, constructing the file object according to the storage absolute path of the local courseware, and judging whether the file object exists.

[0105] Step 10566, in response to determining that the file object does not exist, deleting the association relationship, and setting the download state of the local courseware to not started.

[0106] Step 10567, in response to determining that the file object exists, setting the download state of the local courseware to complete, determining that the file object is a target file according to the storage absolute path, and downloading the local courseware.

[0107] In the implementation, the local file is matched for the courseware according to the association between the downloading mode of the courseware in the remote platform and the storage address of the local database according to the digital summary of the courseware. The downloading mode is a download link.

[0108] In the above scheme, by matching the local file for the courseware, the type of the courseware file can be determined, the installation of the courseware is realized, and the accuracy of the courseware in the local database is ensured.

[0109] In some embodiments, step 10567 includes:

[0110] Step 10567A, query the downloading mode of the local courseware to be downloaded.

[0111] Step 10567B, comparing and judging the downloading mode of the local courseware to be downloaded.

[0112] Step 10567C, in response to determining that there is a same downloading mode in the downloading mode of the local courseware to be downloaded, removing the local courseware corresponding to the same downloading mode.

[0113] In the implementation, before downloading the courseware, it further includes judging the downloading mode of the courseware list. By judging the downloading mode of the courseware, redundant courseware data is removed. The downloading mode is a download link.

[0114] In the above scheme, by judging the downloading mode of the courseware, redundant courseware data in the local database can be removed, the accuracy and consistency of the courseware in the local database and the courseware in the remote platform are ensured, and resource waste is reduced.

[0115] In some embodiments, the local course data includes a course; the next level local course data of the course is a directory; or the local course data includes a directory; the next level local course data of the directory is a courseware; or the local course data includes a courseware; the next level local course data of the courseware is a program package file of the courseware.

[0116] In the above embodiments, by judging the course data list on the remote platform and the local course data respectively, the remote course data to be synchronized on the remote platform and the local course data already stored in the local database can be accurately identified. Then, based on the remote course data to be synchronized and the local course data already stored in the local database, the course data that has not yet been synchronized from the remote course data to be synchronized is identified as the target course data. Synchronizing the target course data to the local database can improve the accuracy of course data synchronization, ensure the accuracy and consistency of course data in the local database, and avoid wasting resources by resynchronizing remote course data already stored locally. Playback is performed after the course data is synchronized locally, avoiding the problems of poor real-time performance and smoothness that occur when directly accessing course data.

[0117] It should be noted that the embodiments of this disclosure can also be further described in the following ways:

[0118] (I) Overall process.

[0119] Offline course synchronization for remote classroom terminals is primarily used in remote classroom terminals. Upon terminal startup, the service for synchronizing offline courses automatically begins. First, all download tasks are paused. Then, a thread for acquiring offline course network data is started to retrieve course data from the remote platform. Under normal network conditions, the terminal's course data is acquired, parsed, and then matched with the course data stored in the terminal's local database.

[0120] like Figure 2A As shown, Figure 2A This is a schematic diagram of the course structure according to an embodiment of this disclosure. The course data is arranged hierarchically as follows: course, catalog, and courseware. Course data synchronization includes course synchronization, catalog synchronization, and courseware synchronization. The course data synchronization operation involves adding and updating. During this process, the courseware built into the terminal is matched. After this operation is completed, the course data in the remote platform is matched with the course data in the terminal, thereby completing the data deletion operation. After the deletion operation is completed, the offline course data on the remote platform and the course data in the local database on the terminal are synchronized. After the download start time is reached, the matching of identical courseware is performed again to remove redundancy, avoiding the download of duplicate courseware, thus preventing resource waste and unnecessary space occupation.

[0121] (ii) Setting up and triggering course data synchronization.

[0122] Course data synchronization includes the synchronization of offline course data and download time settings. The triggering mechanism includes three parts: course data synchronization settings, synchronization triggering mechanism, and post-trigger operations.

[0123] (1) Course data synchronization setting is divided into download time period setting and synchronization course data time setting, wherein the synchronization course data time is the start time of the download time period. The terminal sets a default download time period, for example, the default download time period is 18:00-9:00, that is, at the time of 18:00, the course data synchronization and the download time setting synchronization are performed, and the synchronization and download of the terminal course data are completed according to the new course content and the download time. The time period can be set on the three course platforms of the remote platform, the terminal and the local database.

[0124] (2) The process of the synchronization triggering mechanism includes: starting to trigger synchronization when starting; triggering synchronization when reaching the set synchronization time and the start time of the download time period; triggering synchronization when the user modifies the school location of the terminal device and modifies the school where the course terminal is located.

[0125] (3) The operation after triggering includes: judging whether to switch the target school according to the obtained school data; stopping all download tasks and resetting to the state before triggering when the target school is switched, and emptying the terminal course data; starting to synchronize data when the target school is not switched. Pausing the current download task, obtaining course data and synchronizing with the terminal data to ensure data accuracy and integrity. Setting the download time period parameter of the obtained course data, updating the terminal setting data to ensure uniformity with the platform setting. Judging whether the current time is in the download time period; when the current time is in the download time period, obtaining the course data list of the remote platform and starting the synchronization task; when the current time is not in the download time period, setting the triggering strategy of the course data synchronization, obtaining the course data list of the remote platform according to the triggering strategy, and waiting for the synchronization task to start after triggering.

[0126] (Three) Offline course network data acquisition.

[0127] The network data of the offline course is mainly realized by the interface request mode. The interface is a paging request, and the request is completed by recursion. The process is as follows: obtaining the page number of the course data, requesting the course data according to the page number in turn; stopping requesting the course data when the course data request fails; editing the course data in the local database and the course data in the remote platform to complete synchronization when the course data request succeeds; judging whether the current page number is inconsistent with the total page number after the course data request succeeds; when the current page number is inconsistent with the total page number, obtaining the course data of the next page number of the current page number by recursion; when the current page number is consistent with the total page number, stopping recursion to obtain the course data, and matching the course data in the local database with the course data in the remote platform to delete redundant course data.

[0128] (Four) Course data synchronization.

[0129] (1) As shown in Figure 2B ,Figure 2B Flow chart of course synchronization of the embodiment of the present disclosure. The course synchronization is to synchronize the courses in the local database and the remote platform, and the course synchronization operation includes course editing and adding, and the specific steps are as follows:

[0130] It is judged whether the course list in the remote platform is empty; when the course list is empty, no course synchronization is performed; when the course list is not empty, the course list in the remote platform is looped to complete the synchronization of a single course.

[0131] The course data in the local database is queried according to the course ID, the directory data of the course is edited, it is judged whether the directory in the remote platform course data is contained, the number of all course directories and the number of course directories unsuccessfully downloaded are queried according to the course ID, and it is judged whether the course is successfully downloaded in combination with the three.

[0132] As shown in Figure 2C , the flow chart of the course download state synchronization of the embodiment of the present disclosure is shown. Figure 2C When the course list in the remote platform is empty, a new course data object is constructed and added to the new course list.

[0133] When the course list in the local database is empty, a new course data object is constructed and added to the new course list.

[0134] The course data object is added to the global course list, and the preparation for the final course synchronization with the local database is completed.

[0135] The loop is completed, and when the new course list is not empty, the course data is batch inserted into the local database.

[0136] (2) As shown in Figure 2D , the flow chart of the directory synchronization of the embodiment of the present disclosure is shown. Figure 2D The directory synchronization is to synchronize the directories in the local database and the remote platform, and the directory synchronization operation includes directory editing and adding, and the specific steps are as follows:

[0137] It is judged whether the directory list in the remote platform is empty; when the directory list is empty, the directory data in the local database is deleted if the parent data (i.e. course data) of the directory exists in the local database; when the directory list is not empty, the directory list in the remote platform is looped to complete the synchronization of a single directory.

[0138] If the parent data of the directory (i.e., course data) is not empty, query the directory data in the local database based on the course ID and directory ID, edit the courseware data, determine whether the directory data on the remote platform contains courseware, query the number of all courseware and the number of courseware that failed to download based on the course ID and directory ID, and combine the three to determine whether the directory was downloaded successfully.

[0139] like Figure 2E As shown, Figure 2E This is a flowchart illustrating the synchronization of the directory download status in an embodiment of this disclosure. The process involves: querying the local database to retrieve the entire directory; if the queried directory in the local database is not empty, synchronizing the directory attributes from the remote platform to the directory object; obtaining the total number of courseware files, calculating the directory download progress based on the number of courseware files that failed to download, and updating the directory object; if a directory download fails, querying the number of courseware files in a paused state; if there are paused courseware files, setting the directory download status to paused; if there are no paused courseware files, and the number of courseware files that failed to download equals the total number of courseware files, setting the directory download status to not started; if the directory download succeeds, setting the directory download status to successful; and updating the directory data to the local database.

[0140] If the local database query directory is empty, construct a new directory data object and add it to the list of newly added directories.

[0141] When the parent data of the directory (i.e., the course data) is empty, edit the courseware data, get the total number of courseware that failed to download, and determine whether the directory has been downloaded completely by combining the directory data of the remote platform with the number of courseware. Construct a new directory data object and add it to the list of newly added directories.

[0142] Add directory data objects to the global directory list to prepare for the final synchronization of directory data with the local database.

[0143] Once the loop completes, if the list of newly added directories is not empty, batch insert the directory data into the local database.

[0144] (3) Figure 2F As shown, Figure 2F This is a flowchart illustrating courseware synchronization in an embodiment of this disclosure. Courseware synchronization involves synchronizing courseware between the local database and the remote platform. The courseware synchronization operation includes editing and adding courseware, and the specific steps are as follows:

[0145] Determine if the courseware list on the remote platform is empty; if the courseware list is empty, and the parent data (i.e., directory data) of the courseware exists in the local database, delete the courseware data in the local database; if the courseware list is not empty, loop through the courseware list on the remote platform to complete the synchronization of a single courseware.

[0146] If the parent data of the courseware (i.e., the directory data) is not empty, query the courseware data in the local database based on the course ID, directory ID, and courseware ID.

[0147] If the courseware query in the local database is not empty, synchronize the courseware attributes in the remote platform to the courseware object; if the courseware type is a file, and the download link of the courseware data in the remote platform is not empty, check the download link of the courseware data.

[0148] If the local courseware download link is not equal to the courseware download link on the remote platform, check the courseware download status; if the courseware download status is successful, obtain the actual download links of the local courseware download link and the courseware download link on the remote platform. If the two are not equal, process the courseware data; if the courseware download status is failed or downloading, process the courseware data.

[0149] When the local courseware download link is equal to the remote platform's courseware download link, if the courseware download status is failed or downloading, obtain the absolute path of the courseware download, generate a file object, and if the file type is a file and the file exists, it means that the downloaded courseware is an Android application package (apk), a keylayout (kl), or a compressed file (zip), which is either not installed or decompressed, or the download failed. If the file size is equal to the size of the downloaded courseware and neither is 0, execute the logic for successful courseware download, update the courseware object data, and update the courseware data to the local database.

[0150] If the local database returns no courseware, a new courseware data object is constructed and added to the list of newly added courseware.

[0151] When the parent data of the courseware (i.e., the directory data) is empty, a new courseware data object is constructed and added to the list of newly added courseware.

[0152] Add the courseware data object to the global courseware list to prepare for the final synchronization of courseware data with the local database.

[0153] When the loop ends and the list of newly added courseware is not empty, batch insert the courseware information into the local database.

[0154] (4) Figure 2G As shown, Figure 2G This is a flowchart illustrating the processing of courseware data according to an embodiment of the present disclosure. Specific steps include:

[0155] Set the courseware download status to "Not Started" and the download progress to 0.

[0156] Check if the absolute path for storing courseware in the courseware data is empty.

[0157] When the stored absolute path is not empty, a file object of the courseware is constructed, and whether the file object of the courseware is a program package file is judged according to the extension. When the file object is a program package file, the package name of the program package file is obtained, when the package name is not empty, the number of coursewares is queried according to the package name, and when the number of coursewares is less than 1 (i.e. Count < 1), the program package file is uninstalled according to the package name.

[0158] When the stored absolute path is empty, the courseware download absolute path is queried, the file object of the courseware is constructed, and if the courseware is a file and the file exists, the file is deleted according to the file absolute path.

[0159] The courseware package name is updated to be empty, and the courseware storage absolute path is empty.

[0160] The local file is matched.

[0161] (5) As shown in Figure 2H , a flowchart of matching a local file according to an embodiment of the present disclosure is shown. The specific steps include: Figure 2H

[0162] According to the courseware download link, the real download link address is obtained, and the token is removed (i.e. token is removed); the digital digest (i.e. hash value) is obtained.

[0163] According to the hash value, the association relationship between the download link and the local storage address in the database is queried, and whether it is empty. When the association relationship is empty, the courseware download state is set to not started, and the download progress is 0; when the association relationship is not empty, the file object is constructed according to the file absolute path, and whether the file exists is judged.

[0164] When the file does not exist, the association relationship between the download link and the local file storage address is deleted, the courseware download state is set to not started, and the download progress is 0; when the file exists, the courseware download state is set to completed, and the download progress is 100, and whether the file object is a file is judged according to the local file storage path. When the file object is a file, the file size attribute of the courseware is set, and whether the file is a program package file is judged according to the file extension. When the file is a program package file, the courseware package name attribute is set, and the program package file of the courseware is silently installed.

[0165] (6) Course data deletion

[0166] The course data deletion process only deletes the course data in the database, and retains the course data in the local. When the deleted course data in the database is updated back in the remote platform, it can avoid re-downloading and reduce resource waste.

[0167] 1) As shown in Figure 2I , a flowchart of deleting courseware according to an embodiment of the present disclosure is shown. The specific steps include: Figure 2I

[0168] ​​If the global courseware list is empty, check if all courseware data is empty. If all courseware data is not empty, uninstall the courseware package files recursively.

[0169] Delete all courseware records from the database.

[0170] If the global courseware list is not empty, query all courseware data and perform a double loop traversal with the global courseware list to obtain the courseware list to be deleted, and check if the courseware list to be deleted is empty; if the courseware list to be deleted is not empty, loop through the list and delete the courseware data to be deleted from the database; recursively unload the program package files of the courseware to be deleted.

[0171] 2) such as Figure 2J As shown, Figure 2J This is a flowchart illustrating the deletion of a directory according to an embodiment of this disclosure. Specific steps include:

[0172] When the global directory list is empty, delete all directory records in the database and clear the global courseware list.

[0173] If the global course directory list is not empty, query the entire directory list and perform a double loop traversal with the global directory list to obtain the directory list to be deleted, and check if the directory list to be deleted is empty; if the directory list to be deleted is not empty, loop through the list and delete the directory data to be deleted from the database.

[0174] 3) such as Figure 2K As shown, Figure 2K This is a flowchart illustrating the course deletion process according to an embodiment of this disclosure. Specific steps include:

[0175] When the global course list is empty, delete all course records in the database, clear the global directory list, and clear the global courseware list.

[0176] If the global course list is not empty, query the entire course list and perform a double loop to traverse the global course list to obtain the course list to be deleted, and check if the course list to be deleted is empty; if the course list to be deleted is not empty, loop through the list and delete the course data to be deleted from the database.

[0177] (v) Matching of built-in courseware on the terminal.

[0178] To save data usage and time, the terminal will pre-install some courseware resources, their download links, hash values ​​generated from the download links, and local storage addresses.

[0179] Timing of matching built-in courseware:

[0180] The course data has new courseware resources, the course data existing in the terminal does not contain the courseware resources, and when new courseware data is constructed, matching with built-in courseware resources is performed; the courseware data existing in the terminal changes, such as the courseware download link changes, the courseware is considered to be a new courseware resource that needs to be downloaded, and therefore matching with built-in courseware resources needs to be performed.

[0181] The matching of the built-in courseware is consistent with the process of matching the local file.

[0182] (Six) Redundant download is removed for the same resources.

[0183] The courseware resources can be reused, that is, different courses contain different courseware, but the courseware needs to download the same resources, and therefore, in order to reuse the resources and save storage space, the redundant operation of removing the same resources needs to be completed when starting to download, and the steps are as follows:

[0184] The courseware resource list that needs to be downloaded currently is queried.

[0185] According to the link of the downloaded courseware resources, the resource data with the same download link in the courseware resource list that needs to be downloaded is removed, and the redundant data is removed.

[0186] After the deduplication is completed, the new courseware download resource list is obtained, and then a download task is created and the downloading is started.

[0187] After the downloading is successful, the downloading state of the courseware with the same resources needs to be updated to success, the downloading progress is 100, the local storage path is the resource storage address, and meanwhile, the new courseware download link, the hash value generated by the real download link, and the local storage path data need to be inserted into the built-in courseware matching data center, so as to provide new data support for the local matching of the subsequent courseware.

[0188] In the above embodiment, the remote classroom terminal offline course synchronization scheme is mainly applied to the synchronization of offline courses after the remote classroom terminal is started, and can complete the synchronization with the local offline data course, including course synchronization, directory synchronization and courseware synchronization, the synchronization operation includes adding, editing and deleting, the accuracy and consistency of the terminal data are ensured, and the diversity and universality of the remote education mode are improved.

[0189] It should be noted that the method of the embodiment of the disclosure can be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only execute one or more steps in the method of the embodiment of the disclosure, and the multiple devices will interact with each other to complete the method.

[0190] It is to be understood that the foregoing description is directed to some embodiments of the disclosure. Other embodiments fall within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the accompanying figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0191] Based on the same inventive concept, the disclosure also provides a course data synchronization device corresponding to the method of any of the above embodiments.

[0192] Reference Figure 3 , the course data synchronization device comprises:

[0193] The list obtaining module 301 is configured to obtain a course data list of a remote platform and store it in a local memory;

[0194] The determination module 302 is configured to determine whether the course data list is empty;

[0195] The request module 303 is configured to determine that the course data list is not empty, loop through the course data list, take out the remote course data in the course data list, and obtain the identification information of the remote course data;

[0196] The query module 304 is configured to query whether the local course data in the local database is empty according to the identification information;

[0197] The update module 305 is configured to, in response to the local course data not being empty, determine the download state of the local course data, synchronize the remote course data to the local course data to obtain first target course data, and update the first target course data and the download state to the local database;

[0198] The addition module 306 is configured to, in response to determining that the local course data is empty, construct a local course data object, and obtain the remote course data corresponding to the local course data in the local memory as second target course data, and add the second target course data to the local database.

[0199] In some embodiments, the list obtaining module 301 comprises:

[0200] The site data obtaining unit is configured to obtain site data;

[0201] The target site determination unit is configured to determine whether a target site is switched according to the site data;

[0202] a data clearing unit configured to, in response to determining that the target site switches, stop a download task, and clear the local course data in the local database;

[0203] a current time obtaining unit configured to, in response to determining that the target site does not switch, obtain a current time;

[0204] a current time judging unit configured to judge whether the current time is within a preset synchronization time;

[0205] a first list obtaining unit configured to, in response to determining that the current time is within the synchronization time, obtain a course data list of a remote platform;

[0206] a second list obtaining unit configured to, in response to determining that the current time is not within the synchronization time, set a trigger strategy of the course data synchronization, and obtain the course data list of the remote platform according to the trigger strategy.

[0207] In some embodiments, the updating module 305 comprises:

[0208] a judging unit configured to judge whether next-level remote course data in the remote course data is empty, to obtain a judging result;

[0209] a first number obtaining unit configured to, according to identification information of the remote course data, query a total number of the next-level remote course data in the local database as a first number;

[0210] a second number obtaining unit configured to, according to the identification information of the remote course data, query whether the next-level remote course data is downloaded in the local database, and count a second number of the next-level remote course data that is not downloaded;

[0211] a download state determining unit configured to determine a download state of the local course data by comparing the judging result, the first number and the second number.

[0212] In some embodiments, the apparatus further comprises:

[0213] a list judging module configured to receive a deletion instruction of the local course data, and judge a remote course data list;

[0214] a list deleting module configured to, in response to determining that the remote course data list is empty, delete the local course data in the local database, and clear next-level local course data of the local course data;

[0215] The course data deletion module is configured to, in response to determining that the remote course data list is not empty, double-loop through the local course data, obtain course data to be deleted in the local course data, determine that the course data to be deleted is not empty, and delete the course data to be deleted.

[0216] In some embodiments, the apparatus further comprises:

[0217] The course data request module is configured to obtain a page number of the remote course data, and sequentially request the remote course data according to the page number.

[0218] The stop request module is configured to, in response to determining that the remote course data request fails, stop the request.

[0219] The page number obtaining module is configured to, in response to determining that the remote course data request succeeds, obtain a current page number and a total page number of the remote course data.

[0220] The page number judgment module is configured to compare and judge the current page number and the total page number.

[0221] The course data obtaining module is configured to, in response to determining that the current page number and the total page number are inconsistent, obtain remote course data of a next page number of the current page number in a recursive manner.

[0222] The course data deletion module is configured to, in response to determining that the current page number and the total page number are consistent, match the local course data in the local database and the remote course data table in the remote platform, and delete redundant local course data.

[0223] In some embodiments, the course data comprises courseware; and the method further comprises:

[0224] The path obtaining module is configured to obtain a storage absolute path of the local courseware.

[0225] The path judgment module is configured to judge whether the storage absolute path is empty.

[0226] The program package file uninstalling module is configured to, in response to determining that the storage absolute path is not empty, create a file object of the local courseware, determine that the file object is a program package file, obtain a package name of the program package file, and uninstall the program package file according to the package name.

[0227] The file object deletion module is configured to, in response to determining that the storage absolute path is empty, query the storage absolute path of the local courseware, create a file object of the local courseware, determine that the file object exists, and delete the file object according to the storage absolute path.

[0228] a path updating module configured to update a package name of the program package file as empty, and update a storage absolute path of the local courseware as empty;

[0229] a local file matching module configured to match a local file for the local courseware.

[0230] In some embodiments, the local file matching module comprises:

[0231] a digital digest obtaining unit configured to obtain a digital digest of the local courseware;

[0232] a download mode obtaining unit configured to obtain a download mode of the local courseware on a remote platform and a storage address of a local database;

[0233] a download mode judging unit configured to determine, according to the digital digest, whether an association relationship between the download mode and the storage address is empty;

[0234] a download state setting unit configured to set a download state of the local courseware as not started in response to a determination that the association relationship is empty;

[0235] a file object judging unit configured to construct the file object according to the storage absolute path of the local courseware, and determine whether the file object exists in response to a determination that the association relationship is not empty;

[0236] a relationship deleting unit configured to delete the association relationship and set the download state of the local courseware as not started in response to a determination that the file object does not exist;

[0237] a courseware downloading unit configured to set the download state of the local courseware as completed, determine that the file object is a target file according to the storage absolute path, and download the local courseware in response to a determination that the file object exists.

[0238] In some embodiments, the courseware downloading unit comprises:

[0239] a download mode querying sub-unit configured to query a download mode of a local courseware to be downloaded;

[0240] a download mode judging sub-unit configured to compare and judge the download mode of the local courseware to be downloaded;

[0241] a courseware list removing sub-unit configured to remove a local courseware corresponding to an identical download mode in response to a determination that the identical download mode exists in the download mode of the local courseware to be downloaded.

[0242] In some embodiments, the local course data comprises a course; the next level local course data of the course is a catalog; or, the local course data comprises a catalog; the next level local course data of the catalog is a courseware; or, the local course data comprises a courseware; the next level local course data of the courseware is a package file of the courseware.

[0243] For the convenience of description, the above apparatus is described in various modules in terms of functions. Of course, the functions of the modules can be implemented in one or more software and / or hardware when implementing the present disclosure.

[0244] The apparatus of the above embodiments is used to implement the corresponding course data synchronization method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here again.

[0245] Based on the same inventive concept, the present disclosure also provides an electronic device corresponding to the method of any of the above embodiments, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the course data synchronization method of any of the above embodiments when executing the program.

[0246] Figure 4 A more specific hardware structure of an electronic device provided by the present embodiment is shown, which can include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 for communication within the device.

[0247] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the present embodiment.

[0248] The memory 1020 can be implemented by a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 can store an operating system and other application programs, and when the technical solutions provided by the present embodiment are implemented by software or firmware, the related program codes are stored in the memory 1020 and executed by the processor 1010.

[0249] The input / output interface 1030 is configured to connect an input / output module to realize information input and output. The input / output module can be configured in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.

[0250] The communication interface 1040 is configured to connect a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired manner (such as a USB (Universal Serial Bus), a network cable, etc.) or a wireless manner (such as a mobile network, WIFI (Wireless Fidelity), Bluetooth, etc.).

[0251] The bus 1050 includes a channel to transmit information between various components (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040) of the device.

[0252] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only include components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all components shown in the figure.

[0253] The electronic device of the above embodiments is used to implement the corresponding course data synchronization method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here.

[0254] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the course data synchronization method according to any of the above embodiments.

[0255] The computer readable media of the embodiments can include permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0256] The storage medium of the above embodiments stores computer instructions for causing the computer to execute the course data synchronization method as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here.

[0257] Those skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present disclosure (including claims) is limited to these examples; under the idea of the present disclosure, the above embodiments or technical features between different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes of different aspects of the embodiments of the present disclosure as described above. In order to be brief, they are not provided in detail.

[0258] In addition, in order to simplify the description and discussion, and so as not to make the embodiments of the present disclosure difficult to understand, the well-known power / ground connections of integrated circuit (IC) chips and other components can or can not be shown in the provided drawings. In addition, the devices can be shown in the form of block diagrams in order to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented the embodiments of the present disclosure (i.e. these details should be fully within the understanding of those skilled in the art). Where specific details (e.g. circuits) are set forth in order to describe an exemplary embodiment of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with variations on these specific details. Therefore, these descriptions should be considered illustrative rather than limiting.

[0259] While the present disclosure has been described in connection with certain embodiments thereof, many modifications, substitutions, and variations will be apparent to those of ordinary skill in the art from the foregoing description. For instance, other memory architectures (e.g., dynamic RAM (DRAM)) can use the embodiments discussed.

[0260] Embodiments of the disclosure are intended to cover all such alternatives, modifications, and variations as falling within the broad scope of the appended claims. Accordingly, any one or more of the above-described embodiments can be combined with any one or more of the above-described embodiments in any manner within the scope of the disclosure.

Claims

1. A method for synchronizing course data, characterized in that, The method includes: Retrieve the course data list from the remote platform and store it in local memory; Determine whether the course data list is empty; Determine that the course data list is not empty, loop through the course data list, retrieve the remote course data in the course data list, and obtain the identification information of the remote course data; Based on the identification information, query whether the local course data in the local database is empty; In response to the fact that the local course data is not empty, the download status of the local course data is determined, the remote course data is synchronized to the local course data to obtain the first target course data, and the first target course data and the download status are updated to the local database; In response to determining that the local course data is empty, a local course data object is constructed, and the remote course data corresponding to the local course data in the local memory is obtained as the second target course data, and the second target course data is added to the local database; The course data includes courseware; The method further includes: Get the absolute path to the local courseware storage; Determine whether the absolute storage path is empty; In response to determining that the absolute storage path is not empty, a file object of the local courseware is created, the file object is determined to be a program package file, the package name of the program package file is obtained, and the program package file is uninstalled according to the package name; In response to determining that the storage absolute path is empty, query the storage absolute path of the local courseware, create a file object of the local courseware, determine that the file object exists, and delete the file object according to the storage absolute path; The package name of the program package file is updated to be empty, and the absolute storage path of the local courseware is updated to be empty; Match the local files to the local courseware.

2. The method according to claim 1, characterized in that, The process of obtaining the course data list from the remote platform includes: Acquire location data; Determine whether to switch the target location based on the location data; In response to the determination of the target location change, the download task is stopped and the local course data in the local database is cleared; In response to determining that the target location has not been switched, the current time is obtained; Determine whether the current time is within the preset synchronization time; In response to determining the current time within the synchronization time, obtain the course data list from the remote platform; In response to determining that the current time is not within the synchronization time, a trigger strategy for course data synchronization is set, and a course data list from the remote platform is obtained according to the trigger strategy.

3. The method according to claim 1, characterized in that, Determining the download status of the local course data includes: Determine whether the next-level remote course data in the remote course data is empty, and obtain the determination result; Based on the identification information of the remote course data, the total number of the next-level remote course data is retrieved from the local database as the first quantity. Based on the identification information of the remote course data, query the local database to see if the next-level remote course data has been downloaded, and count the second number of the next-level remote course data that has not been downloaded. The download status of the local course data is determined by comparing the judgment result, the first quantity, and the second quantity.

4. The method according to claim 1, characterized in that, Also includes: Upon receiving the deletion command for the local course data, a judgment is made on the remote course data list; In response to determining that the remote course data list is empty, delete the local course data in the local database and clear the next level of local course data; In response to determining that the remote course data list is not empty, a double loop is used to traverse the local course data, obtain the course data to be deleted from the local course data, determine that the course data to be deleted is not empty, and delete the course data to be deleted.

5. The method according to claim 1, characterized in that, Also includes: Obtain the page number of the remote course data, and request the remote course data sequentially according to the page number; In response to the determination that the remote course data request failed, the request is stopped; In response to the successful determination of the remote course data request, the current page number and total page number of the remote course data are obtained; The current page number is compared with the total page number to determine the result. In response to determining that the current page number is inconsistent with the total page number, the remote course data of the next page number of the current page number is obtained recursively. In response to determining that the current page number matches the total page number, the local course data in the local database and the remote course data table in the remote platform are matched, and redundant local course data is deleted.

6. The method according to claim 1, characterized in that, The process of matching local files with local courseware includes: Obtain the digital digest of the local courseware; Obtain the download method of the local courseware on the remote platform and the storage address of the local database; Determine whether the association between the download method and the storage address is empty based on the digital digest; In response to determining that the association is empty, the download status of the local courseware is set to not started; In response to determining that the association is not empty, the file object is constructed based on the absolute storage path of the local courseware, and it is determined whether the file object exists; In response to determining that the file object does not exist, the association is deleted, and the download status of the local courseware is set to not started; In response to determining that the file object exists, the download status of the local courseware is set to complete, the file object is determined as the target file according to the storage absolute path, and the local courseware is downloaded.

7. The method according to claim 6, characterized in that, Before downloading the local courseware, the method further includes: To find the download method for the local courseware to be downloaded; The download methods for the local courseware to be downloaded are compared and judged. In response to the determination that there are identical download methods among the local courseware to be downloaded, the local courseware corresponding to the identical download methods is removed.

8. The method according to any one of claims 1-7, characterized in that, The local course data includes courses; the next level of local course data for the courses is a directory; or, the local course data includes a directory; the next level of local course data for the directory is courseware; or, the local course data includes courseware; the next level of local course data for the courseware is the courseware's package file.

9. A course data synchronization device, characterized in that, include: The list retrieval module is configured to retrieve a list of course data from a remote platform and store it in local memory. The judgment module is configured to determine whether the course data list is empty; The request module is configured to determine that the course data list is not empty, loop through the course data list, retrieve the remote course data in the course data list, and obtain the identification information of the remote course data; The query module is configured to query whether the local course data in the local database is empty based on the identification information; The update module is configured to, in response to the local course data not being empty, determine the download status of the local course data, synchronize the remote course data to the local course data to obtain the first target course data, and update the first target course data and the download status to the local database. The add module is configured to, in response to determining that the local course data is empty, construct a local course data object, obtain the remote course data corresponding to the local course data in the local memory as the second target course data, and add the second target course data to the local database; The course data includes courseware; The device further includes: The path acquisition module is configured to obtain the absolute storage path of local courseware; The path determination module is configured to determine whether the stored absolute path is empty; The package file uninstallation module is configured to, in response to determining that the storage absolute path is not empty, create a file object of the local courseware, determine that the file object is a package file, obtain the package name of the package file, and uninstall the package file according to the package name; The file object deletion module is configured to, in response to determining that the storage absolute path is empty, query the storage absolute path of the local courseware, create a file object of the local courseware, determine that the file object exists, and delete the file object according to the storage absolute path; The path update module is configured to update the package name of the program package file to be empty and update the absolute storage path of the local courseware to be empty; The local file matching module is configured to match local files for the local courseware.

10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions for causing a computer to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data loading method

    CN107370829A

  • Data synchronization method and device based on cloud storage, equipment and storage medium

    CN110347651A