A method and system for synchronizing online course resources based on WeChat Mini Programs

By using cloud-based resource scheduling services to retrieve the appropriate terminal rendering protocol version based on the characteristics of the mini-program's device environment, and only transmitting the incremental changes in lightweight teaching data when the network status changes, the problem of abnormal resource rendering and low synchronization efficiency caused by differences in the mini-program's device environment is solved, achieving efficient resource synchronization and a stable user experience.

CN122489248APending Publication Date: 2026-07-31SHANDONG ZHUOHANG ARCHIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG ZHUOHANG ARCHIVE TECH CO LTD
Filing Date
2026-05-29
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, differences in device environments on the mini-program side lead to abnormal resource rendering, low synchronization efficiency and high bandwidth consumption when switching network states, which affects user experience.

Method used

The cloud-based resource scheduling service retrieves the appropriate terminal rendering protocol version based on the device environment characteristics of the mini-program, and only transmits the incremental changes in lightweight teaching data when the network status changes. Combined with version control and offline locking mechanisms, it achieves efficient resource synchronization.

Benefits of technology

It resolves device environment compatibility issues, reduces resource loading anomalies, improves synchronization efficiency, reduces network bandwidth usage, and ensures normal user operation in weak network environments and rapid synchronization after a stable connection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489248A_ABST
    Figure CN122489248A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for synchronizing online course resources based on WeChat Mini Programs, relating to the field of Mini Program resource synchronization technology. The method includes: the target Mini Program submitting a resource access request containing a unique identifier for the course resources and device environment characteristics to a cloud resource scheduling service; the cloud parsing the request, retrieving the corresponding full resource package address, and querying the compatible terminal rendering protocol version; downloading the course resources and deconstructing and separating core teaching data, rich media display data, and auxiliary explanatory data, prioritizing the loading of core teaching data and transcoding it into a directly parsable lightweight data cache; and when the network switches from a weak network to a stable connection, transmitting the incremental changes in lightweight data and rich media data back to the cloud, completing bidirectional synchronization. This method can achieve stable loading and efficient synchronization of course resources, adapting to Mini Program device environments and network status fluctuation scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of mini-program resource synchronization technology, specifically a method and system for synchronizing online course resources based on mini-programs. Background Technology

[0002] Currently, the technology for accessing and synchronizing online course resources via mini-programs is widely used. In existing technologies, when a mini-program initiates a course resource access request, it typically only submits a unique identifier of the course resource to be accessed to the cloud service. The cloud service then retrieves the corresponding resource address based on this identifier, and the mini-program downloads the full course resources from that address and loads and renders them directly. Furthermore, when the network status on the mini-program changes, especially from a weak network to a stable connection, existing technologies generally employ a method of uploading the locally cached full course resource data back to the cloud to achieve two-way synchronization of course resources.

[0003] The existing technical solution has flaws. The cloud service does not take into account the differences in device environments on the mini-program side. Different device environments correspond to different terminal rendering protocol versions. Only retrieving the resource address without matching the rendering protocol version will cause the downloaded course resources to fail to be parsed and rendered properly, resulting in problems such as loading lag and formatting errors. Furthermore, the return of the full resource data when the network status changes will consume a lot of network bandwidth, resulting in low synchronization efficiency. In addition, resources cached in weak network environments cannot be efficiently synchronized with the cloud, affecting the user experience.

[0004] During the synchronization of online course resources, it is necessary to solve the problem of abnormal resource rendering caused by device environment adaptation, as well as the problems of low synchronization efficiency and high bandwidth consumption when switching network states, to ensure that course resources are loaded stably and synchronized efficiently, and to adapt to the usage scenarios of the mini-program. Summary of the Invention

[0005] This invention aims to solve at least one of the technical problems existing in the prior art; Therefore, this invention proposes a method for synchronizing online course resources based on a mini-program, comprising: Initiate a resource access request on the target mini-program and submit the resource access request to the cloud resource scheduling service. The resource access request includes the unique identifier of the course resource to be accessed and the device environment characteristics of the current mini-program. The cloud resource scheduling service parses the resource access request, retrieves the full resource package address corresponding to the unique identifier of the course resource from the preset resource release list, and simultaneously queries the terminal rendering protocol version adapted to the device environment characteristics. Download the course resources according to the full resource package address, and deconstruct the course resources locally to separate core teaching data, rich media display data and auxiliary explanatory data, wherein the core teaching data is loaded first; The separated core teaching data is transcoded according to the terminal rendering protocol version to generate lightweight teaching data that can be directly parsed by the target mini-program. The lightweight teaching data is cached in the local temporary session space. When the network status of the target mini-program is detected to switch from a weak network to a stable connection, the incremental changes of the locally cached lightweight teaching data and the rich media display data are sent back to the cloud resource scheduling service to complete the two-way synchronization of the course resources.

[0006] Furthermore, the course resources are deconstructed locally to separate core teaching data, rich media presentation data, and supplementary explanatory data, including: The downloaded course resources are parsed to identify the compression and encapsulation format used by the course resources, and the corresponding decompression tool is called to decompress them to obtain the original resource directory; Traverse the original resource directory and, based on the preset file extension whitelist, classify files with teaching logic control attributes as the core teaching data, files with audio / video or animation attributes as the rich media display data, and files with text description or hyperlink attributes as the auxiliary description data. Establish a timestamp-based version index for the core teaching data, establish a hash-based content fingerprint for the rich media display data, and establish a hierarchical tree structure for the auxiliary explanatory data; The established version index, content fingerprint, and tree structure are written into a local resource metadata table, which is used to record the deconstruction results of the course resources.

[0007] Furthermore, the separated core teaching data is transcoded according to the terminal rendering protocol version to generate lightweight teaching data that can be directly parsed by the target mini-program, including: Read the core teaching data recorded in the resource metadata table and parse out the definitions of teaching process control nodes and interactive elements therein; Obtain the terminal rendering protocol version issued by the cloud resource scheduling service, and compare whether the teaching process control node conforms to the standard specifications supported by the terminal rendering protocol version; For teaching process control nodes that do not conform to the aforementioned standard specifications, the local compatible conversion function library is invoked to rewrite them as low-level general control instructions, while retaining the original teaching logic. The rewritten teaching process control nodes, the interactive element definitions, and the static text in the core teaching data are combined and encapsulated into the lightweight teaching data, and a corresponding parsing entry file is generated.

[0008] Furthermore, when the network status of the target mini-program is detected to switch from a weak network to a stable connection, the incremental changes in the locally cached lightweight teaching data and the rich media display data are transmitted back to the cloud resource scheduling service to complete the two-way synchronization of the course resources, including: The network connection quality of the target mini-program is continuously polled through the underlying network monitoring interface. When the network latency is detected to be lower than the set threshold and the packet loss rate is zero for multiple consecutive times, it is determined that the network status has switched from weak network to stable connection. Access the local resource operation logs and filter out all editing operation records performed by the user on the lightweight teaching data since the last successful upload, as well as the download breakpoint resume records of the rich media display data; The editing operation record is converted into a standardized set of change instructions, and the download breakpoint resume record is converted into completed file block verification information. The set of change instructions and the completed file block verification information together constitute the change increment. Initiate a resumeable upload request to the cloud resource scheduling service, submitting the local lightweight teaching data, the incremental changes, and the latest copy of the resource metadata table to overwrite the old data of the corresponding version in the cloud.

