Operation bit resource loading method and device, electronic equipment and storage medium
By obtaining the CDN address from the operating position server and obtaining the operating position resources from the CDN server, the problem of excessive server pressure under high concurrency is solved, and the resource loading speed is improved.
Patent Information
- Application Number
- CN202411736065.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-28
AI Technical Summary
The loading of operational position resources in high concurrency can easily cause excessive server pressure and affect system performance.
By sending a CDN address acquisition request to the operational bit server, receiving and returning the CDN address, then sending an operational bit resource acquisition request to the corresponding CDN server, and finally receiving and using the operational bit resource.
Reduces the loading pressure of the backend server and improves the loading speed of operational location resources.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource loading, and in particular to a method, device, electronic device and storage medium for loading operating position resources. Background Art
[0002] Currently, many websites and applications are facing the problem of slow loading of operational resources. Operational sites usually contain a large number of static resources, such as pictures, videos, etc. The loading speed of these resources directly affects the user experience. The existing solution is usually to store these resources directly on the server. When the user requests, the server needs to calculate and return data in real time. This method is easy to cause excessive pressure on the server in high concurrency situations, affecting system performance. Summary of the invention
[0003] The present invention provides an operation position resource loading method, device, electronic device and storage medium, which are used to solve the technical problem that operation position resource loading easily causes excessive server pressure and affects system performance under high concurrency conditions.
[0004] The present invention provides an operation position resource loading method, which is applied to a mobile terminal, wherein the mobile terminal communicates with an operation position server; the method comprises:
[0005] Sending a CDN address acquisition request to the operation server;
[0006] Receiving the CDN address returned by the operation server in response to the CDN address acquisition request;
[0007] Sending an operation location resource acquisition request to the CDN server corresponding to the CDN address;
[0008] Receive the operation location resource returned by the CDN server in response to the operation location resource acquisition request.
[0009] Optionally, the step of the operation server acquiring the CDN address in response to the CDN address acquisition request includes:
[0010] The operation location server responds to the CDN address acquisition request and queries the preset cache for a CDN address corresponding to the CDN address acquisition request;
[0011] If the query in the cache is successful, returning the CDN address to the mobile terminal;
[0012] If the query in the cache is unsuccessful, query the CDN address in a preset database to obtain the CDN address corresponding to the request;
[0013] If the query in the database is successful, the CDN address is returned to the mobile terminal.
[0014] Optionally, the step of the CDN server returning the operation location resource to the mobile terminal in response to the operation location resource acquisition request includes:
[0015] The CDN server responds to the operation location resource acquisition request, distributes the operation location resource acquisition request to a target CDN server closest to the mobile terminal, and returns the operation location resource to the mobile terminal through the target CDN server.
[0016] Optionally, it also includes:
[0017] When the CDN address returned by the operation location server is not received, a default CDN address is obtained.
[0018] Optionally, after the step of receiving the operation location resource returned by the CDN server in response to the operation location resource acquisition request, the method further includes:
[0019] The operating position resources are used for rendering.
[0020] Optionally, it also includes:
[0021] The operation server receives a resource preheating request sent regularly by the preheating server;
[0022] Responding to the resource preheating request, obtaining preheating operation position resources;
[0023] The preheating operation location resource is stored in the CDN server, and the CDN address of the CDN server is stored in a database.
[0024] The present invention also provides an operation position resource loading device, which is applied to a mobile terminal, and the mobile terminal communicates with an operation position server; the device comprises:
[0025] A CDN address acquisition request sending module, used to send a CDN address acquisition request to the operation location server;
[0026] A CDN address receiving module, configured to receive the CDN address returned by the operation server in response to the CDN address acquisition request;
[0027] An operation position resource acquisition request sending module is used to send an operation position resource acquisition request to the CDN server corresponding to the CDN address;
[0028] The operation position resource receiving module is used to receive the operation position resource returned by the CDN server in response to the operation position resource acquisition request.
[0029] Optionally include:
[0030] A cache query module, configured for the operation server to respond to the CDN address acquisition request and query the CDN address corresponding to the CDN address acquisition request in a preset cache;
[0031] A cache return module, configured to return the CDN address to the mobile terminal if the query in the cache is successful;
[0032] A database query module, configured to query the CDN address in a preset database to obtain the CDN address corresponding to the request if the query in the cache is unsuccessful;
[0033] The database return module is used to return the CDN address to the mobile terminal if the query in the database is successful.
[0034] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0035] The memory is used to store program code and transmit the program code to the processor;
[0036] The processor is used to execute any of the above operation position resource loading methods according to the instructions in the program code.
[0037] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the operation position resource loading method as described in any one of the above items.
[0038] It can be seen from the above technical solutions that the present invention has the following advantages: the present invention sends a CDN address acquisition request to the operation position server; receives the CDN address returned by the operation position server in response to the CDN address acquisition request; sends an operation position resource acquisition request to the CDN server corresponding to the CDN address; receives the operation position resource returned by the CDN server in response to the operation position resource acquisition request. This reduces the loading pressure of the backend server and improves the loading speed of the operation position resource. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A flowchart of a method for loading operating position resources provided by an embodiment of the present invention;
[0041] Figure 2A flowchart of a method for loading operating position resources provided by another embodiment of the present invention;
[0042] Figure 3 A structural block diagram of an operating position resource loading device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The embodiments of the present invention provide an operation position resource loading method, device, electronic device and storage medium, which are used to solve the technical problem that operation position resource loading easily causes excessive server pressure and affects system performance under high concurrency conditions.
[0044] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] See also Figure 1 , Figure 1 A flowchart of the steps of a method for loading operating position resources provided in an embodiment of the present invention.
[0046] The present invention provides an operation position resource loading method, which is applied to a mobile terminal, and the mobile terminal communicates with an operation position server; specifically, the method may include the following steps:
[0047] Step 101, sending a CDN address acquisition request to an operation server;
[0048] Step 102, receiving the CDN address returned by the operation server in response to the CDN address acquisition request;
[0049] CDN (Content Delivery Network) is a new type of network content service system, which is built on IP network and provides content distribution and services based on the efficiency requirements, quality requirements and content order of content access and application. From a broad perspective, CDN represents a network application service model with high quality, high efficiency and distinct network order built on the network.
[0050] Operational position resources refer to the locations in an APP or e-commerce platform used to display and promote specific content. These resource positions usually have high exposure and user attention, and are therefore widely used in product promotion, event publicity, and user guidance.
[0051] In an embodiment of the present invention, the address of each CDN server can be stored in advance on the operation location server. When the user needs to obtain the operation location resources through the mobile terminal, a CDN address acquisition request can be sent to the operation location server to obtain the CDN address where the operation location resources are stored, so as to obtain the corresponding operation location resources through the CDN address.
[0052] In a specific implementation, a mapping relationship between operation location resources and CDN addresses can be established, and users can match and obtain corresponding CDN addresses through CDN address acquisition requests that carry operation location resource information.
[0053] Step 103, sending an operation location resource acquisition request to the CDN server corresponding to the CDN address;
[0054] Step 104: Receive the operation location resource returned by the CDN server in response to the operation location resource acquisition request.
[0055] When the user obtains the CDN address corresponding to the operation position resource through the mobile terminal, the user can send an operation position resource acquisition request to the corresponding CDN server through the CDN address to obtain the corresponding operation position resource from the CDN server.
[0056] The present invention reduces the loading pressure of the backend server and improves the loading speed of the operation position resources by sending a CDN address acquisition request to the operation position server; receiving the CDN address returned by the operation position server in response to the CDN address acquisition request; sending an operation position resource acquisition request to the CDN server corresponding to the CDN address; and receiving the operation position resources returned by the CDN server in response to the operation position resource acquisition request.
[0057] See also Figure 2 , Figure 2 A flowchart of a method for loading operating position resources provided by another embodiment of the present invention. Specifically, the following steps may be included:
[0058] Step 201, sending a CDN address acquisition request to the operation server;
[0059] Step 202, receiving the CDN address returned by the operation server in response to the CDN address acquisition request;
[0060] In an embodiment of the present invention, the address of each CDN server can be stored in advance on the operation location server. When the user needs to obtain the operation location resources through the mobile terminal, a CDN address acquisition request can be sent to the operation location server to obtain the CDN address where the operation location resources are stored, so as to obtain the corresponding operation location resources through the CDN address.
[0061] In a specific implementation, a mapping relationship between operation location resources and CDN addresses can be established, and users can match and obtain corresponding CDN addresses through CDN address acquisition requests that carry operation location resource information.
[0062] In the embodiment of the present invention, the step of the operation server obtaining the CDN address in response to the CDN address obtaining request may include the following steps:
[0063] S11, the operation server responds to the CDN address acquisition request and searches the preset cache for the CDN address corresponding to the CDN address acquisition request;
[0064] S12, if the query in the cache is successful, return the CDN address to the mobile terminal;
[0065] S13, if the query in the cache is unsuccessful, query the CDN address in the preset database to obtain the CDN address corresponding to the request;
[0066] S14, if the query in the database is successful, the CDN address is returned to the mobile terminal.
[0067] In a specific implementation, after receiving a CDN address acquisition request, the operation location server can first query the CDN address in a preset cache, and return the CDN address to the mobile terminal if the query is successful. If the CDN address corresponding to the CDN server where the requested operation location resource is located cannot be found in the preset cache, the CDN address corresponding to the CDN server where the operation location resource is located is searched in a preset database, and if the query is successful, the CDN address is returned to the mobile terminal.
[0068] Furthermore, in an embodiment of the present invention, if the CDN address corresponding to the CDN server where the operation location resource is located cannot be found in the preset database, the CDN address information that no CDN address was found is returned to the mobile terminal. At this time, the mobile terminal can use the default CDN address to obtain the operation location resource.
[0069] In the embodiment of the present invention, CDN can accelerate the speed of resource access. By distributing multiple CDN nodes around the world, the distance between users and resources can be greatly shortened, thereby speeding up the speed of resource loading. In addition, through the cache mechanism, the database pressure can be reduced. When the back-end operation server obtains the CDN address, it will first try to query from the cache. If the cache hits, there is no need to access the database, reducing the burden on the database. At the same time, through the CDN acceleration and cache mechanism, the amount of data transmission between the back-end operation server and the front-end mobile terminal is reduced, thereby reducing the bandwidth cost.
[0070] Step 203, sending an operation location resource acquisition request to the CDN server corresponding to the CDN address;
[0071] Step 204, receiving the operation location resource returned by the CDN server in response to the operation location resource acquisition request;
[0072] When the user obtains the CDN address corresponding to the operation position resource through the mobile terminal, the user can send an operation position resource acquisition request to the corresponding CDN server through the CDN address to obtain the corresponding operation position resource from the CDN server.
[0073] In the implementation of the present invention, the step of the CDN server responding to the operation position resource acquisition request and returning the operation position resource to the mobile terminal may specifically include: the CDN server responds to the operation position resource acquisition request, distributes the operation position resource acquisition request to the target CDN server closest to the mobile terminal, and returns the operation position resource to the mobile terminal through the target CDN server.
[0074] In a specific implementation, after the CDN server receives the operation location resource acquisition request from the mobile terminal, it can distribute the operation location resource acquisition request to the target CDN server closest to the user's mobile terminal. After the target CDN server receives the operation location resource acquisition request, it can send the corresponding operation location resource to the user's mobile terminal.
[0075] Step 205: Rendering using operating location resources.
[0076] After obtaining the operation position resource, the mobile terminal can render it on the display page according to the type and format of the operation position resource.
[0077] Furthermore, in the embodiment of the present invention, the operation location resources on the CDN server can also be updated through the data preheating mechanism. The specific steps are as follows:
[0078] S21, the operation server receives the resource preheating request sent regularly by the preheating server;
[0079] S22, responding to the resource preheating request and obtaining preheating operation position resources;
[0080] S23, saving the preheating operation location resource in the CDN server, and storing the CDN address of the CDN server in the database.
[0081] In the specific implementation, a preheating server can be set up. The preheating server can start a scheduled task, which is executed every 10 minutes and sends an MQ message (resource preheating request) to the operation server. The operation server consumes the MQ message, calculates the corresponding operation resources after 10 minutes, and stores the operation resources after 10 minutes in advance on the CDN, and saves the stored CDN address in the database.
[0082] Furthermore, in the embodiment of the present invention, when the administrator configures a new operation position in the background, the calculation of the operation position resources will also be triggered. For example, if the administrator configures an operation position data at 10:07, the operation position resources at the current time and the operation position resources at 10:10 (rounding up the time) will be calculated, and the calculation results will be stored on the CDN.
[0083] When the administrator configures the operation position data, in addition to calculating the operation position resources at the current time point, the administrator also needs to calculate the operation position resources corresponding to the rounded-up time. For example, if the administrator configures an operation position data at 10:07, and the operation position resources need to be displayed at 10:08, if only the operation position resources at the current time (10:07) are calculated, then the operation position at 10:08 is not included.
[0084] Furthermore, in an embodiment of the present invention, if an exception occurs when loading CDN resources, the exception information can be stored in a database and retried.
[0085] Among them, exceptions can include:
[0086] 1. The operation server cannot obtain the CDN address corresponding to the request parameter;
[0087] 2. Use the response to give the front end a default CDN address.
[0088] When an abnormality triggers the preset alarm threshold, an abnormal alarm is issued.
[0089] If the corresponding CDN address cannot be obtained after five retries, an alarm will be sent via email / SMS to notify relevant personnel.
[0090] For example, when the operation position server calculates the operation position resources in advance, for example, there is a carousel position on the system homepage, and when calculating what data should be displayed in the carousel position, it cannot obtain the corresponding carousel position data. In this case, a threshold can be set to issue an alarm.
[0091] See also Figure 3 , Figure 3 A structural block diagram of an operating position resource loading device provided in an embodiment of the present invention.
[0092] An embodiment of the present invention provides an operation position resource loading device, which is applied to a mobile terminal, and the mobile terminal communicates with an operation position server; the device includes:
[0093] A CDN address acquisition request sending module 301 is used to send a CDN address acquisition request to an operation location server;
[0094] The CDN address receiving module 302 is used to receive the CDN address returned by the operation server in response to the CDN address acquisition request;
[0095] The operation position resource acquisition request sending module 303 is used to send an operation position resource acquisition request to the CDN server corresponding to the CDN address;
[0096] The operation position resource receiving module 304 is used to receive the operation position resource returned by the CDN server in response to the operation position resource acquisition request.
[0097] In an embodiment of the present invention, an operation server includes:
[0098] A cache query module, used for the operation server to respond to the CDN address acquisition request, and query the CDN address corresponding to the CDN address acquisition request in the preset cache;
[0099] A cache return module, used to return the CDN address to the mobile terminal if the query in the cache is successful;
[0100] A database query module is used to query the CDN address in a preset database to obtain the CDN address corresponding to the request if the query in the cache is unsuccessful;
[0101] The database return module is used to return the CDN address to the mobile terminal if the query in the database is successful.
[0102] In an embodiment of the present invention, the CDN server includes:
[0103] The operation position resource return module is used for the CDN server to respond to the operation position resource acquisition request, distribute the operation position resource acquisition request to the target CDN server closest to the mobile terminal, and return the operation position resource to the mobile terminal through the target CDN server.
[0104] In an embodiment of the present invention, it also includes:
[0105] The default CDN address acquisition module is used to acquire the default CDN address when the CDN address returned by the operation server is not received.
[0106] In an embodiment of the present invention, the device further includes:
[0107] The rendering module is used to render using operating position resources.
[0108] In an embodiment of the present invention, the operation location server further includes:
[0109] A resource preheating request sending module is used for the operation server to receive the resource preheating request sent regularly by the preheating server;
[0110] A preheating operation position resource acquisition module is used to respond to resource preheating requests and acquire preheating operation position resources;
[0111] The preheating operation location resources are saved in the CDN server, and the CDN address of the CDN server is stored in the database.
[0112] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory:
[0113] The memory is used to store the program code and transmit the program code to the processor;
[0114] The processor is used to execute the operation bit resource loading method of the embodiment of the present invention according to the instructions in the program code.
[0115] The embodiment of the present invention further provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the operation position resource loading method of the embodiment of the present invention.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0117] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0118] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0119] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0122] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0123] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0124] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for loading operating position resources, characterized in that: Applied to a mobile terminal, the mobile terminal communicates with an operator server; the method comprises: Sending a CDN address acquisition request to the operation server; Receiving the CDN address returned by the operation server in response to the CDN address acquisition request; Sending an operation location resource acquisition request to the CDN server corresponding to the CDN address; Receive the operation location resource returned by the CDN server in response to the operation location resource acquisition request.
2. The method according to claim 1, characterized in that The step of the operation location server acquiring the CDN address in response to the CDN address acquisition request comprises: The operation location server responds to the CDN address acquisition request and queries the preset cache for a CDN address corresponding to the CDN address acquisition request; If the query in the cache is successful, returning the CDN address to the mobile terminal; If the query in the cache is unsuccessful, query the CDN address in a preset database to obtain the CDN address corresponding to the request; If the query in the database is successful, the CDN address is returned to the mobile terminal.
3. The method according to claim 1, characterized in that The step of the CDN server returning the operation location resource to the mobile terminal in response to the operation location resource acquisition request includes: The CDN server responds to the operation location resource acquisition request, distributes the operation location resource acquisition request to a target CDN server closest to the mobile terminal, and returns the operation location resource to the mobile terminal through the target CDN server.
4. The method according to claim 1, characterized in that: Also includes: When the CDN address returned by the operation location server is not received, a default CDN address is obtained.
5. The method according to claim 1, characterized in that After the step of receiving the operation location resource returned by the CDN server in response to the operation location resource acquisition request, the step further includes: The operating position resources are used for rendering.
6. The method according to claim 1, characterized in that Also includes: The operation server receives a resource preheating request sent regularly by the preheating server; Responding to the resource preheating request, obtaining preheating operation position resources; The preheating operation location resource is stored in the CDN server, and the CDN address of the CDN server is stored in a database.
7. An operation position resource loading device, characterized in that: Applied to a mobile terminal, the mobile terminal communicates with an operator server; the device comprises: A CDN address acquisition request sending module, used to send a CDN address acquisition request to the operation location server; A CDN address receiving module, configured to receive the CDN address returned by the operation server in response to the CDN address acquisition request; An operation position resource acquisition request sending module is used to send an operation position resource acquisition request to the CDN server corresponding to the CDN address; The operation position resource receiving module is used to receive the operation position resource returned by the CDN server in response to the operation position resource acquisition request.
8. The device according to claim 7, characterized in that The operating position server comprises: A cache query module, configured for the operation server to respond to the CDN address acquisition request and query the CDN address corresponding to the CDN address acquisition request in a preset cache; A cache return module, configured to return the CDN address to the mobile terminal if the query in the cache is successful; A database query module, configured to query the CDN address in a preset database to obtain the CDN address corresponding to the request if the query in the cache is unsuccessful; The database return module is used to return the CDN address to the mobile terminal if the query in the database is successful.
9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the operation position resource loading method described in any one of claims 1-6 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and the program code is used to execute the operation position resource loading method described in any one of claims 1-6.