CN115766243A - Model resource management method and system - Google Patents

Model resource management method and system Download PDF

Info

Publication number
CN115766243A
CN115766243A CN202211453414.0A CN202211453414A CN115766243A CN 115766243 A CN115766243 A CN 115766243A CN 202211453414 A CN202211453414 A CN 202211453414A CN 115766243 A CN115766243 A CN 115766243A
Authority
CN
China
Prior art keywords
model
resource
downloader
preset
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211453414.0A
Other languages
Chinese (zh)
Inventor
万敏华
罗子初
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202211453414.0A priority Critical patent/CN115766243A/en
Publication of CN115766243A publication Critical patent/CN115766243A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application provides a model resource management method and a system, which are applied to a client, wherein the client is provided with a preset downloader, and the method comprises the following steps: after logging in the client, receiving authentication parameters sent by a server, and displaying a model list interface; wherein the model list interface comprises a plurality of models; determining a target model from the plurality of models in response to a selection operation acting on the model list interface; and acquiring the resources of the target model from the server according to the authentication parameters through the preset downloader so as to update the cached resources of the target model. By deploying the preset downloader at the client and performing updating and management on the model resources in the preset downloader, the user can acquire the latest model resources on the premise of not restarting the application, the flow and time for releasing the new version application are reduced, and the product using experience of the user is improved.

Description

