Material acquisition method and apparatus, computer device and storage medium

By caching when users successfully obtain material list resources, and using message queues and functions as services to replace material when service failures, the problem of relying on technical personnel in the existing technology is solved, and the automation and stability of material services is improved.

WO2025103055A1PCT designated stage expired Publication Date: 2025-05-22BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/125206
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-17
Filing Date
2024-10-16
Publication Date
2025-05-22

AI Technical Summary

Technical Problem

When handling software failures, the prior art relies on the experience of technicians and has low degree of automation, which frequently occurs when material services are unavailable and lacks overall plans.

Method used

When the user successfully obtains the material list resource, it caches it to the Abase database of the storage system, and introduces message queues (MQ) and function-as-a-service (FaaS), use cache resources to replace the material that should be obtained in the event of a service failure, reducing the unavailability time of the material service.

Benefits of technology

It realizes the automation and comprehensive coverage of material services, significantly reduces the unavailability time of material services, reduces the unavailability situation, and improves the stability of material distribution on the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024125206_22052025_PF_FP_ABST
    Figure CN2024125206_22052025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computers. Disclosed are a material acquisition method and apparatus, a computer device and a storage medium. The method comprises: receiving a material loading request sent by a client; acquiring material metadata matching the material loading request, and calling materials corresponding to the material metadata to generate a material list, wherein the material list comprises all the called materials; determining whether the materials in the material list are abnormal or not, if the materials in the material list are abnormal, constructing material query information on the basis of the material loading request, and acquiring cached materials matching 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

Material acquisition method, device, computer equipment and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of Chinese Patent Application No. 202311541205.6, filed on November 17, 2023. The entire teachings of the above application are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of computer technology, and in particular to a material acquisition method, apparatus, computer equipment, and storage medium. Background Art

[0004] Material delivery refers to the act of delivering the required images, videos, audio, and other materials from the server to the client via the network when producing multimedia content.

[0005] Currently, when software-related failures occur, technicians issue control commands on the emergency control platform. Upon receiving these commands, the server-side program performs various downgrade operations to mitigate potential failures. However, this system relies on technicians' experience and has a low level of automation, making it difficult to effectively prevent material service unavailability.

[0006] Summary of the Invention

[0007] In view of this, embodiments of the present disclosure provide a material acquisition method, apparatus, computer device, and storage medium.

[0008] In a first aspect, an embodiment of the present disclosure provides a material acquisition method, comprising: receiving a material loading request sent by a client; obtaining material metadata that matches the material loading request, and calling the material corresponding to the material metadata to generate a material list, wherein the material list includes each of the called materials; determining whether there is an abnormality in the material in the material list, and if so, constructing material query information according to the material loading request, and obtaining cached materials that match the material query information; and feeding back the cached materials to the client.

[0009] The material acquisition method provided by the embodiment of the present disclosure obtains matching material metadata according to the material loading request sent by the client to call the corresponding material and generate a material list. When an exception occurs, material query information can be constructed according to the material loading request to query the matching cached material from the database. Therefore, when the material service is unavailable, the cached material in the cached resource is used to replace the material that should be obtained by the material loading request, thereby reducing the material service failure sense generated by the client, greatly reducing the unavailability time of the material service, and effectively reducing the unavailability of the material service.

[0010] In a second aspect, an embodiment of the present disclosure provides a material acquisition device, including: a request receiving unit, used to receive a material loading request sent by a client; a material list generating unit, used to obtain 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 called; a judgment unit, used to judge whether there is an abnormality in the material in the material list; a cached material acquisition unit, used to construct material query information according to the material loading request if there is an abnormality in the material in the material list, and obtain cached materials matching the material query information; a material feedback unit, used to feed back the cached materials to the client.

[0011] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the material acquisition method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0012] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the material acquisition method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0014] FIG1 is a schematic diagram of a specific implementation of material acquisition according to some embodiments of the present disclosure;

[0015] FIG2 is a flow chart of a material acquisition method according to some embodiments of the present disclosure;

[0016] FIG3 is a flow chart of another material acquisition method according to some embodiments of the present disclosure;