[0009] Furthermore, an interruptible upload request is initiated to the cloud resource scheduling service, submitting the local lightweight teaching data, the incremental changes, and the latest copy of the resource metadata table to overwrite the old data of the corresponding version on the cloud, including: Before the formal upload, obtain the latest version number corresponding to the unique identifier of the course resource currently stored in the cloud from the cloud resource scheduling service, and compare it with the version number in the local resource metadata table; If the local version number is higher than the version number in the cloud, then the entire data will be uploaded directly, and the local version number will be written as the new version number in the request header. If the local version number is the same as the version number in the cloud, only the change increment is uploaded, and the completed file block verification information is carried in the request to verify data integrity. If the local version number is lower than the version number in the cloud, the upload will be terminated, and a command to force-fetch the latest data from the cloud will be pushed to the target mini-program. The forced fetch command will trigger the local data reset process.

[0010] Furthermore, it also includes the step of locking the course resources offline: After the lightweight teaching data is successfully loaded for the first time on the target mini-program, an offline occupancy request is sent to the cloud resource scheduling service. The offline occupancy request contains the current user identity authentication token. The cloud resource scheduling service verifies the validity of the user authentication token, and after successful verification, updates the status field of the course resource to be accessed to a locked state that is occupied, and returns a time-limited offline authorization credential. After receiving the offline authorization certificate, the target mini-program binds it to the local resource metadata table and prohibits the deletion of the occupied course resources during the validity period of the offline authorization certificate. When the offline authorization certificate expires, the lightweight teaching data and binding relationship on the local machine are automatically cleared, and an unlock notification is sent to the cloud resource scheduling service so that the cloud resource scheduling service can restore the status field of the course resource to an accessible state.

[0011] Furthermore, during the validity period of the offline authorization certificate, the deletion operation of the occupied course resources is prohibited, including: Intercept the deletion command for the course resources issued by the target mini-program interface layer, and extract the resource path pointed to by the deletion command; Query the local resource binding records to determine whether the resource path has a mapping relationship with the valid offline authorization credential; If a mapping relationship exists, the execution of the deletion command will be blocked, and a prompt message indicating that the resource is in an offline protection period will be displayed on the interface. If no mapping relationship exists, the deletion command is granted, allowing the subsequent physical deletion process to be executed, and the record status of the resource metadata table is updated.

[0012] Furthermore, it also includes a resource preloading step based on user behavior: The user's browsing trajectory data is captured in real time on the target mini-program, and the browsing trajectory data includes the frequency of the user's jump between course chapters and the duration of stay; The browsing trajectory data is sent to the cloud resource scheduling service, which then runs a prediction model to calculate the identifier of the course chapter the user will visit next. The cloud resource scheduling service retrieves the corresponding rich media display data from the resource library in advance based on the calculated course chapter identifier, and compresses and packages it into preloaded resource fragments; When the target mini-program detects that a user is about to enter the navigation node corresponding to the course chapter identifier, it automatically retrieves the preloaded resource fragment from the local cache and renders it quickly, specifically including: Register visibility listener events for navigation nodes in the interface rendering engine of the target mini-program. These visibility listener events are used to detect the page scroll position. When the visibility listener event is triggered, and the page area to be displayed contains the navigation node corresponding to the course chapter identifier, the preloading logic is activated; The system checks the local resource index table to see if a preloaded resource fragment that matches the course chapter identifier exists. If it does, the preloaded resource fragment is directly injected into the page's rendering queue. If the preloaded resource fragment is not present in the local cache, an on-demand download request for the cloud resource scheduling service is immediately initiated, and rendering is performed after the download is complete.

[0013] Furthermore, it also includes conflict resolution steps in the synchronization process: When the target mini-program modifies the lightweight teaching data during a network interruption, and detects that an updated version already exists in the cloud after the connection is restored, it reads the local conflict log and the version change record in the cloud. The user-modified content in the conflict log is compared field by field with the changed content in the cloud version change record to identify conflict blocks where content overlaps. For each conflicting block, a three-column comparison view is generated, which includes local version content, cloud version content, and a blank editing area, and the comparison view is returned to the target mini-program. The system receives the user's instruction to select the content to keep in the three-column comparison view, generates the final merged data based on the user's selection, and replaces the conflicting versions in the cloud and on-premises with the final merged data to complete the conflict resolution.

[0014] Furthermore, the present invention also includes an online course resource synchronization system based on a mini-program, the system including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements the steps of the online course resource synchronization method based on a mini-program as described above.

[0015] Compared with the prior art, the beneficial effects of the present invention are: When the cloud-based resource scheduling service parses resource access requests from the target mini-program, it retrieves the corresponding full resource package address from a pre-set resource release list based on the unique identifier of the course resource to be accessed. Simultaneously, it queries the terminal rendering protocol version adapted to the current mini-program's device environment characteristics, binding the resource address retrieval and rendering protocol version query together. This approach ensures that downloaded course resources accurately match the current device's rendering protocol, avoiding resource parsing failures and rendering anomalies caused by protocol incompatibility. It allows core teaching data to be loaded preferentially and stably, adapting to the mini-program's usage needs across different device environments and reducing anomalies during resource loading.

[0016] When the network status of the target mini-program changes from a weak network to a stable connection, only incremental changes to locally cached lightweight teaching data and rich media display data are sent back to the cloud resource scheduling service, instead of sending back the full course resource data. This method can significantly reduce network bandwidth consumption, avoid the synchronization delay caused by full data transmission, and speed up resource synchronization. At the same time, the lightweight teaching data cached in the weak network environment can ensure normal use for users. After a stable connection is established, bidirectional synchronization is achieved through incremental transmission, balancing the timeliness of resource synchronization and resource utilization efficiency, and adapting to usage scenarios with fluctuating network status on the mini-program side. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the steps of an online course resource synchronization method based on a mini-program as described in this invention. Figure 2 A flowchart for transcoding core teaching data to generate lightweight data; Figure 3 Heatmap adapted for the new version; Figure 4 A diagram showing the relationship between the validity period of offline authorization certificates and the effectiveness of resource protection; Figure 5 Provide a user chapter access path and preloading plan. Detailed Implementation

