Resource storage method and device based on network speed limitation, and electronic equipment
By adopting a resource storage method based on network rate limiting, and utilizing Nginx rate limiting strategies and the token bucket algorithm, resource fragmentation and stable storage are achieved under network bandwidth constraints. This solves the problem of low resource transmission efficiency and ensures network stability and effective resource storage.
Patent Information
- Application Number
- CN202511268519.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-12-05
AI Technical Summary
Bandwidth limitations on the backbone networks of financial institutions lead to excessive bandwidth consumption by resources such as videos, documents, and images, causing network crashes and low resource transmission efficiency.
A resource storage method based on network rate limiting is adopted. Through Nginx reverse proxy and file fragmentation upload strategy, token bucket algorithm and Nginx rate limiting strategy, combined with dynamic token management algorithm and learning task targeted push function, resource fragmentation upload and rate limiting are realized to ensure that resource upload requests meet network transmission rate requirements.
Under conditions of limited network bandwidth, it ensures the flexibility and efficiency of resource uploading, maintains network stability and response speed, avoids network crashes, and achieves efficient resource transmission and network management.
Smart Images

Figure CN121077977A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, in particular to a resource storage method and device based on network speed limit and an electronic device. BACKGROUND
[0002] To improve the service skills and level of business personnel, generally through the release of video, document, picture and other forms of learning and training courses, improve the learning interest of business personnel, enrich the learning approach, thereby improving the professional skills of business personnel and improving the service level.
[0003] However, the backbone network of the financial institution has bandwidth limitation, and the video, document and picture resources have great occupation of the network bandwidth, which is easy to cause the collapse of the backbone network and the decline of data transmission performance, thereby making the resource uploading and downloading efficiency low.
[0004] At present, no effective solution has been proposed for the above problems. SUMMARY
[0005] The embodiments of the present application provide a resource storage method and device based on network speed limit and an electronic device, to at least solve the technical problem that resources cannot be effectively stored in the related art, resulting in low resource transmission efficiency.
[0006] According to an aspect of an embodiment of the present application, a resource storage method based on network speed limit is provided, applied to an online course learning platform, the online course learning platform at least includes a target server and a file server, comprising: receiving a plurality of resource upload requests initiated by a user at a target terminal, wherein each resource upload request carries a fragmented resource, and the fragmented resource is obtained by cutting the target resource; according to a preset speed limit strategy, performing speed limit processing on all resource upload requests to obtain a plurality of processed resource upload requests; forwarding each processed resource upload request to the target server, and processing the fragmented resources carried by all processed resource upload requests to obtain a target resource, and storing the target resource to the file server.
[0007] Further, before receiving a plurality of resource upload requests initiated by a user at a target terminal, it further includes: determining resource information, and determining a target resource based on the resource information, wherein the target resource is a resource that needs to be stored; cutting the target resource to obtain a plurality of fragmented resources, and generating a fragmented identifier for each fragmented resource, wherein the fragmented identifier is used to represent the name, fragmented index and total number of fragmented resources of the target resource.
[0008] Further, the step of limiting the resource upload requests according to the preset speed limiting strategy to obtain a plurality of processed resource upload requests comprises: constructing a first preset instruction, and constructing a first preset speed limiting strategy based on the first preset instruction; constructing a second preset instruction, and constructing a second preset speed limiting strategy based on the second preset instruction; limiting the resource upload requests according to the first preset speed limiting strategy and the second preset speed limiting strategy to obtain a plurality of processed resource upload requests.
[0009] Further, the step of limiting the resource upload requests according to the first preset speed limiting strategy and the second preset speed limiting strategy to obtain a plurality of processed resource upload requests comprises: initializing a token bucket, and adding tokens to the token bucket at a preset rate, wherein the number of requests within a preset time period is controlled by adjusting the preset rate; limiting the resource upload requests according to the token bucket, the first preset speed limiting strategy and the second preset speed limiting strategy to obtain a plurality of processed resource upload requests.
[0010] Further, the step of limiting the resource upload requests according to the token bucket, the first preset speed limiting strategy and the second preset speed limiting strategy to obtain a plurality of processed resource upload requests comprises: determining the number of tokens required by the resource upload request; in a case where the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, processing the resource upload request to obtain a plurality of processed resource upload requests; or, in a case where the number of tokens in the token bucket is less than the number of tokens required by the resource upload request, caching the resource upload request according to a preset caching strategy until the number of tokens in the token bucket is equal to the number of tokens required by the resource upload request.
[0011] Further, the step of processing all the processed resource upload requests to obtain a target resource comprises: generating a preset identifier for each resource data corresponding to a fragment resource; creating a preset folder based on the preset identifier, and storing all the fragment resources to the preset folder based on a fragment index; and splicing all the fragment resources in the preset folder to obtain a target resource.
[0012] Further, after storing the target resource to the file server, the method further comprises: determining a target course task, wherein the target course task comprises at least one target resource, and the target course task is a learning task published to a preset user; determining a preset user list corresponding to the target course task, wherein all the preset users on the preset user list obtain learning data by learning the target resource; and evaluating the learning state of each preset user based on the learning data to obtain evaluation data, wherein a learning strategy is generated for the preset user based on the evaluation data.
[0013] According to another aspect of the embodiments of the present application, a network speed limit based resource storage device is also provided, comprising: a first receiving unit configured to receive a plurality of resource upload requests initiated by a user at a target terminal, wherein each resource upload request carries a fragment resource, and the fragment resource is obtained by cutting the target resource; a first processing unit configured to perform speed limit processing on all resource upload requests according to a preset speed limit policy, to obtain a plurality of processed resource upload requests; and a second processing unit configured to forward each processed resource upload request to a target server, and process the fragment resources carried by all processed resource upload requests to obtain a target resource, and store the target resource to a file server.
[0014] Further, the network speed limit based resource storage device comprises: a first determining module configured to determine resource information before receiving a plurality of resource upload requests initiated by a user at a target terminal, and determine a target resource based on the resource information, wherein the target resource is a resource that needs to be stored; and a first cutting module configured to cut the target resource to obtain a plurality of fragment resources, and generate a fragment identifier for each fragment resource, wherein the fragment identifier is used to represent the name of the target resource, a fragment index, and a total number of fragments.
[0015] Further, the first processing unit comprises: a first constructing module configured to construct a first preset instruction, and construct a first preset speed limit policy based on the first preset instruction; a second constructing module configured to construct a second preset instruction, and construct a second preset speed limit policy based on the second preset instruction; and a first processing module configured to perform speed limit processing on the resource upload requests based on the first preset speed limit policy and the second preset speed limit policy, to obtain a plurality of processed resource upload requests.
[0016] Further, the first processing module comprises: a first adding submodule configured to initialize a token bucket after constructing the second preset speed limit policy based on the second preset instruction, and add tokens to the token bucket at a preset rate, wherein the number of requests within a preset time period is controlled by adjusting the preset rate; and a first processing submodule configured to perform speed limit processing on the resource upload requests based on the token bucket, the first preset speed limit policy, and the second preset speed limit policy, to obtain a plurality of processed resource upload requests.
[0017] Further, the first processing submodule comprises: a first determining submodule, configured to determine a number of tokens required by the resource upload request; a second processing submodule, configured to, in a case where it is monitored that the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, process the resource upload request to obtain a plurality of processed resource upload requests; and a first caching submodule, configured to, in a case where it is monitored that the number of tokens in the token bucket is less than the number of tokens required by the resource upload request, cache the resource upload request based on a preset caching strategy until the number of tokens in the token bucket is equal to the number of tokens required by the resource upload request.
[0018] Further, the second processing unit comprises: a first generating module, configured to generate a preset identifier for resource data corresponding to each shard resource; a first storage module, configured to create a preset folder based on the preset identifier, and store all shard resources to the preset folder based on a shard index; and a first splicing module, configured to splice all shard resources in the preset folder to obtain a target resource.
[0019] Further, the resource storage device based on network speed limitation further comprises: a second determining module, configured to determine a target course task after the target resource is stored to the file server, wherein the target course task at least comprises one target resource, and the target course task is a learning task published to a preset user; a third determining module, configured to determine a preset user list corresponding to the target course task, wherein all preset users on the preset user list obtain learning data by learning the target resource; and a first evaluation module, configured to evaluate a learning state of each preset user based on the learning data to obtain evaluation data, wherein a learning strategy is generated for the preset user through the evaluation data.
[0020] According to another aspect of the embodiments of the present application, a computer program product is also provided, comprising a non-volatile computer readable storage medium, the non-volatile computer readable storage medium storing a computer program, the computer program being executed by a processor to implement any one of the above resource storage methods based on network speed limitation.
[0021] According to another aspect of the embodiments of the present application, an electronic device is also provided, comprising one or more processors and a memory, the memory being configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above resource storage methods based on network speed limitation.
[0022] In the present application, multiple resource upload requests initiated by a user on a target terminal are received, each resource upload request carrying a fragmented resource obtained by cutting the target resource; all resource upload requests are rate-limited according to a preset rate-limiting policy to obtain multiple processed resource upload requests; each processed resource upload request is forwarded to a target server, and the fragmented resources carried by all processed resource upload requests are processed to obtain a target resource, which is stored in a file server, solving the technical problem of low resource transmission efficiency caused by the inability to effectively store resources in related technologies.
[0023] In the present application, multiple resource upload requests initiated by a user on a target terminal are received, each resource upload request carrying a fragmented resource obtained by cutting the target resource; all resource upload requests are rate-limited according to a preset rate-limiting policy to obtain multiple processed resource upload requests; each processed resource upload request is forwarded to a target server, and the fragmented resources carried by all processed resource upload requests are processed to obtain a target resource, which is stored in a file server, solving the technical problem of low resource transmission efficiency caused by the inability to effectively store resources in related technologies. BRIEF DESCRIPTION OF DRAWINGS
[0024] The accompanying drawings, which are included to provide a further understanding of the present application, form a part of the present application and illustrate the illustrative embodiments of the present application and together with the description serve to explain the present application. In the drawings:
[0025] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the network rate-limiting-based resource storage method is shown;
[0026] Figure 2 is a flowchart of the network rate-limiting-based resource storage method according to Embodiment 1 of the present application;
[0027] Figure 3 is a flowchart of an optional network rate-limiting-based resource storage method according to the present application;
[0028] Figure 4 is a schematic diagram of an optional network rate-limiting-based resource storage device according to the present application;
[0029] Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the embodiment of the present application will be described clearly and completely below in combination with the drawings in the embodiment of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0032] It should be noted that the relevant information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) collected and involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with relevant laws, regulations and standards in relevant regions, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal. For example, the system and the interface between the relevant users or institutions are provided, and before obtaining the relevant information, the interface needs to send an acquisition request to the aforementioned user or institution, and after receiving the consent information fed back by the aforementioned user or institution, the relevant information is acquired.
[0033] In the present application, Nginx reverse proxy (a kind of reverse proxy server), Nginx load balancing algorithm and file fragment upload strategy are adopted, online course learning under network speed restriction is realized, a video, document, picture online learning platform is provided for business personnel of financial institutions, and learning time, learning effect of business personnel can be evaluated, thereby helping business personnel to improve business level and professional skill.
[0034] The present invention will now be described in detail with reference to various embodiments.
[0035] Example 1
[0036] According to an embodiment of this application, an embodiment of a resource storage method based on network rate limiting is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a network rate-limited resource storage method is shown. Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1 The processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions may also be included. In addition, it may include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera, wherein the network interface can be connected to wired and / or wireless networks. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0038] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0039] The memory 104 can be used to store software programs of application software and modules, such as program instructions / data storage means corresponding to the resource storage method based on network speed limit in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the resource storage method based on network speed limit as described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0040] The transmission device 106 is used to receive or send data via a network. The specific examples of the network include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
[0041] The display can be, for example, a touch screen type liquid crystal display (LCD), which can enable a user to interact with the user interface of the computer terminal 10 (or a mobile device).
[0042] In the above operating environment, the present application provides a resource storage method based on network speed limit as shown in Figure 2 . Figure 2 is a flowchart of the resource storage method based on network speed limit according to the embodiment 1 of the present application, which includes the following steps as shown in Figure 2 .
[0043] In step S201, a plurality of resource upload requests initiated by a user at a target terminal are received, wherein each resource upload request carries a fragmented resource, and the fragmented resource is obtained by cutting a target resource.
[0044] In the embodiments of the present application, an online course learning platform (including a target server and a file server) receives a plurality of resource upload requests (such as upload requests of course materials such as videos, documents, and pictures) initiated by a user (i.e., a resource manager of the platform) at a target terminal (such as a computer, a mobile phone, etc.).
[0045] In the embodiment of the present application, in order to improve the uploading efficiency and stability, a large file (i.e. target resource) is divided into smaller segments (i.e. segment resources).
[0046] In step S202, all resource uploading requests are subjected to rate limiting processing according to a preset rate limiting policy, to obtain a plurality of processed resource uploading requests.
[0047] In the embodiment of the present application, all resource uploading requests are subjected to rate limiting processing according to a preset rate limiting policy (i.e. rate limiting rules configured on the Nginx server, including rate-based rate limiting and concurrent connection number-based rate limiting and token bucket algorithm), so that the resource uploading requests meet the network transmission rate requirement, to obtain a plurality of processed resource uploading requests. For example, if 10 requests per second can be processed, if there are more requests exceeding the speed, the first 10 requests can be queued and processed according to the rate limiting policy, and the remaining requests will be temporarily delayed.
[0048] In step S203, each processed resource uploading request is forwarded to a target server, and the segment resources carried by all processed resource uploading requests are processed to obtain a target resource, which is stored in a file server.
[0049] In the embodiment of the present application, the resource uploading requests subjected to rate limiting processing are forwarded to the target server by the Nginx server, the target server receives and processes the uploading requests, is responsible for recombining the segment resources into a complete resource file (i.e. processing the segment resources carried by all processed resource uploading requests to obtain a target resource), and storing it in a file server.
[0050] In summary, by using the preset rate limiting policy of the Nginx server, even in the case of limited network bandwidth, the smooth uploading and downloading of large files such as videos and documents can be ensured, and the impact on the backbone network of the financial institution is avoided. The file segment uploading technology divides a large file into smaller segments, and completes the transmission of the entire file through multiple uploading requests, enhancing the reliability and efficiency of file uploading, and thus solving the technical problem of low resource transmission efficiency caused by the inability to effectively store resources in related technologies.
[0051] In order to accurately obtain a plurality of segment resources, in the resource storage method based on network rate limiting provided in Embodiment 1 of the present application, resource information is determined, and based on the resource information, a target resource is determined, wherein the target resource is a resource that needs to be stored; the target resource is divided to obtain a plurality of segment resources, and a segment identifier is generated for each segment resource, wherein the segment identifier is used to represent the name, segment index and total number of segments of the target resource.
[0052] In the embodiment of the present application, first, resource information needs to be determined, including but not limited to the type of resource (such as video, document or picture), size, uploader information, course information, etc., based on the resource information, the target resource to be stored and managed is determined, and then the target resource is divided to generate a plurality of fragment resources, each fragment resource is assigned a fragment identifier, which contains the name of the target resource, the index of the fragment and the total number of fragments.
[0053] In order to accurately obtain a plurality of processed resource upload requests, in the network speed limit based resource storage method provided in Embodiment 1 of the present application, a first preset instruction is constructed, and based on the first preset instruction, a first preset speed limit strategy is constructed; a second preset instruction is constructed, and based on the second preset instruction, a second preset speed limit strategy is constructed; based on the first preset speed limit strategy and the second preset speed limit strategy, the resource upload request is speed limited to obtain a plurality of processed resource upload requests.
[0054] In the embodiment of the present application, the first preset instruction is constructed based on the limit_req_zone and limit_req instructions provided by Nginx, which is used to implement the speed limit strategy based on rate. Specifically, the speed limit area, the speed limit storage area size and the speed limit rate can be defined. By setting a fixed speed limit rate, the number of upload requests processed per unit time is controlled, avoiding the instantaneous consumption of network bandwidth.
[0055] The second preset instruction can also be constructed based on the limit_conn_zone and limit_conn instructions of Nginx, which is used to implement the speed limit strategy based on the number of concurrent connections. By limiting the number of concurrent connections of each terminal, it is prevented that a small number of users or malicious behavior causes excessive occupation of server resources, ensuring more fair allocation of network resources. Then, based on the first preset speed limit strategy and the second preset speed limit strategy, the resource upload request is speed limited to ensure that the resource upload request neither exceeds the rate limit nor exceeds the limit of the number of concurrent connections, and a plurality of processed resource upload requests are obtained.
[0056] In order to improve the accuracy of obtaining a plurality of processed resource upload requests, in the network speed limit based resource storage method provided in Embodiment 1 of the present application, a token bucket is initialized, and tokens are added to the token bucket at a preset rate, wherein the number of requests in a preset time period is controlled by adjusting the preset rate; based on the token bucket, the first preset speed limit strategy and the second preset speed limit strategy, the resource upload request is speed limited to obtain a plurality of processed resource upload requests.
[0057] In the embodiment of the present application, the rate limiting of the Nginx server is mainly based on the leaky bucket algorithm. In the Nginx server, a token bucket algorithm can be constructed, which is more flexible than the leaky bucket algorithm and can cope with a certain degree of burst traffic. First, a data structure of a token bucket is initialized, and the rate of requests is controlled by storing tokens in the token bucket. The size of the token bucket is fixed, and tokens are filled into the token bucket at a preset rate. When a resource upload request occurs, a token can be taken out of the token bucket. If there is a token in the token bucket, the request is allowed to pass, and if there is no token, the request is delayed or rejected. By dynamically adjusting the filling rate (i.e., the preset rate), the number of requests per unit time (i.e., in a preset time period) can be controlled, and the optimal upload speed can be maintained under varying network conditions, avoiding network overload and fully utilizing available bandwidth to ensure smooth platform network traffic. In this way, the resource upload requests can be rate-limited based on the token bucket, the first preset rate limiting strategy and the second preset rate limiting strategy to obtain a plurality of processed resource upload requests.
[0058] For example, when a user attempts to upload a course video, first check if there are available tokens in the token bucket. If there are 30 tokens in the bucket at this time, and the filling rate is 10 tokens per second, the upload request is allowed to pass and a token is taken out of the bucket. If the number of concurrent connections has exceeded 10 (limited by the second preset rate limiting strategy) at this time, even if there are enough tokens in the bucket, additional upload requests can be rejected or delayed until the number of concurrent connections decreases.
[0059] To further improve the accuracy of the plurality of processed resource upload requests, in the network rate limiting based resource storage method provided in Embodiment 1 of the present application, the number of tokens required by the resource upload request is determined; in the case where the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, the resource upload request is processed to obtain a plurality of processed resource upload requests; or, in the case where the number of tokens in the token bucket is less than the number of tokens required by the resource upload request, the resource upload request is cached based on a preset caching strategy until the number of tokens in the token bucket is equal to the number of tokens required by the resource upload request.
[0060] In the embodiment of the present application, first, the number of tokens required by the resource upload request is calculated according to the size and type of the fragmented resource. Each token represents a certain amount of resource upload permission, for example, a token can be set to allow the upload of 50MB of data. Then, the number of tokens in the token bucket is monitored in real time. In the case where the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, the resource upload request is processed to obtain a plurality of processed resource upload requests, and the corresponding tokens are removed from the token bucket.
[0061] In the case of monitoring the number of tokens in the token bucket is less than the number of tokens required for resource upload request, the request will enter the cache queue, waiting for the filling of subsequent tokens (that is, based on the preset cache strategy (which can include cache location (such as memory or disk), cache time limit (requests should be processed within a certain time to avoid long suspension), priority rules of cache queue, etc.), cache resource upload request until the number of tokens in the token bucket is equal to the number of tokens required for resource upload request), during which the platform can prioritize requests with less token demand to maintain high overall upload efficiency.
[0062] In order to accurately obtain the target resource, in the resource storage method based on network speed limit provided in Embodiment 1 of the present application, a preset identifier is generated for each piece of resource data corresponding to the fragmented resource; based on the preset identifier, a preset folder is created, and all fragmented resources are stored in the preset folder based on the fragment index; all fragmented resources in the preset folder are spliced to obtain the target resource.
[0063] In the present embodiment, when the target resource is divided into multiple fragmented resources, each fragmented resource needs a unique identifier (i.e. a preset identifier, such as the MD5 value (a fixed-length numerical value generated by a hash function) of the fragmented resource), based on the preset identifier, a temporary folder (i.e. a preset folder) is created, and all fragmented resources are stored in the preset folder based on the fragment index (e.g. 1.chunk, 2.chunk, etc.), after which all fragmented resources in the preset folder can be spliced to obtain the target resource, and a video course can be created according to the target resource (e.g. a video courseware).
[0064] In order to accurately generate a learning strategy for a preset user, in the resource storage method based on network speed limit provided in Embodiment 1 of the present application, a target course task is determined, wherein the target course task includes at least one target resource, and the target course task is a learning task issued to a preset user; a preset user list corresponding to the target course task is determined, wherein all preset users on the preset user list obtain learning data by learning the target resource; based on the learning data, the learning state of each preset user is evaluated to obtain evaluation data, wherein the evaluation data is used to generate a learning strategy for the preset user.
[0065] In the embodiments of the present application, a target course task is determined, and the name of the target course task and task information such as a learning date are filled in on a platform, wherein the target course task at least includes one target resource, the target course task is a learning task issued to a preset user (i.e., a learner), and a preset user list corresponding to the target course task can be uploaded, all preset users on the preset user list learn the target resource (such as a video courseware) in the target course task to obtain learning data (such as a learning duration and a learning state (for example, in the case that the learning duration is greater than the duration of the video courseware, it indicates that the learning is completed)), the same target resource can be repeatedly learned for multiple times, and the learning progress can be saved at a regular time.
[0066] The learning state of each preset user can be evaluated (for example, an examination is set) based on the target resource and the learning data to obtain evaluation data, so as to feed back the learning achievement, and a learning strategy is generated for the preset user through the evaluation data (for example, the students with poor examination results are trained for multiple times to continuously strengthen the learning of the students and improve the business level).
[0067] Figure 3 It is an optional flowchart for resource storage based on network speed limit according to the embodiments of the present application, as shown in Figure 3 The management personnel can upload courseware (including video, document and picture and other course resources) first, cut these course resources into smaller fragments to adapt to efficient transmission under the condition of network speed limit, fine control of upload and download requests can be realized by using the speed limit function of Nginx, which not only ensures the smooth transmission of resources, but also avoids excessive occupation of the backbone network, the upload request is intelligently forwarded to the backend server through the Nginx reverse proxy, the safe storage of resources and the creation of courses are realized, then the management personnel can publish tasks in a targeted manner, the students can learn the course tasks, the learning duration and the learning state are recorded, the learning progress is saved at a regular time, finally, the personalized learning report of the students can be generated through the statistics of the learning data and the effect evaluation.
[0068] The resource storage method based on network speed limit provided in the embodiments of the present application can realize an efficient and stable online course learning platform by combining a multi-level network traffic control based on an Nginx speed limit strategy and a resource fragment upload mechanism, a dynamic token management algorithm, and a learning task targeted push function. Specifically, first, the token bucket algorithm, the first preset speed limit strategy, and the second preset speed limit strategy are used to dynamically adjust the network speed limit, effectively control the resource upload request, balance the network bandwidth usage, and avoid network congestion. Then, a preset identifier is generated for each fragment resource, and a preset folder is created according to the identifier to orderly store all fragments and ensure the integrity of the resources. Meanwhile, a preset user list can be determined for a specific course task, and the learning data, learning state, and effect evaluation of each preset user are collected. Based on these data, an individualized learning strategy is generated to provide supplementary materials and tutoring suggestions for the user, which not only optimizes the resource upload and network management, but also realizes accurate learning task push and effect tracking.
[0069] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0070] Embodiment 2
[0071] The embodiments of the present application also provide a resource storage device based on network speed limit. It should be noted that the resource storage device based on network speed limit of the embodiments of the present application can be used to execute the resource storage method based on network speed limit provided by the embodiments of the present application. The resource storage device based on network speed limit provided by the embodiments of the present application is introduced as follows.
[0072] According to the embodiments of the present application, a device for implementing the above-mentioned resource storage method based on network speed limit is also provided. Figure 4 is a schematic diagram of an optional resource storage device based on network speed limit according to the embodiments of the present application, as shown in Figure 4 The resource storage device based on network speed limit can include a first receiving unit 40, a first processing unit 41, and a second processing unit 42.
[0073] The first receiving unit 40 is configured to receive a plurality of resource upload requests initiated by a user on a target terminal, wherein each resource upload request carries a fragment resource, and the fragment resource is obtained by cutting a target resource;
[0074] The first processing unit 41 is configured to perform speed limit processing on all resource upload requests according to a preset speed limit strategy to obtain a plurality of processed resource upload requests;
[0075] The second processing unit 42 is configured to forward each processed resource upload request to a target server, process all the fragment resources carried by the processed resource upload requests, obtain a target resource, and store the target resource in a file server.
[0076] The network speed limit based resource storage device provided by the embodiment of the application can receive multiple resource upload requests initiated by a user at a target terminal through the first receiving unit 40, perform speed limit processing on all the resource upload requests according to a preset speed limit strategy through the first processing unit 41, obtain multiple processed resource upload requests, forward each processed resource upload request to a target server through the second processing unit 42, process all the fragment resources carried by the processed resource upload requests, obtain a target resource, and store the target resource in a file server.
[0077] Optionally, the network speed limit based resource storage device comprises a first determining module configured to determine resource information before receiving multiple resource upload requests initiated by a user at a target terminal, and determine a target resource based on the resource information, wherein the target resource is a resource that needs to be stored; and a first splitting module configured to split the target resource to obtain multiple fragment resources, and generate a fragment identifier for each fragment resource, wherein the fragment identifier is used to represent the name of the target resource, a fragment index, and a total number of fragments.
[0078] Optionally, the first processing unit 41 comprises a first constructing module configured to construct a first preset instruction, and construct a first preset speed limit strategy based on the first preset instruction; a second constructing module configured to construct a second preset instruction, and construct a second preset speed limit strategy based on the second preset instruction; and a first processing module configured to perform speed limit processing on the resource upload requests based on the first preset speed limit strategy and the second preset speed limit strategy, and obtain multiple processed resource upload requests.
[0079] Optionally, the first processing module comprises a first adding submodule configured to initialize a token bucket after constructing the second preset speed limit strategy based on the second preset instruction, and add tokens to the token bucket at a preset rate, wherein the number of requests within a preset time period is controlled by adjusting the preset rate; and a first processing submodule configured to perform speed limit processing on the resource upload requests based on the token bucket, the first preset speed limit strategy, and the second preset speed limit strategy, and obtain multiple processed resource upload requests.
[0080] Optionally, the first processing submodule comprises: a first determining submodule, configured to determine the number of tokens required by the resource upload request; a second processing submodule, configured to, in a case where it is monitored that the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, process the resource upload request to obtain a plurality of processed resource upload requests; and a first caching submodule, configured to, in a case where it is monitored that the number of tokens in the token bucket is less than the number of tokens required by the resource upload request, cache the resource upload request based on a preset caching strategy until the number of tokens in the token bucket is equal to the number of tokens required by the resource upload request.
[0081] Optionally, the second processing unit 42 comprises: a first generating module, configured to generate a preset identifier for resource data corresponding to each shard resource; a first storage module, configured to create a preset folder based on the preset identifier, and store all shard resources to the preset folder based on a shard index; and a first splicing module, configured to splice all shard resources in the preset folder to obtain a target resource.
[0082] Optionally, the resource storage device based on network speed limitation further comprises: a second determining module, configured to determine a target course task after storing the target resource to the file server, wherein the target course task comprises at least one target resource, and the target course task is a learning task published to a preset user; a third determining module, configured to determine a preset user list corresponding to the target course task, wherein all preset users on the preset user list obtain learning data by learning the target resource; and a first evaluation module, configured to evaluate the learning state of each preset user based on the learning data to obtain evaluation data, wherein a learning strategy is generated for the preset user through the evaluation data.
[0083] The resource storage device based on network speed limitation described above can further comprise a processor and a memory, and the first receiving unit 40, the first processing unit 41, the second processing unit 42, etc. are stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.
[0084] The processor described above comprises a core, and the core retrieves the corresponding program units from the memory. The core can be set to one or more, and each processed resource upload request is forwarded to the target server by adjusting the core parameters, and the shard resources carried by all processed resource upload requests are processed to obtain a target resource, and the target resource is stored to the file server.
[0085] The memory described above can comprise a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory, such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.
[0086] It should be noted that the first receiving unit 40, the first processing unit 41, and the second processing unit 42 correspond to steps S201 to S203 in Embodiment 1, and have the same instances and application scenarios as those implemented by the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above units can be hardware components or software components stored in a memory (for example, the memory 104) and processed by one or more processors (for example, the processors 102a, 102b,..., 102n), or can be a part of the apparatus and run in the computer terminal 10 provided in Embodiment 1.
[0087] Embodiment 3
[0088] Embodiments of the present application can provide a computer terminal, which can be any one of the computer terminal devices in the computer terminal group. Alternatively, in the present embodiment, the computer terminal can also be replaced by a mobile terminal or an electronic device, or the like.
[0089] Alternatively, in the present embodiment, the computer terminal can be located in at least one of the network devices in the computer network.
[0090] In the present embodiment, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: receiving a plurality of resource upload requests initiated by a user at a target terminal, wherein each resource upload request carries a shard resource, and the shard resource is obtained by cutting the target resource; performing speed limit processing on all resource upload requests according to a preset speed limit policy to obtain a plurality of processed resource upload requests; forwarding each processed resource upload request to a target server, and processing the shard resources carried by all processed resource upload requests to obtain a target resource, and storing the target resource to a file server.
[0091] Alternatively, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: determining resource information, and determining a target resource based on the resource information, wherein the target resource is a resource that needs to be stored; cutting the target resource to obtain a plurality of shard resources, and generating a shard identifier for each shard resource, wherein the shard identifier is used to represent the name of the target resource, a shard index, and a total number of shards.
[0092] Optionally, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: constructing a first preset instruction, and constructing a first preset speed limit strategy based on the first preset instruction; constructing a second preset instruction, and constructing a second preset speed limit strategy based on the second preset instruction; performing speed limit processing on the resource upload request based on the first preset speed limit strategy and the second preset speed limit strategy to obtain a plurality of processed resource upload requests.
[0093] Optionally, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: initializing a token bucket, and adding tokens to the token bucket at a preset speed, wherein the number of requests within a preset time period is controlled by adjusting the preset speed; performing speed limit processing on the resource upload request based on the token bucket, the first preset speed limit strategy, and the second preset speed limit strategy to obtain a plurality of processed resource upload requests.
[0094] Optionally, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: determining the number of tokens required by the resource upload request; in a case where it is monitored that the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, processing the resource upload request to obtain a plurality of processed resource upload requests; or, in a case where it is monitored that the number of tokens in the token bucket is less than the number of tokens required by the resource upload request, based on a preset caching strategy, caching the resource upload request until the number of tokens in the token bucket is equal to the number of tokens required by the resource upload request.
[0095] Optionally, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: generating a preset identifier for resource data corresponding to each shard resource; based on the preset identifier, creating a preset folder, and based on a shard index, storing all shard resources to the preset folder; splicing all shard resources in the preset folder to obtain a target resource.
[0096] Optionally, the computer terminal can execute program codes of the following steps in the network speed limit-based resource storage method: determining a target course task, wherein the target course task includes at least one target resource, and the target course task is a learning task published to a preset user; determining a preset user list corresponding to the target course task, wherein all preset users on the preset user list obtain learning data by learning the target resource; based on the learning data, evaluating the learning state of each preset user to obtain evaluation data, wherein a learning strategy is generated for the preset user through the evaluation data.
[0097] Optionally, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. As shown in Figure 5As shown, the electronic device may include: one or more ( Figure 5 Only one of the components is shown: processor 502, memory 504, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module, and display.
[0098] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the network-rate-limited resource storage method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned network-rate-limited resource storage method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0099] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the resource storage method based on network rate limiting.
[0100] The embodiments of this application provide a solution for resource storage based on network rate limiting. By uploading resources in fragments and dynamically controlling network traffic, the upload needs of large files can be processed efficiently and orderly under the condition of limited network bandwidth. This achieves a significant improvement in resource storage efficiency and enhanced network stability, thereby solving the technical problem in related technologies where resources cannot be effectively stored, resulting in low resource transmission efficiency.
[0101] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. Electronic devices can also be terminal devices such as smartphones, tablets, PDAs, and mobile internet devices (MIDs). Figure 5 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.
[0102] Those skilled in the art can understand that all or part of the steps of various methods in the above embodiments can be completed by instructing the terminal device related hardware through programs, and the programs can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0103] Embodiment 4
[0104] The embodiments of the present application further provide a storage medium. Optionally, in the embodiments, the storage medium can be used to save the program codes executed by the network speed limit based resource storage method provided in the embodiment 1.
[0105] Optionally, in the embodiments, the storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0106] The present application further provides a computer program product, which, when executed on a data processing device, is adapted to execute the steps of the network speed limit based resource storage method.
[0107] The above embodiment numbers of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0108] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0109] In several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the unit embodiment described above is only schematic. For example, the division of the units is only a logical function division. There can be another division manner for actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.
[0110] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the embodiment.
[0111] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0112] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in the form of a contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes various media that can store program codes, such as a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, etc.
[0113] The above is only the preferred embodiment of the present application, and it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A network-limited resource storage method, characterized by, The application is applied to an online course learning platform, and the online course learning platform at least comprises a target server and a file server. Receiving a plurality of resource upload requests initiated by a user at a target terminal, wherein each resource upload request carries a shard resource, and the shard resource is obtained by splitting a target resource; According to a preset speed limiting strategy, all the resource upload requests are speed limited to obtain a plurality of processed resource upload requests; Forwarding each processed resource upload request to the target server, processing the shard resources carried by all the processed resource upload requests, obtaining the target resource, and storing the target resource to the file server.
2. The network-limit-rate-based resource storage method according to claim 1, wherein, Before receiving a plurality of resource upload requests initiated by a user at a target terminal, further comprising: Determine resource information, and determine the target resource based on the resource information, wherein the target resource is a resource that needs to be stored; Splitting the target resource to obtain a plurality of shard resources, and generating a shard identifier for each shard resource, wherein the shard identifier represents the name, shard index and total number of shards of the target resource.
3. The network-limited resource storage method of claim 1, wherein, According to a preset speed limiting strategy, all the resource upload requests are speed limited to obtain a plurality of processed resource upload requests, comprising: Constructing a first preset instruction and constructing a first preset speed limiting strategy based on the first preset instruction; Constructing a second preset instruction and constructing a second preset speed limiting strategy based on the second preset instruction; Based on the first preset speed limiting strategy and the second preset speed limiting strategy, the resource upload request is speed limited to obtain a plurality of processed resource upload requests.
4. The network-limited resource storage method of claim 3, wherein, Based on the first preset speed limiting strategy and the second preset speed limiting strategy, the resource upload request is speed limited to obtain a plurality of processed resource upload requests, comprising: Initializing a token bucket and adding tokens to the token bucket at a preset rate, wherein the number of requests in a preset time period is controlled by adjusting the preset rate; Based on the token bucket, the first preset speed limiting strategy and the second preset speed limiting strategy, the resource upload request is speed limited to obtain a plurality of processed resource upload requests.
5. The network-limited resource storage method of claim 4, wherein, Based on the token bucket, the first preset speed limiting strategy and the second preset speed limiting strategy, the resource upload request is speed limited to obtain a plurality of processed resource upload requests, comprising: Determine the number of tokens required by the resource upload request; In the case where the number of tokens in the token bucket is greater than or equal to the number of tokens required by the resource upload request, the resource upload request is processed to obtain a plurality of processed resource upload requests; or, in the case where the number of tokens in the token bucket is less than the number of tokens required by the resource upload request, the resource upload request is cached based on a preset caching strategy until the number of tokens in the token bucket is equal to the number of tokens required by the resource upload request.
6. The network-limited resource storage method of claim 1, wherein, The step of processing the fragment resources carried by all the processed resource upload requests to obtain the target resource includes: generating a preset identifier for resource data corresponding to each fragment resource; creating a preset folder based on the preset identifier and storing all the fragment resources in the preset folder based on a fragment index; splicing all the fragment resources in the preset folder to obtain the target resource.
7. The network-limited resource storage method of claim 6, wherein, After storing the target resource in the file server, the method further includes: determining a target course task, wherein the target course task includes at least one target resource, and the target course task is a learning task issued to a preset user; determining a preset user list corresponding to the target course task, wherein all preset users on the preset user list obtain learning data by learning the target resource; based on the learning data, evaluating the learning state of each preset user to obtain evaluation data, wherein the evaluation data is used to generate a learning strategy for the preset user.
8. A network-limited resource storage device, comprising: The online course learning platform includes at least a target server and a file server, and the resource storage device includes: a first receiving unit configured to receive a plurality of resource upload requests initiated by a user on a target terminal, wherein each resource upload request carries a fragment resource, and the fragment resource is obtained by splitting a target resource; a first processing unit configured to perform rate limiting processing on all the resource upload requests according to a preset rate limiting strategy to obtain a plurality of processed resource upload requests; a second processing unit configured to forward each processed resource upload request to the target server and process the fragment resources carried by all the processed resource upload requests to obtain the target resource, and store the target resource in the file server.
9. A computer program product, characterised in that, A non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the network rate limiting based resource storage method of any one of claims 1 to 7.
10. An electronic device, comprising: One or more processors and a memory are included, and the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the network rate limiting based resource storage method of any one of claims 1 to 7.