[0017] FIG4 is a flow chart of another material acquisition method according to some embodiments of the present disclosure;

[0018] FIG5 is a structural block diagram of a material acquisition device according to an embodiment of the present disclosure;

[0019] FIG6 is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below 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 the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present disclosure.

[0021] When a software-related failure occurs, a technician issues a control command on the emergency plan control platform. When the server program receives the control command, it performs different downgrade operations to mitigate possible failure issues. The emergency plans used in related technologies may include:

[0022] (1) Computer room traffic switching plan: This plan is used to switch all traffic from a data center to another computer room. This plan can be used to deal with possible data center-level failures, such as a complete loss of connectivity within a data center.

[0023] (2) Check Update Plan: This is used to tell the client to prioritize using the cache if available and not to try updating data through the server. This plan can be used to handle situations where the server is overloaded.

[0024] However, the execution of each contingency plan requires R&D decision-making and manual activation, which is highly dependent on the technical staff's experience. Different technicians have different timing, resulting in different loss prevention processes, which is not conducive to standardization. Manual activation is limited by the time and space constraints of R&D, and there is a possibility that the technicians will not respond when the plan should be executed, which will affect the speed of loss prevention. Different contingency plans address specific issues in different links, lacking a comprehensive contingency plan. Therefore, the contingency plans in related technologies rely on the technical staff's experience and have a low degree of automation, making it difficult to effectively prevent the unavailability of material services.

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

[0026] Based on this, the technical solution disclosed in this disclosure is to cache the material list resources successfully obtained by the user in the Abase database of the storage system during the normal use of the material service by the user, and cache the successfully obtained material resource list by introducing message queues (MQ) and functions as a service (FaaS). When a possible failure or empty resource is found at the service exit, the cached resources are used to replace the resources that should have been obtained, thereby reducing the unavailability of the material service and avoiding the problem of the client obtaining empty resources due to configuration errors, failures, etc., realizing the automation and comprehensive coverage of material distribution, greatly reducing the unavailability of material services, and improving the stability of the server-side material distribution.

[0027] According to an embodiment of the present disclosure, an embodiment of a material acquisition method 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 a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0028] In this embodiment, a material acquisition method is provided, which can be used for computer devices such as computers, servers, etc. Taking the computer device as a material server as an example, as shown in Figure 1, the material server is 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 the corresponding material metadata according to the material dependency request information sent by the material server; the material server can generate the material according to the material metadata, and send the generated material to the client, and write the generated material into the Abase database of the KV storage system at the same time. When a material abnormality occurs, the material server can retrieve the corresponding material from the Abase database and return it to the client.

[0029] FIG2 is a flow chart of a material acquisition method according to an embodiment of the present disclosure. As shown in FIG2 , the process includes the following steps:

[0030] Step S101: receiving a material loading request sent by a client.

[0031] A resource loading request is triggered when a user requests resources through a client, such as a special effects loading request, a sticker loading request, or a personalized text loading request. Specifically, the resource loading request carries various information, such as the region, resource top-level category, resource sub-category, resource call method, and client ID.

[0032] The client is connected to the material server for communication. After responding to the material loading request triggered by the user, the client sends the material loading request to the material server. Correspondingly, the material server can receive the material loading request sent by the client.

[0033] Step S102: obtaining material metadata that matches the material loading request, and calling the material corresponding to the material metadata to generate a material list, wherein the material list includes each of the called materials.

[0034] Material metadata is information that describes the properties and characteristics of a material. Specifically, it can include basic information such as keywords, title, author, creation date, file format, and file size, as well as detailed descriptions of the material's content and characteristics, such as tags, categories, summaries, and relevance. Material metadata is stored in the database or media storage device of downstream servers. Downstream servers can use this metadata to understand and manage the material, facilitating material retrieval and organization.

[0035] The content server sends a content request to the downstream server based on the content load request it receives. The downstream server then receives and parses the content request, retrieves the matching content metadata, and feeds it back to the content server. The content server then retrieves the content metadata and assembles the content based on the metadata to obtain a list of content and its components.