Model resource management method and system
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a model resource management method, a model resource management system, computer equipment and a computer readable storage medium.
Background
In the prior art, many scenes need to be applied to model resources, for example, live broadcast is performed by using an avatar, and virtual characters, virtual props and the like in the virtual scenes use the model resources. At present, in the process of developing or maintaining projects containing various types of model resources, if there is a need to update the model resources, the normal update flow is as follows: and uniformly packaging all model resources in the current project into a resource file by using an AssetBundle compression technology, adding a binary file obtained by compiling the project source code, performing one-layer compression to generate an independent file, and finally pushing the file to a user for downloading and decompressing.
However, the AssetBundle only provides a resource compression standard, and does not perform version management and provide functions of distribution and downloading on the compressed resources, and if only a small part (such as a head cover) of the model resources needs to be updated, all the processes need to be executed, so that a user needs to additionally download a binary file corresponding to a repeated project source code and a resource file corresponding to an unchanged part of the model resources, which results in unnecessary time and storage space waste from a development end to a user end, and bandwidth resources are also wasted by uploading and downloading.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, a system, a computer device and a computer-readable storage medium for model resource management, which are used to solve the following problems: when part of the model resources are updated, all the model resources contained in the project need to be downloaded again, which wastes much time, bandwidth resources and storage space.
One aspect of the embodiments of the present application provides a model resource management method, which is applied to a client, where the client is deployed with a preset downloader, and the method includes:
after logging in the client, receiving authentication parameters sent by a server, and displaying a model list interface; wherein the model list interface comprises a plurality of models;
determining a target model from the plurality of models in response to a selection operation acting on the model list interface;
and acquiring the resources of the target model from the server according to the authentication parameters through the preset downloader so as to update the cached resources of the target model.
Optionally, after the step of presenting a model list interface, the method further includes:
sending a resource list request to the server according to the authentication parameters through the preset downloader;
receiving model information returned by the server in response to the resource list request; wherein the model information comprises a first resource list;
and determining that an updated model exists in the model list interface according to the first resource list, and displaying an update prompt message on the model list interface.
Optionally, the receiving the model information returned by the server in response to the resource list request includes:
and after receiving the resource list request, the server authenticates the preset downloader according to the authentication parameters in the resource list request, and returns model information to the preset downloader under the condition of successful authentication.
Optionally, the determining that an updated model exists in the model list interface according to the first resource list includes:
acquiring a cached second resource list;
and comparing the first resource list with the second resource list to determine that an updated model exists in the model list interface.
Optionally, the model information further includes a download address of a default resource corresponding to each model in the first resource list, and after the step of displaying the update prompting message on the model list interface, the method further includes:
downloading the default resources corresponding to each model from the server according to the downloading addresses of the default resources corresponding to each model through the preset downloader;
and displaying the default resources corresponding to the models on the model list interface.
Optionally, the obtaining, by the preset downloader, the resource of the target model from the server according to the authentication parameter includes:
sending a resource path request carrying the authentication parameters to the mobile terminal through the preset downloader;
receiving a download address of the target model and a first check code corresponding to the target model, which are returned by the server in response to the resource path request;
acquiring a cached second check code corresponding to the target model;
and under the condition that the first check code is inconsistent with the second check code, downloading the resources of the target model from the server according to the downloading address so as to update the cached resources of the target model.
Optionally, the receiving, by the server, a download address of the target model and a first check code corresponding to the target model, which are returned in response to the resource path request, includes:
and after receiving the resource path request, the server authenticates the preset downloader according to the authentication parameters in the resource path request, and returns the download address of the target model and the first check code corresponding to the target model to the preset downloader under the condition of successful authentication.
Optionally, the method further comprises:
generating a third check code corresponding to the resource of the target model;
under the condition that the first check code is consistent with the third check code, sending a message of successful downloading to the client; or the like, or, alternatively,
and under the condition that the first check code is inconsistent with the third check code, sending a message of download failure to the client.
Optionally, the downloading the resource of the target model from the server according to the download address further includes:
sending a resource downloading request carrying the authentication parameters to the server through the preset downloader;
and authenticating the preset downloader through the server according to the authentication parameters in the resource path request, and transmitting the resources of the target model to the preset downloader under the condition of successful authentication.
Optionally, the transmitting the resource of the target model to the preset downloader includes:
setting a timeout time in the process of transmitting the resources of the target model through the server; and under the condition that the server is disconnected with the preset downloader within the overtime, reconnecting the preset downloader according to a preset period, and continuously transmitting the resources of the target model to the preset downloader.
Optionally, the method further comprises:
receiving a downloading state of the resource of the target model sent to the preset downloader by the server; wherein the download status includes any one of:
when the resources of the target model start to be transmitted, setting the resources of the target model to be in a downloading state;
under the condition that the server is disconnected with the preset downloader within the overtime, setting the resources of the target model to be in a downloading failure state; or the like, or, alternatively,
and under the condition that the resources of the target model are transmitted, setting the resources of the target model to be in a cache state.
Optionally, the first check code, the second check code, and the third check code are MD5 values.
Optionally, the authentication parameter is used for the server to authenticate the validity of the resource request of the preset downloader.
An aspect of the embodiments of the present application further provides a model resource management system, which is applied to a client, where the client is deployed with a preset downloader, and the system includes:
the authentication parameter receiving module is used for receiving the authentication parameters sent by the server after logging in the client and displaying a model list interface; wherein the model list interface comprises a plurality of models;
a target model determination module for determining a target model from the plurality of models in response to a selection operation acting on the model list interface;
and the model resource acquisition module is used for acquiring the resources of the target model from the server according to the authentication parameters through the preset downloader so as to update the cached resources of the target model.
An aspect of the embodiments of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the model resource management method as described above.
An aspect of the embodiments of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so that when the computer program is executed by the at least one processor, the steps of the model resource management method as described above are implemented.
According to the model resource management method, the system, the equipment and the computer readable storage medium provided by the embodiment of the application, the preset downloader is deployed at the client, the model resources are updated and managed up and down in the preset downloader, a user can acquire the latest model resources on the premise of not restarting the application, the process and time for releasing the new version application are reduced, and the product using experience of the user is improved. And when the resources are updated, the resources of the selected updated target model are downloaded, and the binary files corresponding to the repeated project source codes and the resources corresponding to the unchanged part of the models in all the resource files do not need to be additionally downloaded, so that the time and the storage space from the development end to the user end can be saved, and the bandwidth resources for uploading and downloading can be saved.
Drawings
FIG. 1 schematically illustrates an application environment diagram of a model resource management method according to an embodiment of the present application;
FIG. 2 is a flow chart schematically illustrating a method for model resource management according to a first embodiment of the present application;
FIG. 3 schematically illustrates a timing diagram of a model resource update process;
FIG. 4 schematically shows a block diagram of a model resource management apparatus according to a second embodiment of the present application; and
fig. 5 schematically shows a hardware architecture diagram of a computer device suitable for implementing the model resource management method according to a third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the descriptions relating to "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
In the prior art, many scenes need to be applied to model resources, for example, some anchor broadcasters do not want to show real images in live broadcasting when performing network live broadcasting, in order to meet the use requirements of users, many live broadcasting platforms provide a function of performing live broadcasting by using virtual images, and each virtual image needs to create corresponding model resources. At present, in the process of developing or maintaining such projects, if there is a need to update the avatar resources, the normal update process is as follows: and uniformly packaging all the virtual image resources in the current project into a resource file by using an AssetBundle compression technology, adding a binary file compiled by a project source code, performing one-layer compression to generate an independent file, and finally pushing the file to a user for downloading and decompressing. However, if only a small portion of the avatar (e.g. the headset) needs to be updated, all the above processes need to be executed, so that the user needs to additionally download the binary file corresponding to the repeated item source code and the resource file corresponding to the unchanged portion of the avatar, which wastes unnecessary time and storage space from the development end to the user end, and also wastes bandwidth resources due to uploading and downloading.
In view of this, the present application aims to provide a model resource management method based on a preset downloader, where the preset downloader is deployed at a client, and after logging in the client, the preset downloader receives an authentication parameter sent by a server and displays a model list interface; wherein the model list interface comprises a plurality of models; determining a target model from the plurality of models in response to a selection operation acting on the model list interface; and acquiring the resources of the target model from the server according to the authentication parameters through the preset downloader so as to update the cached resources of the target model. Therefore, the model resources can be updated and managed up and down in the preset downloader, the user can acquire the latest model resources on the premise of not restarting the application, the process and time for releasing the new version application are reduced, and the product using experience of the user is improved. And when the resources are updated, the resources of the selected updated target model are downloaded, and the binary files corresponding to the repeated project source codes and the resources corresponding to the unchanged part of the models in all the resource files do not need to be additionally downloaded, so that the time and the storage space from the development end to the user end can be saved, and the bandwidth resources for uploading and downloading can be saved.
The present application provides various embodiments to further introduce model resource management schemes, with particular reference to the following.
In the description of the present application, it should be understood that the numerical references before the steps do not identify the order of performing the steps, but merely serve to facilitate the description of the present application and to distinguish each step, and therefore should not be construed as limiting the present application.
The following are explanations of terms of the present application:
unity is a game development engine.
AssetBundle is a resource compression standard specified by Unity.
Task is a wrapper class for asynchronous methods in programming languages.
Protocol-concept in the Unity engine. Multithreading-like operation can be performed on the main thread by coroutine.
Univibweb request: class of quadratic encapsulation for HTTP requests by Unity engine.
Fig. 1 schematically shows an environment application diagram according to an embodiment of the application. As shown in fig. 1:
computer device 10000 can be connected to client 30000 through network 20000.
The computer device 10000 can provide services, such as performing network debugging, or returning model resource management result data to the client 30000.
Computer device 10000 can be located in a data center, such as a single site, or distributed across different geographic locations (e.g., at multiple sites). Computer device 10000 can provide services via one or more networks 20000. The network 20000 includes various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like. The network 20000 may include physical links such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and the like. The network 20000 may include wireless links such as cellular links, satellite links, wi-Fi links, etc.
Computer device 10000 can be implemented by one or more computing nodes. One or more compute nodes may include virtualized compute instances. The virtualized compute instance may include an emulation of a virtual machine, such as a computer system, operating system, server, and the like. The computing node may load a virtual machine from the computing node based on the virtual image and/or other data defining the particular software (e.g., operating system, dedicated application, server) used for emulation. As the demand for different types of processing services changes, different virtual machines may be loaded and/or terminated on one or more compute nodes. A hypervisor may be implemented to manage the use of different virtual machines on the same compute node.
Client 30000 may be configured to access content and services of computer device 10000. Client 30000 can include any type of electronic device, such as a mobile device, a tablet device, a laptop computer, a workstation, a virtual reality device, a gaming device, a set-top box, a digital streaming media device, a vehicle terminal, a smart television, a set-top box, and so forth.
Client 30000 can output (e.g., display, render, present) model resource management result data, and the like, to a user.
The network commissioning scheme will be described below by way of various embodiments. The scheme may be implemented by the computer device 10000.
Example one
Fig. 2 schematically shows a flowchart of a model resource management method according to a first embodiment of the present application. Comprising steps S202-S206, wherein,
step S202, after logging in the client, receiving authentication parameters sent by a server, and displaying a model list interface; wherein the model list interface comprises a plurality of models;
the authentication parameter is used for the server to authenticate the validity of the resource request of the preset downloader, and the resource request may include a resource list request, a resource path request, a resource download request, and the like. The preset downloader needs to carry the authentication parameters when requesting resources from the server every time, and the server returns the currently requested resource file to the preset downloader after the server follows the authentication parameters.
Step S204, responding to the selection operation acted on the model list interface, and determining a target model from the plurality of models;
in this embodiment, the user may select a model to be updated through the model list interface. The device for installing the client is provided with a user data acquisition module, and can acquire the selection operation acted on the model list interface through the user data acquisition module and report the selection operation to the client, for example, the coordinate position used by the selection operation can be reported. The selection operation may include a single click, a double click, a long press, and the like. After receiving the selection operation acted on the model list interface, the client responds to the selection operation to determine the target model from the multiple models according to the coordinate position used by the selection operation.
In a specific implementation, default resources of each model, such as a cover page map, may be displayed on a model list interface, and when a user needs to update resources of a certain model, the user may select the model to download and update resources by clicking the default resources displayed on the model list interface or clicking a download control corresponding to the model.
Step S206, obtaining the resources of the target model from the server according to the authentication parameters through the preset downloader, so as to update the cached resources of the target model.
In this embodiment, the preset downloader is used to download the resource from the server, and perform the resource security check, the resource integrity check, the resource cache, and the like. Specifically, the preset downloader may include a three-layer architecture, which is a configuration layer, a download layer, and a cache layer, wherein the configuration layer: fixed parameters required for providing to the downloader, such as URL, client engine version id, client type id, resource cache directory, etc. Downloading a layer: and providing a plurality of interfaces for the downloader, such as interfaces of a download cover file of a Task return value, a download model file of a coroutine, a download model list, a download model address and the like, and downloading the required resources from the server by calling the interfaces, wherein the download model file maintains the download state of the cache layer and the resource suffix information of the cache layer. A cache layer: and providing an interface for caching and reading data for a downloader, wherein the caching layer can depend on a resource suffix caching layer and a response data structure layer, the resource suffix caching layer stores suffix information of resources, and the response data structure layer stores structure information of response data. The preset downloader stores references to three levels, acquires configuration data of a configuration layer during initialization, calls an interface of the download layer during downloading, finishes downloading or needs to check the integrity of resources, and acquires data in a cache layer for comparison during security.
In this embodiment, when the resource of the target model needs to be updated, the preset downloader calls the interface of the download layer, and the resource of the target model is obtained from the server according to the authentication parameter, so as to update the resource of the target model cached in the cache layer. Therefore, by using the preset downloader for downloading, the user can acquire the latest model resource on the premise of not restarting the application, and the process and time for releasing the new version application are reduced. And the resources of the updated target model are selected when the resources are updated, and the binary files corresponding to repeated project source codes and the resources corresponding to the part of the model which is not changed in all the resource files do not need to be additionally downloaded, so that the time and the storage space from the development end to the user end can be saved, and the bandwidth resources for uploading and downloading can be saved.
Several optional embodiments are provided below to optimize the model resource management method, specifically as follows:
in a preferred embodiment of the present application, after the step of presenting a model list interface, the method further includes the following steps:
sending a resource list request to the server according to the authentication parameters through the preset downloader; receiving model information returned by the server in response to the resource list request; wherein the model information comprises a first resource list; and determining that an updated model exists in the model list interface according to the first resource list, and displaying an update prompt message on the model list interface.
In this embodiment, it may be determined whether the model list interface needs to be updated, for example, to add, delete or replace a model, etc., to prompt the user that there is an update to the model list interface. Specifically, a resource list request carrying authentication parameters is sent to a server through a preset downloader, and model information returned by the server in response to the resource list request is received. The model information may include a first resource list corresponding to the model list interface, a download address of a default resource corresponding to each model in the first resource list, and information such as an ID and a version number of the model, which is not limited in this embodiment. The client can determine that an updated model exists in the model list interface according to the first resource list in the model information, and display an update prompt message on the model list interface.
In a preferred embodiment of the present application, the resource list request carries the authentication parameter, and the receiving of the model information returned by the server in response to the resource list request includes the following steps:
and after receiving the resource list request, the server authenticates the preset downloader according to the authentication parameters in the resource list request, and returns model information to the preset downloader under the condition of successful authentication.
In this embodiment, when the server returns data to the preset downloader, the server first needs to authenticate the preset downloader, and after receiving the resource list request, the server extracts authentication information in the resource list request, authenticates the preset downloader according to the authentication parameters, and returns model information to the preset downloader if the authentication is successful. If the authentication fails, the server does not return model information to the preset downloader.
In a preferred embodiment of the present application, the determining that there is an updated model in the model list interface according to the first resource list includes the following steps:
acquiring a cached second resource list; and comparing the first resource list with the second resource list to determine that an updated model exists in the model list interface.
In this embodiment, a second resource list corresponding to the model list interface may be obtained from a cache layer of a preset downloader, and the updated model in the model list interface is determined by comparing the first resource list with the second resource list.
In a preferred embodiment of the present application, the model information further includes a download address of a default resource corresponding to each model in the first resource list, and after the step of displaying the update prompting message on the model list interface, the method further includes the following steps:
downloading the default resources corresponding to each model from the server according to the downloading addresses of the default resources corresponding to each model through the preset downloader; and displaying the default resources corresponding to the models on the model list interface.
In this embodiment, the resource of each model may include two parts, one part is a default resource, the other part is a common resource, different resource update mechanisms are implemented for different types of model resources, and the default resource downloads the default resource corresponding to each model from the server through a preset downloader according to a download address of the default resource corresponding to each model directly after updating the model list; and displaying the default resources corresponding to each model on a model list interface.
In one example, the default resource may be a cover sheet corresponding to the model, and after the model list is updated, the cover sheet of the model displayed on the model list interface may be directly updated to display the latest cover sheet to the user.
It should be noted that, taking the avatar resources as an example: the method is characterized in that a default virtual image is required to be built in an APP, the purpose is that when the APP is started, even if a user does not purchase the APP, the default virtual image can be seen in a scene, extra purchase and downloading are not required, resources of the default virtual image are directly combined in an APP package and are issued to the user along with an APP version issuing process. If a new default image is to be replaced, the new portion of the resource needs to be replaced by downloading.
In a preferred embodiment of the present application, the step S206 may include the following steps:
sending a resource path request carrying the authentication parameters to the mobile terminal through the preset downloader; receiving a download address of the target model and a first check code corresponding to the target model, which are returned by the server in response to the resource path request; acquiring a cached second check code corresponding to the target model; and under the condition that the first check code is inconsistent with the second check code, downloading the resources of the target model from the server according to the downloading address so as to update the cached resources of the target model.
In this embodiment, when the resource of the target model needs to be updated, it is first checked whether the resource cached in the cache layer of the preset downloader is the latest resource. Sending a resource path request carrying authentication parameters through a preset downloader; receiving a download address of the target model returned by the server in response to the resource path request and a first check code corresponding to the target model; acquiring a cached second check code corresponding to the target model; and under the condition that the first check code is inconsistent with the second check code, downloading the resources of the target model from the server according to the downloading address so as to update the cached resources of the target model. It should be noted that, if the resource of the target model in the server is updated, or the resource cached in the cache layer of the preset downloader is damaged or replaced, etc., the first check code and the second check code may be inconsistent, and the resource of the target model needs to be downloaded from the server again.
In a preferred embodiment of the present application, the receiving a download address of the target model and a first check code corresponding to the target model, which are returned by the server in response to the resource path request, includes the following steps:
and after receiving the resource path request, the server authenticates the preset downloader according to the authentication parameters in the resource path request, and returns the download address of the target model and the first check code corresponding to the target model to the preset downloader under the condition of successful authentication.
In this embodiment, after receiving the resource path request, the server extracts authentication information in the resource path request, authenticates a preset downloader according to the authentication parameter, and returns a download address of the target model and a first check code corresponding to the target model to the preset downloader if the authentication is successful. If the authentication fails, the server does not return the downloading address of the target model and the first check code corresponding to the target model to the preset downloader.
In a preferred embodiment of the present application, the method may further comprise the steps of:
generating a third check code corresponding to the resource of the target model; under the condition that the first check code is consistent with the third check code, sending a message of successful downloading to the client; or, under the condition that the first check code is inconsistent with the third check code, sending a message of download failure to the client.
In this embodiment, after downloading the resources of the target model, the preset downloader may generate a third check code corresponding to the resources of the target model, for example, generate an MD5 value, by using a preset algorithm. Then, comparing the first check code and the third check code issued by the server, and sending a message of successful downloading to the client under the condition that the first check code is consistent with the third check code; or, under the condition that the first check code is inconsistent with the third check code, sending a message of download failure to the client. It should be noted that, if the resource file is lost or repeated or replaced during the downloading process, the verification may fail, and the resource of the target model needs to be downloaded again.
In a preferred embodiment of the present application, the downloading the resource of the target model from the server according to the download address further includes the following steps:
sending a resource downloading request carrying the authentication parameters to the server through the preset downloader; and authenticating the preset downloader through the server according to the authentication parameters in the resource path request, and transmitting the resources of the target model to the preset downloader under the condition of successful authentication.
In a preferred embodiment of the present application, the transmitting the resource of the target model to the preset downloader includes the following steps:
setting a timeout time in the process of transmitting the resources of the target model through the server; and under the condition that the server is disconnected with the preset downloader within the overtime, reconnecting the preset downloader according to a preset period, and continuously transmitting the resources of the target model to the preset downloader.
In this embodiment, the server may configure a disconnected reconnection mechanism, and by setting an timeout period, when the server is disconnected from the preset downloader within the timeout period, reconnect the preset downloader according to a preset period, and continue to transmit the resource of the target model to the preset downloader, where the preset period may be 5 seconds or 10 seconds, and this embodiment is not limited in particular.
In a preferred embodiment of the present application, the method further comprises the steps of:
receiving the downloading state of the resources of the target model sent to the preset downloader by the server; wherein the download status includes any one of: when the resources of the target model start to be transmitted, setting the resources of the target model to be in a downloading state; under the condition that the server is disconnected with a preset downloader within the overtime, setting the resources of the target model to be in a downloading failure state; or, under the condition that the resources of the target model are transmitted, setting the resources of the target model to be in a cache state.
In this embodiment, starting to download the resource of the model, the current downloading state of the model is changed into downloading, and meanwhile, a downloading model progress event is sent, if the network is disconnected, reconnection is continuously requested within the set timeout time timeout, if the connection is recovered within the timeout time, the downloading is continued, otherwise, the downloading model fails, and an event that the downloading model fails is sent. If the downloading is finished, the downloaded model id and the corresponding suffix are cached through the cache layer, the current state of the model is converted into the cache state, the cache local data is updated through the cache layer cache interface, and finally the event that the model is downloaded successfully is sent. The downloading progress event of the resources of the target model is updated in real time, and the downloading state of the resources of the target model is displayed on the model list interface, so that a user can follow the downloading progress of the resources of the target model conveniently.
In a preferred embodiment of the present application, the first check code, the second check code and the third check code are MD5 values.
In this embodiment, the check code of the resource may be an MD5 value, and a first check code, a second check code, and a third check code are generated through an MD5 encryption algorithm, where the first check code is issued to a preset downloader through a server and is compared with the second check code cached in the cache layer of the preset downloader for checking to determine whether the cached resource is the latest resource, and when the cached resource is not the latest resource, the required resource is further downloaded from the server, and after the downloading is completed, the third check code is generated according to the downloaded resource, and the first check code issued by the server is compared with the third check code for checking the integrity of the downloaded resource.
In this embodiment, different resource update download mechanisms are implemented according to different resource types, so that efficient management for different resource types is realized, the downloader with a three-layer structure comprising a data configuration layer, a download layer and a cache layer is configured, the capability of continuous downloading after weak networking and even network disconnection recovery is realized, the resource verification, consistency and the like are performed on the cache layer, the download hit rate is improved, illegal resources are eliminated, and the downward pressure of a server is relieved.
Only a small number of model resources are combined in the APP package, downloading is not performed through a preset downloader, the model resources are released to a user along with the APP version release process, independent version management is performed on other model resources, and the size of the APP package is effectively reduced. Model resources are updated and managed in a preset downloader in an up-down management mode, a user can acquire the latest preset downloader on the premise of not restarting application, the process and time for releasing a new version are reduced, and the product using experience of the user is improved.
To further describe the present embodiment, a scene in which an avatar is live is taken as an example for explanation. The steps are decomposed as follows:
1. the user logs in the client and the server issues Cookie to the client. The Cookie is an authentication parameter and is used for the server side to authenticate whether the request of the current downloader is legal or not when the downloader calls the interface of the server side each time. The client can be used for opening the live broadcast room and/or watching the video of the live broadcast room.
2. And the client pulls up the virtual live broadcasting tool, and at the moment, the virtual live broadcasting tool can acquire the Cookie of the client. The virtual live broadcasting tool is deployed in the client and used for a user to carry out live broadcasting through the virtual image.
3. And if the server successfully authenticates according to the Cookie, the server returns corresponding response data (comprising the model list, the model ID, the version number, the download address of the cover map and the like) to the downloader. At this time, the downloader may obtain the local cache data through the cache layer to compare, and confirm whether the model list has an update, for example, some models are newly added, some models are removed, and the like. And finally, updating the data cached locally in the cache layer of the downloader. Similarly, when the model list is updated, the server needs to authenticate according to the Cookie, and if the authentication fails, the model list is returned to be failed to update.
And after the model list is updated successfully, the server requests to download the cover art corresponding to the model according to the download address of the cover art corresponding to each Id model, and the cover art corresponding to the model is displayed in the model list interface.
4. When a certain Id model needs to be downloaded, the downloader calls the interface of the download model of the download layer, the Cookie is taken to request the download address and the MD5 value of the Id model from the server, and the server returns response data of the download model information after authentication is successful. And after receiving the response data, the downloader takes out the MD5 value of the response data in the downloaded model information, then takes out the corresponding MD5 value from the cache layer according to the ID of the model, compares the MD5 value with the MD5 value issued by the service, and directly takes out the resources of the model from the local cache if the MD5 value is consistent with the MD5 value issued by the service. If not, downloading the resource of the model from the server according to the download address of the model, then generating an MD5 value of the downloaded resource, comparing the generated MD5 value with the MD5 value issued by the server, if so, returning download success information, and if not, returning download failure information.
As an example, as shown in fig. 3, a timing diagram of a model resource updating process is provided, which specifically includes the following steps:
s1: the client passes the cookie to the virtual live tool.
S2: displaying a resource interface by the virtual live broadcasting tool, and transmitting the cookie to the downloader;
s3: the downloader requests a resource list from the server;
s4: the server checks the cookie, retrieves the version and sends the version to the engine;
s5: the server returns the resource list to the downloader;
s6: the downloader transmits the resource list to the virtual live broadcasting tool to be displayed on the resource interface;
s7: checking, caching and updating a resource list in a cache layer of the downloader;
s8: requesting to load a resource of a certain ID by the virtual live broadcasting tool;
s9: checking ID, checking ID version, checking ID integrity consistency and returning to a resource path by a cache layer of the downloader;
s10: the downloader requests the server to download the resource;
s11: the server returns the resource address and MD5 to the downloader;
s12: the downloader returns a corresponding resource path to the virtual live broadcasting tool;
s13: downloading the resource at the downloader, checking the integrity and the consistency, and caching the resource to a cache layer of the downloader.
Example two
Fig. 4 schematically illustrates a block diagram of a model resource management system according to a second embodiment of the present application, which may be partitioned into one or more program modules, stored in a storage medium, and executed by one or more processors to implement the second embodiment of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments that can perform specific functions, and the following description will specifically describe the functions of the program modules in the embodiments of the present application.
As shown in fig. 4, the model resource management system 400 is applied to a client, where the client is deployed with a preset downloader, and specifically includes the following modules:
an authentication parameter receiving module 410, configured to receive an authentication parameter sent by a server after logging in the client, and display a model list interface; wherein the model list interface comprises a plurality of models;
a target model determination module 420 for determining a target model from the plurality of models in response to a selection operation acting on the model list interface;
a model resource obtaining module 430, configured to obtain, by the preset downloader, the resource of the target model from the server according to the authentication parameter, so as to update the cached resource of the target model.
In a preferred embodiment of the present application, the method further comprises:
a resource list request sending module, configured to send a resource list request to the server according to the authentication parameter through the preset downloader;
the model information receiving module is used for receiving the model information returned by the server in response to the resource list request; wherein the model information comprises a first resource list;
and the update prompting module is used for determining that an updated model exists in the model list interface according to the first resource list and displaying an update prompting message on the model list interface.
In a preferred embodiment of the present application, the resource list request carries the authentication parameter, and the model information receiving module includes:
and the server authentication submodule is used for authenticating the preset downloader according to the authentication parameters in the resource list request after the server receives the resource list request, and returning model information to the preset downloader under the condition of successful authentication.
In a preferred embodiment of the present application, the update prompting module includes:
the list acquisition submodule is used for acquiring a cached second resource list;
and the list comparison submodule is used for comparing the first resource list with the second resource list so as to determine that an updated model exists in the model list interface.
In a preferred embodiment of the present application, the model information further includes a download address of a default resource corresponding to each model in the first resource list, and further includes:
the default resource downloading submodule is used for downloading the default resources corresponding to the models from the server according to the downloading addresses of the default resources corresponding to the models through the preset downloader;
and the default resource display sub-module is used for displaying the default resources corresponding to the models on the model list interface.
In a preferred embodiment of the present application, the model resource obtaining module 430 includes:
a resource path request sending submodule, configured to send a resource path request carrying the authentication parameter to the terminal through the preset downloader;
the download address receiving submodule is used for receiving a download address of the target model and a first check code corresponding to the target model, which are returned by the server in response to the resource path request;
the second check code acquisition submodule is used for acquiring a cached second check code corresponding to the target model;
and the resource downloading submodule is used for downloading the resources of the target model from the server according to the downloading address under the condition that the first check code is inconsistent with the second check code so as to update the cached resources of the target model.
In a preferred embodiment of the present application, the download address receiving submodule includes:
and the server authentication unit is used for authenticating the preset downloader according to the authentication parameters in the resource path request after the server receives the resource path request, and returning the download address of the target model and the first check code corresponding to the target model to the preset downloader under the condition of successful authentication.
In a preferred embodiment of the present application, the method further comprises:
the third check code generation submodule is used for generating a third check code corresponding to the resource of the target model;
the successful message sending sub-module is used for sending a message of successful downloading to the client under the condition that the first check code is consistent with the third check code; or the like, or, alternatively,
and the failure message sending submodule is used for sending a message of downloading failure to the client under the condition that the first check code is inconsistent with the third check code.
In a preferred embodiment of the present application, the model resource obtaining module 430 further includes:
the resource downloading request sending submodule is used for sending a resource downloading request carrying the authentication parameters to the server through the preset downloader;
and the server authentication submodule is used for authenticating the preset downloader according to the authentication parameters in the resource path request through the server and transmitting the resources of the target model to the preset downloader under the condition of successful authentication.
In a preferred embodiment of the present application, the server authentication sub-module includes:
the disconnected network reconnection module is used for setting overtime time in the process of transmitting the resources of the target model through the server; and under the condition that the server is disconnected from the preset downloader within the overtime, the preset downloader is reconnected according to a preset period, and the resources of the target model are continuously transmitted to the preset downloader.
In a preferred embodiment of the present application, the method further comprises:
a download state receiving module, configured to send a download state of a resource of the target model to the preset downloader through the server setting; wherein the download status includes any one of:
when the resources of the target model start to be transmitted, setting the resources of the target model to be in a downloading state;
under the condition that the server is disconnected with the preset downloader within the overtime, setting the resources of the target model to be in a download failure state; or the like, or a combination thereof,
and under the condition that the resources of the target model are transmitted, setting the resources of the target model to be in a cache state.
In a preferred embodiment of the present application, the first check code, the second check code and the third check code are MD5 values.
In a preferred embodiment of the present application, the authentication parameter is used for the server to authenticate the validity of the resource request of the preset downloader.
EXAMPLE III
Fig. 5 schematically shows a hardware architecture diagram of a computer device 10000 suitable for implementing a model resource management method according to a third embodiment of the present application. In this embodiment, the computer device 10000 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. For example, the server may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an FEN independent server, or a server cluster composed of a plurality of servers), and the like. As shown in fig. 5, computer device 10000 includes at least but is not limited to: the memory 10010, processor 10020, and network interface 10030 may be communicatively linked to each other via a system bus. Wherein:
the memory 10010 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 10010 may be an internal storage module of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 10000. Of course, the memory 10010 may also comprise both an internal memory module of the computer device 10000 and an external memory device thereof. In this embodiment, the memory 10010 is generally used for storing an operating system and various application software installed in the computer device 10000, such as program codes of the model resource management method. In addition, the memory 10010 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 10020, in some embodiments, can be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip. The processor 10020 is generally configured to control overall operations of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is configured to execute program codes stored in the memory 10010 or process data.
Network interface 10030 may comprise a wireless network interface or a wired network interface, and network interface 10030 is generally used to establish a communication link between computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal via a network, establish a data transmission channel and a communication link between the computer device 10000 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of mobile communication (GSM), wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), or Wi-Fi.
It should be noted that fig. 5 only shows a computer device having components 10010-10030, but it should be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the model resource management method stored in the memory 10010 can be further divided into one or more program modules and executed by one or more processors (in this embodiment, the processor 10020) to complete the embodiment of the present application.
Example four
Embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the model resource management method in the embodiments.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in a computer device, for example, the program code of the model resource management method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different from that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (16)

