Material acquisition method and device, computer equipment and storage medium

By receiving material loading requests on the client and querying cached materials from cache resources, the problem of relying on technical personnel's experience and low degree of automation in the existing technology is solved, and the high availability and stability of material services are achieved.

CN120020749APending Publication Date: 2025-05-20BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311541205.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

When handling software failures, the prior art relies on the experience of technicians and has low degree of automation, making it difficult to effectively avoid the situation where material services are unavailable.

Method used

By receiving the client's material loading request, obtaining matching material metadata, generating a material list, and when an exception occurs, querying cached materials from the cache resources to replace the originally obtained materials and reducing the client's material service failure sense.

Benefits of technology

It greatly reduces the unavailability time of material services, reduces the unavailability of material services, and improves the stability of material distribution on the server side.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020749A_ABST
    Figure CN120020749A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a material acquisition method and device, computer equipment and a storage medium. The method comprises the following steps: receiving a material loading request sent by a client; material metadata matched with the material loading request is obtained, materials corresponding to the material metadata are called to generate a material list, and the material list comprises all the materials obtained through calling; judging whether materials in the material list are abnormal or not, if yes, constructing material query information according to the material loading request, and obtaining cached materials matched with the material query information; and feeding back the cached materials to the client.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and particularly to a method and apparatus for obtaining materials, a computer device, and a storage medium. Background Art

[0002] The distribution of materials refers to the act of distributing required pictures, videos, audios, etc. from a server to a client via a network when making multimedia content.

[0003] Currently, when a software - caused fault occurs, a technician issues a control instruction on a pre - plan control platform. When the server program receives the control instruction, different degradation operations will be performed to soften possible fault problems. However, the control instruction issuance and control by technicians rely on technicians' experience and have a low degree of automation, making it difficult to effectively avoid the situation where the material service is unavailable. Summary of the Invention

[0004] In view of this, embodiments of the present disclosure provide a method and apparatus for obtaining materials, a computer device, and a storage medium to solve the problem of difficulty in effectively avoiding the unavailability of the material service.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for obtaining materials, including: receiving a material loading request sent by a client; obtaining material metadata matching the material loading request, and invoking the material corresponding to the material metadata to generate a material list, where the material list includes each material obtained by the invocation; determining whether there is an abnormality in the materials in the material list, if there is an abnormality, constructing material query information according to the material loading request, and obtaining cached materials matching the material query information; and feeding back the cached materials to the client.

[0006] The method for obtaining materials provided by the embodiments of the present disclosure obtains matching material metadata according to the material loading request sent by the client to invoke the corresponding materials and generate a material list. When an abnormality occurs, material query information can be constructed according to the material loading request to query matching cached materials from a database. Thus, when the material service is unavailable, the cached materials in the cache resource are used to replace the materials that should be obtained by the material loading request, thereby reducing the sense of material service failure generated by the client, greatly reducing the unavailable duration of the material service, and effectively reducing the occurrence of the unavailable situation of the material service.

[0007] Second aspect, embodiments of the present disclosure provide a material acquisition device, including: a request receiving unit configured to receive a material loading request sent by a client; a material list generating unit configured to obtain material metadata matching the material loading request, and call materials corresponding to the material metadata to generate a material list, where the material list includes each of the called materials; a judgment unit configured to judge whether there is an abnormality in the materials in the material list; a cached material acquisition unit configured to, if there is an abnormality in the materials in the material list, construct material query information according to the material loading request, and obtain cached materials matching the material query information; and a material feedback unit configured to feedback the cached materials to the client.

[0008] Third aspect, embodiments of the present disclosure provide a computer device, including: a memory and a processor, which are communicatively connected to each other, where computer instructions are stored in the memory, and the processor executes the computer instructions to execute the material acquisition method according to the first aspect or any corresponding implementation manner thereof.

[0009] Fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the material acquisition method according to the first aspect or any corresponding implementation manner thereof. Description of the Drawings

[0010] In order to more clearly illustrate the specific implementation manners of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings required to be used in the description of the specific implementation manners or the prior art. Obviously, the following drawings are some implementation manners of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0011] Figure 1 It is a schematic diagram of the specific implementation of material acquisition according to some embodiments of the present disclosure;