[0036] Step S103: determine whether there is any abnormality in the material list.

[0037] After obtaining the material list, an anomaly check is performed on each material in the material list to determine whether any of the materials in the material list are abnormal. If it is determined that any of the materials in the material list are abnormal, step S104 is executed; otherwise, other operations are performed. The other operations may include feeding back each material in the material list to the client, caching each material in the material list, or caching each material in the material list simultaneously when feeding back each material in the material list to the client. The other operations are not limited herein.

[0038] Step S104: If there is an abnormality in the material in the material list, material query information is constructed according to the material loading request, and cached materials matching the material query information are obtained.

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

[0040] Cached assets are pre-cached in Abase and match the asset loading request. Cached assets are stored as values ​​in a key-value format. If an asset in the asset list is abnormal, a unique asset query can be constructed in conjunction with the asset loading request. This uniquely identifies the cached asset that matches it.

[0041] Step S105: Feedback the cached material to the client.

[0042] The cached assets are the assets that match the asset loading request. After the asset server obtains the cached assets, it replaces the abnormal asset result of the current asset loading request with the cached assets and feeds the cached assets back to the client, allowing the client to obtain the requested assets. This avoids situations where the client has difficulty obtaining asset resources due to asset service anomalies.

[0043] The material acquisition method provided in this embodiment obtains matching material elements according to the material loading request sent by the client to call the corresponding material and generate a material list. When an exception occurs, material query information can be constructed according to the material loading request to query the matching cached material from the database. Therefore, when the material service is unavailable, the cached material in the cached resource is used to replace the material that should have been obtained by the material loading request, thereby reducing the material service failure feeling generated by the client, greatly reducing the unavailability time of the material service, and effectively reducing the unavailability of the material service.

[0044] In this embodiment, a material acquisition method is provided, which can be used in a computer device, such as a computer, a server, etc. In this embodiment, the computer device is used as a material server as an example. FIG3 is a flow chart of the material acquisition method according to the embodiment of the present disclosure. As shown in FIG3, the flow chart includes the following steps:

[0045] Step S201: Receive a material loading request sent by a client. Detailed descriptions refer to the corresponding descriptions of the above embodiments, which will not be repeated here.

[0046] 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, which includes the called materials. Detailed descriptions refer to the corresponding descriptions of the above embodiments, which will not be repeated here.

[0047] Step S203: Determine whether there is any abnormality in the material list.

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

[0049] Step S2031: Determine whether the number of materials included in the material list is less than or equal to a specified number threshold.

[0050] Step S2032: When the number of materials included in the material list is less than or equal to the specified number threshold, it is determined that there is an abnormality in the materials in the material list.

[0051] The specified quantity threshold is the number of assets that should be requested in the asset load request. The asset quantity is the actual number of assets in the asset list. This asset quantity is compared with the specified quantity threshold to determine whether the number of assets in the asset list is less than or equal to the specified quantity threshold. If the number of assets in the asset list is less than or equal to the specified quantity threshold, the assets in the acquired asset list cannot match the asset load request, and the asset list is determined to be abnormal. Otherwise, the asset list is determined to be normal.

[0052] Step S2033: Determine whether the material list includes a status code indicating a call exception.

[0053] Step S2034: When the material list includes a status code indicating a call abnormality, it is determined that an abnormality exists in the material in the material list.

[0054] The status code of the call exception is used to indicate the status of an exception in the material call process. The status code may include a network error status code, a configuration error status code, a server failure status code, etc., which are not specifically limited here.

[0055] After obtaining the material list, the material list is checked for a status code indicating a call exception. If the material list contains a status code indicating a call exception, it indicates that the material in the obtained material list is abnormal; otherwise, it is determined that the material in the material list is not abnormal.

[0056] Step S204: If there is an abnormality in the material in the material list, material query information is constructed according to the material loading request, and cached materials matching the material query information are obtained.

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

[0058] Step S2041 : extracting the field contents of each designated field defined by a preset rule from the material loading request, and constructing the extracted field contents into material query information.

[0059] 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.