[0018] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] See Figure 1The target mini-program initiates an access request for specific course resources, which is submitted to the cloud resource scheduling service. The resource access request encapsulates a unique identifier for the course resource to be accessed, as well as the device environment characteristics of the current mini-program's running device, such as the operating system version and the mini-program's basic library version. Upon receiving the request, the cloud resource scheduling service parses it and retrieves the storage address of the corresponding full resource package on the network from its maintained resource release list, based on the unique identifier of the course resource. Simultaneously, the service queries the terminal rendering protocol version that matches the device environment characteristics; this version determines the data format specifications that the target mini-program can directly parse. Based on the obtained full resource package address, the target mini-program downloads the complete course resource package from the resource storage server. After downloading, the course resource package is deconstructed locally, separating it into three parts: core teaching data, rich media display data, and supplementary explanatory data. The core teaching data, containing necessary teaching logic, receives priority loading. The separated core teaching data is transcoded according to the terminal rendering protocol version distributed by the cloud, transforming it into a lightweight teaching data structure that can be directly parsed and rendered by the target mini-program. This lightweight teaching data is stored in a local temporary session space. During the use of course resources, the network status of the target mini-program is continuously monitored. When the network status changes from a weak network environment to a stable connection, the system will initiate a synchronization process: the locally cached lightweight teaching data, along with the incremental changes in rich media display data generated during this period, will be sent back to the cloud resource scheduling service. After receiving this data, the cloud resource scheduling service will merge or overwrite it with the corresponding resources stored in the cloud, thereby completing the two-way synchronization of course resources between the cloud and local storage.

[0020] In one embodiment of the present invention, the specific process of deconstructing course resources locally to separate core teaching data, rich media display data, and auxiliary explanatory data is as follows: The downloaded course resource files are parsed to identify the compression and packaging format used by the files. Then, a decompression tool corresponding to that format is called to decompress the resource package, resulting in a structured original resource directory. All files in the original resource directory are traversed, and files are classified according to a predefined whitelist rule for file extensions. Files with extensions indicating program scripts, configuration files, or other teaching process control attributes are classified as core teaching data; files with extensions indicating video, audio, animation, or high-resolution images or other audiovisual or animation attributes are classified as rich media display data; and files with extensions indicating text, hypertext links, or simple documents or other text descriptions or hyperlink attributes are classified as auxiliary explanatory data. A version index based on the last modification timestamp is established for the core teaching data; a hash value is calculated for the content of the rich media display data to establish a unique content fingerprint; and a hierarchical tree structure is established for the auxiliary explanatory data based on the references and dependencies between files. Write the version index, content fingerprint, and tree structure information established above into a locally created and maintained resource metadata table. This resource metadata table is used to fully record the deconstruction results and metadata of the current course resources.

[0021] In practice, the online course resource synchronization method based on WeChat Mini Programs downloads a compressed, single-file package when decomposing the course resources locally. The first step in identifying the format is parsing the file header. The header contains a specific byte sequence that identifies the compression format; for example, PK indicates ZIP format and Rar indicates RAR format. The system reads the preset byte length of the header and matches it with an internally stored format signature library to identify the compression format used by the course resource. After identifying the format, the system calls the corresponding decompression tool to decompress it. For ZIP format, it calls the ZIP decompression library, and for RAR format, it calls the RAR decompression library. The decompression operation expands the package in a local temporary directory to obtain a structured original resource directory.

[0022] In practice, traversing the original resource directory is the fundamental operation for classification. The system accesses every file and subdirectory under the original resource directory using a depth-first or breadth-first algorithm. In practice, a pre-defined whitelist of file extensions serves as a mapping table, associating file extensions with data type categories. For example, extensions like .json, .js, and .xml are mapped to file categories with teaching logic control attributes; .mp4, .mp3, .gif, and .webp are mapped to file categories with audio / video or animation attributes; and .txt, .html, and .md are mapped to file categories with text descriptions or hyperlinks. During traversal, the system checks the extension of each file and, based on the mapping relationship of the whitelist, categorizes the file path into the core teaching data set, the rich media display data set, or the auxiliary explanatory data set. Optionally, to handle complex cases, file classification decisions can be based on a comprehensive function based on extension and file content characteristics, the formal representation of which is shown below: ; Where: function Confirm file The final category, Represents the core teaching data category, Represents the data categories displayed by rich media. This represents the data category for supplementary explanation. Represents a file The suffix of the name. Represents a file The characteristics of the header content. Indicates the suffix name With category Match score within the whitelist. This indicates that the file is parsed. The header content determines its relationship with the category. The degree of conformity score. and It is a coefficient used to balance the weights of file extensions and content features, and .

[0023] In practical implementation, establishing an index structure for the separated data is a crucial step in constructing the resource metadata table. To categorize each file into the core teaching data set, the system reads the file's last modified time attribute, converts the timestamp into a standard format string, and stores this string in association with the file path, forming a timestamp-based version index. To categorize each file into the rich media display data set, the system applies a hash function, such as the SHA-256 algorithm, to the complete binary content of the file to calculate a fixed-length hash value string. This hash value string is stored as a content fingerprint in association with the file path. To categorize files into the auxiliary explanatory data set, the system analyzes the reference relationships between files. Links in hypertext files and dependency declarations in configuration files are used to construct nodes and edges, ultimately generating a tree structure reflecting the hierarchy of subordination and reference. In practical implementation, writing the established version index, content fingerprint, and tree structure into the local resource metadata table is a serialization operation. The resource metadata table uses a structured format, such as an SQLite database table or a JSON file, and its record fields include at least the resource path, data type category, version index value, content fingerprint string, and the parent node identifier in the tree structure. The system encodes the file paths, classification results, version index strings, content fingerprint strings, and hierarchical relationships generated in the previous steps into records and writes them sequentially to the resource metadata table. In some embodiments, the write operation is transactional to ensure the consistency of the resource metadata table records in the event of an interruption. The resource metadata table serves as a complete record of the course resource deconstruction results and is used to support subsequent data transcoding, synchronization, and management operations.

[0024] In one embodiment of the present invention, the process of transcoding the separated core teaching data according to the terminal rendering protocol version to generate lightweight teaching data that can be directly parsed by the target mini-program includes: (See below) Figure 2 The system reads categorized core teaching data files from the local resource metadata table, parses these files, and identifies the defined teaching process control nodes and various interactive elements. It obtains the terminal rendering protocol version number from the cloud resource scheduling service and compares the parsed teaching process control nodes with the standard control instruction set supported by that version of the protocol. For teaching process control nodes found to be non-compliant with the standard specifications, it calls the locally pre-built compatible conversion function library to rewrite the node into a series of low-level, general basic control instructions, while ensuring that the original teaching logic and process sequence remain unchanged. The rewritten teaching process control nodes, the parsed interactive element definitions, and the static text content from the core teaching data are combined and packaged into a new data package, which is the lightweight teaching data. Simultaneously, a corresponding parsing entry file is generated, which specifies the parsing order and initialization method of the lightweight teaching data.

[0025] In practice, the process of transcoding the separated core teaching data according to the terminal rendering protocol version to generate lightweight teaching data begins with reading records from the resource metadata table. This table records a list of file paths categorized as core teaching data, and the system loads the corresponding file content from local storage based on these paths. In practice, parsing the core teaching data file content to identify teaching flow control nodes and interactive element definitions involves analyzing the file's syntax structure. For JSON or XML configuration files, the system traverses its tree structure, identifying objects with specific keys (such as controlType and nodeId) as potential teaching flow control nodes and elements with specific attributes as interactive element definitions. For JavaScript script files, the system performs lexical analysis and simple syntax analysis to identify function definitions, event binding statements, and API call patterns, thereby extracting the code blocks defining the interactive logic.

[0026] In practice, obtaining the terminal rendering protocol version issued by the cloud resource scheduling service is a network request and response process. The target mini-program sends a query request to the cloud resource scheduling service during initialization or periodically, carrying device environment characteristics. The cloud resource scheduling service returns a matching terminal rendering protocol version number, such as "Rendering-Protocol-v2.1". The system associates the obtained version number with the locally cached protocol specification description file. In practice, comparing whether the teaching process control nodes conform to the standard specifications supported by the terminal rendering protocol version is done through a specification validator. The specification validator loads the standard specification file corresponding to the terminal rendering protocol version number. This file defines all legal control node types, attributes, and value ranges. The validator compares each parsed teaching process control node with the standard specification item by item, checking whether the node type is within the list allowed by the specification, whether the node's attribute keys conform to the specification definition, and whether the type and range of attribute values ​​meet the constraints. The verification process generates a result list, marking each teaching process control node as "compliant" or "non-compliant" with the standard specification.

[0027] In practice, for teaching process control nodes that do not conform to standard specifications, the system calls a local compatible conversion function library for rewriting. The compatible conversion function library is a pre-built set of functions, each designed to map a non-standard or higher-version control node syntax or semantics to low-level general control instructions supported by the terminal rendering protocol version. For example, a non-standard "high-level animation control node" might be rewritten as a set of sequentially executed "basic displacement instructions," "transparency gradient instructions," and "time delay instructions." The mathematical abstraction of the rewriting operation can be represented as finding a mapping function that functionally replaces the non-standard node. Optionally, this process can be formally optimized using an optimization function to select the best rewriting path. ; in: This indicates control nodes for non-standard teaching processes. The rewritten result. This indicates all nodes that can be processed in the compatible conversion function library. rewrite program A set of. Measuring rewritten programs Calculations and time overhead during execution. Measure the original node Functions With the rewritten program Functions The goal is to minimize the difference between them. and It is a weighting coefficient that balances overhead and fidelity. The system executes the selected rewritten program, generating a series of low-level general control instructions. At the same time, semantic analysis ensures that the teaching logic carried by the original nodes, such as decision branches, loop order, and state jumps, is preserved in the instruction sequence.

[0028] In practice, the rewritten teaching process control nodes, interactive element definitions, and static text combinations from the core teaching data are encapsulated into lightweight teaching data, which is a data packaging and serialization operation. The system creates a new structured data object, such as a JavaScript object or a binary buffer. The rewritten low-level general control instruction array, the parsed interactive element definition object, and all plain text content extracted from the core teaching data are respectively filled into the attributes of this data object. In some embodiments, to optimize transmission and parsing efficiency, the system compresses and serializes this data object. After serialization, the system generates a corresponding parsing entry file. The parsing entry file contains initialization code to instruct the target mini-program's rendering engine how to deserialize the lightweight teaching data and initialize control instructions and interactive elements in the correct order and dependencies. It can be understood that the final generated lightweight teaching data package and its parsing entry file are stored in the local temporary session space for direct use by the mini-program rendering engine.

[0029] In one embodiment of the present invention, when the network status of the target mini-program is detected to have switched from a weak network to a stable connection, the synchronization process is as follows: The system continuously polls the network connection quality parameters of the target mini-program through the underlying network monitoring interface provided by the operating system or runtime environment. When the network latency is detected to be lower than a set threshold and the packet loss rate is zero multiple times consecutively, the system determines that the network status has switched from a weak network to a stable connection. The system accesses the locally recorded resource operation logs and filters out all editing operation records performed by the user on the lightweight teaching data since the last successful upload to the cloud, as well as the file block records completed during the interrupted download process of the rich media display data. The filtered editing operation records are converted into a standardized set of change instructions describing "operation type-operation object-operation content"; the interrupted download records are converted into a set of verification information for successfully downloaded file blocks. The change instruction set and the file block verification information together constitute the incremental changes that need to be synchronized. Before the formal upload, the system queries the cloud resource scheduling service for the latest version number currently stored in the cloud that corresponds to the unique identifier of the course resource, and compares this version number with the version number recorded in the local resource metadata table. If the local version number is higher than the cloud version number, an upload request is initiated to the cloud resource scheduling service. This upload submits the latest copy of the local lightweight teaching data, incremental changes, and resource metadata table as the entire dataset, overwriting the older data on the cloud. The higher local version number is also included in the request header. If the local and cloud version numbers are the same, only the incremental changes are uploaded, and the upload request includes file block verification information for the cloud to verify the integrity of this incremental data. If the local version number is lower than the cloud version number, the upload operation is terminated, and a forced fetch command is pushed to the target mini-program. This command triggers a data reset process on the target mini-program, discarding outdated local data and fetching the latest version from the cloud.

[0030] See Figure 3In the version adaptation and conflict resolution process of the online course resource synchronization method based on mini-programs, the visualization of the adaptation relationship between the client and the version relies on the version gradient mapping technology of heatmap. Specifically, the original adaptation relationship is represented as a two-dimensional discrete adaptation space composed of the client device and the terminal rendering protocol version, with the version adaptation degree values ​​forming a field strength distribution. After processing by the version compatibility strategy of the cloud resource scheduling service, a continuous version adaptation gradient surface is formed. The version difference quantification of the two field structures is achieved by calculating the distribution overlap of the version number intervals: the original adaptation field is filtered by a version number threshold, and the generation and disappearance times of connected components for each client-version pair during the adaptation degree threshold change process are recorded. The processed adaptation gradient field undergoes the same operation, and the degree of difference between the two fields is measured by the Jaccard similarity coefficient, which is added as a version adaptation loss term to the version control function of resource synchronization. During parameter configuration, the version number filtering step size is set to 10% of the version number interval span, and the client connected component determination radius is twice the client number interval.