[0012] Figure 2 It is a flowchart of the material acquisition method according to some embodiments of the present disclosure;

[0013] Figure 3 It is a flowchart of another material acquisition method according to some embodiments of the present disclosure;

[0014] Figure 4 It is a flowchart of yet another material acquisition method according to some embodiments of the present disclosure;

[0015] Figure 5 It is a structural block diagram of the material acquisition device according to an embodiment of the present disclosure;

[0016] Figure 6This is a schematic diagram of the hardware structure of the computer device in the embodiment of the present disclosure. Specific implementation method

[0017] To make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be described clearly and completely in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0018] When a fault occurs due to software reasons, the technician will issue a control command on the emergency plan control platform. When the server program receives the control command, it will perform different downgrade operations to soften the possible fault problem. The emergency plans used in related technologies may include:

[0019] (1) Computer room traffic switching plan: used to switch all traffic in the data center to other computer rooms. This plan can be used to deal with possible data center-level failures, such as a data center losing communication as a whole.

[0020] (2) Check update plan: used to inform the client to use the cache first if there is one, and not to try to update data through the server. This plan can be used to deal with high server load.

[0021] However, the execution of each plan requires R&D decision-making and manual activation, which is highly dependent on the experience of technicians. Different technicians grasp different opportunities, resulting in different stop-loss processes, which is not conducive to standardization; manual activation is limited by the time and space constraints of R&D, and there may be a state where the technicians do not respond when the plan should be executed, affecting the speed of stop-loss; different plans solve specific problems in different links, and there is a lack of overall plans. Therefore, the plans in the relevant technology rely on the experience of technicians, have a low degree of automation, and it is difficult to effectively avoid the situation where material services are unavailable.

[0022] On the premise of ensuring that the user experience is not damaged, how to overcome the problems of heavy reliance on subjective experience, low degree of automation, and incomplete coverage of emergency plans needs to be solved urgently.

[0023] Based on this, in the process of the user's normal use of the material service, the list of material resources successfully obtained by the user is cached in the Abase database of the storage system. By introducing a message queue (MQ) and function as a service (FaaS), the list of successfully obtained material resources is cached. When possible failures or emptiness are found at the service exit, the cached resources are used to replace the resources that should have been obtained, thereby reducing the situation where the material service is unavailable and avoiding the problem that the client obtains empty resources due to configuration errors, failures, etc. It realizes the automation and comprehensive coverage of material distribution, and greatly reduces the situation where the material service is unavailable, improving the stability of the server to distribute materials.

[0024] According to an embodiment of the present disclosure, an embodiment of a method for obtaining materials is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0025] In this embodiment, a method for obtaining materials is provided, which can be used in computer devices such as computers, servers, etc. Taking a computer device as a material server as an example, as Figure 1 shown, the material server is communicatively connected to the client and other downstream servers. Among them, the client is used to send a material request to the material server; the material server is used to send material dependency request information to the downstream server according to the material request; the downstream server can feedback corresponding material meta-information according to the material dependency request information sent by the material server; the material server can generate materials according to the material meta-information to send the generated materials to the client, and at the same time write the generated materials into the Abase database of the KV storage system. When there is a material exception, the material server can retrieve the corresponding materials from the Abase database and return them to the client.

[0026] Figure 2 is a flowchart of the method for obtaining materials according to an embodiment of the present disclosure. As Figure 2 shown, the process includes the following steps:

[0027] Step S101, receive a material loading request sent by the client.

[0028] The material loading request is a request triggered when the user requests materials through the client, such as a special effect loading request, a sticker loading request, a personalized text loading request, etc. Specifically, the material loading request carries a variety of information, such as region, top-level material classification, secondary material classification, material calling method, and client identifier, etc.

[0029] The client is communicatively connected to the material server. After the client responds to the material loading request triggered by the user, it sends the material loading request to the material server. Correspondingly, the material server can receive the material loading request sent by the client.

[0030] Step S102: Obtain the material metadata that matches the material loading request, and call the materials corresponding to the material metadata to generate a material list, where the material list includes each material obtained by the call.

[0031] Material metadata is information describing the attributes and characteristics of materials. Specifically, it can include basic information such as the keyword, title, author, creation date, file format, file size of the material, as well as detailed descriptions of the content and characteristics of the material, such as tags, classifications, abstracts, relevance, etc. The material metadata is stored in the database or media storage device of the downstream server. The downstream server can understand and manage the materials through the material metadata to facilitate material retrieval and organization.

[0032] The material server sends a material request to the downstream server according to the material loading request it receives. The downstream server can receive and parse the material request, retrieve the material metadata that matches it, and feedback it to the material server. Correspondingly, the material server can obtain the material metadata and assemble each material according to the material metadata to obtain each material and the material list composed of each material.

[0033] Step S103: Determine whether there are any abnormalities in the materials in the material list.

[0034] After obtaining the material list, perform anomaly detection on each material in the material list to determine whether there are any abnormalities in the materials in the material list. When it is determined that there are abnormalities in the materials in the material list, execute step S104; otherwise, perform other operations. Among them, other operations can be to feedback each material in the material list to the client, or to cache each material in the material list. Of course, it can also cache each material while feedbacking each material in the material list to the client. The other operations are not limited here.

[0035] Step S104: If there are abnormalities in the materials in the material list, construct material query information according to the material loading request, and obtain the cached materials that match the material query information.

[0036] The material query information is used to query the materials corresponding to the material loading request. Specifically, the material query information is the key information (key) constructed by extracting the fields required for material query from the material loading request.

[0037] The cached material is the material that has been pre-cached in Abase and matches the material loading request, and the cached material is used as the value, which is stored in the form of Key-Value. If there is an abnormality in the materials in the material list, combined with the material loading request, unique material query information can be constructed, and then the material query information can uniquely determine the cached material that matches it.

[0038] Step S105, feedback the cached material to the client.

[0039] The cached material is the material that matches the material loading request. After the material server obtains the cached material, the abnormal material result of this material loading request is replaced with the cached material, and the cached material is fed back to the client so that the client can obtain the material it requests, avoiding the situation where it is difficult for the client to obtain material resources due to material service exceptions.

[0040] The material acquisition method provided in this embodiment obtains the matching material elements according to the material loading request sent by the client to call the corresponding materials, generates a material list, and when an abnormality occurs, the material query information can be constructed according to the material loading request to query the matching cached material from the database. Thus, when the material service is unavailable, the cached material in the cache resource is used to replace the material that the material loading request should have obtained, thereby reducing the sense of material service failure generated by the client, greatly reducing the unavailable duration of the material service, and effectively reducing the situation where the material service becomes unavailable.

[0041] In this embodiment, a material acquisition method is provided, which can be used in computer devices such as computers and servers. In the embodiments of the present disclosure, the computer device is taken as an example of the material server. Figure 3 is the flowchart of the material acquisition method according to the embodiments of the present disclosure, as Figure 3 shown, this process includes the following steps:

[0042] Step S201, receive the material loading request sent by the client. For detailed description, refer to the relevant description corresponding to the above embodiment, which will not be elaborated here.

[0043] Step S202, obtain the material metadata that matches the material loading request, and call the material corresponding to the material metadata to generate a material list, and the material list includes each material obtained by the call. For detailed description, refer to the relevant description corresponding to the above embodiment, which will not be elaborated here.

[0044] Step S203, determine whether there is an abnormality in the materials in the material list.

[0045] Specifically, the above step S203 may include:

[0046] Step S2031, determine whether the number of materials included in the material list is less than or equal to a specified quantity threshold.

[0047] Step S2032, when the number of materials included in the material list is less than or equal to the specified quantity threshold, determine that the materials in the material list are abnormal.

[0048] The specified quantity threshold is the quantity of materials that should be requested by the material loading request. The quantity of materials is the actual quantity of materials existing in the material list. Compare this quantity of materials with the specified quantity threshold to determine whether the number of materials included in the material list is less than or equal to the specified quantity threshold. When the number of materials included in the material list is less than or equal to the specified quantity threshold, it means that the materials obtained in the material list cannot match the material loading request, and at this time, it is determined that the materials in the material list are abnormal; otherwise, it is determined that the materials in the material list are not abnormal.

[0049] Step S2033, determine whether the material list includes a status code indicating a call exception.

[0050] Step S2034, when the material list includes a status code indicating a call exception, determine that the materials in the material list are abnormal.

[0051] The status code of the call exception is a status identifier used to indicate an exception that occurs during the material call process. Among them, this status code can include a network error status code, a configuration error status code, a server failure status code, etc., which are not specifically limited here.

[0052] After obtaining the material list, detect whether there is a status code of a call exception in the material list. When the material list includes a status code indicating a call exception, it means that the materials obtained in the material list are abnormal; otherwise, it is determined that the materials in the material list are not abnormal.

[0053] Step S204, if the materials in the material list are abnormal, construct material query information according to the material loading request, and obtain the cached materials that match the material query information.

[0054] Specifically, the above step S204 may include:

[0055] Step S2041, extract the field content of each specified field limited by the preset rules from the material loading request, and construct the extracted field content into material query information.

[0056] Among them, the field content includes at least one of the following: fixed prefix, regional identifier, material classification information, request method, device identifier.

[0057] The preset rule is a pre-set protocol for constructing material query information. The material loading request carries multiple fields. When it is determined that there is an abnormality in the materials in the material list, in order to be able to feedback the matching materials to the client, it is necessary to parse the fields carried by the material loading request to reconstruct the material query information to retrieve the matching cached materials from the materials cached in the Abase database.

[0058] Specifically, the preset rule can be: {header_prefix}-{region}-{panel}-{category}-{1method}-{DeviceId}. Among them, header_prefix is a fixed prefix used to avoid conflicts with other key-value pairs in the KV database; region is a region identifier used to identify the region where the client is currently located and to distinguish some services related to the region; panel is the material panel used to represent the top-level classification to which the material belongs, such as special effects, stickers, personalized text, etc.; category is the secondary classification of the material. For example, the secondary classification of special effects can include beauty special effects, latest special effects, most popular special effects, etc.; method represents the specific request method required for the material; deviceId represents the device identifier used to uniquely identify a device, such as a mobile phone, tablet computer, computer, etc. Different devices have different corresponding device identifiers.

[0059] The material server extracts each required specified field and the field content corresponding to each specified field from the material loading request in combination with the preset rule, and then assembles the field content corresponding to each specified field to generate material query information.

[0060] Step S2042, obtain the cached materials that match the material query information.

[0061] Query the Abase database according to the determined material query information to determine the cached materials corresponding to the material query information.

[0062] Step S205, feedback the cached materials to the client. For the detailed description, please refer to the relevant description corresponding to the above embodiment, which will not be elaborated here.

[0063] The material acquisition method provided in this embodiment determines whether there is an abnormality in the materials in the material list by detecting whether the number of materials in the material list meets the specified quantity threshold or detecting whether there is a status code indicating a call exception in the material list, so as to avoid feedback of abnormal materials to the client and cause a poor user experience. When it is determined that there is an abnormality in the material list, the field content of the specified field is extracted from the material loading request in combination with the preset rules, so as to construct material query information according to the extracted field content of each field. In this way, it can be ensured that the cached materials queried from the cache resources match the material loading request, meet the materials required by different material loading requests, realize the automatic distribution of different materials, without the intervention of technicians, overcome the dependence on the experience of technicians, and improve the stability of the material service distribution.

[0064] In some optional implementation manners, such as Figure 4 shown, the above method may further include:

[0065] Step S206, if there is no abnormality in the materials in the material list, generate cache data corresponding to the material list.

[0066] The cache data is each material cached in the Abase database. A key-value pair is formed between the material query information and the cache data, that is, taking the material query information as the key (Key), then the cache data is the value (Value) corresponding to the material query information.

[0067] When it is determined that there is no abnormality in the material list, a non-abnormal material list is sent to the Abase database, and each material in the material list is written into the Abase database to cache the materials corresponding to the current material loading request, and obtain the cache data corresponding to each cache in the material list.

[0068] Specifically, the above step S206 may include:

[0069] Step S2061, extract the field content of each specified field limited by the preset rules from the material loading request, and construct the extracted field content of each field into header information.

[0070] The cache data is composed of header information and a message body. The field content of each field in the header information is the same as the field content of each field in the material query information. After extracting the field content of each specified field from the material loading request according to the preset rules, each specified field and the field content of each specified field are encapsulated into the header information of the cache data. Thus, when querying the cache data according to the material query information, pre-matching can be performed on the header information. If the header information does not match the material query information, it can be determined that there is a mismatch between the cache data and the material query information, and there is no need to further parse the message body content of the cache data, which improves the material query speed.

[0071] Step S2062: Construct the data of each material included in the material list into a message body according to a preset data model.

[0072] Among them, the preset data model is a data model preset for constructing the message body. Specifically, the preset data model includes at least one of a panel model, a classification model, and a special effect model. Among them, the panel model stores information such as panel copywriting required for the top-level classification of materials, material entry icons, material tags, and material update time; the classification model stores information such as IDs required for the secondary classification of materials, material names, material icons, material special effect lists, and classification identifiers; the special effect model stores information such as material special effect names, versions compatible with the material special effects, platforms supported by the material special effects, download addresses of material special effect packages, material special effect icons, and associated relationships of the material special effects.

[0073] Perform serialization and deserialization processing on each material included in the material list according to the preset data model, and perform compression processing on the serialization result using a compression algorithm with a fast compression rate and decompression rate during serialization and deserialization processing, and perform decompression processing on the already compressed serialization result during deserialization, and perform deserialization processing after the decompression processing is completed to obtain the message body corresponding to each material.

[0074] In a specific example, for the panel model, classification model, and special effect model in the message body, use the Proto3 protocol for serialization and deserialization. In order to read and decompress the complete message body from the cache as soon as possible, the Lz4 compression algorithm can be selected to balance the compression rate and decompression speed.

[0075] Step S2063: Generate cache data including header information and a message body.

[0076] Encapsulate the header message and the message body according to a preset encapsulation format to generate cache data corresponding to each material.

[0077] In the above embodiment, extract the field content of the specified field from the material loading request in combination with the preset rules, construct the header information according to the extracted field content, and construct the message body for the data of each material. Thus, construct the cache data according to the header information and the message body, which is convenient for subsequent retrieval of the cache data and is beneficial to improving the retrieval effect and retrieval accuracy.

[0078] Step S207: Write the cache data into a preset message queue.

[0079] Among them, the cache data in the preset message queue is written into the database after being processed by a preset function service.

[0080] The preset function service is a pre-set service for implementing function writing and function deployment. Here, a function is a code snippet that can implement specific business logic. Specifically, the preset function service can be Function as a Service (FaaS). As a cloud computing service model, FaaS can provide tasks such as managing the execution environment of functions, automatic scaling, and load balancing, allowing developers to write and deploy functions in an event-driven manner without managing the underlying infrastructure and servers.

[0081] The preset message queue is a pre-set message queue for storing the cache data corresponding to each material. When it is determined that there is no abnormality in the materials in the material list, in order to ensure the cache speed of the materials, first write the cache data corresponding to each material into the message queue BMQ, and then process the cache data in the message queue BMQ through the preset function service, and write the processed cache data into the Abase database.

[0082] The material acquisition method provided in this embodiment, when there is no abnormality in the materials in the material list, generates cache data corresponding to the material list, and writes the cache data into the database through the message queue and the preset function service, thus avoiding the impact on the normal distribution of materials. By using the message queue and the preset function service, the cache is prevented from affecting the normal material distribution path, thus ensuring the effective decoupling of the cache mechanism and the material distribution link.

[0083] Specifically, the step of writing the cache data in the preset message queue into the database after being processed by the preset function service includes:

[0084] Step a1, the preset function service reads the cache data from the preset message queue and parses the header information in the cache data.

[0085] Step a2, the preset function service generates a cache key according to the header information, and writes the cache data as the cache value associated with the cache key into the database.

[0086] The cache data written in the preset message queue is only the material data corresponding to the material. That is to say, only the Value value is written in the preset message queue, and the key value matching the Value value is not written. When the preset function service writes the cache data into the database, it needs to parse the corresponding header information from the cache data, and assemble the fields in the header information according to the preset rules to generate a cache key corresponding to the header information. Then, the cache data is used as the cache value corresponding to the cache key, and the cache key and the cache data are written into the database in the form of Key-Value, realizing the associated storage of the Value value and the Key value.

[0087] The material acquisition method provided in this embodiment parses the header information in the cache data, generates a cache key in combination with the header information, and thus uses the cache data as the cache value, associatively stores the cache key and the cache value, which facilitates the subsequent effective query of the cache data from the database and ensures the accuracy of the materials fed back to the client.

[0088] In some optional embodiment modes, the steps of writing the cache data as the cache value associated with the cache key into the database include:

[0089] Step b1, match the cache key with the keys already recorded in the database.

[0090] Step b2, if there is a target key in the database that matches the cache key, write the cache data as the cache value of the target key into the database.

[0091] Step b3, if there is no target key in the database that matches the cache key, create the cache key in the database and write the cache data as the cache value associated with the cache key into the database.

[0092] Since the database does not only serve materials, but stores data for multiple services, in order to avoid data caching confusion, the keys corresponding to different services are different, that is, there is a corresponding key format for the material service to distinguish it from other services.

[0093] When generating the cache key and writing the cache data into the database, match the generated cache key with the existing keys in the database to determine whether there is a target key in the database that matches the cache key. When there is a target key in the database that matches the cache key, at this time, the cache data can be directly written as the cache value of the target key into the database. When there is no key in the database that matches the cache key, it is necessary to create the cache key in the database and write the cache data as the cache value associated with the cache key into the database.

[0094] The material acquisition method provided in this embodiment matches the cache key with the keys already recorded in the database. When there is a target key that matches the cache key, the cache data can be directly used as the cache value of the target key, thus avoiding the caching confusion of the material data caused by the existence of the same key. When there is no target key that matches the cache key, create a cache key to write the cache data, which is convenient for subsequent querying and obtaining the cached materials in combination with the cache key.

[0095] In this embodiment, a material acquisition device is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0096] This embodiment provides a material acquisition device, as Figure 5 shown, including:

[0097] A request receiving unit 301, configured to receive a material loading request sent by a client.

[0098] A material list generating unit 302, configured to obtain material metadata matching the material loading request, and call the materials corresponding to the material metadata to generate a material list, where the material list includes each material obtained by the call.

[0099] A judgment unit 303, configured to judge whether there is an abnormality in the materials in the material list.

[0100] A cached material acquisition unit 304, configured to, if there is an abnormality in the materials in the material list, construct material query information according to the material loading request, and obtain cached materials matching the material query information.

[0101] A material feedback unit 305, configured to feedback the cached materials to the client.

[0102] In some alternative embodiment manners, the above-mentioned judgment unit 303 may include:

[0103] A first determination subunit, configured to determine that there is an abnormality in the materials in the material list when the number of materials included in the material list is less than or equal to a specified quantity threshold.

[0104] A second determination subunit, configured to determine that there is an abnormality in the materials in the material list when a status code indicating a call abnormality is included in the material list.

[0105] In some alternative embodiment manners, the above-mentioned cached material acquisition unit 304 may include:

[0106] A query information construction subunit, configured to extract the field content of each specified field limited by a preset rule from the material loading request, and construct the extracted field content into material query information, where the field content includes at least one of the following: a fixed prefix, a region identifier, material classification information, a request method, and a device identifier.

[0107] In some alternative embodiment manners, the above-mentioned device may further include:

[0108] A cache data generation unit, configured to generate cache data corresponding to a material list if there is no abnormality in the materials in the material list.

[0109] A writing unit, configured to write the cache data into a preset message queue, wherein the cache data in the preset message queue is written into a database after being processed by a preset function service.

[0110] In some alternative embodiment manners, the above cache data generation unit may include:

[0111] A header information extraction subunit, configured to extract the field contents of each specified field defined by a preset rule from a material loading request, and construct the extracted field contents into header information.

[0112] A message body construction subunit, configured to construct the data of each material included in the material list into a message body according to a preset data model, wherein the preset data model includes at least one of a panel model, a classification model, and a special effect model.

[0113] A generation subunit, configured to generate cache data including the header information and the message body.

[0114] In some alternative embodiment manners, the above writing unit may include:

[0115] An analysis subunit, configured to read the cache data from the preset message queue by the preset function service and analyze the header information in the cache data.

[0116] A writing subunit, configured to generate a cache key by the preset function service according to the header information, and write the cache data as a cache value associated with the cache key into the database.

[0117] In some alternative embodiment manners, the above writing subunit is specifically further configured to: match the cache key with the keys already recorded in the database; if there is a target key matching the cache key in the database, write the cache data as the cache value of the target key into the database; if there is no target key matching the cache key in the database, create a cache key in the database, and write the cache data as a cache value associated with the cache key into the database.