1. A model resource management method is applied to a client, wherein a preset downloader is deployed at the client, and the method comprises the following steps:
after logging in the client, receiving authentication parameters sent by a server, and displaying a model list interface; wherein the model list interface comprises a plurality of models;
determining a target model from the plurality of models in response to a selection operation acting on the model list interface;
and acquiring the resources of the target model from the server according to the authentication parameters through the preset downloader so as to update the cached resources of the target model.
2. The model resource management method of claim 1, after said step of presenting a model list interface, further comprising:
sending a resource list request to the server according to the authentication parameters through the preset downloader;
receiving model information returned by the server in response to the resource list request; wherein the model information comprises a first resource list;
and determining that an updated model exists in the model list interface according to the first resource list, and displaying an update prompt message on the model list interface.
3. The model resource management method of claim 2, wherein the resource list request carries the authentication parameter, and the receiving of the model information returned by the server in response to the resource list request comprises:
and after receiving the resource list request, the server authenticates the preset downloader according to the authentication parameters in the resource list request, and returns model information to the preset downloader under the condition of successful authentication.
4. The model resource management method of claim 2, wherein said determining from the first resource list that an updated model exists in the model list interface comprises:
acquiring a cached second resource list;
and comparing the first resource list with the second resource list to determine that an updated model exists in the model list interface.
5. The model resource management method according to claim 2, wherein the model information further includes a download address of a default resource corresponding to each model in the first resource list, and after the step of displaying the update prompt message on the model list interface, the method further includes:
downloading the default resources corresponding to each model from the server according to the downloading addresses of the default resources corresponding to each model through the preset downloader;
and displaying the default resources corresponding to the models on the model list interface.
6. The model resource management method of claim 1, wherein the obtaining, by the preset downloader, the resource of the target model from the server according to the authentication parameter comprises:
sending a resource path request carrying the authentication parameters to the mobile terminal through the preset downloader;
receiving a download address of the target model and a first check code corresponding to the target model, which are returned by the server in response to the resource path request;
acquiring a cached second check code corresponding to the target model;
and under the condition that the first check code is inconsistent with the second check code, downloading the resources of the target model from the server according to the downloading address so as to update the cached resources of the target model.
7. The method for managing model resources of claim 6, wherein the receiving the download address of the target model and the first check code corresponding to the target model returned by the server in response to the resource path request comprises:
and after receiving the resource path request, the server authenticates the preset downloader according to the authentication parameters in the resource path request, and returns the download address of the target model and the first check code corresponding to the target model to the preset downloader under the condition of successful authentication.
8. The model resource management method of claim 6, further comprising:
generating a third check code corresponding to the resource of the target model;
under the condition that the first check code is consistent with the third check code, sending a message of successful downloading to the client; or the like, or, alternatively,
and under the condition that the first check code is inconsistent with the third check code, sending a message of download failure to the client.
9. The model resource management method of claim 6, wherein the downloading the resource of the target model from the server according to the download address further comprises:
sending a resource downloading request carrying the authentication parameters to the server through the preset downloader;
and authenticating the preset downloader through the server according to the authentication parameters in the resource path request, and transmitting the resources of the target model to the preset downloader under the condition of successful authentication.
10. The model resource management method of claim 9, wherein said transmitting the resources of the target model to the preset downloader comprises:
setting a timeout time in the process of transmitting the resources of the target model through the server; and under the condition that the server is disconnected with the preset downloader within the overtime, reconnecting the preset downloader according to a preset period, and continuously transmitting the resources of the target model to the preset downloader.
11. The model resource management method of claim 10, further comprising:
receiving the downloading state of the resources of the target model sent to the preset downloader by the server; wherein the download status includes any one of:
when the resources of the target model start to be transmitted, setting the resources of the target model to be in a downloading state;
under the condition that the server is disconnected with the preset downloader within the overtime, setting the resources of the target model to be in a downloading failure state; or the like, or, alternatively,
and under the condition that the resources of the target model are transmitted, setting the resources of the target model to be in a cache state.
12. The model resource management method according to claim 6 or 8, wherein the first check code, the second check code and the third check code are MD5 values.
13. The model resource management method of claim 1, wherein the authentication parameter is used for the server to authenticate the validity of the resource request of the preset downloader.
14. A model resource management system is applied to a client, wherein a preset downloader is deployed at the client, and the system comprises:
the authentication parameter receiving module is used for receiving the authentication parameters sent by the server after logging in the client and displaying a model list interface; wherein the model list interface comprises a plurality of models;
a target model determination module for determining a target model from the plurality of models in response to a selection operation acting on the model list interface;
and the model resource acquisition module is used for acquiring the resources of the target model from the server according to the authentication parameters through the preset downloader so as to update the cached resources of the target model.
15. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, is adapted to carry out the steps of the model resource management method of any one of claims 1 to 13.
16. A computer-readable storage medium, having stored thereon a computer program, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the model resource management method of any one of claims 1 to 13.
CN202211453414.0A 2022-11-18 2022-11-18 Model resource management method and system Pending CN115766243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211453414.0A CN115766243A (en) 2022-11-18 2022-11-18 Model resource management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211453414.0A CN115766243A (en) 2022-11-18 2022-11-18 Model resource management method and system

