Resource management method, access method and storage medium
By obtaining the geographical location relationship between the smart learning machine client and the cloud terminal server, generating a pre-delivery strategy, and directing the resource to the nearest server, solving the problem of long loading time for smart learning machine resources and significantly improving the user experience.
Patent Information
- Application Number
- CN202411829311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-29
AI Technical Summary
In the application of smart learning machines, users are susceptible to network fluctuations and server distance factors when accessing cloud web pages, resulting in long resource loading time and affecting user experience.
By obtaining the geographical location relationship between the client and the cloud terminal server, a pre-delivery policy is generated, and the pre-set resources are sent to the cloud terminal server closest to the client, thereby realizing the targeted delivery of resources.
It greatly improves the speed of loading preset resources, improves the speed of opening the client, improves the user experience, reduces the complaints of the software, and gains a good reputation among users.
Smart Images

Figure CN119903253A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to but are not limited to the field of resource management technology, and in particular, to a resource management method, an access method, and a storage medium. Background Art
[0002] With the continuous deepening and development of educational informatization, intelligent learning machines, as a multi-functional intelligent educational auxiliary tool, have received widespread attention and application. This device provides students with a convenient learning path through built-in learning applications, making personalized learning and acquiring knowledge anytime and anywhere possible. However, in actual application, due to the existence of many different types of learning resources and services on the market, in order to be able to update and present the latest and most comprehensive content to users in a timely manner, many developers tend to use Web pages to load this rich information.
[0003] However, this method also brings new problems: First, when users access cloud web pages, they are very dependent on the current network status. When encountering network fluctuations, the access is very slow, and the user waits for a long time, which greatly affects the user experience, resulting in a lot of customer complaints; second, if the server where the requested resource is located is very far away from the user's location, it will cause a long resource loading time, making the user wait longer, which greatly affects the user experience. This not only greatly reduces the user experience, but may also have a negative impact on students' learning enthusiasm, thus violating the original intention of using intelligent learning machines to improve learning efficiency. Therefore, how to optimize the resource access mechanism has become one of the problems that need to be solved urgently. Summary of the invention
[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0005] The present application provides a resource management method, access method and storage medium, which can optimize resource access and greatly improve the speed at which a client records preset resources.
[0006] An embodiment of the present application provides a resource management method, which is applied to a cloud server, wherein the cloud server is used to store preset resources required by a client, and the cloud server includes multiple cloud sub-servers; the method includes: obtaining a geographical location relationship between the client and the cloud sub-server; generating a pre-delivery strategy based on the geographical location relationship; and sending the preset resources to the cloud sub-server according to the pre-delivery strategy.
[0007] In some exemplary embodiments of the present application, obtaining the location relationship between the client and the cloud sub-server includes: obtaining the geographical location distribution of the client; establishing the geographical location relationship according to the geographical location distribution of the client and the geographical location distribution of the cloud sub-server; wherein the geographical location distribution of the client is uploaded by the client or obtained through a survey.
[0008] In some exemplary embodiments of the present application, the geographic location relationship includes a first correspondence between a client and a server that is closest to the client, and obtaining the location relationship between the client and the cloud sub-server includes: for each client, obtaining the geographic location of the current client; based on the geographic location of the current client, searching for the cloud sub-server that is closest to the current client; and establishing a first correspondence between the current client and the cloud sub-server that is closest to the current client.
[0009] In some exemplary embodiments of the present application, the cloud server further includes a centralized cloud service center, and after establishing the geographic location relationship, the step further includes: storing the geographic location relationship in the centralized cloud service center.
[0010] In some exemplary embodiments of the present application, the pre-delivery strategy includes a second correspondence table between the preset resources and the cloud sub-server; generating the pre-delivery strategy based on the geographic location relationship includes: for each client, determining the preset resources required by the current client respectively; determining the cloud sub-server closest to the current client according to the geographic location table; establishing a second correspondence between the preset resources required by the current client and the cloud sub-server closest to the client; and adding the correspondence to the second correspondence table.
[0011] In some exemplary embodiments of the present application, before generating the pre-delivery strategy according to the geographical location relationship, the method further includes: collecting the preset resources required by all clients; structuring the preset resources to generate a preset resource list.
[0012] In some exemplary embodiments of the present application, sending the preset resources to the cloud sub-server includes: for each preset resource in the preset resource list, searching for the corresponding cloud sub-server from the correspondence table, and sending the current preset resource to the corresponding cloud sub-server.
[0013] In some exemplary embodiments of the present application, after sending the preset resources to the cloud sub-server, the method further includes: detecting whether the preset resources are uploaded to the cloud sub-server.
[0014] In some exemplary embodiments of the present application, the method may further include: upon receiving a request from the client to obtain preset resources, obtaining a first cloud sub-server that is closest to the client based on the geographic location relationship; and sending identification information of the first cloud sub-server to the client, so that the client loads the preset resources from the first cloud sub-server based on the identification information.
[0015] An embodiment of the present application also provides a resource access method, including: a client obtains a first correspondence relationship as described in any embodiment of the present application from a cloud service center, and obtains a cloud sub-server closest to the client based on the first correspondence relationship; the client obtains the required preset resources from the cloud sub-server closest to it.
[0016] An embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, can implement the resource management method as described in any embodiment of the present application.
[0017] An embodiment of the present application also provides a resource management system, including: a memory and a processor; the memory is used to store a program for resource management; the processor is used to read the program for resource management and execute the resource management method as described in any embodiment of the present application.
[0018] Compared with the related art, the embodiment of the present application provides a resource management method, access method and storage medium, and the technical solution of the scheme is as follows: obtain the geographical location relationship between the client and the cloud sub-server; generate a pre-delivery strategy according to the geographical location relationship; according to the pre-delivery strategy, send the preset resources to the cloud sub-server. Through this scheme, since the preset resources are sent to the cloud sub-server through the pre-delivery strategy generated according to the geographical location relationship, the preset resources can be delivered in a targeted manner, so that the client can obtain the preset resources from the cloud sub-server closest to it, greatly improving the speed of loading the preset resources, thereby improving the opening speed of the client, greatly improving the user experience, reducing software customer complaints, and gaining a good reputation among users.
[0019] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by implementing the embodiments of the present application. The purpose and other advantages of the embodiments of the present application can be achieved and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0021] Figure 1 This is a flow chart of a resource management method according to an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a resource management method according to an embodiment of the present application;
[0023] Figure 3 This is a flow chart of a resource access method according to an embodiment of the present application;
[0024] Figure 4 This is a flow chart of a learning machine downloading preset resources from a cloud server according to an embodiment of the present application;
[0025] Figure 5 This is a schematic diagram of a resource management system according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0027] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0028] First, some nouns in this application are explained:
[0029] Learning machine application: refers to the software installed on the learning machine system.
[0030] Static resources mainly refer to static resources that need to be called during the running of the application, such as resource files that will not change in the application, such as HTML, CSS, JS, JSON, PNG, JPG, etc.
[0031] Web page: A web page is an information display interface accessed through the Internet that contains multiple elements such as text, images, audio, video, etc. It is an important carrier for information display and interaction on the Internet.
[0032] Learning machine applications on the market are either implemented in full native mode or in hybrid development mode. The full native mode has a large package size and troublesome updates and iterations, high upgrade costs, poor user experience, and long-tail problems. The hybrid development mode can be updated efficiently, users are unaware of the changes and have a good experience, the package size is small, and enterprise costs are reduced. However, using the hybrid development mode will cause two problems: First, when users access cloud web pages, they are very dependent on the current network status. When encountering network fluctuations, the network is very slow, and the user waits for a long time, which greatly affects the user experience, resulting in a lot of customer complaints; second, if the server where the requested resource is located is very far away from the user's location, it will cause a long time to load the resource, which will increase the user's waiting time and greatly affect the user experience (for example, due to the long loading time, the screen is white for a long time, which may make the user think that the application is stuck).
[0033] In order to solve the above technical problems, the present application provides a resource management method, which is applied to a cloud server, wherein the cloud server is used to store preset resources required by a client, and the cloud server includes multiple cloud sub-servers; Figure 1 As shown, the method may include the following steps:
[0034] Step S110: obtaining the geographical location relationship between the client and the cloud sub-server;
[0035] Step S120: generating a pre-delivery strategy according to the geographical location relationship;
[0036] Step S130: sending the preset resources to the cloud sub-server according to the pre-delivery strategy.
[0037] The resource management method of this embodiment obtains the geographical location relationship between the client and the cloud sub-server, generates a pre-delivery strategy based on the geographical location relationship, and then sends the preset resources to the cloud sub-server according to the pre-delivery strategy. Through this solution, since the preset resources are sent to the cloud sub-server through the pre-delivery strategy generated according to the geographical location relationship, the preset resources can be delivered in a targeted manner, so that the client can obtain the preset resources from the cloud sub-server closest to it, greatly improving the speed of loading the preset resources, thereby improving the opening speed of the client, greatly improving the user experience, reducing software customer complaints, and gaining a good reputation among users.
[0038] In some exemplary embodiments of the present application, in step S110, obtaining the location relationship between the client and the cloud sub-server may include:
[0039] Obtaining the geographical location distribution of the client;
[0040] Establishing the geographical location relationship according to the geographical location distribution of the client and the geographical location distribution of the cloud sub-server;
[0041] The geographical location distribution of the clients is uploaded by the clients or obtained through surveys.
[0042] For example, if the client turns on the option to allow the user to access the geographic location, the geographic location may be uploaded when the client opens the application for the first time.
[0043] In some exemplary embodiments of the present application, the client may be a learning machine.
[0044] For example, since the learning machine is usually located near a store, we can use the location of the store as the location of the learning machine and obtain the location of the learning machine by counting the locations of the stores.
[0045] In some exemplary embodiments of the present application, the geographical location relationship includes a first corresponding relationship between the client and the server closest to the client, and obtaining the location relationship between the client and the cloud sub-server includes:
[0046] For each client, obtain the current client's geographic location;
[0047] According to the current client's geographical location, find the cloud sub-server closest to the current client;
[0048] A first correspondence relationship between the current client and its nearest cloud sub-server is established.
[0049] Exemplarily, the first correspondence relationship can be stored in a database table, for example, the first correspondence relationship is stored as a first correspondence relationship table. The first correspondence relationship table can be stored in a centralized cloud service center. The database described in this example can be a relational database (such as MySQL, PostgreSQL, Oracle, etc.) or a non-relational database (such as MongoDB, Red is, etc.), and this application does not limit this.
[0050] The resource management method of this embodiment, after obtaining the geographical location of the client, obtains the cloud sub-server closest to the current client according to the geographical location of the client, thereby establishing a first correspondence between each client and the cloud sub-server closest to the client, so that when the client is opened, the client can find the cloud sub-server closest to it according to the first correspondence, so as to load preset resources from the cloud sub-server, thereby improving the loading speed.
[0051] In some examples of this embodiment, the cloud server also includes a centralized cloud service center, and after the geographic location relationship is established, the method may further include: storing the geographic location relationship in the centralized cloud service center.
[0052] In this example, since the geographical location relationship includes a first correspondence between the client and the server closest to the client, the centralized cloud service center also stores the first correspondence. In this way, the client can first obtain the first correspondence from the centralized service center, and then obtain the cloud sub-server closest to it based on the first correspondence, and then load the preset resources from the cloud sub-server to improve the loading speed (the relationship between the client and the cloud server can be seen in Figure 2 ).
[0053] For example, Figure 2 The client in the description can represent the store and the user, or it can also be understood that the client is located in the store or in the hands of the user.
[0054] In some exemplary embodiments of the present application, the pre-delivery strategy includes a second correspondence table between the preset resources and the cloud sub-servers; in step S120, the pre-delivery strategy is generated according to the geographical location relationship, including:
[0055] For each client, determine the preset resources required by the current client;
[0056] Determine the cloud sub-server closest to the current client according to the geographic location table;
[0057] Establishing a second correspondence between the preset resources required by the current client and the cloud sub-server closest to the client;
[0058] The corresponding relationship is added to the second corresponding relationship table.
[0059] The resource management method of this embodiment determines, for each client, the cloud sub-server closest to the current client, and establishes a second correspondence between the preset resources required by the client and the cloud sub-server closest to it. In this way, when the preset resources are delivered to each cloud sub-server according to the second correspondence table, it can be ensured that each client can download the preset resources it needs from the cloud sub-server closest to it, thereby improving the resource loading speed, increasing the client opening speed, and improving the user experience.
[0060] In some exemplary embodiments of the present application, before generating the pre-delivery strategy according to the geographical location relationship, the method may further include: collecting the preset resources required by all clients; structuring the preset resources to generate a preset resource list.
[0061] Exemplarily, the preset resources can be automatically collected through a pre-written script, and the collected resources can be structured to generate a preset resource list. It should be noted that the structuring of this embodiment refers to the serialization of the resource list, and the preset resource list obtained after serialization includes the distribution of resources and the cloud sub-servers to which the resources need to be sent (i.e., where the resources need to go).
[0062] The resource access method of this embodiment can improve the efficiency of resource collection by automatically collecting preset resources through script collection. Further, the collected preset resources are sorted into a preset resource list to achieve serialization of the preset resources, thereby laying a foundation for distributing the preset resources to various cloud servers.
[0063] In some exemplary embodiments of the present application, sending the preset resources to the cloud sub-server may include: for each preset resource in the preset resource list, searching for the corresponding cloud sub-server from the correspondence table, and sending the current preset resource to the corresponding cloud sub-server.
[0064] The resource access method of this embodiment implements sending preset resources to each cloud sub-server according to the correspondence table between preset resources and cloud sub-servers. Since the correspondence between preset resources and cloud sub-servers in the correspondence table is generated according to the client that needs the preset resource and the cloud sub-server closest to it, the client that needs the preset resource can download the preset resource from the cloud sub-server closest to it, thereby greatly improving the speed of loading preset resources, improving the opening speed of the client, greatly improving the user experience, reducing software customer complaints, and gaining a good reputation among users.
[0065] In some exemplary embodiments of the present application, after sending the preset resources to the cloud sub-server, the method further includes: detecting whether the preset resources are uploaded to the cloud sub-server.
[0066] In some examples of this embodiment, when it is detected that the preset resource is uploaded to the cloud sub-server successfully, the upload success status is returned; when it is detected that the preset resource is uploaded to the cloud sub-server unsuccessfully, the upload failure status is returned and the upload is performed again.
[0067] Exemplarily, a maximum number of re-upload times can also be set. If the upload is still unsuccessful after reaching the maximum number of re-upload times, the administrator can be informed of the upload failure through message reminders, so that the administrator can troubleshoot the problem and re-upload to ensure that all preset resources can be uploaded to the corresponding cloud sub-server, ensuring that the client can download the required preset resources normally.
[0068] The resource access method of this embodiment ensures that all preset resources can be sent to the corresponding cloud sub-server through failed retransmission and message reminder, thereby ensuring that the client can download the required preset resources normally, avoiding download failures on the client, and further improving the user experience.
[0069] In some exemplary embodiments of the present application, after generating the preset resource list, the method may further include: storing the preset resources in the preset resource list in the centralized cloud service center.
[0070] The resource access method of this embodiment, in addition to sending preset resources to the nearest cloud sub-server according to the needs of the client, can also store the preset resources in a centralized cloud service center. In this way, when the preset resources cannot be obtained from the nearest cloud sub-server (for example, the cloud sub-server closest to the client fails), the resources can be obtained from the centralized cloud service center, thereby avoiding client failures due to inability to download resources and improving user experience.
[0071] In some exemplary embodiments of the present application, the method may further include:
[0072] When receiving a request from the client to obtain preset resources, obtaining a first cloud sub-server closest to the client according to the geographical location relationship;
[0073] The identification information of the first cloud sub-server is sent to the client, so that the client loads the preset resource from the first cloud sub-server according to the identification information.
[0074] The resource management method of this embodiment, when receiving the request of the client to obtain the preset resource, obtains the first cloud sub-server closest to the client according to the geographical location relationship, and sends the identification information of the first cloud sub-server to the client, so that the client can load the preset resource from the first cloud sub-server according to the identification information. That is, the client can download the preset resource it needs from the cloud sub-server closest to it, thereby improving the resource loading speed, improving the client opening speed, and improving the user experience.
[0075] In summary, this embodiment provides a resource management method, which delivers resources in a targeted manner through a pre-delivery strategy, so that the client can obtain preset resources from the cloud sub-server closest to it, greatly improving the speed of loading preset resources, thereby improving the opening speed of the client, greatly improving the user experience, reducing software customer complaints, and gaining a good reputation among users.
[0076] An embodiment of the present application also provides a resource access method, such as Figure 3 As shown, the method may include:
[0077] Step S310: the client obtains the first corresponding relationship as described in any embodiment of the present application from the cloud service center, and obtains the cloud sub-server closest to the client according to the first corresponding relationship;
[0078] Step S320: The client obtains the required preset resources from the cloud sub-server closest to it.
[0079] In some exemplary embodiments of the present application, acquiring the cloud sub-server closest to the client according to the first corresponding relationship may include: acquiring identification information of the cloud sub-server closest to the client according to the first corresponding relationship;
[0080] The client obtains the required preset resources from the cloud sub-server closest to the client, which may include: accessing the cloud sub-server closest to the client according to the identification information to download the preset resources from the cloud sub-server.
[0081] In the resource access method of this embodiment, the client obtains resources from the nearest cloud sub-server. Compared with the traditional method of obtaining resources from a central server, the speed at which the client records resources in this embodiment is greatly improved, and the content required by the user can be quickly displayed, giving the user an ultimate experience.
[0082] In some exemplary embodiments of the present application, the client may be a learning machine. When the client is a learning machine, since the learning machine is usually located near a store, we can use the store's location as the learning machine's location and obtain the location of the learning machine by counting the store's location; in addition, since the learning machine may also be in the user's hands, the user's address may be surveyed to obtain the location of the learning machine. In addition, if the client turns on the permission for the user to access the geographic location, the client will upload its geographic location to the cloud server for the cloud server to establish the geographic location relationship between the client and the cloud sub-server.
[0083] The following uses a learning machine as an example to illustrate the interaction method between the learning machine and the cloud server in this application. Figure 4 As shown, the following steps may be included:
[0084] Step S410: When the project goes online, R&D technicians collect the static resource list through the configured scripts and structure it to facilitate program execution.
[0085] Step S420: After executing the program through the pre-delivery strategy and confirming that everything is completed as planned, the task is terminated.
[0086] Step S430: When a user or a store uses a learning machine device to open an application, the learning machine device can download preset resources from the cloud sub-server closest to it, thereby increasing the speed of opening the application and quickly displaying the content the user needs.
[0087] In summary, this application pre-sets static resources to provide services near users. When a user opens an application, the static resources that the application depends on only need to be obtained from a nearby server. The short-distance resource loading will be very fast. The application will be initialized immediately after obtaining the resources, and the web page will quickly display the content the user needs. In this way, the user's waiting time is very short and is less affected by network fluctuations, which greatly improves the user experience.
[0088] In some examples of this embodiment, the "collecting a list of static resources through a configured script" described in step S410 may include the following steps: Step S411, clarifying the requirements: determine which static resources need to be collected; this may include pictures, videos, audios, text files, CSS style sheets, JavaScript files, etc. Clarifying the types and locations of these resources is the first step. Step S412, writing a script: writing a script using an appropriate programming language (such as Python, Node.js, Shell, etc.); the main function of the script is to traverse the specified directory or file system, find and list all eligible static resources; when writing a script, regular expressions can be used to match file names or paths to filter out the required static resources. Step S413, configuring script parameters: in order to make the script more flexible, it can be configured to accept command line parameters or configuration files; for example, the directory to be scanned, resource type, output format, etc. can be specified through parameters; in this way, different projects or environments can reuse the same script by simply modifying the configuration file. Step S414, execute the script: deploy the script to the target environment and execute it; the script will traverse the specified directory, find and list all eligible static resources; as needed, the results can be output to the console, written to a file, or sent to a remote server. Step S415, verify the results: check the output results of the script to ensure that the listed resources are accurate; if problems are found, the script logic or parameters can be adjusted and the script can be re-executed. Step S416, integrate into the automated process: in order to improve efficiency, the script can be integrated into the continuous integration / continuous deployment (CI / CD) process; in this way, whenever a new static resource is added to the project, the script will automatically run and update the resource list. In summary, through the above steps, R&D technicians can effectively collect static resource lists through configured scripts. This method not only improves work efficiency, but also reduces the possibility of human error.
[0089] In some examples of this embodiment, step S420 may include the following sub-steps (or may also be understood as the pre-delivery strategy algorithm includes):
[0090] Step S421: Automatically collect and structure the preset resource list through a script.
[0091] Exemplarily, the structuring in step S421 refers to the serialization of the resource list, and the preset resource list obtained after serialization includes the distribution of resources and the cloud sub-servers to which the resources need to be sent (that is, where the resources need to go).
[0092] Step S422: According to the geographical distribution of stores and survey users (i.e., the location of the survey client), prepare the quantity and location to be sent to the cloud and structure them.
[0093] Exemplarily, the structuring in step S422 refers to further adding relevant information such as store location, user status, etc.
[0094] Step S423: Connect to all clouds and test connectivity, and prepare batch upload scripts.
[0095] Step S424: upload the structured resource list to the specified cloud through the script and return a success status; if it fails, retransmit it.
[0096] Step S425: Perform a simulation test to check whether the resources are uploaded to the cloud and can be quickly accessed.
[0097] In some examples of this embodiment, the "batch upload script" described in step S423 can be implemented by the following steps: (1) Clarify the requirements: determine the file type, quantity, and target server or storage location that need to be uploaded in batches; for example, it may be necessary to upload different types of files such as pictures, videos, and documents to a specified server directory or cloud storage service. (2) Select programming language: Select a suitable programming language based on the technology stack of the individual or team; Python is often used to write batch upload scripts because it is concise, easy to read, and has rich library support. (3) Prepare the environment: Ensure that the required programming language interpreter and third-party libraries are installed in the development environment; for Python, it may be necessary to install the requests library to process HTTP requests. (4) Write a script: Get a file list: Use the file operation function provided by the operating system (such as os.listd ir in Python) to obtain all file names in the specified directory. (5) Splice file information: Splice the file name, type, and other information into a data structure in JSON or other formats according to the interface requirements. (6) Send an HTTP request: Use the network request library provided by the programming language (such as requests.post in Python) to send a POST request to the target server to upload file information. (7) Process the response: Receive and process the response returned by the server, confirm whether the upload is successful, and perform necessary error handling. (8) Optimize the script: To improve the maintainability and efficiency of the script, you can consider the following optimization measures: encapsulate repeated code into functions or methods; use list derivation or generator expressions to simplify the code; add exception handling mechanisms to capture and handle possible errors; adjust the HTTP request timeout and retry strategy as needed. (9) Testing and deployment: After development is completed, conduct a comprehensive test on the script to ensure that it can run stably in different environments and conditions; after the test passes, the script can be deployed to the production environment to start the batch upload task.
[0098] In some examples of this embodiment, "perform simulation test to check whether the resource is uploaded to the cloud" in step S425 can be implemented by the following steps: (1) clarify the test objectives: determine the specific resource types to be tested (such as files, data, applications, etc.) and the target cloud environment to be uploaded (such as Alibaba Cloud, Tencent Cloud, AWS, etc.); at the same time, clarify the expected results of the test, that is, the state or behavior of the resource after successful upload. (2) Prepare the test environment: build a test environment similar to the production environment, including network configuration, server settings, database, etc.; ensure that the hardware and software versions in the test environment are consistent with the production environment to more accurately simulate the actual situation. (3) Write a test script: use an appropriate programming language (such as Python, Java, etc.) to write an automated test script; the script should contain the complete process of resource upload, including file reading, network request sending, response processing, etc.; in the script, assertions can be used to verify whether the result of resource upload meets expectations, such as checking the returned status code, response content, or records in the database. (4) Perform a simulation test: run the written test script in the test environment to simulate the actual resource upload process; observe and record any abnormal or error information during the test for subsequent analysis and repair. (5) Verify test results: Verify whether the resources are successfully uploaded to the cloud based on the assertions and expected results in the test script; this can be confirmed by checking the file list in the cloud storage, database records, or the response content returned by the API; if the test results do not meet expectations, the reasons need to be analyzed and corresponding adjustments and repairs need to be made. In addition, it should be noted that when conducting simulation tests, the real network environment and user behavior should be simulated as much as possible to ensure the accuracy and reliability of the test results. In addition, for upload operations involving sensitive data or important resources, security measures should be strengthened to prevent data leakage or damage.
[0099] In some examples of this embodiment, the "connecting all clouds and testing connectivity" described in step S423 can be implemented by the following schemes: (1) Configuring network interconnection: According to business needs, configure the network interconnection between each cloud platform; this may involve setting up a VPN gateway, dedicated line connection or using the cross-cloud service provided by the cloud platform; ensure that the network configuration is correct so that different cloud platforms can communicate with each other. (2) Deploy lightweight detection agents: Deploy lightweight detection agents in each cluster; these agents can communicate with each other and verify the connection through HTTP / HTTPS requests; the agents should be able to collect and report the connectivity status between clusters, including any potential problems or failures. (3) Use automated tools for connectivity testing: Use automated tools or scripts to test the connectivity between each cloud platform; these tools can simulate actual business traffic, send requests and receive responses, so as to verify whether the network connection is normal; commonly used testing tools include ICMP, telnet and API interfaces provided by each cloud platform. (4) Monitoring and logging: Establish a monitoring mechanism to track the connectivity status between each cloud platform in real time; at the same time, record test results and log information so that they can be checked and analyzed when problems arise. (5) Regular maintenance and updates: With the development of business and the update of cloud platform technology, network configuration and connectivity tests are regularly maintained and updated to ensure that the network architecture always meets business needs and can adapt to new technological changes. Through the above steps, all clouds (i.e. cloud sub-servers, centralized cloud service centers) can be effectively connected and their connectivity tested to ensure network stability and reliability in a multi-cloud environment.
[0100] In some examples of this embodiment, the cloud server can be a variety of types of servers. Exemplarily, it can be a public cloud server: owned and operated by a third-party cloud service provider, and users can access these server resources through the Internet; public cloud servers usually have the characteristics of high availability, high performance and high security. Exemplarily, it can also be a private cloud server: built by the enterprise itself and run in the enterprise's internal data center, providing the enterprise with exclusive cloud resources; private cloud servers can better protect the data security and privacy of the enterprise. Exemplarily, it can also be a hybrid cloud server: combining the characteristics of public cloud and private cloud, allowing enterprises to flexibly switch resources between private cloud and public cloud to meet different business needs; hybrid cloud servers can make full use of the advantages of cloud resources while maintaining control over sensitive enterprise data. Exemplarily, it can also be a container cloud server: a lightweight virtualization technology running on a cloud server, which can package the application and its dependent operating environment into a portable container, which is convenient for deployment and operation in different cloud environments; container cloud servers have the characteristics of rapid deployment, high availability and cross-platform. Exemplarily, it can also be a bare metal cloud server: a cloud environment that runs directly on a physical server. Compared with traditional virtualization technology, a bare metal cloud server has no virtualization overhead and can provide higher performance and better security; it is suitable for application scenarios that require high performance and high security. Exemplarily, it can also be an edge computing server: deployed at the edge of the network, it processes and analyzes data with lower data transmission latency; this server is suitable for application scenarios that require real-time data processing and analysis, such as the Internet of Things, smart transportation, etc. Exemplarily, it can also be a distributed storage server: using distributed storage technology, it can provide large-scale, scalable, and highly available storage services; this server is suitable for application scenarios that require a large amount of storage space and high reliability, such as big data processing, video surveillance, etc. Exemplarily, it can also be a virtual private cloud server: a private virtual cloud is created in a public cloud environment to provide independent cloud resources for specific customers; this server combines the advantages of public and private clouds, providing both the flexibility and scalability of public clouds and ensuring the security and privacy of data.
[0101] In summary, through the interaction method between the learning machine and the cloud server described in this embodiment, when the project is launched, you can refer to Figure 2 Schematic diagram and Figure 4The above steps. When the project goes online, the R&D technicians collect the static resource list through the configured scripts, and structure it to facilitate program execution. The next step is to execute the program through the pre-delivery strategy, confirm that everything is completed as planned, and end the task. After the above process is completed, when the user or store uses the device to open the application, the application can load resources from the nearest server cloud node. Compared with obtaining resources from a distant centralized server before, the speed of opening the application will be greatly improved, quickly displaying the content that users need, bringing users the ultimate experience, reducing users' complaints due to slow loading when using the device, and gaining a good reputation from users.
[0102] An embodiment of the present application also provides a resource management system. Figure 5 , including: memory and processor;
[0103] The memory is used to store a program for resource management;
[0104] The processor is used to read the program for resource management and execute the resource management method as described in any embodiment of the present application.
[0105] In some examples of this embodiment, the resource management system is applied to resource management between a cloud server and a client; wherein the cloud server is used to store preset resources required by the client, and the cloud server includes multiple cloud sub-servers; the resource management method includes: obtaining the geographical location relationship between the client and the cloud sub-server; generating a pre-delivery strategy based on the geographical location relationship; and sending the preset resources to the cloud sub-server according to the pre-delivery strategy.
[0106] The resource management system of this embodiment can be used for resource management between the client and the cloud server. Through this system, the client can obtain resources from the nearest cloud sub-server. Compared with the traditional method of obtaining resources from the central server, the speed of recording resources by the client of this embodiment is greatly improved, and the content required by the user can be quickly displayed, giving the user an ultimate experience.
[0107] The processor of the above-mentioned embodiment of the present application can be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor, NP for short), a microprocessor, etc., or other conventional processors, etc.; the processor can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA), a discrete logic or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or other equivalent integrated or discrete logic circuits, or a combination of the above devices. That is, the processor of the above-mentioned embodiment can be any processing device or device combination that implements the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. If the embodiments of the present application are partially implemented in software, the instructions for the software can be stored in a suitable non-volatile computer-readable storage medium, and one or more processors can be used to execute the instructions in hardware to implement the method of the embodiments of the present application. The term "processor" used herein may refer to the above-mentioned structure or any other structure suitable for implementing the technology described herein.
[0108] In some exemplary embodiments of the present application, the client may be a learning machine. The resource management system of the embodiment of the present application, after reading the program for resource management from the memory through the processor, can preset static resources to the cloud sub-server near the learning machine based on the program, so that when the user opens the application in the learning machine, the static resources that the application depends on only need to be obtained from the nearby server, and the short-distance resource loading will be very fast. After the application obtains the resources, it will be initialized immediately, and the webpage will quickly display the content required by the user, so that the user's waiting time is very short, and the impact of network fluctuations is small, which greatly improves the user experience.
[0109] An embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, can implement the resource management method as described in any embodiment of the present application.
[0110] In general, the present application provides a resource management method, an access method, and a storage medium, which implements an implementation scheme for pre-setting learning machine application static resources to the cloud based on a pre-delivery strategy. This scheme places resources on services close to users through a pre-delivery strategy for static resources to the cloud. When users use applications to access resources, they can obtain them from nearby services. The response speed is very fast and the user experience is very good. This scheme can be used in various application usage scenarios on learning machines (for example, it is suitable for the implementation of pre-loaded resources such as learning machines, pencil cases, and smart learning tables), and is also suitable for the implementation of pre-delivery strategies to implement solutions for pre-setting static resources to the cloud (such as mobile phones, smart AI, and many other educational products). This strategy is the most advanced implementation strategy on the market, and it is of great significance to the strategy of improving user experience through the future pre-delivery of static resource processes. This solution has the advantages of simple implementation, stability, and good user experience.
[0111] In one or more of the above exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on a computer-readable medium or transmitted via a computer-readable medium as one or more instructions or codes, and executed by a hardware-based processing unit. A computer-readable medium may include a computer-readable storage medium corresponding to a tangible medium such as a data storage medium, or a communication medium that facilitates a computer program, such as any medium transmitted from one place to another according to a communication protocol. In this way, a computer-readable medium may generally correspond to a non-temporary tangible computer-readable storage medium or a communication medium such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the technology described in this application. A computer program product may include a computer-readable medium.
[0112] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection may also be referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transient (transient) media, but are directed to non-transient tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, or Blu-ray disks, etc., where disks typically reproduce data magnetically, while optical disks use lasers to reproduce data optically. Combinations of the above should also be included within the scope of computer-readable media.
Claims
1. A resource management method, applied to a cloud server, characterized in that: The cloud server is used to store preset resources required by the client, and the cloud server includes multiple cloud sub-servers; the method includes: Obtaining the geographical location relationship between the client and the cloud sub-server; generating a pre-delivery strategy according to the geographical location relationship; According to the pre-delivery strategy, the preset resources are sent to the cloud sub-server.
2. The method according to claim 1, characterized in that The obtaining of the position relationship between the client and the cloud sub-server includes: Obtaining the geographical location distribution of the client; Establishing the geographical location relationship according to the geographical location distribution of the client and the geographical location distribution of the cloud sub-server; The geographical location distribution of the clients is uploaded by the clients or obtained through surveys.
3. The method according to claim 2, characterized in that The geographical location relationship includes a first corresponding relationship between a client and a server closest to the client, and obtaining the location relationship between the client and the cloud sub-server includes: For each client, obtain the current client's geographic location; According to the current client's geographical location, find the cloud sub-server closest to the current client; A first correspondence relationship between the current client and its nearest cloud sub-server is established.
4. The method according to claim 3, characterized in that The cloud server also includes a centralized cloud service center. After the geographical location relationship is established, the following steps are also included: The geographical location relationship is stored in the centralized cloud service center.
5. The method according to claim 2, characterized in that: The pre-delivery strategy includes a corresponding relationship table between the preset resources and the second cloud sub-server; the pre-delivery strategy is generated according to the geographical location relationship, including: For each client, determine the preset resources required by the current client; Determine the cloud sub-server closest to the current client according to the geographic location table; Establishing a second correspondence between the preset resources required by the current client and the cloud sub-server closest to the client; The corresponding relationship is added to the second corresponding relationship table.
6. The method according to claim 5, characterized in that: Before generating the pre-delivery strategy according to the geographical location relationship, the method further includes: collecting the pre-set resources required by all clients; structuring the pre-set resources to generate a pre-set resource list; The sending the preset resources to the cloud sub-server includes: for each preset resource in the preset resource list, searching for a corresponding cloud sub-server from the corresponding relationship table, and sending the current preset resource to the corresponding cloud sub-server.
7. The method according to claim 6, characterized in that The method further comprises: When receiving a request from the client to obtain preset resources, obtaining a first cloud sub-server closest to the client according to the geographical location relationship; The identification information of the first cloud sub-server is sent to the client, so that the client loads the preset resource from the first cloud sub-server according to the identification information.
8. The method according to claim 1, characterized in that After sending the preset resources to the cloud sub-server, the method further includes: Detect whether the preset resource is uploaded to the cloud sub-server.
9. A resource access method, characterized in that: include: The client obtains the first corresponding relationship as claimed in claim 3 from the cloud service center, and obtains the cloud sub-server closest to the client according to the first corresponding relationship; The client obtains the required provisioned resources from the cloud sub-server closest to it.
10. A non-transitory computer-readable storage medium storing a computer program, wherein: The computer program, when executed by a processor, can implement the resource management method as claimed in any one of claims 1 to 8.