[0060] The default rule is a pre-defined protocol for constructing resource query information. A resource loading request contains multiple fields. When an abnormal resource in the resource list is detected, the client must be informed of the matching resource by parsing the fields in the resource loading request to reconstruct the resource query information and retrieve matching resources from the cached resources in the Abase database.

[0061] 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 the region identifier, used to identify the region where the client is currently located and to distinguish some region-related services; panel is the material panel, used to represent the top-level category to which the material belongs, such as special effects, stickers, personalized text, etc.; category is the secondary category of the material, for example, the secondary category of special effects can include beauty effects, latest special effects, most popular special effects, etc.; method indicates the specific request method required for the material; deviceId indicates the device identifier, which is used to uniquely identify a device, such as a mobile phone, tablet computer, etc. Different devices have different corresponding device identifiers.

[0062] The material server extracts the required designated fields and the field contents corresponding to the designated fields from the material loading request in accordance with preset rules, and then assembles the field contents corresponding to the designated fields to generate material query information.

[0063] Step S2042: Acquire cached materials that match the material query information.

[0064] The Abase database is queried according to the determined material query information to determine the cached material corresponding to the material query information.

[0065] Step S205: Feedback the cached material to the client. Detailed descriptions refer to the corresponding descriptions of the above embodiments, which will not be repeated here.

[0066] The material acquisition method provided in this embodiment determines whether there is an abnormality in the material in the material list by detecting whether the number of materials in the material list meets the specified number threshold, or detecting whether the material list includes a status code representing a call abnormality, so as to avoid feeding back abnormal materials to the client and causing user experience problems. 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, and the material query information is constructed according to the extracted field content. This ensures that the cached material retrieved from the cached resource matches the material loading request, satisfies the materials required by different material loading requests, and realizes the automatic distribution of different materials without the intervention of technical personnel, overcomes the dependence on the experience of technical personnel, and improves the stability of material service distribution.

[0067] In some optional embodiments, as shown in FIG4 , the method may further include:

[0068] Step S206: If there is no abnormality in the material in the material list, generate cache data corresponding to the material list.

[0069] The cached data is the various materials cached in the Abase database. The material query information and the cached data form a key-value pair, that is, the material query information is the key (Key), and the cached data is the value corresponding to the material query information (Value).

[0070] When it is determined that there is no abnormality in the material list, a normal material list is sent to the Abase database, and each material in the material list is written into the Abase database to cache the material corresponding to this material loading request, and obtain the cache data corresponding to each cache in the material list.

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

[0072] Step S2061: extract the field contents of each designated field defined by a preset rule from the material loading request, and construct the extracted field contents into header information.

[0073] The cached data consists of header information and a message body. The contents of each field in the header information are consistent with the contents of each field in the material query information. After extracting the field contents of each specified field from the material loading request according to preset rules, each specified field and the field contents of each specified field are encapsulated as the header information of the cached data. Therefore, when querying the cached data based on the material query information, a pre-match can be performed on the header information. If the header information does not match the material query information, it can be determined that the cached data and the material query information do not match, and there is no need to further parse the message body content of the cached data, thereby improving the material query speed.

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

[0075] The preset data model is a pre-set data model used to construct the message body. Specifically, the preset data model includes at least one of a panel model, a classification model, and a special effect model. The panel model stores information such as the panel text, material entry icon, material label, and material update time required for the top-level classification of materials; the classification model stores information such as the ID, material name, material icon, material special effect list, and classification identifier required for the secondary classification of materials; and the special effect model stores information such as the material special effect name, compatible version information of the material special effect, supported platforms of the material special effect, download address of the material special effect package, material special effect icon, and the relationship between material special effects.

[0076] Each material contained in the material list is serialized and deserialized according to the preset data model, and a compression algorithm with a faster compression rate and decompression speed is used to compress the serialization results during the serialization and deserialization process. The compressed serialization results are decompressed during deserialization, and deserialization is performed after the decompression process is completed to obtain the message body corresponding to each material.