Publications (1)

Publication Number Publication Date
CN115766243A true CN115766243A (en) 2023-03-07

Family

ID=85333183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211453414.0A Pending CN115766243A (en) 2022-11-18 2022-11-18 Model resource management method and system

Country Status (1)

Country Link
CN (1) CN115766243A (en)

Similar Documents

Publication Publication Date Title
CN106844137B (en) Server monitoring method and device
CN107346252B (en) Application updating method and device
US20120227032A1 (en) Method, apparatus, and system for invoking widget
CN109391673A (en) A kind of method, system and the terminal device of management update file
CN106911502A (en) A kind of upgrade method and system of intelligent home gateway equipment
CN113505354B (en) Data processing method, device and storage medium
CN114257551A (en) Distributed current limiting method and system and storage medium
CN112650520A (en) Ammeter upgrading method and system, intelligent ammeter and storage medium
CN110968331A (en) Method and device for running application program
CN112527397A (en) Method and device for modifying basic input output system options and computer equipment
CN113590169B (en) Application deployment method, application deployment system, and computer-readable storage medium
CN112714365A (en) Video playing method and system
CN114915565B (en) Network debugging method and system
CN115766243A (en) Model resource management method and system
KR100524588B1 (en) succeeding method of data in mobile
CN107948134B (en) Data interaction method and device
CN113746851B (en) Proxy system and method supporting real-time analysis of GRPC request
CN114912097A (en) Certificate verification method and device, electronic equipment and storage medium
CN107783837B (en) Method and device for performing storage expansion and electronic equipment
CN112973129B (en) Game deployment method, game deployment device, electronic equipment and computer readable storage medium
CN113986423A (en) Bullet frame display method and system, storage medium and terminal equipment
CN104348646A (en) Configuration data processing method, device and system
CN113064616A (en) Software updating method and device, storage medium and electronic equipment
CN112464225A (en) Request processing method, request processing device and computer readable storage medium
CN108134683B (en) Terminal and bus architecture implementation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination