Information Processing Method, Apparatus, Device, Storage Medium, and Program Product
By extracting the actual query words and features in the query request, and updating the mapping relationship data using the time stamps in local storage and cache, the processing capability and stability challenges of the user's search intention understanding system in the fuzzy search scenario are solved, and efficient and accurate feedback of query results is achieved.
Patent Information
- Application Number
- CN202210417765.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-20
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-04-20
AI Technical Summary
In the fuzzy search scenario, it is difficult for the system to accurately determine the vertical category to which the user's search intent or query request belongs, resulting in a huge challenge to the system's concurrency processing capability and stability.
By extracting the actual query words and features from the query request, extracting the corresponding timestamp from the local storage and cache, determining the mapping relationship data of the latest timestamp is the target data, and updating the corresponding mapping relationship data in the cache is to generate accurate query results.
It improves the accuracy and efficiency of query results feedback, and improves the concurrency processing capability and stability of the system.
Smart Images

Figure CN114706894B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, specifically to technical fields such as deep learning and data synchronization, and particularly relates to an information processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] With the gradual development of artificial intelligence technology, the understanding of user search intentions or the processing of user query requests based on natural language understanding has been increasingly emphasized, with the expectation of improving the feedback accuracy and efficiency of search results by better identifying the true search or query intentions of users.
[0003] In the case of fuzzy search, since the user search intention understanding system or user query request processing system cannot accurately determine which vertical category the user search intention or query request belongs to, it usually mounts hundreds or thousands of machine learning models belonging to different vertical categories (that is, each machine learning model corresponds to the understanding of user search intentions or the processing of user query requests under a vertical category), which is a typical computationally intensive service.
[0004] With the continuous growth of the model scale and strategy complexity, both the system's concurrent processing ability and stability face great challenges. That is, how to accurately and efficiently feedback search results or query results in such a scenario is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] Embodiments of the present disclosure propose an information processing method, apparatus, electronic device, computer-readable storage medium, and computer program product.
[0006] In a first aspect, embodiments of the present disclosure propose an information processing method, including: extracting an actual query term and actual query features from an obtained query request; respectively extracting timestamps corresponding to the actual query term from mapping relationship data stored in local storage and cache; wherein, the mapping relationship data includes the corresponding relationships between query terms, model numbers, timestamps, query features, and calculation results, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by local storage; determining the mapping relationship data containing the latest timestamp as the target mapping relationship data; in response to the actual query features being consistent with the query features in the target mapping relationship data and the target mapping relationship data being taken from local storage, taking the calculation result in the target mapping relationship data as the target calculation result; using the target mapping relationship data to update the mapping relationship data containing the same model number stored in the cache; generating a query result corresponding to the query request based on the target calculation result.
[0007] Second aspect, an embodiment of the present disclosure provides another information processing method, including: extracting an actual query term and actual query features from the obtained query request; respectively extracting the timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and cache; wherein, the mapping relationship data includes the corresponding relationship between the query term, model number, timestamp, query features, and calculation result, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; determining the mapping relationship data containing the latest timestamp as the target mapping relationship data; in response to the actual query features not being consistent with the query features in the target mapping relationship, calculating a target calculation result based on the model corresponding to the target mapping relationship data and the actual query features; determining a new timestamp according to the generation time of the target calculation result, and generating new mapping relationship data based on the actual query term, model number, new timestamp, actual query features, and target calculation result; using the new mapping relationship data to update the mapping relationship data containing the same model number stored in the cache; generating a query result corresponding to the query request based on the target calculation result.
[0008] Third aspect, an embodiment of the present disclosure proposes an information processing device, including: a query request parsing unit configured to extract an actual query term and actual query features from the obtained query request; a timestamp extraction unit configured to respectively extract the timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and cache; wherein, the mapping relationship data includes the corresponding relationship between the query term, model number, timestamp, query features, and calculation result, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; a target mapping relationship data determination unit configured to determine the mapping relationship data containing the latest timestamp as the target mapping relationship data; a first processing unit configured to, in response to the actual query features being consistent with the query features in the target mapping relationship data and the target mapping relationship data being taken from the local storage, use the calculation result in the target mapping relationship data as the target calculation result; a first update unit configured to use the target mapping relationship data to update the mapping relationship data containing the same model number stored in the cache; a query result generation unit configured to generate a query result corresponding to the query request based on the target calculation result.
[0009] Fourth aspect, embodiments of the present disclosure provide another information processing apparatus, including: a query request parsing unit configured to extract an actual query term and actual query features from the obtained query request; a timestamp extraction unit configured to extract timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and cache respectively; wherein the mapping relationship data includes the corresponding relationships among query terms, model numbers, timestamps, query features, and calculation results, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; a target mapping relationship data determination unit configured to determine the mapping relationship data including the latest timestamp as the target mapping relationship data; a second processing unit configured to, in response to the actual query features not being consistent with the query features in the target mapping relationship, calculate a target calculation result based on the model corresponding to the target mapping relationship data and the actual query features; a new mapping relationship generation unit configured to determine a new timestamp according to the generation time of the target calculation result, and generate new mapping relationship data based on the actual query term, model number, new timestamp, actual query features, and target calculation result; a second update unit configured to update the mapping relationship data including the same model number stored in the cache with the new mapping relationship data; a query result generation unit configured to generate a query result corresponding to the query request based on the target calculation result.
[0010] Fifth aspect, embodiments of the present disclosure provide an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to implement the information method described in any implementation manner of the first aspect or any implementation manner of the second aspect.
[0011] Fourth aspect, embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to enable a computer to implement the information processing method described in any implementation manner of the first aspect or any implementation manner of the second aspect when executed.
[0012] Fifth aspect, embodiments of the present disclosure provide a computer program product including a computer program, and the computer program can implement the information processing method described in any implementation manner of the first aspect or any implementation manner of the second aspect when executed by a processor.
[0013] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. Description of the Drawings
[0014] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non - limiting embodiments read in conjunction with the accompanying drawings:
[0015] Figure 1 It is a flowchart of an information processing method provided for an embodiment of the present disclosure;
[0016] Figure 2 It is a flowchart of another information processing method provided for an embodiment of the present disclosure;
[0017] Figure 3 It is a flowchart of yet another information processing method provided for an embodiment of the present disclosure;
[0018] Figure 4 It is a flowchart of a method for determining whether an actual query feature is consistent with a query feature in target mapping relation data provided for an embodiment of the present disclosure;
[0019] Figure 5 It is a schematic flowchart of an information processing method in an application scenario provided for an embodiment of the present disclosure;
[0020] Figure 6 It is a structural block diagram of an information processing device provided for an embodiment of the present disclosure;
[0021] Figure 7 It is a structural block diagram of another information processing device provided for an embodiment of the present disclosure;
[0022] Figure 8 It is a schematic structural diagram of an electronic device suitable for executing an information processing method provided for an embodiment of the present disclosure. Detailed Embodiments
[0023] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to assist understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well - known functions and structures are omitted. It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other.
[0024] In the technical solution of the present disclosure, the processing of collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved all complies with the provisions of relevant laws and regulations and does not violate public order and good customs.
[0025] Please refer to Figure 1 , Figure 1The flowchart of an information processing method provided by an embodiment of the present disclosure, where process 100 includes the following steps:
[0026] Step 101: Extract the actual query term and actual query features from the obtained query request;
[0027] This step aims to extract the actual query term (hereinafter collectively referred to as the actual query term, used to distinguish query terms from other sources) and the actual query features (hereinafter collectively referred to as the actual query features, used to distinguish query features from other sources) from the received query request by the execution entity of the information processing method (such as a data storage server or a user terminal device).
[0028] Among them, the actual query term is usually directly given by the object initiating the query request, and can be physically entered directly through a keyboard or touch screen, or obtained by parsing the incoming voice signal, such as "Old Summer Palace", "XXX (a movie name)", etc.; the actual query features are used to represent the relevant features accompanying the actual query term, and are used to reflect the search or query intentions of different users in different scenarios based on different starting points. For example, it may include at least one of the client features when the query request is triggered, the behavior features when the query request is triggered, the public opinion features when the query request is triggered, and the voice features when the query request is triggered.
[0029] Taking the client features when the query request is triggered as an example, the current clients can be generally divided into: personal computer (PC) terminals, Android mobile phone terminals, and iOS mobile phone terminals. For the same object, query requests initiated based on the same query term through different types of clients may reflect different search intentions of the object for the query term. For example, when the query term has a strong association with a certain type of client, it will significantly affect the search results; taking the public opinion features when the query request is triggered as an example, if the change of the public opinion features leads to different interpretation methods or new implicit associations of a certain query term in the past and now, it will inevitably affect the accuracy of the search results. Other features are similar and will affect the accuracy of the search results to different degrees in different dimensions. Therefore, it is necessary to scientifically and effectively analyze the non-query term data included in the query request, and then obtain as much relevant data as possible, and finally analyze to obtain as comprehensive query features as possible.
[0030] Furthermore, when a comprehensive query feature is composed of the above multiple specific features at the same time, corresponding feature comprehensive weights can be set in advance for each feature that constitutes the query feature, so that the finally generated query feature is more in line with the actual situation by combining each weight item.
[0031] Step 102: Extract the timestamps corresponding to the actual query terms from the mapping relationship data stored in the local storage and cache respectively;
[0032] Based on Step 101, the purpose of this step is for the above-mentioned execution entity to extract the timestamps corresponding to the actual query terms from the mapping relationship data stored in the local storage and cache respectively.
[0033] Herein, both the "local storage" and "cache" described in this application refer to storage media for storing data or information. The difference is that the read and write speed of the data stored in the "cache" will be significantly higher than that of the data stored in the "local storage". Therefore, by means of the storage medium with high-speed read and write characteristics of the "cache", the feedback efficiency of the query can be improved.
[0034] Specifically, in some scenarios, the "local storage" and "cache" can simply refer to the "Read Only Memory (ROM)" and "Random Access Memory (RAM)". Among them, ROM usually appears as a non-power-off non-volatile persistent storage hard disk (with a larger capacity compared to the memory capacity), and RAM usually appears as a power-off volatile storage medium of the memory (with a smaller capacity compared to the hard disk capacity). In some other scenarios, the cache can be understood as a memory located between the Central Processing Unit (CPU) and the memory, which has a faster data read and write speed than the memory. When the CPU reads or writes data to the memory, these data will also be stored in the cache. When the CPU needs these data again, it will directly read from the cache instead of the memory, thereby further improving the read and write speed. However, no matter which of the above, it does not affect the understanding of the two concepts of "local storage" and "cache" described in this application. The core is that the "cache" will be used as a storage medium with a faster data read and write speed than the "local storage" to improve the data feedback efficiency by virtue of its high-speed data read and write ability.
[0035] Among them, the mapping relationship data includes the corresponding relationships among query terms, model numbers, timestamps, query features, and calculation results. That is, under one query term, each model with a certain number will calculate a calculation result based on the corresponding query features and query terms, and generate the corresponding time as the timestamp. Usually, the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated in the local storage (that is, the original mapping relationship data is initially generated in the local storage). Therefore, when the model structure and query features remain unchanged, the mapping relationship data stored in the cache should be consistent with the mapping relationship data in the local storage and both are the latest.
[0036] Step 103: Determine the mapping relationship data containing the latest timestamp as the target mapping relationship data;
[0037] Based on Step 102, this step aims to have the above-mentioned execution entity determine the mapping relationship data containing the latest timestamp as the target mapping relationship data by comparing the times corresponding to the two timestamps from local storage and cache respectively.
[0038] Step 104: In response to the actual query feature being consistent with the query feature in the target mapping relationship data and the target mapping relationship data being taken from local storage, use the calculation result in the target mapping relationship data as the target calculation result;
[0039] Based on Step 103, this step aims to have the above-mentioned execution entity, when it is found that the actual query feature is consistent with the query feature in the target mapping relationship data and the target mapping relationship data is taken from local storage (that is, there is mapping relationship data in local storage that is newer than the cache for the same model number), use the calculation result in the target mapping relationship as the target calculation result.
[0040] The fact that the actual query feature is consistent with the query feature in the target mapping relationship data indicates that the actual query feature corresponding to the current query request is consistent with the query feature recorded in the stored mapping relationship data. Therefore, it can be considered that the calculation result obtained based on the query feature recorded in the mapping relationship data is still valid and available. Therefore, the calculation result in the target mapping relationship data can be used as the target calculation result.
[0041] Since there is mapping relationship data in local storage that is newer than the cache for the same model number, it is very likely that after the mapping relationship data in local storage was synchronized to the cache last time, the model with the corresponding model number was modified locally (such as modifications to the model structure and model parameters), and this modification will cause the query results corresponding to the same query term to be different from those before the modification, but a new synchronization operation has not been triggered yet. Therefore, by clarifying whether the target mapping relationship data is taken from local storage or cache, it is possible to further clarify whether the corresponding mapping relationship data stored in the cache is still in an available state.
[0042] Step 105: Use the target mapping relationship data to update the mapping relationship data containing the same model number stored in the cache;
[0043] Based on Step 104, this step aims to have the above-mentioned execution entity, when the corresponding mapping relationship data stored in the cache is in an unavailable state, use the target mapping relationship data to update the mapping relationship data containing the same model number stored in the cache, so that subsequent identical query requests can directly access the cache and quickly return accurate query results.
[0044] Step 106: Generate a query result corresponding to the query request based on the target calculation result.
[0045] Based on Step 105, this step aims to generate a query result corresponding to the query request by the above-mentioned execution entity based on the target calculation result. Usually, it is based on the target settlement result in the updated mapping relationship data stored in the cache after Step 105 to generate the query result. However, in some cases, the target calculation result in the local storage can actually be used to generate the query result.
[0046] Since in the scenario targeted by this application, multiple machine learning models corresponding to different vertical categories need to be used simultaneously to return a sufficiently comprehensive and accurate query result. Therefore, when executing Step 106, it is usually necessary to confirm whether the target calculation results corresponding to all model numbers are obtained, or the target calculation results corresponding to the machine learning models of a sufficient number of vertical categories, or the target calculation results corresponding to the machine learning models of sufficiently important vertical categories, and then generate a query result corresponding to the query request based on these target calculation results.
[0047] The information processing method provided by the embodiments of the present disclosure provides a fine management granularity at the model level based on the mapping relationship data composed of the model number, timestamp, and query features, and determines which cache data is unavailable and needs to be updated specifically by comparing the timestamps in the mapping relationship data stored in the local storage and the cache respectively. Thus, through a scientific update strategy, it is possible to control as much as possible that the cache stores the latest model calculation results, thereby improving the hit rate of the query result corresponding to the query request directly hitting the cache, and ultimately achieving an improvement in the query result feedback efficiency.
[0048] Please refer to Figure 2 , Figure 2 which is a flowchart of another information processing method provided by the embodiments of the present disclosure. The process 200 includes the following steps:
[0049] Step 201: Extract the actual query term and actual query features from the obtained query request;
[0050] Step 202: Extract the timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and the cache respectively;
[0051] Step 203: Determine the mapping relationship data containing the latest timestamp as the target mapping relationship data;
[0052] Steps 201 - 203 are the same as Steps 101 - 103 in Process 100, and will not be elaborated here.
[0053] Step 204: In response to the actual query feature not being consistent with the query feature in the target mapping relationship, calculate the target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature;
[0054] Based on Step 203, this step aims to have the above-mentioned execution entity calculate the target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature when it is found that the actual query feature is not consistent with the query feature in the target mapping relationship data.
[0055] The fact that the actual query feature is not consistent with the query feature in the target mapping relationship data indicates that the actual query feature corresponding to the current query request is not consistent with the query feature recorded in the stored mapping relationship data. Therefore, it can be considered that the calculation result obtained based on the original query feature recorded in the mapping relationship data will no longer be of use value. Thus, it is necessary to recalculate the available target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature.
[0056] Step 205: Determine a new timestamp according to the generation time of the target calculation result, and generate new mapping relationship data based on the actual query term, model number, new timestamp, actual query feature, and target calculation result;
[0057] Based on Step 204, this step aims to have the above-mentioned execution entity determine a new timestamp according to the generation time of the target calculation result, and generate new mapping relationship data based on the actual query term, model number, new timestamp, actual query feature, and target calculation result. That is, compared with the target mapping relationship data, the new mapping relationship data updates the calculation result, query feature, and timestamp.
[0058] Among them, the new timestamp can directly be the generation time of the target calculation result, or it can be a time calculated based on the generation time.
[0059] Step 206: Use the new mapping relationship data to update the mapping relationship data stored in the cache that contains the same model number;
[0060] Based on Step 205, this step aims to have the above-mentioned execution entity use the new mapping relationship data to update the mapping relationship data stored in the cache that contains the same model number.
[0061] Step 207: Generate a query result corresponding to the query request based on the target calculation result.
[0062] Different from the solution given when the query features in the actual query feature and target mapping relationship data are consistent and the target mapping relationship data is taken from local storage in Process 100, this embodiment provides another solution when the query features in the actual query feature and target mapping relationship data are not consistent. However, the core points of both embodiments are to provide a fine management granularity at the model level through the mapping relationship data composed of model numbers, timestamps, and query features, and to determine which cached data is unavailable and needs to be updated specifically by comparing the timestamps in the mapping relationship data stored in local storage and cache respectively. Thus, through a scientific update strategy, it is possible to control that the cached data stores the latest model calculation results as much as possible, thereby increasing the hit rate of the query results corresponding to the query requests directly hitting the cache, and ultimately improving the feedback efficiency of the query results.
[0063] To better understand all possible branches in the actual situation, this embodiment comprehensively Figure 1 、 Figure 2 In the case of their respective processing branches, it also shows a flowchart of another information processing method through Figure 3 and reflects the third processing branch. The process 300 includes the following steps:
[0064] Step 301: Extract the actual query term and actual query features from the obtained query request;
[0065] Step 302: Extract the timestamps corresponding to the actual query term from the mapping relationship data stored in local storage and cache respectively, and determine the mapping relationship data containing the latest timestamp as the target mapping relationship data;
[0066] The above steps 301 - 302 are the same as the first three steps shown in Figure 1 and Figure 2 For the same parts, please refer to the corresponding parts of the previous embodiment, and details will not be repeated here.
[0067] Step 303: Determine whether the actual query features are consistent with the query features in the target mapping relationship data. If they are not consistent, execute Step 304; if they are consistent, execute Step 307;
[0068] This step aims to determine whether the actual query features are consistent with the query features in the target mapping relationship data by the above execution entity, and select different subsequent processing branches according to the discrimination result.
[0069] Considering that it is rare for two different query requests to be accompanied by exactly the same query features, when making the discrimination of consistency, the discrimination result is usually not obtained based on strict identity. One implementation method including but not limited to can be seen inFigure 4 The flow chart shown below:
[0070] Step 401: Calculate the degree of difference between the actual query feature and the query feature in the target mapping relationship data according to a preset dimension;
[0071] Among them, the preset dimension is used to represent the feature dimension that can be used to discriminate the degree of difference, such as the behavior feature dimension, the public opinion feature dimension, the client type dimension, etc., and can also be other more general or specific dimensions, mainly used to represent the value that affects the calculated degree of difference in the actual application scenario, and it is closer to the requirements in the actual application scenario.
[0072] Step 402: Determine whether the degree of difference exceeds a preset difference threshold. If it exceeds, execute Step 404; otherwise, execute Step 403;
[0073] Step 403: Determine that the actual query feature and the query feature in the target mapping relationship data are consistent;
[0074] Step 404: Calculate the degree of difference between the actual query feature and the query feature in the target mapping relationship data according to a preset dimension.
[0075] Based on the above Figure 4 As can be seen from the implementation method shown above, when the degree of difference between the actual query feature and the query feature in the target mapping relationship data is small, it can still be considered that there is consistency between the actual query feature and the query feature in the target mapping relationship data. In the case of consistency, there is no need to recalculate a new calculation result based on the actual query feature, that is, the calculation result recorded in the target mapping relationship data can still be used.
[0076] Step 304: Calculate the target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature;
[0077] This step is based on the judgment result of Step 303 that there is no consistency between the actual query feature and the query feature in the target mapping relationship data. Since the two are not consistent, that is, the calculation result recorded in the target mapping relationship data cannot be used continuously, it is necessary to recalculate a usable target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature.
[0078] Step 305: Determine a new timestamp according to the generation time of the target calculation result, and generate a new mapping relationship based on the actual query term, model number, new timestamp, actual query feature, and target calculation result;
[0079] Step 306: Use the new mapping relationship to update the mapping relationship data stored in the cache that contains the same model number;
[0080] Steps 304 - 306 are the same as steps 204 - 206 in process 200 and will not be elaborated here.
[0081] Step 307: Determine whether the target mapping relationship data is retrieved from the cache. If it is retrieved from local storage, execute step 308; if it is retrieved from the cache, execute step 310.
[0082] This step is based on the judgment result of step 303 that there is consistency between the actual query feature and the query feature in the target mapping relationship data. It aims to determine by the above-mentioned execution entity whether the target mapping relationship data is retrieved from the cache, and can also be equivalently understood as "determining where the target mapping relationship data is retrieved from or its source". It should be noted that the "where it is retrieved from" described in this step refers to determining where the mapping relationship data containing the latest "timestamp" is stored between "local storage" and "cache". When the timestamp in the mapping relationship data stored in "local storage" is not newer than that in the "cache", due to the faster data reading and writing ability of the "cache" compared to "local storage", it is considered that the target mapping relationship data is retrieved from the "cache"; otherwise, it is only when the timestamp in the mapping relationship data stored in "local storage" is newer than that in the "cache" that it is considered that the target mapping relationship data is retrieved from "local storage".
[0083] Step 308: Use the calculation result in the target mapping relationship data as the target calculation result.
[0084] This step is based on the judgment result of step 307 that the target mapping relationship data is not retrieved from the cache but from local storage. It aims to use the calculation result in the target mapping relationship data as the target calculation result by the above-mentioned execution entity.
[0085] Step 309: Use the target mapping relationship data to update the mapping relationship data with the same model number in the cache.
[0086] Based on step 308, this step aims to use the target mapping relationship data to update the mapping relationship data with the same model number in the cache by the above-mentioned execution entity, so as to complete the purpose of synchronizing the latest mapping relationship to the cache.
[0087] Step 310: Use the calculation result in the target mapping relationship data as the target calculation result.
[0088] This step is based on the judgment result of step 307 that the target mapping relationship data is retrieved from the cache, indicating that the data stored in the cache can be directly used. It aims to directly use the calculation result in the target mapping relationship data as the target calculation result by the above-mentioned execution entity.
[0089] Step 311: Generate a query result corresponding to the query request based on the target calculation result.
[0090] Based on Figure 2 the embodiment shown, this embodiment provides a two-layer judgment processing scheme that is carried out in sequence through steps 303 to 310, thereby comprehensively considering more other situations including the situations described in steps 104 to 105 shown in process 100 and the situations described in steps 204 to 206 shown in process 200. Furthermore, through comprehensive consideration, it more reflects the specific fine management granularity of the model and the synchronization update strategy of the mapping relationship data between local storage and cache. Finally, it ensures that the query request can have a high hit rate in the cache and also improves the feedback efficiency of the query result.
[0091] Based on any of the above embodiments, this embodiment mainly provides a specific implementation method for how to construct mapping relationship data that records the correspondence between query terms, model numbers, timestamps, query features, and calculation results, in order to facilitate understanding of the actual representation form and usage method of the mapping relationship data:
[0092] Use the bucketing technique to create models with different model numbers into different model buckets;
[0093] Load different model buckets into a unified hash map through the HashMap technique of the hash graph, and establish a mapping relationship table from the model number to the timestamp;
[0094] Generate mapping relationship data based on the mapping relationship table and the corresponding query terms, query features, and calculation results.
[0095] Among them, the hashing method (also known as the hash method in Chinese) is a method of converting a string composed of characters into a numerical value or index value of a fixed length (usually a shorter length). Since searching the database with a shorter hash value is faster than using the original value, this method is generally used to create indexes and perform searches in the database, and is also used in various decryption algorithms.
[0096] The HashMap is an asynchronous implementation of the Map interface based on a hash table. This implementation provides all optional mapping operations and allows the use of null values and null keys. The HashMap stores key-value pairs and is very fast. This class does not guarantee the order of the mappings, especially it does not guarantee that the order will remain constant. The internal structure of the HashMap can be regarded as a composite structure composed of an array and a linked list. The array is divided into buckets, and each bucket stores one or more Entry objects. Each Entry object contains three parts: key, value, and next (pointing to the next Entry). The hash value determines the addressing of the Entry object in this array; Entry objects (key-value pairs) with the same hash value are stored in the form of a linked list. If the size of the linked list exceeds the threshold for tree conversion (TREEIFY_THRESHOLD = 8), the linked list will be transformed into a tree structure.
[0097] To deepen the understanding, the present disclosure also combines a specific application scenario and presents a cache technology based on model granularity to mark a time stamp for the model in the time dimension of model updates, and to achieve incremental calculation of model granularity and incremental update of the cache by calculating the differences in the time series of the model (also known as diff calculation), so as to achieve the effects of high cache hit rate, high timeliness, consistency, low latency, and saving computing resources.
[0098] The cache technology based on model granularity is designed and implemented based on the diff calculation between the model time series and the query feature time series: the system (i.e., the above-mentioned execution entity) locally (i.e., local storage) maintains the time series of all models and query features, and the cache also stores the output data of all model calculations (i.e., the calculation results described above) and query features, and maintains a set of time series of models and query features. The two time series are subjected to diff calculation to obtain an updated list of models and features. The system only performs model calculations on this list, and the calculation result data is then fed back to the cache to form a positive loop feedback mechanism to achieve incremental update. For the specific system components and interaction relationships, see Figure 5 :
[0099] To achieve the above objectives, the following will specifically elaborate by combining the key problems to be solved:
[0100] 1. Problem of perceiving model changes and feature changes
[0101] The system needs to identify the requirements for query requests (queries), which requires a large amount of online computing of machine learning models, thousands of model changes and feature changes. The change frequencies of different models vary greatly, including half-hourly, hourly, daily, and weekly. Due to the relatively coarse-grained management of cached data by traditional methods, they cannot perceive changes, so they do not have the core conditions to manage cached data at the model granularity. How the system perceives changes in all models and features at the cache level and how to perform model calculations only for the changed models and features are the key issues.
[0102] In this embodiment, time series tags are used to perceive model changes. When the offline model training is completed, a time tag timestamp is synchronized to the model. The offline model is distributed to the online service instances through a unified distribution platform. The instances use cold start and hot loading technologies to complete the loading of the model and at the same time complete the loading of the full or incremental model timestamps. The timestamps of each model in the bucket are loaded into a unified hash map to establish a mapping relationship table between model numbers and timestamps. The system will timely refresh the latest timestamp to this mapping relationship table as the model changes. A specific data structure is maintained in the cache, and this structure is used to store the output data of model calculations and the mapping relationship table.
[0103] When the first query request arrives, it will trigger feature queries and full-model calculations. The data calculated by the model and the corresponding mapping relationship table will be written into this data structure. At the same time, the feature data will be stored in this data structure and a timestamp will be added. Both the local system and the cache system maintain a time series, thus achieving efficient and accurate perception of model and feature changes.
[0104] 2. Cache update problem at the model granularity
[0105] In traditional cache technologies, the cache granularity is at the query request (or query term) level, and the effectiveness control cannot be refined. It can only be made to take effect as a whole and become invalid as a whole, and differential incremental updates cannot be performed. Considering the timeliness of query requests and model effectiveness, the general cache effectiveness period is not set too long, otherwise it will affect the timeliness. The key issue of the cache is to improve the cache hit rate while ensuring the timeliness. In traditional methods, these two are in an opposing relationship and cannot be optimized as a whole.
[0106] When the second query request arrives, first query the cache system, parse the cache data, and obtain the mapping relationship table. Since the mapping tables in both the local and cache are based on time series, perform a time series diff calculation on the two tables to obtain the model list of the latest time series. Then, parse the feature data to obtain the feature data within the effective period. The expired feature data will immediately trigger a feature query. The two pieces of feature data are fused to form a feature list. Next, put the latest model list and feature list into the model calculation center for model calculation. The model calculation result data and the latest feature data are written back to the data structure of the cache. At the same time, the timestamps of the latest model and feature list are written into the mapping relationship table of the cache.
[0107] For subsequent query requests, continuous time series diff calculations will be performed, resulting in continuous data write-back to the cache, forming a positive loop feedback mechanism, and ultimately realizing cache data management at the model granularity. Due to the large difference in the change frequencies of models and features, most models do not require model calculation and directly use the cache data. Therefore, the cache hit rate will be greatly improved. At the same time, due to the time series diff calculation, models and features that accurately sense changes can immediately perform model calculation, greatly enhancing the timeliness of the models.
[0108] 3. Consistency issues
[0109] There are two types of consistency issues. The first is the consistency issue caused by the inability to recognize traffic features, which can occur in traditional cache technologies with extensive management. Query requests under search traffic carry not only the query term itself but also a large number of query features related to the query behavior. These query features can be used for model calculation, guiding strategies, traffic end identification, and small traffic mechanisms. For complex strategy systems, the calculation results of the same query term under different query features can vary significantly. Traditional cache technologies, which manage at the granularity of query requests or query terms, are difficult to accurately and timely fully recognize all query features. Especially for upstream cache technologies, the upstream views the downstream as a black box and does not understand how the downstream system utilizes these traffic features, thus resulting in cache consistency issues. A typical problem is the interference between small traffic and full traffic.
[0110] In this embodiment, the cache is refined to the model granularity and deep into the model calculation level. It can identify all query features at low cost and high efficiency, and extract the features that affect the model calculation in a targeted manner. The extracted features are added to the cache key signature calculation. Therefore, the cache key contains the query features, which will ensure the uniqueness of the key-to-value result mapping. For small traffic features, the corresponding small traffic features are also added to the model level. During the time series diff calculation process, small feature matching operations at the model and traffic levels will be performed. Model calculation will be performed only after the match is successful, that is, the small traffic and full traffic model calculations are separated to solve the problem of mutual interference between small traffic and full traffic, and the overall solution to the consistency problem at the traffic feature level.
[0111] The second consistency problem is caused by the extensive control of the effective cycle and the asynchronous model changes on large-scale online instances. In the search of large-scale distributed systems, each subsystem and module may have hundreds or thousands of instances, and the model data is changed through the distribution platform. Considering the stability and complexity of the online environment, there is generally a hierarchical distribution mechanism. Therefore, it is basically impossible to synchronize all instances. There is a certain time difference, which may be tens of minutes to hours. Due to the asynchronous instance changes, the cache data written to different instances is different, which interferes with each other and leads to cache inconsistency problems.
[0112] In this embodiment, the model time series diff calculation is used to filter out the latest model in the time series and update it synchronously to the cache structure. When a query request falls on an instance that has not completed the model change, the model data at the front of the time series in the cache structure is directly used as the calculation result of the model according to the time series diff. The model no longer participates in the model calculation. Therefore, for a query request, as long as the model calculation is completed once in the changed model instance and written to the cache system, all instances can share the data, realize the synchronous change of the model of all instances, solve the consistency problem, and also improve the timeliness of the model. In simple terms, when the actual query instance to which the query request belongs is in the mapping relationship update state, the query result corresponding to the query request can be obtained from the same query instance in the mapping relationship update completion state.
[0113] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an information processing device, and the device embodiment is Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0114] like Figure 6As shown in the figure, the information processing device 600 of this embodiment may include: a query request parsing unit 601, a timestamp extraction unit 602, a target mapping relationship data determination unit 603, a first processing unit 604, a first update unit 605, and a query result generation unit 606. Among them, the query request parsing unit 601 is configured to extract an actual query term and an actual query feature from the obtained query request; the timestamp extraction unit 602 is configured to extract the timestamp corresponding to the actual query term from the mapping relationship data stored in the local storage and the cache respectively; wherein, the mapping relationship data includes the correspondence between the query term, the model number, the timestamp, the query feature, and the calculation result, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; the target mapping relationship data determination unit 603 is configured to determine the mapping relationship data containing the latest timestamp as the target mapping relationship data; the first processing unit 604 is configured to, in response to the actual query feature being consistent with the query feature in the target mapping relationship data and the target mapping relationship data being taken from the local storage, use the calculation result in the target mapping relationship data as the target calculation result; the first update unit 605 is configured to update the mapping relationship data containing the same model number stored in the cache with the target mapping relationship data; the query result generation unit 606 is configured to generate a query result corresponding to the query request based on the target calculation result.
[0115] In this embodiment, in the information processing device 600: the specific processing of the query request parsing unit 601, the timestamp extraction unit 602, the target mapping relationship data determination unit 603, the first processing unit 604, the first update unit 605, and the query result generation unit 606 and the technical effects brought by them can be respectively referred to Figure 1 the relevant descriptions of steps 101-106 in the corresponding embodiment, which will not be elaborated here.
[0116] In some alternative implementation manners of this embodiment, the information processing device 600 may further include:
[0117] A second processing unit, configured to, in response to the actual query feature being consistent with the query feature in the target mapping relationship and the target mapping relationship being taken from the cache, use the calculation result in the target mapping relationship as the target calculation result.
[0118] In some alternative implementation manners of this embodiment, the query result generation unit 606 may be further configured to:
[0119] Generate a query result corresponding to the query request based on the target calculation results corresponding to all the obtained model numbers respectively.
[0120] In some alternative implementation manners of this embodiment, the query features include at least one of: client features when a query request is triggered, behavior features when a query request is triggered, public opinion features when a query request is triggered, and voice features when a query request is triggered.
[0121] In some alternative implementation manners of this embodiment, the information processing apparatus 600 may further include:
[0122] A feature comprehensive weight setting unit, configured to set corresponding feature comprehensive weights for each feature constituting the query features.
[0123] In some alternative implementation manners of this embodiment, the information processing apparatus 600 may further include:
[0124] A difference degree calculation unit, configured to calculate the difference degree between the actual query features and the query features in the target mapping relationship data according to a preset dimension;
[0125] A consistency determination unit, configured to determine that the actual query features and the query features in the target mapping relationship data are consistent in response to the difference degree not exceeding a preset difference threshold.
[0126] In some alternative implementation manners of this embodiment, the information processing apparatus 600 may further include:
[0127] A model bucket creation unit, configured to create models with different model numbers into different model buckets by using a bucket technology;
[0128] A mapping relationship table creation unit, configured to load different model buckets into a unified hash map through a HashMap technology of a hash graph, and establish a mapping relationship table from the model number to the timestamp;
[0129] A mapping relationship generation unit, configured to generate mapping relationship data based on the mapping relationship table and the corresponding query words, query features, and calculation results.
[0130] In some alternative implementation manners of this embodiment, the information processing apparatus 600 may further include:
[0131] An update status processing unit, configured to obtain a query result corresponding to the query request from the same query instance in the mapping relationship update completed state in response to the actual query instance to which the query request belongs being currently in the mapping relationship update state.
[0132] This embodiment exists as an apparatus embodiment corresponding to the method embodiment as shown in Figure 1 corresponding process 100.
[0133] For further reference Figure 7, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an information processing apparatus, which corresponds to the method embodiment shown in Figure 2 and can be specifically applied to various electronic devices.
[0134] As shown in Figure 7 , the information processing apparatus 700 in this embodiment may include: a query request parsing unit 701, a timestamp extraction unit 702, a target mapping relationship data determination unit 703, a second processing unit 704, a new mapping relationship generation unit 705, a second update unit 706, and a query result generation unit 707. Among them, the query request parsing unit 701 is configured to extract an actual query term and an actual query feature from the obtained query request; the timestamp extraction unit 702 is configured to extract timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and the cache respectively; wherein, the mapping relationship data includes the correspondence between a query term, a model number, a timestamp, a query feature, and a calculation result, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; the target mapping relationship data determination unit 703 is configured to determine the mapping relationship data containing the latest timestamp as the target mapping relationship data; the second processing unit 704 is configured to, in response to the actual query feature not being consistent with the query feature in the target mapping relationship, calculate a target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature; the new mapping relationship generation unit 705 is configured to determine a new timestamp according to the generation time of the target calculation result, and generate a new mapping relationship based on the actual query term, the model number, the new timestamp, the actual query feature, and the target calculation result; the second update unit 706 is configured to update the mapping relationship data containing the same model number stored in the cache with the new mapping relationship; the query result generation unit 707 is configured to generate a query result corresponding to the query request based on the target calculation result.
[0135] In this embodiment, for the information processing apparatus 700: the specific processing of the query request parsing unit 701, the timestamp extraction unit 702, the target mapping relationship data determination unit 703, the second processing unit 704, the new mapping relationship generation unit 705, the second update unit 706, and the query result generation unit 707 and the technical effects brought by them can be respectively referred to Figure 2 the relevant descriptions of steps 201-207 in the corresponding embodiments, which will not be elaborated here.
[0136] In some optional implementation manners of this embodiment, the information processing apparatus 700 may further include:
[0137] A second processing unit, configured to use the calculation result in the target mapping relationship as the target calculation result in response to the actual query feature being consistent with the query feature in the target mapping relationship and the target mapping relationship being taken from the cache.
[0138] In some optional implementation manners of this embodiment, the query result generation unit 706 may be further configured to:
[0139] Generate a query result corresponding to the query request based on the target calculation results respectively corresponding to all the obtained model numbers.
[0140] In some optional implementation manners of this embodiment, the query feature includes at least one of: client features when the query request is triggered, behavior features when the query request is triggered, public opinion features when the query request is triggered, and voice features when the query request is triggered.
[0141] In some optional implementation manners of this embodiment, the information processing device 700 may further include:
[0142] A feature comprehensive weight setting unit, configured to set corresponding feature comprehensive weights for each feature constituting the query feature.
[0143] In some optional implementation manners of this embodiment, the information processing device 700 may further include:
[0144] A difference degree calculation unit, configured to calculate the difference degree between the actual query feature and the query feature in the target mapping relationship data according to a preset dimension;
[0145] A non - consistency determination unit, configured to determine that the actual query feature and the query feature in the target mapping relationship data are not consistent in response to the difference degree exceeding a preset difference threshold.
[0146] In some optional implementation manners of this embodiment, the information processing device 700 may further include:
[0147] A model bucket creation unit, configured to create models with different model numbers into different model buckets by using the bucket technology;
[0148] A mapping relationship table creation unit, configured to load different model buckets into a unified hash map through the HashMap technology and establish a mapping relationship table from the model number to the time stamp;
[0149] A mapping relationship generation unit, configured to generate mapping relationship data based on the mapping relationship table and the corresponding query words, query features, and calculation results.
[0150] In some optional implementation manners of this embodiment, the information processing device 700 may further include:
[0151] An update status processing unit, configured to obtain a query result corresponding to a query request from the same query instance in a mapping relationship update completion state in response to the fact that the actual query instance to which the query request belongs is currently in a mapping relationship update state.
[0152] The above two embodiments respectively exist as device embodiments corresponding to the method embodiments shown in Figure 1 corresponding process 100 and Figure 2 the method embodiments shown in corresponding process 200.
[0153] The information processing device provided by the above two device embodiments provides a fine management granularity at the model level through a mapping relationship composed of a model number, a time stamp, and query features, and determines which cached data is unavailable and needs to be updated specifically by comparing the time stamps in the mapping relationships stored locally and in the cache respectively. Thus, through a scientific update strategy, it is possible to control that the cached data stored is as up-to-date as possible, thereby improving the hit rate of the query result corresponding to the query request directly hitting the cache, and ultimately realizing the improvement of the query result feedback efficiency.
[0154] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to implement the information processing method described in any of the above embodiments.
[0155] According to an embodiment of the present disclosure, the present disclosure also provides a readable storage medium, which stores computer instructions for enabling a computer to implement the information processing method described in any of the above embodiments when executed.
[0156] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which can implement the information processing method described in any of the above embodiments when executed by a processor.
[0157] Figure 8FIG. 0 shows a schematic block diagram of an exemplary electronic device 800 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementations of the present disclosure described and / or claimed herein.
[0158] As Figure 8 shown, the device 800 includes a computing unit 801 that can perform various appropriate actions and processes in accordance with a computer program stored in a read only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0159] A plurality of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as, for example, a keyboard, a mouse, etc.; an output unit 807, such as, for example, various types of displays, speakers, etc.; a storage unit 808, such as, for example, a magnetic disk, an optical disk, etc.; and a communication unit 809, such as, for example, a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0160] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 executes the various methods and processes described above, such as the information processing method. For example, in some embodiments, the information processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the information processing method described above can be executed. Alternatively, in other embodiments, the computing unit 801 can be configured to execute the information processing method by any other suitable means (e.g., by means of firmware).
[0161] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0162] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0164] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0165] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0166] A computer system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to address the defects of high management difficulty and weak business scalability existing in traditional physical hosts and virtual private server (VPS) services.
[0167] According to the technical solution of the embodiment of the present disclosure, by means of the mapping relationship composed of a model number, a timestamp, and a query feature, a fine management granularity at the model level is provided, and by comparing the timestamps in the mapping relationships stored locally and in the cache respectively, it is determined which cache data is unavailable and needs to be updated specifically, so as to control, through a scientific update strategy, that the cache stores as much as possible the latest model calculation results, thereby enhancing the hit rate of the query result corresponding to the query request directly hitting the cache, and ultimately achieving an improvement in the query result feedback efficiency.
[0168] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in the present disclosure can be achieved, and no limitation is made herein.
[0169] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. An information processing method, comprising: extracting an actual query term and actual query features from the obtained query request; respectively extracting timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and cache; wherein, the mapping relationship data includes the corresponding relationship between query terms, model numbers, timestamps, query features, and calculation results, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; the model refers to the machine learning model corresponding to the vertical category to which the query request belongs; determining the mapping relationship data containing the latest timestamp as the target mapping relationship data; in response to the actual query features being consistent with the query features in the target mapping relationship data and the target mapping relationship data being taken from the local storage, using the calculation result in the target mapping relationship data as the target calculation result; using the target mapping relationship data to update the mapping relationship data containing the same model number stored in the cache; generating a query result corresponding to the query request based on the target calculation result.
2. The method according to claim 1, wherein, The generating a query result corresponding to the query request based on the target calculation result includes: generating a query result corresponding to the query request based on the target calculation results corresponding to all the obtained model numbers respectively.
3. The method according to claim 1, wherein The query features include: at least one of client features when triggering the query request, behavioral features when triggering the query request, public opinion features when triggering the query request, and voice features when triggering the query request.
4. The method according to claim 3, further comprising: setting corresponding feature comprehensive weights for each feature constituting the query features.
5. The method according to claim 1, further comprising: calculating the degree of difference between the actual query features and the query features in the target mapping relationship data according to a preset dimension; in response to the degree of difference not exceeding a preset difference threshold, determining that the actual query features are consistent with the query features in the target mapping relationship data.
6. The method according to claim 1, further comprising: using the bucketing technique to create different model buckets for models with different model numbers; loading different model buckets into a unified hash map through the HashMap technique and establishing a mapping relationship table from the model number to the timestamp; generating the mapping relationship data based on the mapping relationship table and the corresponding query terms, query features, and calculation results.
7. The method according to any one of claims 1-6, further comprising: in response to the actual query instance to which the query request belongs being currently in the mapping relationship update state, obtaining a query result corresponding to the query request from the same query instance in the mapping relationship update completed state.
8. An information processing method, comprising: extracting an actual query term and actual query features from the obtained query request; Extract the timestamp corresponding to the actual query term from the mapping relationship data stored in the local storage and cache respectively; wherein, the mapping relationship data includes the corresponding relationship between the query term, model number, timestamp, query feature, and calculation result, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; the model refers to the machine learning model corresponding to the vertical category to which the query request belongs. Determine the mapping relationship data containing the latest timestamp as the target mapping relationship data. In response to the fact that the actual query feature does not match the query feature in the target mapping relationship, calculate the target calculation result based on the model corresponding to the target mapping relationship data and the actual query feature. Determine a new timestamp according to the generation time of the target calculation result, and generate new mapping relationship data based on the actual query term, model number, the new timestamp, the actual query feature, and the target calculation result. Use the new mapping relationship data to update the mapping relationship data containing the same model number stored in the cache. Generate a query result corresponding to the query request based on the target calculation result.
9. The method according to claim 8, wherein, The generating a query result corresponding to the query request based on the target calculation result includes: Generate a query result corresponding to the query request based on the target calculation results corresponding to all the obtained model numbers respectively.
10. The method according to claim 8, wherein, The query feature includes: At least one of the client feature when triggering the query request, the behavior feature when triggering the query request, the public opinion feature when triggering the query request, and the voice feature when triggering the query request.
11. The method according to claim 10, further comprising: Set corresponding feature comprehensive weights for each feature constituting the query feature.
12. The method according to claim 8, further comprising: Calculate the difference degree between the actual query feature and the query feature in the target mapping relationship data according to a preset dimension. In response to the difference degree exceeding a preset difference threshold, determine that the actual query feature does not match the query feature in the target mapping relationship data.
13. The method according to claim 8, further comprising: Use the bucketing technique to create different model buckets for models with different model numbers. Load different model buckets into a unified hash map through the HashMap technique, and establish a mapping relationship table between the model number and the timestamp. Generate the mapping relationship data based on the mapping relationship table and the corresponding query term, query feature, and calculation result.
14. The method according to any one of claims 8-13, further comprising: In response to the fact that the actual query instance to which the query request belongs is currently in the mapping relationship update state, obtain the query result corresponding to the query request from the same query instance in the mapping relationship update completed state.
15. An information processing device, comprising: A query request parsing unit configured to extract an actual query term and an actual query feature from the obtained query request. A timestamp extraction unit, configured to extract timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and the cache respectively; wherein, the mapping relationship data includes the correspondence between query terms, model numbers, timestamps, query features, and calculation results, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; the model refers to the machine learning model corresponding to the vertical category to which the query request belongs. A target mapping relationship data determination unit, configured to determine the mapping relationship data containing the latest timestamp as the target mapping relationship data. A first processing unit, configured to, in response to the actual query feature being consistent with the query feature in the target mapping relationship data and the target mapping relationship data being taken from the local storage, use the calculation result in the target mapping relationship data as the target calculation result. A first update unit, configured to update the mapping relationship data containing the same model number stored in the cache with the target mapping relationship data. A query result generation unit, configured to generate a query result corresponding to the query request based on the target calculation result.
16. The device according to claim 15, wherein the query result generation unit is further configured to: Generate a query result corresponding to the query request based on the target calculation results corresponding to all the model numbers that have been obtained.
17. The apparatus according to claim 15, wherein, The query feature includes at least one of: client features when the query request is triggered, behavioral features when the query request is triggered, public opinion features when the query request is triggered, and voice features when the query request is triggered.
18. The device according to claim 17, further comprising: A feature comprehensive weight setting unit, configured to set corresponding feature comprehensive weights for each feature constituting the query feature.
19. The device according to claim 15, further comprising: A difference degree calculation unit, configured to calculate the difference degree between the actual query feature and the query feature in the target mapping relationship data according to a preset dimension. A consistency determination unit, configured to, in response to the difference degree not exceeding a preset difference threshold, determine that the actual query feature is consistent with the query feature in the target mapping relationship data.
20. The device according to claim 15, further comprising: A model bucket creation unit, configured to use the bucket technology to create different model buckets for models with different model numbers. A mapping relationship table creation unit, configured to load different model buckets into a unified hash map through the HashMap technology and establish a mapping relationship table from the model number to the timestamp. A mapping relationship generation unit, configured to generate the mapping relationship data based on the mapping relationship table and the corresponding query terms, query features, and calculation results.
21. The device according to any one of claims 15-20, further comprising: An update status processing unit, configured to obtain a query result corresponding to the query request from the same query instance in the mapping relationship update completion state in response to the actual query instance to which the query request belongs being currently in the mapping relationship update state.
22. An information processing device, comprising: A query request parsing unit, configured to extract an actual query term and actual query features from the obtained query request; A timestamp extraction unit, configured to extract timestamps corresponding to the actual query term from the mapping relationship data stored in the local storage and the cache respectively; wherein, the mapping relationship data includes the corresponding relationships among query terms, model numbers, timestamps, query features, and calculation results, and the mapping relationship data stored in the cache is synchronized from the mapping relationship data generated by the local storage; the model refers to a machine learning model corresponding to the vertical category to which the query request belongs; A target mapping relationship data determination unit, configured to determine the mapping relationship data containing the latest timestamp as the target mapping relationship data; A second processing unit, configured to calculate a target calculation result based on the model corresponding to the target mapping relationship data and the actual query features in response to the actual query features not being consistent with the query features in the target mapping relationship; A new mapping relationship generation unit, configured to determine a new timestamp according to the generation time of the target calculation result, and generate new mapping relationship data based on the actual query term, model number, the new timestamp, the actual query features, and the target calculation result; A second update unit, configured to update the mapping relationship data containing the same model number stored in the cache with the new mapping relationship data; A query result generation unit, configured to generate a query result corresponding to the query request based on the target calculation result.
23. The device according to claim 22, wherein the query result generation unit is further configured to: Generate a query result corresponding to the query request based on the target calculation results respectively corresponding to all the obtained model numbers.
24. The apparatus according to claim 22, wherein, The query features include at least one of client features when the query request is triggered, behavioral features when the query request is triggered, public opinion features when the query request is triggered, and voice features when the query request is triggered.
25. The device according to claim 24, further comprising: A feature comprehensive weight setting unit, configured to set corresponding feature comprehensive weights for each feature constituting the query features.
26. The device according to claim 22, further comprising: A difference degree calculation unit, configured to calculate the difference degree between the actual query features and the query features in the target mapping relationship data according to a preset dimension; A non-consistency determination unit, configured to determine that the actual query features and the query features in the target mapping relationship data are not consistent in response to the difference degree exceeding a preset difference threshold.
27. The device according to claim 22, further comprising: A model bucket creation unit, configured to create models with different model numbers into different model buckets by using a bucketing technique; A mapping relationship table creation unit, configured to load different model buckets into a unified hash map through the HashMap technology of a hash map, and establish a mapping relationship table between the model numbers and the timestamps; A mapping relationship generation unit, configured to generate the mapping relationship data based on the mapping relationship table, the corresponding query words, query features, and calculation results.
28. The apparatus according to any one of claims 22-27, further comprising: An update status processing unit, configured to, in response to the fact that the actual query instance to which the query request belongs is currently in a mapping relationship update state, obtain a query result corresponding to the query request from the same query instance that has completed the mapping relationship update.
29. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information processing method according to any one of claims 1-7 or any one of claims 8-14.
30. A non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the information processing method according to any one of claims 1-7 or any one of claims 8-14.
31. A computer program product, comprising a computer program, and when the computer program is executed by a processor, the steps of the information processing method according to any one of claims 1-7 or any one of claims 8-14 are implemented.
Citation Information
Patent Citations
Cache updating method and device
CN111459987A
Query request response method and device, storage medium and electronic device
CN114254001A