Data query method and device, electronic equipment, storage medium and program product
By performing semantic compression and feature extraction on the descriptive information of queryable objects, the problems of low data query efficiency and high transmission overhead caused by multimodal models are solved, and efficient data query and processing are achieved.
Patent Information
- Application Number
- CN202511688616.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-24
AI Technical Summary
In systems such as media content recommendation, the high-dimensional, long-sequence feature vectors extracted by multimodal models result in low data query efficiency, high transmission overhead, and extremely high query rate per second for the feature vectors of queryable objects, putting pressure on the data storage system. Furthermore, the inconsistency between the embedding space of the multimodal model and the business model weakens the generalization ability.
By semantically compressing the descriptive information of queryable objects, semantic identifiers are obtained, and feature vectors are extracted using a target feature extraction model, thereby reducing data volume and transmission overhead and improving the processing efficiency of business models.
It effectively reduces the amount of data processed by the business model and the overhead of data transmission, improves data query efficiency and processing throughput, and enhances the generalization ability of multimodal models.
Smart Images

Figure CN121561126A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to data query methods, devices, electronic devices, storage media, and program products. Background Technology
[0002] In systems involving data querying, such as media content recommendation, multimodal models are typically used to extract features from the descriptive information of queryable objects, obtaining and storing feature vectors of these objects. Subsequently, in the data querying process, the query is performed by matching the feature vectors of the queryable objects. However, because the feature vectors of queryable objects are often high-dimensional and have long sequence lengths, data query efficiency is low. Summary of the Invention
[0003] This application provides a data query method, apparatus, electronic device, storage medium, and program product to solve the problem of low data query efficiency.
[0004] Firstly, this application provides a data query method, including: Receive a data query request, the data query request including first descriptive information of the target query object; Semantic matching is performed between the first description information and the first semantic identifier corresponding to the queryable object to obtain the target semantic identifier; wherein, the first semantic identifier is obtained by semantically compressing the second description information of the queryable object; Based on the target semantic identifier, the target feature vector is obtained by querying the first feature vector corresponding to the first semantic identifier; wherein, the first feature vector is obtained by extracting features from the first semantic identifier through a target feature extraction model. The target feature vector is input into the business model, and the data query result of the data query request is obtained from the queryable objects.
[0005] Secondly, this application provides a data query device, comprising: A request receiving module is used to receive a data query request, wherein the data query request includes first descriptive information of the target query object; The semantic identifier matching module is used to perform semantic matching between the first description information and the first semantic identifier corresponding to the queryable object to obtain the target semantic identifier; wherein, the first semantic identifier is obtained by semantically compressing the second description information of the queryable object; The feature vector matching module is used to query the first feature vector corresponding to the first semantic identifier based on the target semantic identifier to obtain the target feature vector; wherein, the first feature vector is obtained by extracting features from the first semantic identifier through a target feature extraction model. The business query module is used to input the target feature vector into the business model and retrieve the data query results of the data query request from the queryable objects.
[0006] Thirdly, this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the data query method described in the first aspect or any corresponding embodiment.
[0007] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to execute the data query method described in the first aspect or any corresponding embodiment.
[0008] Fifthly, this application provides a computer program product, including computer instructions for causing a computer to execute the data query method described in the first aspect or any corresponding embodiment thereof.
[0009] The data query method provided in this application embodiment, since the first semantic identifier is obtained by semantically compressing the second descriptive information of the queryable object, not only contains the semantic information of the queryable object, but also has a smaller data volume compared to the second descriptive information. The first feature vector of the first semantic identifier also has a smaller data volume than the feature vector of the second descriptive information. Therefore, when a data query request is received, semantic matching is performed between the first descriptive information of the target query object in the data query request and the first semantic identifier of the queryable object to obtain the target semantic identifier. Then, based on the target semantic identifier, a matching target feature vector is queried from the first feature vector corresponding to the first semantic identifier, which is used as the feature vector for data querying. This effectively reduces the amount of data to be processed by the business model and the data transmission overhead. Furthermore, when using the target feature vector and the business model to query the data query results of the data query request in the queryable object, the processing efficiency of the business model can be effectively improved, thereby improving data query efficiency.
[0010] The beneficial effects of data query devices, electronic devices, storage media, and program products correspond to the beneficial effects of data query methods, and will not be elaborated here. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application; Figure 2 This is a schematic diagram of the first type of data query method according to an embodiment of this application; Figure 3 This is a flowchart illustrating a first method for obtaining the first semantic identifier of a queryable object according to an embodiment of this application. Figure 4 This is a schematic diagram illustrating multiple semantic division levels according to embodiments of this application; Figure 5 This is a flowchart illustrating a second method for obtaining the first semantic identifier of a queryable object according to an embodiment of this application. Figure 6 This is a flowchart illustrating a third method for obtaining the first semantic identifier of a queryable object according to an embodiment of this application. Figure 7 This is a schematic diagram of the parameter update process for various compression models and vector quantization models according to embodiments of this application; Figure 8 This is a flowchart illustrating the method for obtaining the first feature vector of the first semantic identifier according to an embodiment of this application; Figure 9 This is a flowchart illustrating the first training method of the target feature extraction model according to an embodiment of this application; Figure 10 This is a flowchart illustrating the second training method of the target feature extraction model according to an embodiment of this application; Figure 11 This is a schematic diagram of a first application scenario according to an embodiment of this application; Figure 12 This is a schematic diagram of a second application scenario according to an embodiment of this application; Figure 13 This is a schematic diagram illustrating a third application scenario according to an embodiment of this application; Figure 14 This is a structural block diagram of a data query device according to an embodiment of this application; Figure 15 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0014] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0015] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this application's technical solution, based on the prompt message.
[0016] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0017] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this application. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this application.
[0018] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0019] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0020] In systems involving data query functions, such as media content recommendation, multimodal models are typically used to extract features from the descriptive information of queryable objects, obtaining and storing the feature vectors of these objects. Then, in subsequent data query processes, the data query is performed by matching the feature vectors of the queryable objects.
[0021] Taking media content recommendation as an example, a multimodal model is used to extract features from the descriptive information of the recommended content, resulting in a unified feature vector for long sequences. This feature vector is then directly applied to long sequence scenarios.
[0022] This method of data retrieval has the following problems: 1. In long sequence scenarios, the feature vectors extracted by multimodal models are often high in dimensionality (e.g., 1536 dimensions) and have large sequence lengths (e.g., 5000), resulting in huge data transmission overhead and thus low data query efficiency.
[0023] 2. Long sequence feature vectors result in an extremely high query rate (QPS) for querying the feature vectors of queryable objects, such as 700 million QPS, which puts enormous pressure on data storage systems.
[0024] 3. The inconsistency between the embedding space of the multimodal model and the embedding space of the business model will weaken the generalization ability of the multimodal model and affect the business processing effect of the business model.
[0025] As one optional application scenario in the embodiments of this application, such as Figure 1 As shown, the data query system may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.
[0026] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.
[0027] According to an embodiment of this application, a data query method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0028] This embodiment provides a data query method that can be used with the aforementioned server. Figure 2 This is a flowchart of a data query method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S201: Receive a data query request, which includes the first description information of the target query object.
[0029] In practical applications, users can enter the first descriptive information of the target query object on their terminal device. The terminal device then sends a data query request to the server based on the first descriptive information.
[0030] Step S202: Semantic matching is performed between the first description information and the first semantic identifier corresponding to the queryable object to obtain the target semantic identifier; wherein, the first semantic identifier is obtained by semantic compression of the second description information of the queryable object.
[0031] The first description information may include object information of the queryable object. For example, if the queryable object is a product, the first description information may be the product name, product attributes, etc.
[0032] Optionally, the second descriptive information includes descriptive information for at least one data modality, which includes one or more of text modality and non-text modality. The non-text modality includes one or more of image modality and video modality. Furthermore, the non-text modality may also include audio modality, etc., and can be adjusted according to the actual situation.
[0033] For example, taking media content as the queryable object, the second descriptive information includes the title of the media content, landing page information, etc.
[0034] It should be noted that the first semantic identifier (also known as the Semantic ID) should retain as much key information as possible from the second descriptive information. For example, descriptive information about the object to which the media content belongs.
[0035] Step S203: Based on the target semantic identifier, query the first feature vector in the first feature vector corresponding to the first semantic identifier to obtain the target feature vector; wherein, the first feature vector is obtained by extracting features from the first semantic identifier through the target feature extraction model.
[0036] That is, the first feature vector corresponding to the first semantic identifier that matches the target semantic identifier is used as the target feature vector.
[0037] Optionally, the target feature extraction model is a large language model. In addition, other feature extraction models can also be used, which are not limited here.
[0038] Step S204: Input the target feature vector into the business model and retrieve the data query results of the data query request from the queryable objects.
[0039] The business model refers to the business model of the target business to which the data query request belongs. Optionally, the business model is a fine-grained ranking model, which can be adjusted according to the actual situation.
[0040] The data query method provided in this embodiment, because the first semantic identifier is obtained by semantically compressing the second descriptive information of the queryable object, not only contains the semantic information of the queryable object, but also has a smaller data volume compared to the second descriptive information. The first feature vector of the first semantic identifier also has less data volume than the feature vector of the second descriptive information. Therefore, when a data query request is received, semantic matching is performed between the first descriptive information of the target query object in the data query request and the first semantic identifier of the queryable object to obtain the target semantic identifier. Then, based on the target semantic identifier, a matching target feature vector is queried from the first feature vector corresponding to the first semantic identifier, which is used as the feature vector for data querying. This effectively reduces the amount of data that the business model needs to process and the data transmission overhead. Furthermore, when using the target feature vector and the business model to query the data query results of the data query request in the queryable object, the processing efficiency of the business model can be effectively improved, thereby increasing data query efficiency and data processing throughput.
[0041] In some alternative implementations, see [link to implementation details]. Figure 3 The methods for obtaining the first semantic identifier corresponding to the queryable object include: Step S301: Extract the summary information of the second description information of the queryable object.
[0042] Optionally, a summary of the second descriptive information of the queryable object can be extracted using a multimodal model. Alternatively, other models for extracting summaries can be used to extract the summary of the second descriptive information of the queryable object (such as the title of media content, landing page information, etc.), which are not limited here.
[0043] Step S302: Input the summary information of the second description information into the text compression model for semantic compression to obtain the first semantic feature of the queryable object.
[0044] Optionally, the text compression model can be a text compression tool for large language models (also known as Text LLMCompressor), which can be selected according to the actual situation.
[0045] Specifically, the text compression model is configured with a preset number (e.g., 2) of semantic features to be output. The summary information of the second descriptive information is input into the text compression model for semantic compression to obtain the preset number (e.g., 2) of first semantic features for the queryable object. That is, the summary information of the second descriptive information is input into the text compression model, and the summary information is compressed into a preset number of tokens, which are then used as the first semantic features of the queryable object. Therefore, the sequence of tokens constituting the entire first semantic identifier (i.e., the summary information of the second descriptive information) can be horizontally divided into several independent and parallel groups to obtain the first semantic features of the queryable object. Each first semantic feature is responsible for capturing and representing a specific aspect of the semantics in the second descriptive information.
[0046] Step S303: Input the first semantic feature into the first vector quantization model for vector quantization to obtain the first semantic identifier of the queryable object.
[0047] Specifically, the first vector quantization model is configured with multiple semantic partitioning levels. The first semantic feature is input into the first vector quantization model and partitioned according to the multiple semantic partitioning levels to obtain multiple first semantic identifiers.
[0048] For example, assuming the number of first semantic features of the queryable object is 2, and the first vector quantization model is configured with 3 semantic partitioning levels, the first vector quantization model can be used to partition each first semantic feature according to the 3 semantic partitioning levels, thereby dividing each first semantic feature into 3 groups, resulting in a total of 6 groups. Each group is quantized into 3 first semantic identifiers through 3 layers of residual quantization in the first vector quantization model, thereby obtaining 18 first semantic identifiers.
[0049] like Figure 4As shown, the spatial size of the first semantic identifier is 65536. In the first layer, each first semantic feature is divided according to clothing services, beauty services, hardware tools, etc., resulting in multiple semantic identifiers. In the second layer, the semantic identifiers of clothing services are further divided according to clothes, hats, etc., resulting in multiple semantic identifiers under clothing services again. Similarly, the semantic identifiers of hardware tools are further divided according to electrical tape, screws, etc., resulting in multiple semantic identifiers under hardware tools. In the third layer, the semantic identifiers of clothing are further divided according to shirts, short sleeves, etc., resulting in multiple semantic identifiers under clothing. Similarly, the semantic identifiers of screws are further divided according to hexagonal screws, wood screws, etc., resulting in multiple semantic identifiers under screws. The semantic identifiers of each first semantic feature in each layer are grouped together to obtain three groups of semantic identifiers: c1, c2, and c3, obtained from the division of each first semantic feature.
[0050] The data query method provided in this embodiment first extracts summary information of the second descriptive information of the queryable object. Therefore, it can convert the second descriptive information of different data modalities into summary information of the text modal, facilitating semantic compression using a unified text compression model to obtain the first semantic feature of the queryable object. Furthermore, a unified first vector quantization model is used to perform vector quantization on the first semantic feature to obtain the first semantic identifier of the queryable object. This ensures that the semantic compression process of the second descriptive information of different data modalities is consistent, thereby guaranteeing the accuracy of the obtained first semantic feature.
[0051] Taking a specific application example, the acquisition of the first semantic identifier of a queryable object can be divided into real-time data inference and historical data inference. Real-time data inference utilizes a distributed processing engine to write the second description information of the queryable object into a message queue (MQ) in real time. Tasks in the distributed processing engine consume the second description information of the queryable object from the message queue. A multimodal model is requested to extract summary information from the second description information. Then, a semantic identifier inference service is requested to obtain the first semantic identifier of the queryable object through a text compression model and a first vector quantization model. The obtained first semantic identifier is then written into a first storage space (such as an online space or training space) corresponding to the queryable object.
[0052] Historical data inference utilizes Hive tables in the Hadoop data query system to store the second description information of historical queryable objects. Spark tasks consume this second description information from the Hive tables. A multimodal model is then requested to extract summary information from the second description information. Next, a semantic identifier inference service is requested to obtain the first semantic identifier of the queryable object using a text compression model and a first vector quantization model. The obtained first semantic identifier is then mapped to the queryable object and written into a first storage space (such as an online space or training space).
[0053] As one specific application example, see Figure 5 The acquisition of the first semantic identifier corresponding to the queryable object mainly includes the following steps: First, extract the summary information of the second descriptive information of the queryable object using a multimodal model. Second, perform semantic compression on the second descriptive information using a semantic identifier inference service to obtain the first semantic identifier of the queryable object. The semantic identifier inference service provides a text compression model and a first vector quantization model. Third, input the summary information of the second descriptive information into the text compression model for semantic compression to obtain the first semantic feature of the queryable object. Finally, input the first semantic feature into the first vector quantization model for vector quantization to obtain the first semantic identifier of the queryable object.
[0054] In some alternative implementations, the number of second descriptive information items can be one or more. See also Figure 6 The methods for obtaining the first semantic identifier corresponding to the queryable object include: Step S601: Based on the data modalities of each second description information, determine the target compression model corresponding to the second description information in the text compression model and the non-text compression model.
[0055] Specifically, if the data modality of the second descriptive information is text, then the text compression model is used as the target compression model for the second descriptive information. If the data modality of the second descriptive information is non-text (such as video), then the non-text compression model (such as video compression model) is used as the target compression model for the second descriptive information.
[0056] Step S602: Input each second description information into the corresponding target compression model for semantic compression to obtain the second semantic features of each second description information.
[0057] Specifically, if the data modality of the second descriptive information is text-based, then the second descriptive information is input into a text compression model for semantic compression to obtain the second semantic features of the second descriptive information. If the data modality of the second descriptive information is non-text-based, then the second descriptive information is input into a non-text compression model for semantic compression to obtain the second semantic features of the second descriptive information.
[0058] Taking the second description information of a video modality as an example, video frames are extracted from the second description information to obtain video frames. The video frames are then input into a video compression model for semantic compression to obtain the second semantic features of the second description information.
[0059] Step S603: Input each second semantic feature into the vector quantization model connected to the corresponding target compression model for vector quantization to obtain the semantic identifier corresponding to each second description information; wherein, the vector quantization model connected to the text compression model is the first vector quantization model; and the vector quantization model connected to the non-text compression model is the second vector quantization model.
[0060] Specifically, if the data modality of the second descriptive information is textual, then the second semantic feature of the second descriptive information is input into the first vector quantization model for vector quantization to obtain the semantic identifier corresponding to the second descriptive information. If the data modality of the second descriptive information is non-textual, then the second semantic feature of the second descriptive information is input into the second vector quantization model for vector quantization to obtain the semantic identifier corresponding to the second descriptive information.
[0061] Taking the second description information of a video modality as an example, the semantic identifiers corresponding to the second description information include the video description, the product information introduced in the video, and the usage scenarios of the video.
[0062] Step S604: Based on the semantic identifiers corresponding to each of the second description information, obtain the first semantic identifier of the queryable object.
[0063] Specifically, the semantic identifiers corresponding to each of the second descriptive information are concatenated to obtain the first semantic identifier of the queryable object.
[0064] The data query method provided in this embodiment configures different compression models for the second description information of different data modalities. Therefore, it can perform targeted semantic compression of the second description information according to the characteristics of different data modalities, and obtain the second semantic features of the second description information of different data modalities. Furthermore, different vector quantization models are configured for different compression models, thus ensuring the adaptability of the compression model and the vector quantization model, thereby improving the accuracy of the semantic identifiers of the extracted second description information.
[0065] In some optional implementations, the data query method of this application further includes: Step a1: Obtain a sample of the description information of the first query object. The sample of the description information includes a text description sample.
[0066] Optionally, if the first query object is media content, the description information sample includes the title of the media content, landing page information, etc.
[0067] Step a2: Input the text description sample into the text compression model for semantic compression to obtain the third semantic feature of the text description sample.
[0068] Specifically, the text compression model is configured with a preset number of semantic features to be output (e.g., 2). The text description sample is input into the text compression model, and the text description sample is semantically compressed according to the preset number to obtain the preset number of third semantic features of the text description sample.
[0069] Step a3: Input the third semantic feature into the first vector quantization model for vector quantization to obtain the third semantic identifier corresponding to the text description sample; Specifically, the first vector quantization model is configured with multiple semantic partitioning levels. The third semantic feature is input into the first vector quantization model and partitioned according to the multiple semantic partitioning levels to obtain multiple third semantic identifiers.
[0070] It should be noted that the third semantic identifier should retain as much key information as possible from the text description sample. For example, descriptive information about the object to which the media content belongs.
[0071] Step a4: Input the third semantic identifier into the first reconstruction model for reconstruction to obtain the first reconstruction result.
[0072] Optionally, the first reconstruction model is a text decompression tool for a large language model (also known as a Text LLM Decompressor).
[0073] Specifically, the text description sample is reconstructed using the first reconstruction model and the third semantic identifier to obtain the first reconstruction result.
[0074] For example, assuming the text description sample includes the title of the media content and product information of the product described in the media content, then the title of the media content and product information of the product described in the media content need to be reconstructed using the first reconstruction model and the third semantic identifier.
[0075] Step a5: Determine the first reconstruction loss based on the difference between the text description sample and the first reconstruction result.
[0076] Specifically, the first reconstruction loss is calculated using the following formula:
[0077] in, The first reconstruction loss, This is the first reconstruction result, where T is the time step. Characterizing the first reconstruction model based on the first t-1 words ~ At that time, the t-th word is predicted. The logarithm of the probability.
[0078] Step a6: Update the parameters of the text compression model and the first vector quantization model based on the first reconstruction loss.
[0079] The data query method provided in this embodiment first uses a text compression model to semantically compress the text description sample of the first query object, obtaining the third semantic feature of the text description sample. Then, it uses a first vector quantization model to perform vector quantization on the third semantic feature, obtaining the third semantic identifier of the text description sample. Subsequently, it uses a first reconstruction model to reconstruct the text of the third semantic identifier, obtaining the first reconstruction result. Therefore, the quality of the extracted third semantic identifier can be characterized by the difference between the first reconstruction result and the text description sample. Based on the difference between the first reconstruction result and the text description sample, the first reconstruction loss is determined to update the parameters of the text compression model and the first vector quantization model, improving the semantic compression capability of the text compression model and the vector quantization capability of the first vector quantization model, and further improving the accuracy of the semantic identifier extracted by the text compression model and the first vector quantization model.
[0080] In some optional implementations, the description information sample also includes a non-text description sample. This non-text description sample may be an image, video, etc., of the first query object. Step a6 above includes: Step a61: Input the non-textual description sample into the non-textual compression model for semantic compression to obtain the fourth semantic feature of the non-textual description sample.
[0081] Specifically, the non-text compression model is configured with a preset number of output semantic features (e.g., 2). The non-text description sample is input into the non-text compression model, and the non-text description sample is semantically compressed according to the preset number to obtain the preset number of fourth semantic features of the non-text description sample.
[0082] For example, if the non-textual description sample is a video frame obtained by extracting video frames for the first query object, then the video frame is input into the video compression model to perform semantic feature extraction, resulting in the fourth semantic feature of the video frame.
[0083] Step a62: Input the fourth semantic feature into the second vector quantization model for vector quantization to obtain the fourth semantic identifier of the non-textual description sample.
[0084] Specifically, the second vector quantization model is configured with multiple semantic partitioning levels. The fourth semantic feature is input into the second vector quantization model and partitioned according to the multiple semantic partitioning levels to obtain multiple fourth semantic identifiers.
[0085] Step a63: Input the fourth semantic identifier into the second reconstruction model for reconstruction to obtain the second reconstruction result.
[0086] Specifically, the second reconstruction model is a text decompression tool for large language models (also known as Vision LLM De-Compressor).
[0087] Specifically, the second reconstruction model and the fourth semantic identifier are used to reconstruct the text information in non-textual description samples (such as text information in videos) to obtain the second reconstruction result.
[0088] Step a64: Based on the difference between the second reconstruction result and the text information in the non-text description samples, the second reconstruction loss is obtained.
[0089] Specifically, the second reconstruction loss is calculated using the following formula:
[0090] in, For the second reconstruction loss, This is the second reconstruction result, where T is the time step. Characterizing the second reconstruction model based on the first t-1 words ~ At that time, the t-th word is predicted. The logarithm of the probability.
[0091] Step a65: Based on the first reconstruction loss and the second reconstruction loss, update the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model.
[0092] The data query method provided in this embodiment characterizes the quality of the extracted fourth semantic identifier by the difference between the second reconstruction result and the text information in the non-text description sample, thereby determining the second reconstruction loss. Furthermore, by combining the first and second reconstruction losses, the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model are updated. Therefore, the semantic compression capability of each compression model and the vector quantization capability of each vector quantization model can be improved, further enhancing the accuracy of the semantic identifiers extracted through the compression model and the vector quantization model.
[0093] In some alternative implementations, step a65 above includes: Step a651: Based on the difference between the third semantic identifier and the fourth semantic identifier, obtain the contrast loss.
[0094] Specifically, the contrast loss is calculated using the following formula:
[0095] in, To compare the loss, N is the number of sample pairs formed by the third and fourth semantic identifiers in each batch. As a third semantic identifier, As the fourth semantic identifier, To compare the learning parameters.
[0096] Step a652: Based on the first reconstruction loss, the second reconstruction loss, and the contrast loss, update the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model.
[0097] The data query method provided in this embodiment updates the parameters of each compression model and vector quantization model by combining contrastive loss. Therefore, it can align the text modal information and non-text modal information of each compression model and vector quantization model, thereby bringing the features of the two data modalities of the same query object closer together.
[0098] In some optional implementations, step a652 above includes: inputting the fourth semantic feature into the third vector quantization model for vector quantization to obtain the fifth semantic identifier of the non-text description sample; inputting the fifth semantic identifier into the third reconstruction model for reconstruction to obtain the third reconstruction result; obtaining the third reconstruction loss based on the difference between the third reconstruction result and the non-text description sample; and updating the parameters of the text compression model, the first vector quantization model, the non-text compression model, the second vector quantization model, and the third vector quantization model based on the first reconstruction loss, the second reconstruction loss, the third reconstruction loss, and the contrast loss.
[0099] Specifically, the third vector quantization model is configured with multiple semantic partitioning levels. The fourth semantic feature is input into the third vector quantization model and partitioned according to the multiple semantic partitioning levels to obtain multiple fifth semantic identifiers.
[0100] Specifically, the third reconstruction model is a non-text decompression tool for large language models. For example, if the non-text description sample is a video modality, then the third reconstruction model is a video decompression tool for large language models (also known as Vision LLM De-Compressor).
[0101] Specifically, the third reconstruction model and the fifth semantic identifier are used to reconstruct non-textual description samples to obtain the third reconstruction result.
[0102] Specifically, the third reconstruction loss is calculated using the following formula:
[0103] in, For the third reconstruction loss, This is the third reconstruction result, where T is the time step. Characterizing the third reconstruction model based on the first t-1 words ~ When the t-th word is predicted... The logarithm of the probability.
[0104] Furthermore, the above-mentioned parameter updates for the text compression model, the first vector quantization model, the non-text compression model, the second vector quantization model, and the third vector quantization model based on the first reconstruction loss, the second reconstruction loss, the third reconstruction loss, and the contrast loss include: obtaining the first model loss based on the first reconstruction loss, the second reconstruction loss, the third reconstruction loss, and the contrast loss; and updating the parameters of the text compression model, the first vector quantization model, the non-text compression model, the second vector quantization model, and the third vector quantization model based on the first model loss.
[0105] The loss of the first model is obtained by the following formula:
[0106] Wherein, the loss of the first model is This is the fusion result of the first reconstruction loss, the second reconstruction loss, and the third reconstruction loss (such as the summation result). To compare the losses and their corresponding weights.
[0107] The data query method provided in this embodiment can further align textual modal information and non-textual modal information of the same query object by utilizing the third reconstruction loss, since the third reconstruction loss is only related to information in the pure non-textual modality.
[0108] In some optional implementations, the first vector quantization model and the second vector quantization model are configured with multiple semantic partitioning levels. Both the first vector quantization model and the second vector quantization model perform vector quantization on the input semantic features according to multiple semantic partitioning levels and output semantic identifiers of multiple semantic partitioning levels.
[0109] The semantic classification hierarchy is related to the business requirements of the target business to which the data query request belongs, and can be adjusted according to the business requirements.
[0110] It should be noted that the multiple semantic division levels are a hierarchical structure from coarse to fine in the vertical direction, used to represent the semantics of the corresponding division dimension. For example... Figure 4The semantic partitioning hierarchy shown is divided into three semantic partitioning levels: c1, c2, and c3. Different combinations of semantic partitioning levels can be used according to the needs of the scenario. For example, coarse-grained semantic identifiers can use only c1, finer-grained semantic identifiers can choose a combination of c1 and c2 (such as the multiplication result), and the finest-grained semantic identifiers can choose a combination of c1, c2, and c3 (such as the multiplication result).
[0111] For example, suppose a media content with 288 queryable tokens has its first semantic identifier represented as [g1c1, g1c2, g1c3, g2c1, g2c2, g2c3 ... g6c1, g6c2, g6c3], a total of 18 first semantic identifiers, each with a space size of 2. 16 * 18 =65536. These 18 first semantic identifiers will retain key semantic information as much as possible, such as product brands, product information, and scenarios involved in the media content. If two media pieces are similar in some aspects, it will be shown that the first semantic identifiers of the two media pieces are different overall, but some first semantic identifiers are the same.
[0112] The data query method provided in this embodiment is configured with multiple semantic partitioning levels in the vector quantization model. This allows the vector quantization model to perform vector quantization on the input semantic features according to these multiple levels and output semantic identifiers for each level. Therefore, on the one hand, the semantic identifiers to be extracted can be flexibly adjusted by configuring the semantic partitioning levels. On the other hand, combining semantic compression and hierarchical quantization to extract the first semantic identifier of the queryable object for data querying effectively reduces data processing volume and data transmission overhead, thereby improving data query efficiency and data processing throughput.
[0113] In some optional implementations, the third vector quantization model is configured with multiple semantic partitioning levels. The third vector quantization model performs vector quantization on the input semantic features according to the multiple semantic partitioning levels and outputs semantic identifiers of multiple semantic partitioning levels.
[0114] As one specific application example, see Figure 7Taking a video frame with a non-text description sample as the first query object and a video compression model as the non-text compression model as an example, the parameter update process of each model mainly includes the following: The text description sample of the first query object is input into the text compression model for semantic compression to obtain the third semantic feature of the text description sample. The third semantic feature is input into the first vector quantization model for vector quantization to obtain the third semantic identifier corresponding to the text description sample. The third semantic identifier is input into the first reconstruction model for reconstruction to obtain the first reconstruction result. Based on the difference between the text description sample and the first reconstruction result, the first reconstruction loss is determined. The video frame of the first query object is input into the video compression model for semantic compression to obtain the fourth semantic feature of the video frame. The fourth semantic feature is input into the second vector quantization model for vector quantization to obtain the fourth semantic identifier of the video frame. The fourth semantic identifier is input into the second reconstruction model for reconstruction to obtain the second reconstruction result (the second reconstruction result is the reconstruction result of the text information in the video frame). Based on the difference between the second reconstruction result and the text information in the video frame, the second reconstruction loss is obtained. Based on the difference between the third and fourth semantic identifiers, the contrast loss is obtained. The fourth semantic feature is input into the third vector quantization model for vector quantization to obtain the fifth semantic identifier of the video frame. The fifth semantic identifier is input into the third reconstruction model for reconstruction, resulting in the third reconstruction result (the third reconstruction result is the reconstructed video frame). Based on the difference between the third reconstruction result and the video frame, the third reconstruction loss is obtained. Based on the first reconstruction loss, second reconstruction loss, third reconstruction loss, and contrast loss, the parameters of the text compression model, first vector quantization model, non-text compression model, second vector quantization model, and third vector quantization model are updated.
[0115] In some alternative implementations, see [link to implementation details]. Figure 8 The methods for obtaining the first feature vector corresponding to the first semantic identifier include: Step S801: Obtain the business prediction tags of the queryable objects.
[0116] Among them, the business prediction tag is related to the target business of the data query request.
[0117] For example, if the target business is media content recommendation, and the queryable object is media content A, and the object initiating the data query request has historically saved media content A, then the business prediction tag is that media content A has been saved.
[0118] Step S802: Input the first semantic identifier of the queryable object into the preset feature extraction model for feature extraction to obtain the initial feature vector of the first semantic identifier.
[0119] In practical applications, see Figure 9The existing feature extraction model for attribute identifiers of queryable objects can be used as the preset feature extraction model. Based on this, a first semantic identifier is introduced as supplementary information (also known as sideinfo) for the queryable object. The preset feature extraction model includes a feature pooling module, multiple deep learning modules, and a mapping module between semantic identifiers and feature vectors. The input to the feature pooling module includes the attribute identifiers of the queryable object (e.g., attribute identifier 1, attribute identifier 2, etc.) and the first semantic identifier (e.g., semantic identifier 1, semantic identifier 2, etc.). The output of the feature pooling module includes the feature vector obtained after feature pooling the attribute identifiers and the first semantic identifier. The input to the mapping module includes the first semantic identifier and the output of the feature pooling module. The mapping module is used to construct the mapping relationship between the first semantic identifier and the feature vector finally output by the preset feature extraction model. The input to the deep learning module includes the output of the mapping module, and the deep learning module includes a feedforward neural network and an attention layer. Optionally, the deep learning module uses a Transformer module. The output of the last deep learning module includes the initial feature vector of the first semantic identifier.
[0120] In addition, see Figure 10 Furthermore, a separate preset feature extraction module can be established for the first semantic identifier, thus avoiding conflicts with attribute identifiers (such as third-level categories) in the existing feature extraction model for attribute identifiers of queryable objects. The preset feature extraction model includes a feature pooling module, multiple deep learning modules, and a mapping module between semantic identifiers and feature vectors. The input to the feature pooling module includes the first semantic identifier (e.g., semantic identifier 1, semantic identifier 2, etc.), and the output includes the feature vector obtained after feature pooling of the first semantic identifier. The input to the mapping module includes the first semantic identifier and the output of the feature pooling module. The mapping module is used to construct the mapping relationship between the first semantic identifier and the feature vector finally output by the preset feature extraction model. The input to the deep learning module includes the output of the mapping module, and the deep learning module includes a feedforward neural network and an attention layer. Optionally, the deep learning module uses a Transformer module. The output of the last deep learning module includes the initial feature vector of the first semantic identifier.
[0121] Step S803: Input the initial feature vector into the business model for processing to obtain the business prediction results of the queryable objects.
[0122] For example, if the target business is media content recommendation, and the queryable object is media content A, and the object initiating the data query request has historically saved media content A, then the business prediction result is used to characterize whether media content A has been saved.
[0123] Step S804: Update the parameters of the preset feature extraction model based on the business prediction labels and business prediction results to obtain the target feature extraction model.
[0124] It should be noted that the construction of the aforementioned target feature extraction model belongs to the long sequence modeling part of the business model. By introducing a learnable semantic identifier feature vector (sideinfo vector) through the first semantic identifier, the second descriptive information can be fused with the business behavior information to be modeled in the business model, thereby improving the business capabilities of the business model.
[0125] It is worth noting that after introducing the first semantic identifier, the overall training objective of the business model should be consistent with the task of the business model without the first semantic identifier.
[0126] Specifically, a second model loss is obtained based on the difference between the business prediction labels and the business prediction results. The parameters of the preset feature extraction model are updated using the second model loss to obtain the target feature extraction model.
[0127] Optionally, the second model loss is the cross-entropy loss, which can be obtained by processing the business prediction labels and business prediction results using the cross-entropy loss function.
[0128] For example, assuming the task of the business model is a binary classification problem, the loss of the second model is obtained by the following formula:
[0129] in, For the second model loss, Label the business forecast. This represents the business forecast results.
[0130] In practical applications, in addition to using the second model loss to update the parameters of the preset feature extraction model, the second model loss is also used to update the parameters of the business model.
[0131] Step S805: Use the target feature extraction model to extract features from the first semantic identifier to obtain the first feature vector corresponding to the first semantic identifier.
[0132] Therefore, the feature vector corresponding to the first semantic identifier can be updated through the second model loss, allowing the feature vectors of the same queryable object under similar business behaviors to naturally learn a space with high similarity. Furthermore, the clustering property inherent in the first semantic identifier allows this similarity to be generalized to the feature vectors of the first semantic identifier of queryable objects that have not been learned or have not been sufficiently learned, thereby improving the predictive performance of the business model for queryable objects in a cold start.
[0133] It is worth noting that during the training process, the preset feature extraction model will store the feature vectors generated for each first semantic identifier in the training space, and will also synchronize them to the online space for online use.
[0134] In some optional implementations, the data query method of this application further includes: Step b1: Configure the identifier type of the first semantic identifier.
[0135] It is worth noting that since the original business model also includes attribute identifiers and other identifier information for queryable objects, if the first semantic identifier is added to the business model as a sparse feature, the identifier type of the first semantic identifier needs to be configured so that the business model can recognize the first semantic identifier.
[0136] Step b2: Perform a digest operation on the first semantic identifier to obtain the digest information of the first semantic identifier.
[0137] Optionally, the digest operation is a hash operation.
[0138] That is, a hash operation is performed on the first semantic identifier to obtain the summary information of the first semantic identifier.
[0139] Understandably, if a first semantic identifier is added, the identifier type will need to occupy a certain amount of storage space. Therefore, a digest operation needs to be performed on the first semantic identifier to control the data size of the final constructed new first semantic identifier.
[0140] Step b3: Based on the summary information and identifier type of the first semantic identifier, construct a new first semantic identifier for the queryable object.
[0141] For example, the high 16 bits of the int64 are allocated to a preset unit (slot_mask) to configure the identifier type of the first semantic identifier, and the low 48 bits are used to store the summary information of the first semantic identifier. Identifier information for different identifier types shares a single preset unit.
[0142] The data query method provided in this embodiment constructs a new first semantic identifier by utilizing the identifier type and summary information of the first semantic identifier. Therefore, the upstream business model can support both batch and streaming training samples. The downstream target feature extraction model can be compatible with different training frameworks simultaneously. For the business model, the cost of accessing the first semantic identifier is equivalent to adding side information to a long sequence.
[0143] As one specific application example, see Figure 11The data processing module in the server can acquire training samples (such as the second descriptive information of queryable objects) in batch or streaming mode to obtain the first semantic identifier of the queryable object and the first feature vector corresponding to the first semantic identifier. The data processing module can configure the identifier type of the first semantic identifier and construct a new first semantic identifier based on the identifier type and the summary information of the first semantic identifier. The data processing module can also combine first semantic identifiers of different semantic division levels to convert the original first semantic identifier into a new first semantic identifier. At the same time, the training module in the server uses training samples to train each model and uploads the relevant training data (such as the feature vector corresponding to the first semantic identifier) to the training space, and the training space synchronizes the training data to the online space.
[0144] In some optional implementations, the data query method of this application further includes: deduplicating the first semantic identifier. Therefore, duplicate first semantic identifiers can be reduced.
[0145] In some optional implementations, the data query method of this application further includes: Step c1: Write the first feature vector corresponding to the first semantic identifier into memory.
[0146] Step c2: If the remaining space in memory does not meet the first preset write condition, then query the first feature vector with the earliest write time in memory and write the first feature vector with the earliest write time to the solid-state drive.
[0147] It is worth noting that since the first semantic identifier and the business information of the target business to which the data query request belongs remain unchanged for a long time, the first semantic identifier and the corresponding first feature vector can be cached using a two-level storage method of memory and solid-state drive, thereby significantly reducing the data transmission bandwidth of reading the first semantic identifier or the first feature vector in the training space and online space.
[0148] See Figure 12 The data processing module writes the first feature vector corresponding to the first semantic identifier into memory. In practical applications, the first feature vector corresponding to the first semantic identifier is first searched in memory. If the first feature vector corresponding to the first semantic identifier is not found in memory, it is then searched in the solid-state drive. When memory is full, the earliest written first feature vector in memory is found according to the Least Recently Used (LRU) strategy, and then written to the solid-state drive.
[0149] In some optional implementations, the data query method of this application further includes: Step c3: If the remaining space of the solid-state drive does not meet the second preset write condition, then query the first feature vector that has existed for the longest time in the solid-state drive and delete the first feature vector that has existed for the longest time in the solid-state drive.
[0150] See Figure 12 In practical applications, when a solid-state drive (SSD) is full, the LRU (Least Recently Used) policy of the SSD is used to find the oldest eigenvector in the SSD and delete it to discard old data.
[0151] As a specific application example of this application, see Figure 13 The application has a client installed on a mobile phone, and the target software is used to execute the data query method of this application. The user inputs the first description information of the target query object through the client. The client sends a data query request to the server of the target software based on the first description information. The server calls the estimation module to perform semantic matching between the first description information in the data query request and the attribute identifiers and first semantic identifiers of the pre-stored queryable objects, obtaining the target semantic identifier. Taking the storage of the first feature vector corresponding to the first semantic identifier in an online space as an example, the server queries the target feature vector corresponding to the target semantic identifier from the online space based on the target semantic identifier, and inputs the target feature vector into the business model, so that the business model can obtain the data query result of the data query request from the queryable objects based on the target feature vector, thereby providing online inference services for the target business corresponding to the business model. During this process, the server can also feed back the data query result to the client and display the data query result on the client.
[0152] An experiment using a specific data query business demonstrates that, in traditional data query methods, the feature vectors extracted by multimodal models are typically long sequences of 96 dimensions and 5000 characters. However, the data query method of this application, which semantically compresses the descriptive information of queryable objects according to three semantic partitioning levels, allows the first semantic identifier of the three semantic partitioning levels to replace the long sequences extracted by the multimodal model for data querying, thereby reducing data transmission volume by 94%. Furthermore, the caching and deduplication mechanisms employed in this application's data query method can reduce the QPS of the storage system by more than 70%, effectively reducing the QPS pressure on the storage system. The first feature vector used in this application effectively addresses the OutOfMemoryError (OOM) problem. The first semantic identifier, through multimodal alignment and business behavior constraints, is consistent with the embedding space of the business model, improving model performance. In addition, it supports multiple existing training and inference frameworks, allowing businesses to integrate them at low cost.
[0153] This embodiment also provides a data query device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0154] This embodiment provides a data query device, such as... Figure 14 As shown, it includes: The request receiving module 1401 is used to receive a data query request, which includes first descriptive information of the target query object. The semantic identifier matching module 1402 is used to perform semantic matching between the first description information and the first semantic identifier corresponding to the queryable object to obtain the target semantic identifier; wherein, the first semantic identifier is obtained by semantically compressing the second description information of the queryable object; The feature vector matching module 1403 is used to query the target feature vector based on the target semantic identifier in the first feature vector corresponding to the first semantic identifier; wherein, the first feature vector is obtained by extracting features from the first semantic identifier through a target feature extraction model; The business query module 1404 is used to input the target feature vector into the business model and retrieve the data query results of the data query request from the queryable objects.
[0155] In some optional implementations, the data query device further includes: The summary information extraction module is used to extract summary information of the second description information of queryable objects; The first semantic compression module is used to input the summary information of the second descriptive information into the text compression model for semantic compression to obtain the first semantic features of the queryable object. The first vector quantization module is used to input the first semantic feature into the first vector quantization model for vector quantization to obtain the first semantic identifier of the queryable object.
[0156] In some optional implementations, the data query device further includes: The first model filtering module is used to determine the target compression model corresponding to the second description information in the text compression model and the non-text compression model based on the data modality of each second description information. The second semantic compression module is used to input each second description information into the corresponding target compression model for semantic compression to obtain the second semantic features of each second description information. The second vector quantization module is used to input each second semantic feature into a vector quantization model connected to the corresponding target compression model for vector quantization, so as to obtain the semantic identifier corresponding to each second description information; wherein, the vector quantization model connected to the text compression model is the first vector quantization model; and the vector quantization model connected to the non-text compression model is the second vector quantization model. The semantic identifier determination module is used to obtain the first semantic identifier of the queryable object based on the semantic identifier corresponding to each second description information.
[0157] In some optional implementations, the data query device further includes: The sample acquisition module is used to acquire a descriptive information sample of the first query object, which includes a text description sample. The third semantic compression module is used to input text description samples into the text compression model for semantic compression, and obtain the third semantic features of the text description samples. The third vector quantization module is used to input the third semantic feature into the first vector quantization model for vector quantization to obtain the third semantic identifier corresponding to the text description sample. The text reconstruction module is used to input the third semantic identifier into the first reconstruction model for reconstruction, and obtain the first reconstruction result; The first loss calculation module is used to determine the first reconstruction loss based on the difference between the text description sample and the first reconstruction result; The first parameter update module is used to update the parameters of the text compression model and the first vector quantization model based on the first reconstruction loss.
[0158] In some optional implementations, the description information sample also includes a non-text description sample. The first update module includes: The semantic compression unit is used to input non-textual description samples into the non-textual compression model for semantic compression, and obtain the fourth semantic feature of the non-textual description samples. The vector quantization unit is used to input the fourth semantic feature into the second vector quantization model for vector quantization to obtain the fourth semantic identifier of the non-textual description sample; The text reconstruction unit is used to input the fourth semantic identifier into the second reconstruction model for reconstruction, and obtain the second reconstruction result; The reconstruction loss computation unit is used to obtain the second reconstruction loss based on the difference between the second reconstruction result and the text information in the non-text description sample; The first parameter update unit is used to update the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model based on the first reconstruction loss and the second reconstruction loss.
[0159] In some optional implementations, the first parameter update unit includes: The contrast loss operation subunit is used to obtain the contrast loss based on the difference between the third semantic identifier and the fourth semantic identifier; The model parameter update subunit is used to update the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model based on the first reconstruction loss, the second reconstruction loss, and the contrast loss.
[0160] In some optional implementations, the model parameter update subunit is specifically used for: inputting the fourth semantic feature into the third vector quantization model for vector quantization to obtain the fifth semantic identifier of the non-text description sample; inputting the fifth semantic identifier into the third reconstruction model for reconstruction to obtain the third reconstruction result; obtaining the third reconstruction loss based on the difference between the third reconstruction result and the non-text description sample; and updating the parameters of the text compression model, the first vector quantization model, the non-text compression model, the second vector quantization model, and the third vector quantization model based on the first reconstruction loss, the second reconstruction loss, the third reconstruction loss, and the contrast loss.
[0161] In some optional implementations, the first vector quantization model and the second vector quantization model are configured with multiple semantic partitioning levels. Both the first vector quantization model and the second vector quantization model perform vector quantization on the input semantic features according to multiple semantic partitioning levels and output semantic identifiers of multiple semantic partitioning levels.
[0162] In some optional implementations, the data query device further includes: The tag acquisition module is used to acquire business prediction tags for queryable objects; The first feature extraction module is used to input the first semantic identifier of the queryable object into the preset feature extraction model for feature extraction, and obtain the initial feature vector of the first semantic identifier; The business prediction module is used to input the initial feature vector into the business model for processing, and obtain the business prediction results of the queryable objects. The second parameter update module is used to update the parameters of the preset feature extraction model based on the business prediction label and the business prediction result to obtain the target feature extraction model. The second feature extraction module uses a target feature extraction model to extract features from the first semantic identifier, thereby obtaining the first feature vector corresponding to the first semantic identifier.
[0163] In some optional implementations, the data query device further includes: The type configuration module is used to configure the identifier type of the first semantic identifier; The digest operation module is used to perform digest operation on the first semantic identifier to obtain the digest information of the first semantic identifier; The identifier reconstruction module is used to construct a new first semantic identifier for queryable objects based on the summary information and identifier type of the first semantic identifier.
[0164] In some optional implementations, the data query device further includes: The first data writing module is used to write the first feature vector corresponding to the first semantic identifier into memory; The second data writing module is used to query the first feature vector with the earliest writing time in memory and write the first feature vector with the earliest writing time to the solid-state drive if the remaining space in memory does not meet the first preset writing conditions.
[0165] In some optional implementations, the data query device further includes: The data deletion module is used to query the longest-existing first feature vector in the solid-state drive and delete the longest-existing first feature vector in the solid-state drive if the remaining space of the solid-state drive does not meet the second preset write conditions.
[0166] The data query apparatus provided in this application embodiment can execute the data query method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0167] Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0168] The following is a detailed reference. Figure 15 The diagram illustrates a structural schematic suitable for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1502 or a program loaded from memory 1508 into random access memory (RAM) 1503. The RAM 1503 also stores various programs and data required for the operation of the electronic device. The processor 1501, ROM 1502, and RAM 1503 are interconnected via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.
[0169] Typically, the following devices can be connected to I / O interface 1505: input devices 1506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1509. Communication device 1509 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 15 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0170] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1509, or installed from memory 1508, or installed from ROM 1502. When the computer program is executed by processor 1501, it performs the functions defined in the data query method of embodiments of this application.
[0171] Figure 15 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0172] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the data query method shown in the above embodiments is implemented.
[0173] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0174] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A data query method, characterized in that, include: Receive a data query request, the data query request including first descriptive information of the target query object; Semantic matching is performed between the first description information and the first semantic identifier corresponding to the queryable object to obtain the target semantic identifier; wherein, the first semantic identifier is obtained by semantically compressing the second description information of the queryable object; Based on the target semantic identifier, the target feature vector is obtained by querying the first feature vector corresponding to the first semantic identifier; wherein, the first feature vector is obtained by extracting features from the first semantic identifier through a target feature extraction model. The target feature vector is input into the business model, and the data query result of the data query request is obtained from the queryable objects.
2. The data query method according to claim 1, characterized in that, The methods for obtaining the first semantic identifier corresponding to the queryable object include: Extract summary information of the second description information of the queryable object; The summary information of the second description information is input into the text compression model for semantic compression to obtain the first semantic feature of the queryable object; The first semantic feature is input into the first vector quantization model for vector quantization to obtain the first semantic identifier of the queryable object.
3. The data query method according to claim 1, characterized in that, The methods for obtaining the first semantic identifier corresponding to the queryable object include: Based on the data modalities of each of the second description information, the target compression model corresponding to the second description information is determined in both the text compression model and the non-text compression model; Each of the second description information is input into the corresponding target compression model for semantic compression to obtain the second semantic features of each of the second description information; Each of the second semantic features is input into a vector quantization model connected to the corresponding target compression model for vector quantization to obtain the semantic identifier corresponding to each of the second description information; wherein, the vector quantization model connected to the text compression model is the first vector quantization model; and the vector quantization model connected to the non-text compression model is the second vector quantization model. Based on the semantic identifiers corresponding to each of the second description information, the first semantic identifier of the queryable object is obtained.
4. The data query method according to claim 2 or 3, characterized in that, Also includes: Obtain a description information sample of the first query object, wherein the description information sample includes a text description sample; The text description sample is input into a text compression model for semantic compression to obtain the third semantic feature of the text description sample; The third semantic feature is input into the first vector quantization model for vector quantization to obtain the third semantic identifier corresponding to the text description sample; The third semantic identifier is input into the first reconstruction model for reconstruction, and the first reconstruction result is obtained. Based on the difference between the text description sample and the first reconstruction result, a first reconstruction loss is determined; The parameters of the text compression model and the first vector quantization model are updated based on the first reconstruction loss.
5. The data query method according to claim 4, characterized in that, The descriptive information samples also include non-textual descriptive samples; the parameter update of the text compression model and the first vector quantization model based on the first reconstruction loss includes: The non-textual description sample is input into a non-textual compression model for semantic compression to obtain the fourth semantic feature of the non-textual description sample; The fourth semantic feature is input into the second vector quantization model for vector quantization to obtain the fourth semantic identifier of the non-textual description sample; The fourth semantic identifier is input into the second reconstruction model for reconstruction, and the second reconstruction result is obtained. Based on the difference between the second reconstruction result and the text information in the non-text description sample, a second reconstruction loss is obtained; Based on the first reconstruction loss and the second reconstruction loss, the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model are updated.
6. The data query method according to claim 5, characterized in that, The step of updating the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model based on the first reconstruction loss and the second reconstruction loss includes: Based on the difference between the third semantic identifier and the fourth semantic identifier, a contrast loss is obtained; Based on the first reconstruction loss, the second reconstruction loss, and the contrast loss, the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model are updated.
7. The data query method according to claim 6, characterized in that, The step of updating the parameters of the text compression model, the first vector quantization model, the non-text compression model, and the second vector quantization model based on the first reconstruction loss, the second reconstruction loss, and the contrast loss includes: The fourth semantic feature is input into the third vector quantization model for vector quantization to obtain the fifth semantic identifier of the non-textual description sample; The fifth semantic identifier is input into the third reconstruction model for reconstruction, and the third reconstruction result is obtained. Based on the difference between the third reconstruction result and the non-textual description sample, the third reconstruction loss is obtained; Based on the first reconstruction loss, the second reconstruction loss, the third reconstruction loss, and the contrast loss, the parameters of the text compression model, the first vector quantization model, the non-text compression model, the second vector quantization model, and the third vector quantization model are updated.
8. The data query method according to claim 4, characterized in that, The first vector quantization model and the second vector quantization model are configured with multiple semantic partitioning levels. Both the first vector quantization model and the second vector quantization model perform vector quantization on the input semantic features according to the multiple semantic partitioning levels and output the semantic identifiers of the multiple semantic partitioning levels.
9. The data query method according to claim 1, characterized in that, The methods for obtaining the first feature vector corresponding to the first semantic identifier include: Obtain the business prediction tags of the queryable objects; The first semantic identifier of the queryable object is input into a preset feature extraction model for feature extraction to obtain the initial feature vector of the first semantic identifier; The initial feature vector is input into the business model for processing to obtain the business prediction result of the queryable object; Based on the business prediction labels and the business prediction results, the parameters of the preset feature extraction model are updated to obtain the target feature extraction model. The target feature extraction model is used to extract features from the first semantic identifier to obtain the first feature vector corresponding to the first semantic identifier.
10. The data query method according to claim 9, characterized in that, Also includes: Configure the identifier type of the first semantic identifier; Perform a digest operation on the first semantic identifier to obtain the digest information of the first semantic identifier; Based on the summary information of the first semantic identifier and the identifier type, a new first semantic identifier is constructed for the queryable object.
11. The data query method according to claim 1, characterized in that, Also includes: Write the first feature vector corresponding to the first semantic identifier into memory; If the remaining space in the memory does not meet the first preset write condition, then the first feature vector with the earliest write time in the memory is queried, and the first feature vector with the earliest write time is written to the solid-state drive.
12. The data query method according to claim 11, characterized in that, Also includes: If the remaining space of the solid-state drive does not meet the second preset write condition, then query the first feature vector that has existed for the longest time in the solid-state drive and delete the first feature vector that has existed for the longest time in the solid-state drive.
13. A data query device, characterized in that, include: A request receiving module is used to receive a data query request, wherein the data query request includes first descriptive information of the target query object; The semantic identifier matching module is used to perform semantic matching between the first description information and the first semantic identifier corresponding to the queryable object to obtain the target semantic identifier; wherein, the first semantic identifier is obtained by semantically compressing the second description information of the queryable object; The feature vector matching module is used to query the first feature vector corresponding to the first semantic identifier based on the target semantic identifier to obtain the target feature vector; wherein, the first feature vector is obtained by extracting features from the first semantic identifier through a target feature extraction model. The business query module is used to input the target feature vector into the business model and retrieve the data query results of the data query request from the queryable objects.
14. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the data query method according to any one of claims 1 to 12 by executing the computer instructions.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the data query method according to any one of claims 1 to 12.
16. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the data query method according to any one of claims 1 to 12.