[0077] In a specific example, the panel model, classification model, and special effect model in the message body are serialized and deserialized using the Proto3 protocol. In order to read and decompress the complete message body from the cache as quickly as possible, the Lz4 compression algorithm can be selected to balance compression rate and decompression speed.

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

[0079] The header message and the message body are encapsulated according to the preset encapsulation format to generate cache data corresponding to each material.

[0080] In the above implementation, the content of specified fields is extracted from the resource loading request in accordance with preset rules. Header information is constructed based on the extracted field content, and a message body is constructed based on the data of each resource. Consequently, cached data is constructed based on the header information and the message body, facilitating subsequent retrieval of the cached data and improving retrieval performance and accuracy.

[0081] Step S207: writing the cached data into a preset message queue.

[0082] The cached data in the preset message queue is processed by the preset function service and then written into the database.

[0083] A pre-defined function service is a service designed to facilitate the writing and deployment of functions. A function is a piece of code that implements specific business logic. Specifically, this pre-defined function service can be Function as a Service (FaaS). As a cloud computing service model, FaaS manages the execution environment, auto-scaling, and load balancing for functions. It allows developers to write and deploy functions in an event-driven manner without having to manage the underlying infrastructure and servers.

[0084] The preset message queue is a pre-defined message queue used to store cached data corresponding to each material. Once the material list is confirmed to be free of anomalies, to ensure material caching speed, the cached data corresponding to each material is first written to the message queue BMQ. The cached data in the message queue BMQ is then processed using a preset function service and written to the Abase database.

[0085] The material acquisition method provided in this embodiment generates cache data corresponding to the material list if there are no abnormal materials in the material list. This cache data is then written to the database via a message queue and a preset function service, thereby avoiding any impact on the normal delivery of materials. By using a message queue and a preset function service, the cache is prevented from affecting the normal delivery path of materials, thereby ensuring the effective decoupling of the cache mechanism from the material delivery link.

[0086] Specifically, the steps of writing the cached data in the preset message queue into the database after being processed by the preset function service include:

[0087] In step a1, the preset function service reads the cached data from the preset message queue and parses the header information in the cached data.

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

[0089] The cache data written to the preset message queue is only the material data corresponding to the material, which is equivalent to only writing the Value value into the preset message queue, but not the key value that matches the Value value. When the preset function service writes cache data to 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. The cache data is then used as the cache value corresponding to the cache key, and the cache key and cache data are written into the database in the form of Key-Value, realizing the associated storage of Value value and Key value.

[0090] The material acquisition method provided in this embodiment parses the header information in the cached data and generates a cache key in combination with the header information, thereby using the cached data as the cache value and storing the cache key and the cache value in association, so as to facilitate subsequent effective query of the cached data from the database and ensure the accuracy of the material fed back to the client.

[0091] In some optional embodiments, the step of writing cached data into a database as a cache value associated with a cache key includes:

[0092] Step b1, matching the cache key with the key recorded in the database.

[0093] Step b2: If a target key matching the cache key exists in the database, the cached data is written into the database as the cache value of the target key.

[0094] Step b3: If the target key that matches the cache key does not exist in the database, create a cache key in the database, and write the cache data into the database as a cache value associated with the cache key.

[0095] Since the database is not only for material services, it stores data of multiple services. In order to avoid data cache confusion, different services have different corresponding keys, that is, the material service has a corresponding key format to distinguish it from other services.

[0096] When generating a cache key and writing cache data to the database, the generated cache key is matched against keys existing in the database to determine whether a target key matching the cache key exists in the database. If a target key matching the cache key exists in the database, the cache data can be directly written to the database as the cache value for the target key. If a key matching the cache key does not exist in the database, the cache key must be created in the database and the cache data written to the database as the cache value associated with the cache key.

[0097] The material acquisition method provided in this embodiment matches a cache key with a key already recorded in the database. If a target key matching the cache key exists, the cached data is directly used as the cache value for the target key. This avoids cache clutter caused by duplicate keys. If a target key matching the cache key does not exist, a cache key is created to write the cached data, facilitating subsequent querying and retrieval of cached materials using the cache key.