[0031] In implementation, the network connection quality of the target mini-program is continuously polled through an underlying network monitoring interface. This interface, provided by the operating system or runtime environment, can obtain the current network latency and packet loss rate in real time. The system calls the network monitoring interface at fixed time intervals, such as once per second, to obtain a set of network quality parameter samples. These samples include the current network latency in milliseconds and the packet loss rate percentage from the previous statistical period. The system maintains a fixed-length first-in-first-out queue to store the network quality parameter samples obtained from the most recent sampling. In implementation, when the network latency is repeatedly detected to be below a set threshold and the packet loss rate is zero, a network state switch is determined. The system applies a decision function to analyze the samples in the queue. Specifically, the decision function can be based on checking consecutive samples, for example, requiring that the five most recent samples in the queue all meet the conditions of network latency below 100 milliseconds and a packet loss rate of 0%. In some embodiments, a comprehensive scoring formula for determining network quality can be used for more refined judgment. This formula calculates a scalar value reflecting the current connection stability. ; in: A comprehensive score indicating network connectivity quality. This represents the number of most recent samples used to calculate the score. Indicates the first Network latency values ​​in each sample This indicates the set threshold for network latency. Indicates the first Data packet loss rate in each sample. and It is a weighting coefficient that balances the impact of latency and packet loss, and satisfies... . It is a decay function that maps delay to a score between 0 and 1. When the calculated overall score... When a certain high threshold is exceeded consecutively, the system determines that the network status has switched from a weak network to a stable connection. After the determination is triggered, the system accesses the local resource operation log, which is a file that records the sequence of operations that modify lightweight teaching data in chronological order, as well as a file that records the resume status of interrupted downloads of rich media display data.

[0032] In implementation, filtering editing operation records and breakpoint resume records is the foundation for constructing incremental changes. The system queries the resource operation log to locate the timestamp of the last successful data upload to the cloud resource scheduling service. Starting from that timestamp, the system scans the resource operation log to collect all operation records related to lightweight teaching data. Operation record types include "insert," "update," and "delete." Simultaneously, the system reads the breakpoint resume status file recording the download progress of the rich media display data, extracting the range information and checksum of newly downloaded file blocks since the last successful upload. In implementation, editing operation records are converted into standardized change instruction sets. The system creates a change instruction object for each operation record. The change instruction object contains the operation type, the data path of the operation target, the timestamp of the operation, and the specific content of the operation. For "update" operations, the specific content is the new value after the change; for "delete" operations, the specific content may be empty or a placeholder. All change instruction objects are arranged in chronological order to form a change instruction set array. In practice, the breakpoint resume record is converted into completed file block verification information. The system generates a description object for each newly downloaded file block, which includes the start byte offset, end byte offset, and hash value of the file block content. All file block description objects constitute the set of completed file block verification information. The change instruction set array and the set of completed file block verification information together constitute the incremental change data that needs to be uploaded.

[0033] In practice, before initiating an upload to the cloud resource scheduling service, a version comparison is performed. The system retrieves the latest version number currently stored in the cloud, corresponding to the unique identifier of the course resource. The version number returned by the cloud resource scheduling service is a string, such as "20240321153045" based on a timestamp. The system reads the version number recorded in the local resource metadata table, which is the version number recorded after the last successful synchronization from the cloud or successful local saving. In practice, version comparison is performed and different upload strategies are adopted. The system compares the local version number string with the cloud version number string. If the local version number is higher than the cloud version number, it indicates that the local version was updated while the cloud was not updated during the network outage. The system then initiates a full data overwrite upload request to the cloud resource scheduling service. The payload of the upload request includes the complete local lightweight teaching data, the incremental changes, and the latest copy of the resource metadata table. A custom field, such as "X-Resource-Version", is set in the HTTP request header, with a value of the higher local version number, to instruct the cloud to update the resource with this version number. If the local version number matches the cloud version number, it indicates that the cloud version was not modified by other clients during the network outage, and the system only initiates an incremental upload request. The upload request payload only contains the changed incremental data, and explicitly carries the completed file block verification information set in the request body. The cloud resource scheduling service uses this verification information to verify the integrity of the received incremental data blocks. If the local version number is lower than the cloud version number, it indicates that the cloud version was updated by other clients during the network outage, posing a version conflict risk, and the system immediately terminates the upload process. In other words, the system generates a forced pull command and pushes it to the target mini-program. The forced pull command includes a higher version number from the cloud. After receiving the forced pull command, the target mini-program triggers a local data reset process. This process includes clearing all lightweight teaching data and related caches based on the old version in the current session, then initiating a full download request for the latest version of the resource from the cloud resource scheduling service, and reinitializing the local environment with the downloaded new data.

[0034] In one embodiment of the present invention, the step of offline locking of course resources includes: after the target mini-program successfully loads and generates local lightweight teaching data for the first time, it sends an offline occupancy request to the cloud resource scheduling service. This request includes an encrypted current user authentication token. The cloud resource scheduling service verifies the validity and permissions of the user authentication token. Upon successful verification, it updates the status field of the target course resource to a locked state of "occupied" in its resource management database, and simultaneously generates an offline authorization credential with a clearly defined validity period and returns it to the target mini-program. Upon receiving the offline authorization credential, the target mini-program binds and stores the credential with its local resource metadata table. During the validity period of the offline authorization credential, the system intercepts deletion commands issued by the target mini-program's interface layer for the course resource and extracts the specific resource path pointed to by the deletion command. It queries the local resource binding records to determine whether the resource path has a mapping relationship with a valid offline authorization credential. If a mapping relationship exists, it blocks the continued execution of the deletion command and provides a prompt message through the user interface indicating that the resource is in an offline protection period. If no mapping relationship exists, the deletion command is allowed to continue, completing the subsequent physical file deletion operation and updating the record status in the resource metadata table. When the offline authorization credential expires, the system automatically clears the lightweight teaching data and related caches bound to the credential from local storage, unbinds the credential, and sends an unlock notification to the cloud resource scheduling service. Upon receiving the unlock notification, the cloud resource scheduling service restores the status field of the corresponding course resource to the "accessible" state.

[0035] See Figure 4 In the offline locking and protection mechanism of the online course resource synchronization method based on mini-programs, the visualization of the authorization certificate validity period and resource protection effect relies on dual-axis time-series comparison analysis technology. Specifically, the original offline protection data is represented as a two-dimensional time-series space consisting of the authorization certificate validity period, protection success rate, and deletion attempt count. The protection success rate forms a monotonically increasing columnar distribution field as the validity period extends, while the deletion attempt count forms a monotonically decreasing polygonal distribution field. After offline protection strategy optimization, a coupled gradient surface of resource protection strength and deletion suppression effect is formed. The strategy difference quantification between the two field structures is achieved by calculating the weighted sum of protection gain and deletion suppression rate: the original protection field is filtered by a validity period threshold, and the generation and disappearance times of the gain interval during the change of the protection strength threshold for each validity period node are recorded. The optimized gradient field undergoes the same operation, and the degree of difference between the two fields is measured by a weighted Euclidean distance. This metric is added to the resource lifecycle management model as the optimization objective function of the offline protection strategy. During parameter configuration, the validity period filtering step size is set to 20% of the total duration of the authorization certificate, and the protection gain judgment threshold is 15% of the basic protection success rate.