[0118] The further function descriptions of the above respective units and respective subunits are the same as those in the corresponding above embodiments, and will not be elaborated herein.

[0119] The material acquisition device in this embodiment is presented in the form of functional units, and the units herein refer to ASIC circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0120] The material acquisition device provided in this embodiment obtains matching material elements according to the material loading request sent by the client to call the corresponding materials, generates a material list, and when an exception occurs, it can construct material query information according to the material loading request to query the matching cached materials from the database. Thus, when the material service is unavailable, the cached materials in the cache resource are used to replace the materials that should be obtained by the material loading request, thereby reducing the sense of material service failure generated by the client, greatly reducing the unavailable duration of the material service, and effectively reducing the situation where the material service becomes unavailable.

[0121] This embodiment of the disclosure also provides a computer device having the above Figure 5 shown material acquisition device.

[0122] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present disclosure. As Figure 6 shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 6 In

[0123] FIG. 16, one processor 10 is taken as an example.

[0124] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0125] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely disposed relative to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above-mentioned types of memories.

[0127] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0128] Embodiments of the present disclosure also provide a computer-readable storage medium. The methods according to the embodiments of the present disclosure may be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and to be stored in a local storage medium, so that the methods described herein can be stored in such software processes on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium may further include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods shown in the above embodiments are implemented.

[0129] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A material acquisition method, characterized in that: The method comprises: Receive the material loading request sent by the client; Acquire material metadata matching the material loading request, and call the material corresponding to the material metadata to generate a material list, wherein the material list includes each material obtained by calling; Determine whether there is any abnormality in the material in the material list; If there is an abnormality in the material in the material list, construct material query information according to the material loading request, and obtain cached materials matching the material query information; The cached material is fed back to the client.

2. The method according to claim 1, characterized in that: The abnormalities of the materials in the material list include: The number of materials included in the material list is less than or equal to a specified number threshold; or, The material list includes a status code indicating a call exception.

3. The method according to claim 1, characterized in that Constructing material query information according to the material loading request includes: Extracting the field content of each designated field defined by a preset rule from the material loading request, and constructing the extracted field content into material query information; The field content includes at least one of the following: Fixed prefix, region identifier, material classification information, request method, and device identifier.

4. The method according to claim 1, characterized in that The method further comprises: If there is no abnormality in the material in the material list, generating cache data corresponding to the material list; The cached data is written into a preset message queue, and the cached data in the preset message queue is written into a database after being processed by a preset function service.

5. The method according to claim 4, characterized in that The cache data corresponding to the material list is generated including: Extracting the field content of each designated field defined by a preset rule from the material loading request, and constructing the extracted field content into header information; Constructing the data of each material included in the material list into a message body according to a preset data model, wherein the preset data model includes at least one of a panel model, a classification model, and a special effect model; Generate cache data including the header information and the message body.

6. The method according to claim 4 or 5, characterized in that: The cached data in the preset message queue is processed by the preset function service and written into the database, including: The preset function service reads the cache data from the preset message queue and parses the header information in the cache data; The preset function service generates a cache key according to the header information, and writes the cache data into a database as a cache value associated with the cache key.

7. The method according to claim 6, characterized in that Writing the cache data as a cache value associated with the cache key into a database includes: Matching the cache key with the recorded key in the database; If a target key matching the cache key exists in the database, the cache data is written into the database as a cache value of the target key; If the target key matching the cache key does not exist in the database, the cache key is created in the database, and the cache data is written into the database as a cache value associated with the cache key.

8. A material acquisition device, characterized in that: The device comprises: A request receiving unit, used to receive a material loading request sent by a client; A material list generating unit, configured to obtain material metadata matching the material loading request, and call materials corresponding to the material metadata to generate a material list, wherein the material list includes each material obtained by calling; A judging unit, used for judging whether there is any abnormality in the material in the material list; a cached material acquisition unit, configured to construct material query information according to the material loading request if there is an abnormality in the material in the material list, and acquire cached materials matching the material query information; A material feedback unit is used to feed back the cached material to the client.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the material acquisition method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the material acquisition method according to any one of claims 1 to 7.