[0098] In this embodiment, a material acquisition device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments. Details that have already been described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0099] This embodiment provides a material acquisition device, as shown in FIG5 , including:

[0100] The request receiving unit 301 is configured to receive a material loading request sent by a client.

[0101] The material list generating unit 302 is configured to obtain material metadata matching the material loading request, and call the material corresponding to the material metadata to generate a material list. The material list includes each of the called materials.

[0102] The judging unit 303 is configured to judge whether there is any abnormality in the material in the material list.

[0103] The cached material acquisition unit 304 is 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 that match the material query information.

[0104] The material feedback unit 305 is configured to feed back the cached material to the client.

[0105] In some optional embodiments, the determining unit 303 may include:

[0106] The first determining subunit is configured to determine that abnormality exists 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 number threshold.

[0107] The second determining subunit is configured to determine whether an abnormality exists in the material in the material list when the material list includes a status code indicating a call abnormality.

[0108] In some optional embodiments, the cache material acquisition unit 304 may include:

[0109] The query information construction subunit is used to extract the field content of each specified field defined by preset rules from the material loading request, and construct the extracted field content into material query information, wherein the field content includes at least one of the following: a fixed prefix, an area identifier, material classification information, a request method, and a device identifier.

[0110] In some optional embodiments, the above device may further include:

[0111] The cache data generating unit is configured to generate cache data corresponding to the material list if there is no abnormality in the material in the material list.

[0112] The writing unit is used to write the cached data into a preset message queue, wherein the cached data in the preset message queue is processed by a preset function service and then written into the database.

[0113] In some optional embodiments, the cache data generating unit may include:

[0114] The header information extraction subunit is used to extract the field content of each designated field defined by a preset rule from the material loading request, and construct the extracted field content into header information.

[0115] The message body construction subunit is used 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.

[0116] The generation subunit is used to generate cache data including header information and message body.

[0117] In some optional embodiments, the writing unit may include:

[0118] The parsing subunit is used to preset the function service to read the cached data from the preset message queue and parse the header information in the cached data.

[0119] The writing subunit is used to preset the function service to generate a cache key based on the header information, and write the cache data into the database as the cache value associated with the cache key.

[0120] In some optional embodiments, the above-mentioned writing sub-unit is further specifically used to: match the cache key with the key recorded in the database; if there is a target key matching the cache key in the database, write the cache data into the database as the cache value of the target key; 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 into the database as the cache value associated with the cache key.

[0121] The further functional description of each of the above units and sub-units is the same as that of the above corresponding embodiments and will not be repeated here.

[0122] The material acquisition device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0123] The material acquisition device provided in this embodiment obtains matching material metadata according to the material loading request sent by the client to call the corresponding material and generate a material list. When an exception occurs, material query information can be constructed according to the material loading request to query the matching cached material from the database. Therefore, when the material service is unavailable, the cached material in the cache resource is used to replace the material that should be obtained by the material loading request, thereby reducing the material service failure feeling generated by the client, greatly reducing the unavailability time of the material service, and effectively reducing the unavailability of the material service.

[0124] The embodiment of the present disclosure further provides a computer device having the material acquisition device shown in FIG5 .

[0125] Please refer to Figure 6, which is a structural diagram of a computer device provided by an optional embodiment of the present disclosure. As shown in Figure 6, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to 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 in the computer device, including instructions stored in 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 optional 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 group of blade servers, or a multi-processor system). Figure 6 takes a processor 10 as an example.

[0126] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

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

[0128] The memory 20 may include a program storage area and a data storage area, wherein 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 based on 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-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via 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.

[0129] 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 also include a combination of the above types of memory.

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

[0131] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. 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. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

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

Claims

1. A material acquisition method, comprising: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, comprising: 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 comprising: 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, wherein: 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.

Citation Information

Patent Citations

  • Advertisement preloading method and device, electronic equipment and storage medium

    CN111260396A

  • Information processing method, information processing device, electronic equipment and medium

    CN112785324A

  • Material display method and device, local material creation method and device, server and storage medium

    CN114629886A

  • Method for optimizing the load balance in the cluster and framework thereof

    US20220091874A1