[0036] In implementation, after the lightweight teaching data is successfully loaded for the first time on the target mini-program, the system automatically sends an offline access request to the cloud resource scheduling service. This offline access request is a structured network request. It includes the current user authentication token, a time-sensitive and tamper-proof string issued by the authentication server after user login, used to identify and verify user identity. The request also includes the unique identifier of the course resource to be locked and the expected duration of the lock request. Upon receiving the offline access request, the cloud resource scheduling service first verifies the validity of the user authentication token. This verification process includes checking if the token's signature is correct, if it is valid, and if the user has the permission to request the course resource. In some embodiments, after successful verification, the cloud resource scheduling service queries and updates the status field of the corresponding record in its resource status database, using the unique identifier of the course resource as the key. The status field is updated from the default "accessible" value to a locked "occupied" value. It can be understood that the cloud resource scheduling service simultaneously generates a time-sensitive offline authorization credential and returns it to the target mini-program. The offline authorization certificate includes a unique certificate number, a unique identifier for the bound course resource, the issuance time, the expiration time, and a digital signature generated using the server's private key to prevent client forgery.

[0037] In practice, after receiving the offline authorization credential, the target mini-program performs a binding operation. The system associates and stores the complete content of the offline authorization credential with the local resource metadata table. This binding relationship can be achieved by adding an "offlineAuth" field to the resource metadata table, which stores the core information of the offline authorization credential. The validity period of the offline authorization credential is defined by the "expiration time" field within the credential. During the validity period of the offline authorization credential, the system initiates the interception logic for deletion commands. In practice, this intercepts deletion commands for course resources issued by the target mini-program's interface layer. The system achieves this by overriding or listening to the click event callback function of the delete button on the mini-program page. When the deletion operation is triggered, the callback function is called, and the system extracts the specific resource path pointed to by the deletion command from the event parameters. Next, the system queries the local resource binding records, that is, checks whether there is a record in the resource metadata table where the "offlineAuth" field is not empty, and the unique identifier of the course resource bound to the offline authorization credential stored in this field matches the resource path pointed to by the current deletion command. At the same time, it verifies whether the expiration time of the offline authorization credential is later than the current time. The system determines whether the resource path is mapped to a valid offline authorization credential. If a mapping exists, the system blocks the transmission of the deletion command to subsequent business logic, cancels the default behavior of the deletion operation, and displays a pop-up or notification bar on the mini-program interface stating "The resource is in offline protection period and cannot be deleted." If no mapping exists, the system allows the deletion command, permitting the subsequent process of physically deleting the file from local storage and updating the corresponding record status in the resource metadata table. Optionally, the query and matching relationship of resource binding records is shown in Table 1.

[0038] Table 1: Logic Table for Determining Resource Binding Records and Deletion Commands In practice, the system automatically cleans up expired offline authorization credentials. The system can be configured with a periodic check task, or the expiration time of the offline authorization credential can be checked before each attempt to use offline resources. Verification of the expiration of offline authorization credentials can be achieved through a simple comparison operation: ; in: It is a boolean value indicating whether the offline authorization certificate is valid. This represents the current system timestamp. This represents the expiration timestamp recorded in the offline authorization certificate. When It is false, meaning the current timestamp. Greater than or equal to the expiration timestamp When an offline authorization credential expires, the system determines that it has become invalid. This means that once the offline authorization credential is deemed expired, the system automatically deletes the lightweight teaching data files, related cache files, and unbinding relationships bound to that credential from local storage; that is, it removes the corresponding "offlineAuth" field from the resource metadata table. Subsequently, the system sends an unlock notification to the cloud resource scheduling service, which includes the expired offline authorization credential number. Upon receiving the unlock notification, the cloud resource scheduling service updates the status field of the corresponding course resource's unique identifier from the "occupied" locked state to the "accessible" state in its resource status database, thus completing the full lifecycle management of the resource lock. In some embodiments, if the user actively completes online synchronization before the credential expires, the system will also proactively send an unlock notification and clear the local binding.

[0039] In one embodiment of the present invention, the resource preloading step based on user behavior includes: capturing and recording the user's browsing trajectory data in real time during the operation of the target mini-program. This data includes the sequence and frequency of the user's jumps between different chapters of the course, as well as the duration of stay on each chapter page. The collected browsing trajectory data is sent to a cloud resource scheduling service. The cloud resource scheduling service runs a behavior prediction model and calculates the course chapter identifier that the user is most likely to visit next based on the current and historical browsing trajectory data. Based on the predicted course chapter identifier, the cloud resource scheduling service retrieves the corresponding rich media display data from the resource library in advance and compresses and packages it into a preloaded resource fragment. In the interface rendering engine of the target mini-program, a visibility listener event is registered for the navigation node of the course directory. This event is used to sense the page scroll position and the display status of the navigation node. When the visibility listener event is triggered, and the system determines that the page portion about to enter the user's visible area contains the navigation node corresponding to the predicted course chapter identifier, the preloading logic is activated. The system searches the local resource index table to see if there is a preloaded resource fragment that matches the course chapter identifier. If a preloaded resource fragment exists, it is directly injected into the page rendering queue for fast rendering. If no matching preloaded resource fragment exists in the local cache, an on-demand download request for this chapter's resources is immediately initiated from the cloud resource scheduling service, and rendering is performed after the download is complete. The conflict resolution steps in the synchronization process are as follows: When the target mini-program modifies the lightweight teaching data during a network interruption, and an updated version is detected in the cloud after the connection is restored, the system reads the local conflict log and the version change record obtained from the cloud. The user's modifications recorded in the conflict log are compared field by field with the changes in the cloud version change record to identify conflicting blocks where different modifications have occurred in the same field or data block. For each identified conflicting block, a three-column comparison view is generated. This view displays the content of the local version, the content of the cloud version, and a blank editing area side by side. This comparison view is returned and displayed on the target mini-program. The system receives operation instructions from the user in the three-column comparison view. The user can choose to keep the local version, the cloud version, or manually enter the merged content in the blank editing area. Based on the user's final selection, the system generates a merged dataset and uses this merged dataset to replace the conflicting versions in both the cloud and local systems, thus resolving the conflicting block. This process is repeated for all conflicting blocks until all conflicts are resolved.

[0040] See Figure 5In the user behavior preloading and path planning process of the online course resource synchronization method based on mini-programs, the visualization of user interest distribution and preloading strategy relies on two-dimensional path topology mapping technology. Specifically, the original user behavior data is represented as a discrete topological space composed of course chapter sequences and user interest values. The actual access path and the preloading planned path each constitute two directed path fields. After processing by the behavior prediction model of the cloud resource scheduling service, a user interest gradient surface and a preloading trigger point distribution are formed. The path difference quantification between the two field structures is achieved by calculating the Fréchet distance between paths: the original path field is filtered by an interest value threshold, and the generation and disappearance times of connected components for each chapter node during the interest threshold change process are recorded. The same operation is performed on the preloading path field, and the degree of difference between the two fields is measured using a dynamic time warping algorithm. This metric is added as a path optimization loss term to the resource preloading decision function. During parameter configuration, the interest value filtering step size is set to 10% of the span of the user interest value interval, and the preloading trigger point determination radius is 1.2 times the chapter sequence interval.

[0041] In implementation, browsing trajectory data includes the frequency and duration of user jumps between course chapters. The system collects this data by listening to page routing events and view lifecycle events. When a user switches from one chapter page to another, the system records a jump event, which includes the source chapter identifier, the target chapter identifier, and a timestamp, and updates the jump frequency counter between these two chapter identifiers. When a user stays on a chapter page, the system records the entry and exit timestamps of that page; the difference between the two is the duration of stay. In implementation, the browsing trajectory data is sent to a cloud resource scheduling service. The target mini-program encapsulates the sequence of jump events and duration records collected over a period of time into a data packet and sends it to the cloud resource scheduling service via an asynchronous network request. After receiving the browsing trajectory data, the cloud resource scheduling service inputs it into a pre-built prediction model. Optionally, the prediction model can be a next-hop prediction model based on Markov chains, the core of which is to calculate the probability of a user accessing the next chapter given a historical browsing sequence. The predictive model uses current and historical browsing data to calculate the one or more course chapter identifiers with the highest probability as the user's most likely next destination. The calculation process can be formalized as solving for the chapter identifier with the highest probability: ; in: This indicates the course chapter that the user is most likely to visit next, based on the prediction. This represents the set of all accessible chapters in the current course. This indicates the chapter the user is currently in. This represents historical browsing data, including the sequence of previously visited chapters and the corresponding duration of each visit. It is given by the prediction model, given the current chapter. and history Under these conditions, the user will then access the following chapters. The conditional probability. The cloud resource scheduling service calculates the course chapter identifier. The system retrieves the rich media display data files corresponding to the chapter, such as video and audio clips, from the resource library in advance, compresses and packages them, and generates a preloaded resource clip that can be accessed through a unique URL.

[0042] In practice, when the target mini-program detects that a user is about to enter the navigation node corresponding to the course chapter identifier, it automatically retrieves preloaded resource fragments from the local cache and renders them quickly. In the target mini-program's UI rendering engine, a visibility listener event is registered for each navigation node in the course directory list. This visibility listener event is implemented based on the cross-observer API and is used to perceive the page scroll position and the visibility state of each navigation node element relative to the viewport. When the visibility listener event is triggered, and the system calculates and determines that the page area to be displayed contains the predicted course chapter identifier, the system will automatically display the page. When the corresponding navigation node element is found, the preloading logic is activated. In some embodiments, the activation condition can be set to when the top edge of the navigation node element enters a certain threshold range above the viewport. The system then checks the local resource index table to see if a course chapter identifier exists. The system stores precisely matched preloaded resource fragment records. The resource index table is a key-value pair store, where the key is the course chapter identifier and the value is the storage path of the corresponding preloaded resource fragment in the local cache. If a match is found, the system directly loads the preloaded resource fragment data based on the storage path and injects it into the page rendering queue for decoding and display by the rendering engine. It's understandable that if the local cache does not contain a record matching the course chapter identifier... If a matching preloaded resource fragment is found, the system immediately constructs an on-demand download request for that chapter identifier and sends it to the cloud resource scheduling service. The cloud resource scheduling service responds to this request, returning the corresponding rich media display data. The target mini-program then executes the data parsing and rendering process after the download is complete.

[0043] In practice, the conflict resolution step of the synchronization process is triggered when lightweight teaching data is modified after a network interruption. When the target mini-program makes local modifications to the lightweight teaching data during a network interruption, and detects an updated version in the cloud resource scheduling service when the network connection is restored and synchronization is about to begin, the conflict resolution process is initiated. The system reads the local conflict log, which records all editing operations performed by the user on the lightweight teaching data during the network interruption. Simultaneously, the system retrieves the cloud version change record from the cloud resource scheduling service, which describes all modifications made in the cloud since the public base version. In practice, the user's modifications in the conflict log are compared field-by-field with the changes in the cloud version change record. The system uses a difference comparison algorithm, such as the longest common subsequence algorithm, to analyze the two change records line-by-line or field-by-field. The comparison process identifies conflict blocks where content overlaps. A conflict block refers to a situation where both local and cloud modifications attempt to update the same data field or the same text content, but the modified values ​​differ. The system generates a unique conflict identifier for each identified conflict block. For each conflicting block, the system generates a three-column comparison view containing the local version content, the cloud version content, and a blank editing area. The local version content is the final content after user modifications, extracted from the local conflict log. The cloud version content is the latest content stored in the cloud, extracted from the cloud version change record. The blank editing area is an input box where the user can directly enter text. The three-column comparison view is presented to the user through the user interface, clearly showing the differences between the local and cloud versions. The system receives operation instructions from the user selecting content to retain in the generated three-column comparison view. Operation instructions include the user clicking to select "Retain Local Version," clicking to select "Retain Cloud Version," or manually entering the merged content in the blank editing area and confirming. In some embodiments, the system applies corresponding merging rules based on the user's selection for each conflicting block. For conflicting blocks where the user selects to retain the local version, the local version content is used; for conflicting blocks where the user selects to retain the cloud version, the cloud version content is used; for conflicting blocks where the user enters content in the blank editing area, the user's input is used. The system combines these selected contents to generate a final merged data. Understandably, the system replaces both the conflicting old version data in the cloud resource scheduling service and the conflicting version data locally with the final merged data, thus completing the conflict resolution. In cases with multiple conflicting blocks, this process is executed sequentially or in parallel for each conflicting block until all conflicts are resolved.

[0044] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A method for synchronizing online course resources based on a WeChat Mini Program, characterized in that, The method includes: Initiate a resource access request on the target mini-program and submit the resource access request to the cloud resource scheduling service. The resource access request includes the unique identifier of the course resource to be accessed and the device environment characteristics of the current mini-program. The cloud resource scheduling service parses the resource access request, retrieves the full resource package address corresponding to the unique identifier of the course resource from the preset resource release list, and simultaneously queries the terminal rendering protocol version adapted to the device environment characteristics. Download the course resources according to the full resource package address, and deconstruct the course resources locally to separate core teaching data, rich media display data and auxiliary explanatory data, wherein the core teaching data is loaded first; The separated core teaching data is transcoded according to the terminal rendering protocol version to generate lightweight teaching data that can be directly parsed by the target mini-program. The lightweight teaching data is cached in the local temporary session space. When the network status of the target mini-program is detected to switch from a weak network to a stable connection, the incremental changes of the locally cached lightweight teaching data and the rich media display data are sent back to the cloud resource scheduling service to complete the two-way synchronization of the course resources.

2. The method for synchronizing online course resources based on a mini-program according to claim 1, characterized in that, The course resources are deconstructed locally, separating core teaching data, rich media presentation data, and supplementary explanatory data, including: The downloaded course resources are parsed to identify the compression and encapsulation format used by the course resources, and the corresponding decompression tool is called to decompress them to obtain the original resource directory; Traverse the original resource directory and, based on the preset file extension whitelist, classify files with teaching logic control attributes as the core teaching data, files with audio / video or animation attributes as the rich media display data, and files with text description or hyperlink attributes as the auxiliary description data. Establish a timestamp-based version index for the core teaching data, establish a hash-based content fingerprint for the rich media display data, and establish a hierarchical tree structure for the auxiliary explanatory data; The established version index, content fingerprint, and tree structure are written into a local resource metadata table, which is used to record the deconstruction results of the course resources.

3. The method for synchronizing online course resources based on a mini-program according to claim 2, characterized in that, The separated core teaching data is transcoded according to the terminal rendering protocol version to generate lightweight teaching data that can be directly parsed by the target mini-program, including: Read the core teaching data recorded in the resource metadata table and parse out the definitions of teaching process control nodes and interactive elements therein; Obtain the terminal rendering protocol version issued by the cloud resource scheduling service, and compare whether the teaching process control node conforms to the standard specifications supported by the terminal rendering protocol version; For teaching process control nodes that do not conform to the aforementioned standard specifications, the local compatible conversion function library is invoked to rewrite them as low-level general control instructions, while retaining the original teaching logic. The rewritten teaching process control nodes, the interactive element definitions, and the static text in the core teaching data are combined and encapsulated into the lightweight teaching data, and a corresponding parsing entry file is generated.

4. The method for synchronizing online course resources based on a mini-program according to claim 3, characterized in that, When the network status of the target mini-program is detected to switch from a weak network to a stable connection, the incremental changes in the locally cached lightweight teaching data and the rich media display data are transmitted back to the cloud resource scheduling service to complete the two-way synchronization of the course resources, including: The network connection quality of the target mini-program is continuously polled through the underlying network monitoring interface. When the network latency is detected to be lower than the set threshold and the packet loss rate is zero for multiple consecutive times, it is determined that the network status has switched from weak network to stable connection. Access the local resource operation logs and filter out all editing operation records performed by the user on the lightweight teaching data since the last successful upload, as well as the download breakpoint resume records of the rich media display data; The editing operation record is converted into a standardized set of change instructions, and the download breakpoint resume record is converted into completed file block verification information. The set of change instructions and the completed file block verification information together constitute the change increment. Initiate a resumeable upload request to the cloud resource scheduling service, submitting the local lightweight teaching data, the incremental changes, and the latest copy of the resource metadata table to overwrite the old data of the corresponding version in the cloud.

5. The method for synchronizing online course resources based on a mini-program according to claim 4, characterized in that, Initiate a resumeable upload request to the cloud resource scheduling service, submitting the local lightweight teaching data, the incremental changes, and the latest copy of the resource metadata table to overwrite the old data of the corresponding version on the cloud, including: Before the formal upload, obtain the latest version number corresponding to the unique identifier of the course resource currently stored in the cloud from the cloud resource scheduling service, and compare it with the version number in the local resource metadata table; If the local version number is higher than the version number in the cloud, then the entire data will be uploaded directly, and the local version number will be written as the new version number in the request header. If the local version number is the same as the version number in the cloud, only the change increment is uploaded, and the completed file block verification information is carried in the request to verify data integrity. If the local version number is lower than the version number in the cloud, the upload will be terminated, and a command to force-fetch the latest data from the cloud will be pushed to the target mini-program. The forced fetch command will trigger the local data reset process.

6. The method for synchronizing online course resources based on a mini-program according to claim 5, characterized in that, It also includes the step of locking the course resources offline: After the lightweight teaching data is successfully loaded for the first time on the target mini-program, an offline occupancy request is sent to the cloud resource scheduling service. The offline occupancy request contains the current user identity authentication token. The cloud resource scheduling service verifies the validity of the user authentication token, and after successful verification, updates the status field of the course resource to be accessed to a locked state that is occupied, and returns a time-limited offline authorization credential. After receiving the offline authorization certificate, the target mini-program binds it to the local resource metadata table and prohibits the deletion of the occupied course resources during the validity period of the offline authorization certificate. When the offline authorization certificate expires, the lightweight teaching data and binding relationship on the local machine are automatically cleared, and an unlock notification is sent to the cloud resource scheduling service so that the cloud resource scheduling service can restore the status field of the course resource to an accessible state.

7. The method for synchronizing online course resources based on a mini-program according to claim 6, characterized in that, During the validity period of the offline authorization certificate, deletion operations on the occupied course resources are prohibited, including: Intercept the deletion command for the course resources issued by the target mini-program interface layer, and extract the resource path pointed to by the deletion command; Query the local resource binding records to determine whether the resource path has a mapping relationship with the valid offline authorization credential; If a mapping relationship exists, the execution of the deletion command will be blocked, and a prompt message indicating that the resource is in an offline protection period will be displayed on the interface. If no mapping relationship exists, the deletion command is granted, allowing the subsequent physical deletion process to be executed, and the record status of the resource metadata table is updated.

8. The method for synchronizing online course resources based on a mini-program according to claim 7, characterized in that, It also includes a resource preloading step based on user behavior: The user's browsing trajectory data is captured in real time on the target mini-program, and the browsing trajectory data includes the frequency of the user's jump between course chapters and the duration of stay; The browsing trajectory data is sent to the cloud resource scheduling service, which then runs a prediction model to calculate the identifier of the course chapter the user will visit next. The cloud resource scheduling service retrieves the corresponding rich media display data from the resource library in advance based on the calculated course chapter identifier, and compresses and packages it into preloaded resource fragments; When the target mini-program detects that a user is about to enter the navigation node corresponding to the course chapter identifier, it automatically retrieves the preloaded resource fragment from the local cache and renders it quickly, specifically including: Register visibility listener events for navigation nodes in the interface rendering engine of the target mini-program. These visibility listener events are used to detect the page scroll position. When the visibility listener event is triggered, and the page area to be displayed contains the navigation node corresponding to the course chapter identifier, the preloading logic is activated; The system checks the local resource index table to see if a preloaded resource fragment that matches the course chapter identifier exists. If it does, the preloaded resource fragment is directly injected into the page's rendering queue. If the preloaded resource fragment is not present in the local cache, an on-demand download request for the cloud resource scheduling service is immediately initiated, and rendering is performed after the download is complete.

9. The method for synchronizing online course resources based on a mini-program according to claim 8, characterized in that, It also includes conflict resolution steps in the synchronization process: When the target mini-program modifies the lightweight teaching data during a network interruption, and detects that an updated version already exists in the cloud after the connection is restored, it reads the local conflict log and the version change record in the cloud. The user-modified content in the conflict log is compared field by field with the changed content in the cloud version change record to identify conflict blocks where content overlaps. For each conflicting block, a three-column comparison view is generated, which includes local version content, cloud version content, and a blank editing area, and the comparison view is returned to the target mini-program. The system receives the user's instruction to select the content to keep in the three-column comparison view, generates the final merged data based on the user's selection, and replaces the conflicting versions in the cloud and on-premises with the final merged data to complete the conflict resolution.

10. An online course resource synchronization system based on a mini-program, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the online course resource synchronization method based on a mini-program as described in any one of claims 1 to 9.