Data processing method and device, electronic equipment and storage medium
By directly processing search request association information on the GPU, and using objective functions and half-precision calculation instructions to generate target feature vectors, the problem of time-consuming copying of CPU to GPU data is solved, and processing efficiency and convenience are improved.
Patent Information
- Application Number
- CN202410101666.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, when a vector determination model is run on a CPU, it is necessary to copy the processing results to the GPU, resulting in large amount of data, long transmission time, and low processing efficiency.
By directly processing search request association information on the GPU, processing at least three feature information using the objective function and half-precision calculation instructions, the target feature vector is generated, and the copying and transmission of a large amount of data from the CPU to the GPU is avoided.
It improves the efficiency of data processing, reduces the data copy time, reduces the coupling between the CPU and the GPU, and realizes fast and convenient data processing.
Smart Images

Figure CN120386910A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of computer data processing, and in particular, to a data processing method, apparatus, electronic device, and storage medium. Background Art
[0002] In recent years, with the rapid development and popularization of e-commerce services, more and more recommended objects can be displayed based on a third-party platform. Of course, in order to meet the personalized needs of users, corresponding search controls can be set on the third-party platform to retrieve corresponding recommended objects based on the search content in the search controls. Based on the deployed vector determination model, the target vector corresponding to the corresponding recommended object and the search content can be determined, and then the recommended objects can be displayed in order on the display interface according to the target vector.
[0003] When the inventors implemented the present technical solution based on the above method, they found the following problems:
[0004] The vector determination model runs on the CPU (Central Processing Unit), and determining the display order of the recommended objects on the display interface is implemented based on the correlation determination module deployed on the GPU (Graphics Processing Unit). Based on this, the processing result of the CPU needs to be copied to the GPU. Since the data volume of the CPU processing result is relatively large, it is time-consuming during the copy transmission process, resulting in a problem of low processing efficiency. Summary of the Invention
[0005] The present invention provides a data processing method, apparatus, electronic device, and storage medium, which can achieve the technical effect of quickly and conveniently processing search association information under the condition of low coupling.
[0006] In a first aspect, an embodiment of the present invention provides a data processing method, which includes:
[0007] Determine the search association information corresponding to the search request; wherein, the search association information includes search keywords and an object recommendation set corresponding to the search request;
[0008] Based on the search association information, determine at least three feature information corresponding to the search request;
[0009] Process the at least three feature information based on the objective function and half-precision calculation instructions to obtain a target feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the target feature vector.
[0010] Further, the method further includes:
[0011] Retrieve format data corresponding to the at least three feature information according to a first preset format, so as to determine at least three feature information corresponding to the search request based on the format data and the search association information.
[0012] Further, the method further includes:
[0013] Determine first feature information based on the search keywords in the search association information, the object titles corresponding to at least one recommended object in the object recommendation set, and the first format data in the format data;
[0014] Determine second feature information corresponding to the search keywords based on the second format data in the format data;
[0015] Determine third feature information based on the third format data in the format data and the position information of each character in the search keywords.
[0016] Further, the method further includes:
[0017] Determine a plurality of first identifiers according to the search keywords in the search association information, and fill the first identifiers according to the first character length between the start identifier bit and the split identifier bit;
[0018] Retrieve the corresponding object title according to the object identifier of each recommended object in the object recommendation set;
[0019] For each object title, determine a plurality of second identifiers based on the current object title;
[0020] Fill the second identifiers according to the second character length after the split identifier bit to obtain the first feature information.
[0021] Further, the method further includes:
[0022] Perform a summation process on at least three feature information corresponding to each recommended object in the object recommendation set based on the objective function and the half-precision instruction to obtain a target feature vector corresponding to each recommended object.
[0023] Further, the method further includes:
[0024] Perform matrix operations on the target feature vector to update the target feature vector.
[0025] Further, the method further includes:
[0026] Input the target feature vector into the correlation determination model to obtain the matching degree between at least one recommended object in the object recommendation set and the search request.
[0027] Further, the method further includes:
[0028] The at least one recommended object corresponds to an item category.
[0029] In a second aspect, an embodiment of the present invention further provides a data processing device, which includes:
[0030] An association information determination module, configured to determine search association information corresponding to a search request; wherein, the search association information includes search keywords and an object recommendation set corresponding to the search request;
[0031] A feature information determination module, configured to determine at least three feature information corresponding to the search request based on the search association information;
[0032] A matching degree determination module, configured to process the at least three feature information based on an objective function and a half-precision calculation instruction to obtain a target feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the target feature vector.
[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes:
[0034] One or more processors;
[0035] A storage device, configured to store one or more programs,
[0036] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method according to any one of the embodiments of the present invention.
[0037] In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the data processing method according to any one of the embodiments of the present invention when executed by a computer processor.
[0038] The technical solution provided by the embodiment of the present invention processes the search request associated information through a graphics processing unit to obtain at least three feature information corresponding to the search request. Further, based on the objective function and the half-precision calculation instruction, the at least three feature information is processed to obtain the target feature vector, which solves the problem in the prior art that a large amount of data generated by the CPU needs to be copied to the GPU so that the GPU processes the copied data to obtain the target feature vector. At this time, a long waiting time is required, resulting in low efficiency in obtaining the target result. It realizes that the GPU only needs to obtain a small amount of data from the CPU and then can analyze and process it, that is, a large amount of calculations are executed in the GPU, saving the data copy duration and improving the efficiency and convenience of determining the target feature vector. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] To more clearly illustrate the technical solution of the exemplary embodiment of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the introduced drawings are only the drawings of a part of the embodiments to be described by the present invention, rather than all the drawings. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0040] Figure 1 It is a schematic flowchart of a data processing method provided by an embodiment of the present invention;
[0041] Figure 2 It is a schematic flowchart of a data processing method provided by an embodiment of the present invention;
[0042] Figure 3 It is a schematic flowchart of a data processing method provided by an embodiment of the present invention;
[0043] Figure 4 It is a schematic structural diagram of a data processing device provided by an embodiment of the present invention;
[0044] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] The following further elaborates on the present invention in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the sake of description, only the parts related to the present invention are shown in the drawings rather than all the structures.
[0046] Before introducing the present technical solution, the application scenario can be described first. The solution provided by the embodiments of the present invention can be applied to scenarios where it is necessary to determine the target feature vector of a recommended object associated with the search content. Optionally, the above-mentioned scenario can be a scenario of recommending consumer objects on a third-party platform, and the consumer object can be a physical item or a virtual item, etc. It can also be applied to scenarios such as song recommendation scenarios and video recommendation scenarios. Correspondingly, the object recommendation set includes at least one recommended object, and the at least one recommended object matches the application scenario. Optionally, the recommended object can be an item, a song, an audio-visual, etc. The specific application scenario and recommended object are not limited in this embodiment, as long as it is necessary to determine the target feature vector between the search content and the recommended object, it is within the protection scope of the present invention.
[0047] Exemplarily, the third-party platform can be an e-commerce platform, and the search content can be edited in the search control of the e-commerce platform to determine the target feature vector of at least one recommended object combined with the search content that matches the search content. At this time, the at least one recommended object can be an item to be consumed.
[0048] Figure 1 It is a schematic flowchart of a data processing method provided by an embodiment of the present invention. This embodiment is applicable to any situation where it is necessary to determine the target feature vector associated with the search request. This method can be executed by a data processing device, and the device can be implemented in the form of software and / or hardware. The hardware can be an electronic device, such as a mobile terminal, a PC or a server, etc.
[0049] As Figure 1 shown, the method includes:
[0050] S110. Determine the search association information corresponding to the search request.
[0051] Among them, the search association information includes the search keyword and the object recommendation set corresponding to the search request.
[0052] Among them, the search request is generated based on the triggering operation of the search confirmation control. The corresponding text information can be edited in the search control. After the editing is completed, the confirmation or search control can be clicked to generate a search request. The text information edited can be carried in the search request. The search associated information can be understood as the important information obtained after processing the search request and used to characterize the content of the search request. The search keywords can be understood as the words obtained after dividing the text information carried in the search request into a series of single words using the corresponding word segmentation method and then removing the useless words and some punctuation marks such as "de" (of), "he" (and), etc. The search terms can be obtained by processing with some word segmentation tools. Optionally, the word segmentation tools can be Jieba word segmentation, NLPIR word segmentation system, etc. This embodiment does not limit this. The object recommendation set includes multiple recommended objects, and the recommended objects at this time are associated with the search terms.
[0053] Exemplarily, the text information carried in the search request is a mobile phone of XX brand and YY model. Jieba word segmentation can be used to perform word segmentation processing on the text information to obtain search keywords such as XX brand, YY model, mobile phone, etc. The multiple recommended objects in the object recommendation set determined based on the search terms can be mobile phones of XX brand and YY model, different colors, different sizes, different memories, and different operating kernels sold by different merchants.
[0054] Specifically, the user can edit the corresponding text information in the search control. After the editing is completed, the confirmation or search control can be clicked to generate a corresponding search request. Next, the corresponding text information of the search request can be segmented to obtain search keywords, and at the same time, at least one recommended object can be extracted from the corresponding database according to the search information to form an object recommendation set based on the at least one recommended object. The object recommendation set and the search keywords can be used as the search associated information.
[0055] S120. Based on the search associated information, determine at least three feature information corresponding to the search request.
[0056] Among them, the relationship between each recommended object in the object recommendation set and the search keywords can be described from different dimensions. The description information corresponding to different dimensions can be used as the feature information. Correspondingly, if the number of dimensions includes three, there are three feature information, and the specific number of feature information can be set according to actual needs. That is to say, the feature information is the information used to characterize the association between the search request and the recommended object, so as to determine the matching degree between the search request and the recommended object based on the feature information subsequently.
[0057] It can be understood that to determine the matching degree between each recommended object in the object recommendation set and the user, it can be implemented based on the relevance determination module BERT model (Bidirectional Encoder Representations from Transformers, a natural language processing model). The input of the relevance determination model is a vector, which can be determined by word embedding vectors, segment embedding vectors, and position embedding vectors. Based on this, token embedding (word embedding feature information), segment embedding (segment embedding feature information), and position embedding (position embedding feature information) can be determined respectively. That is to say, at least three feature information can include the three feature information mentioned above.
[0058] Next, each feature information will be introduced separately. Token embedding is to convert the search keywords into vectors of a fixed length. For example, if the text information corresponding to the search request is a mobile phone of XX brand and YY model, the corresponding search keywords can be words such as XX brand, YY model, and mobile phone. At this time, token embedding is to convert each of these words into a vector. Segment embedding can be the feature information obtained after segmenting the text information corresponding to multiple search requests. For example, if the first text information of the search request is XX brand, the second text information of the search request is YY model, and the third text information of the search request is mobile phone, segment embedding can be the corresponding identifiers of "XX", "YY", and "mobile phone". Position embedding can be used to determine the position information of each search keyword. For example, when the text information of the search request is a mobile phone of XX brand and YY model, and its corresponding search keywords can be XX brand, YY model, and mobile phone, position embedding can encode each search keyword through a position sequence to determine the position order of each search keyword in the search request.
[0059] Furthermore, the calculation result of the vector determination model is transmitted to the relevance determination model through RPC (Remote Procedure Call). During the transmission process, it not only increases the network overhead but also prolongs the time-consuming of the entire processing link. Therefore, when processing based on a graphics processor, the data transmission between them is avoided, thereby improving the processing efficiency.
[0060] S130. Process at least three feature information based on the objective function and half-precision calculation instructions to obtain the target feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the target feature vector.
[0061] In an embodiment of the present invention, the objective function can be understood as a function used to process feature information. Optionally, the objective function is a CUDA Kernel function, where CUDA (Compute Unified Device Architecture) is a parallel computing platform and API model. The CUDA Kernel function is a function defined and executed in CUDA programming and is executed in parallel on the GPU. The half-precision computing instruction, i.e., FP16, performs calculations using 16-bit (half-precision) floating-point numbers and theoretically can achieve twice the performance of FP32 (single-precision floating-point numbers). The target feature vector can be understood as being obtained by processing at least three pieces of feature information and is used to determine the matching degree between the recommended object and the search request. The object recommendation set contains multiple recommended objects, and at least three pieces of feature information between each recommended object and the search request can be determined respectively, so as to obtain the target feature vector corresponding to each recommended object. The matching degree can be understood as the similarity between the prediction result of the corresponding model and the search request. Optionally, the higher the matching degree value, the more matching the recommended object is with the search request. Conversely, if it is not matching, at least one recommended object can be determined based on the matching degree for the display position on the display interface, and the display position can be the display order.
[0062] Specifically, after determining at least three pieces of feature information between each recommended object and the search request, the objective function is used to process the feature information using the half-precision computing instruction. For example, processing the feature information can be to perform a summation process on the feature information to obtain the corresponding target feature vector, and then the target feature vector can be input into the corresponding model to obtain the matching degree between each recommended object in the object recommendation set and the search request. Since the above processing is all implemented in the GPU, the problem of a large amount of data transmission is avoided, and thus the processing efficiency is improved.
[0063] Exemplarily, after processing the search request using token embedding, segment embedding, and position embedding in the BERT model and then obtaining the corresponding feature information respectively, the FP16 half-precision computing instruction can be used to process the feature information to convert it into FP16 format feature information, and then the CUDA Kernel function is called to process the FP16 format feature information to obtain the target feature vector, so as to input the target feature vector into the multi-layer encoder of the BERT model to obtain the corresponding matching degree.
[0064] In this embodiment, if it is applied to the scenario of item pushing, then at least one recommended object can correspond to an item category, and different item categories correspond to corresponding items. The item can be a physical item or a virtual item. Optionally, the virtual item can be a coupon or the like, and this embodiment does not limit this.
[0065] The technical solution provided by the embodiment of the present invention processes the search request associated information through a graphics processing unit to obtain at least three feature information corresponding to the search request. Further, based on the objective function and the half-precision calculation instruction, the at least three feature information are processed to obtain a target feature vector, which solves the problem in the prior art that a large amount of data generated by the CPU needs to be copied to the GPU so that the GPU processes the copied data to obtain the target feature vector. At this time, a long waiting time is required, resulting in low efficiency of obtaining the target result. It realizes that the GPU only needs to obtain a small amount of data from the CPU and then can analyze and process it, that is, a large amount of calculations are executed in the GPU, saving the data copy duration and improving the efficiency and convenience of determining the target feature vector.
[0066] Figure 2 It is a schematic flowchart of a data processing method provided by the embodiment of the present invention. On the basis of the foregoing embodiment, before determining the search associated information corresponding to the search request, the format data corresponding to the feature information can be retrieved according to the first preset format, so as to determine the feature information corresponding to the search request based on the format data and the search associated information. The specific implementation manner can refer to the technical solution of this embodiment. The same or corresponding technical terms as those in the above embodiment will not be elaborated here.
[0067] As Figure 2 shown, the method specifically includes the following steps:
[0068] S210. Retrieve the format data corresponding to at least three feature information according to the first preset format, so as to determine at least three feature information corresponding to the search request based on the format data and the search associated information.
[0069] In the embodiment of the present invention, the first preset format is set according to actual needs and is used to retrieve the format of the format data. The specific actual needs are not limited in this embodiment. The format data can be understood as a format template for processing the search request to obtain the feature information.
[0070] Specifically, the corresponding format data is retrieved in the first preset format and loaded from the CPU memory to the GPU video memory. Among them, the format data loaded to the GPU video memory is the data obtained by only formatting the search request, which is different from the data loaded to the GPU in the existing solution, where the data processed by the CPU for a large amount of data is loaded to the GPU. It can be seen that in this embodiment, the amount of the format data loaded to the GPU video memory is very small. Therefore, when loading the format data from the CPU memory to the GPU, the time of the corresponding copy operation can be reduced, the system overhead can be reduced, and the operation speed can be improved. After that, at least three feature information are determined by using the format data loaded to the GPU and the search correlation information. That is, the processing of the data is implemented based on the GPU.
[0071] Exemplarily, the first preset format may be the FP32 single-precision floating-point format, and the format data may be the representation form corresponding to the BERT embedding including data such as token embedding, segment embedding, and position embedding. The BERT embedding data can be retrieved in the FP32 single-precision floating-point format, and the BERT embedding data is loaded from the CPU memory to the GPU video memory. Based on the above method, the time for the CPU to process a large amount of data can be reduced, and correspondingly, the data copy between the CPU and the GPU can be reduced, and the operation speed can be improved.
[0072] In this embodiment, the corresponding format data is retrieved in the first preset format, and then the feature information corresponding to the search request is obtained, which can ensure the data accuracy of the subsequent calculation. At the same time, the method of loading the format data to the GPU and then obtaining the feature information corresponding to the search request also shortens the data copy time between the CPU and the GPU and reduces the system overhead.
[0073] S220. Determine the search correlation information corresponding to the search request.
[0074] Among them, the search correlation information includes the search keyword and the object recommendation set corresponding to the search request.
[0075] S230. Determine the first feature information based on the search keyword in the search correlation information, the object title corresponding to at least one recommended object in the object recommendation set, and the first format data in the format data.
[0076] To reduce the redundancy of data, the object recommendation set can be a set that only contains the identification information of the recommended objects. For example, the identification information of the recommended object can be the unique identifier (id) of the recommended object. The object title can be understood as the description information corresponding to the recommended object, where the description information can be retrieved using the id information in the object recommendation set. For example, when the application scenario is to recommend corresponding items to users based on a search request in a third-party e-commerce platform, at this time, the recommended object corresponds to the recommended item, and each recommended item has its corresponding description information, which can be used as the corresponding item category title, that is, the object title. The first format data can be the corresponding format template used to determine one of the feature information. For example, the first format data can be the representation form of token embedding. For example, the first format data can be CLSxxxxxxxSEQxxxxxx, where CLS is the start identification bit, SEQ is the segmentation identification bit, and the "x" in the middle represents a character. The specific length of the character is not limited in this embodiment. The first feature information can be understood as the feature information obtained by processing the search request using the first format data.
[0077] Specifically, based on the object recommendation set, determine the identification information of each recommended object, and use the identification information to retrieve the description information of the corresponding recommended object, that is, obtain the object title of the recommended object. Then use the first format data to process the search keyword and the object title, so as to obtain the first feature information.
[0078] Exemplarily, if the application scenario is a scenario of recommending corresponding items to users based on a search request, the object recommendation set at this time can be a set that contains the identification information of all recommended items, that is, the sku set. The identification information can be the id information of the recommended item, that is, the sku id. The recommended object corresponds to the recommended item category, and the object title corresponds to the category title. For example, on a third-party e-commerce platform, each recommended item has its corresponding description information, which can be used as the corresponding item category title, that is, the object title, that is, the sku title. The first format data can be the representation form of token embedding. For example, the first format data can be CLSxxxxxxxSEQxxxxxx, where CLS is the start identification bit, SEQ is the segmentation identification bit, and the "x" in the middle represents a character. The specific length of the character is not limited in this embodiment.
[0079] Determine the sku id of each recommended item based on the sku set, and then use the sku id to retrieve the category title of the corresponding recommended item, that is, the sku title. Use the first-format data, that is, the representation form of token embedding, to perform word segmentation on the search keyword and the sku title through the embedded feature extraction service. During the word segmentation process, the corresponding vocabulary and cache can be used to reduce the time-consuming of the word segmentation process, and then perform feature extraction to obtain the corresponding token id information, that is, generate the corresponding id information based on the search keyword and the sku title, that is, the first feature information.
[0080] After determining the corresponding search association information in this embodiment, use the first-format data to process the search keyword and the object title in the search association information to obtain the corresponding first feature information, which provides data support for the input data of the subsequent corresponding model.
[0081] Among them, the character length corresponding to the first-format data is fixed, and it also includes a start flag bit and a segmentation flag bit.
[0082] In the embodiment of the present invention, the fixed character length can be understood as the character length set according to actual needs to improve the corresponding data processing efficiency. Among them, the specific actual needs are not limited in this embodiment. The start flag bit can be understood as the flag bit at the start of the first feature information, used to indicate the start of the data. The segmentation flag bit can be understood as the flag bit used to distinguish the search keyword and the object title.
[0083] Exemplarily, the character length corresponding to the first-format data can be set to 5. The first-format data also includes a start flag bit CLS and a segmentation flag bit SEQ. Then use the first-format data to process the corresponding data to obtain the first feature information, where the character length of the first feature information is 5, with CLS as the start flag bit and SEQ as the segmentation flag bit between the search keyword and the object title.
[0084] Optionally, determining the first feature information based on the search keyword in the search association information, the object title corresponding to at least one recommended object in the object recommendation set, and the first-format data in the format data includes: determining a plurality of first identifiers according to the search keyword in the search association information, and filling the first identifiers according to the first character length between the start flag bit and the segmentation flag bit; retrieving the corresponding object title according to the object identifier of each recommended object in the object recommendation set; for each object title, determining a plurality of second identifiers based on the current object title; filling the second identifiers according to the second character length after the segmentation flag bit to obtain the first feature information.
[0085] In an embodiment of the present invention, the first identifier can be understood as an identifier used to distinguish and represent different positions of the search keyword. The first character length can be understood as the length of the characters existing between the start identifier and the segmentation identifier set according to actual requirements, where the specific actual requirements are not limited in this embodiment. The second identifier can be understood as an identifier used to distinguish and represent different positions of the object title. The second character length can be the length of the characters existing after the segmentation identifier set according to actual requirements, where the specific actual requirements are not limited in this embodiment.
[0086] Specifically, after determining multiple first identifiers from the search keyword in the search association information, set the corresponding character length between the start identifier position and the segmentation identifier position of the search keyword, fill in the corresponding character positions with the first identifier, then determine the identifier information corresponding to each recommended object in the object recommendation set, determine the corresponding object title using the identifier information of each recommended object, and then determine multiple second identifiers according to the object title, so as to fill in the character positions after the segmentation identifier with the second identifier. After the filling is completed, the first feature information can be obtained.
[0087] Exemplarily, if the application scenario is a scenario of recommending corresponding items to a user based on a search request, the object recommendation set at this time can be a set containing the identifier information of all recommended items, that is, the sku set. The identifier information can be the id information of the recommended item, that is, the sku id. The recommended object corresponds to the recommended item category, and the object title corresponds to the category title, that is, the sku title.
[0088] If the search keywords in the search-related information are words such as XX brand, YY model, mobile phone, etc., multiple first identifiers can be determined, such as "XX brand", "YY model", "mobile phone", etc. Here, "mobile phone" is used as the first identifier for illustration. Set the length of the first character between the start identifier CLS and the split identifier SEQ to 2, and then fill each character of "mobile phone" into each character position between CLS and SEQ in turn until it is full. The other filling methods are the same and will not be elaborated here. After that, based on the sku set, determine the sku id of each recommended item, and use the sku id to retrieve the category title of the corresponding recommended item, that is, sku title. If the category title is XX brand YY model ZZ color mobile phone, multiple second identifiers can be determined, such as "XX brand", "YY model", "ZZ color", "mobile phone", etc. Then, which one to fill can be determined according to actual needs. Here, "ZZ color" is used as the second identifier for illustration. Set the length of the second character after the split identifier SEQ to 6, and then fill each character of "ZZ color" into each character position after SEQ in turn until the filling is complete. Based on the filled first identifier and second identifier, the first feature information can be obtained.
[0089] In this embodiment, by processing the search keywords and the object title to determine the first identifier and the second identifier, and then using the first identifier and the second identifier to fill in the corresponding positions of the first character length and the second character length respectively to obtain the first feature information, the time-consuming for obtaining the first feature information can be reduced and the processing efficiency can be improved.
[0090] S240. Determine the second feature information corresponding to the search keywords based on the second format data in the format data.
[0091] In the embodiment of the present invention, the second format data can be a corresponding format template used to determine one of the feature information. For example, the second format data can be the representation form of segment embedding. For example, the second format data can be pre-set identifier information corresponding to segment embedding. The second feature information can be understood as the feature information obtained by processing the search keywords using the second format data.
[0092] Specifically, use the second format data in the format data to process each search keyword to obtain the corresponding feature information, that is, the second feature information.
[0093] Exemplarily, the search keywords are differentiated by using the identifier information corresponding to the segment embedding, and different identifiers are set for each search keyword to distinguish different search keywords, thereby obtaining segment information, that is, the second feature information.
[0094] In this embodiment, the second feature information corresponding to the search keyword is determined by using the second format data in the format data. Since the second feature information corresponds to the search keyword, the second feature information is the feature information for differentiating the search keyword of the search association information, and can provide data support for the input data of the subsequent corresponding model.
[0095] S250. Determine the third feature information based on the third format data in the format data and the position information of each character in the search keyword.
[0096] In the embodiment of the present invention, the third format data may be a corresponding format template for determining one of the feature information. For example, the third format data may be a representation form of position embedding. For example, the third format data may be preset and correspond to the position identifier of the position embedding. The third feature information can be understood as the feature information obtained by processing the position information of each character of the search keyword by using the third format data.
[0097] Specifically, the specific position of each character in the search keyword is determined by using the third format data in the format data, thereby obtaining the feature information, that is, the third feature information.
[0098] Exemplarily, the position identifier information corresponding to the position embedding is used to assign a corresponding position identifier to each character in the search keyword. Then, each character in the search keyword can determine its specific position information in the search keyword according to the corresponding position identifier, thereby determining the position information, that is, the third feature information.
[0099] It should be noted that S230 to S250 may be executed sequentially or in parallel to obtain the corresponding feature information. This embodiment does not limit the execution manner. The above description in the specification is only an explanation of the sequence of S230 to S250.
[0100] In this embodiment, the third feature information is determined by using the third format data in the format data and the position information of each character in the search keyword. Therefore, the third feature information is the feature information for determining the specific position of each character in the search keyword. By using the third feature information, not only can the semantics of the search request be better determined, but also data support can be provided for the input data of the subsequent corresponding model.
[0101] S260. Sum at least three pieces of feature information corresponding to each recommended object in the object recommendation set based on the objective function and the half-precision instruction to obtain the target feature vector corresponding to each recommended object.
[0102] Specifically, use the half-precision calculation instruction in the objective function to sum the first-format data, the second-format data, and the third-format data. Among them, the objective function can be a CUDA Kernel function, and the half-precision calculation instruction is an FP16 half-precision calculation instruction. After transmitting the first feature information, the second feature information, and the third feature information corresponding to each recommended object in the object recommendation set to the GPU, the GPU threads concurrently execute the objective function, parse the corresponding information, and then calculate the target feature vector corresponding to each recommended object, so as to calculate the matching degree between each recommended object and the search request according to the target feature vector corresponding to each recommended object. Among them, all arithmetic operations can be processed in one objective function to reduce system overhead.
[0103] Exemplarily, the objective function can be a CUDA Kernel function, the half-precision calculation instruction is an FP16 half-precision calculation instruction, and the first-format data can be the representation form of token embedding. For example, the first-format data can be CLSxxxxxxxSEQxxxxxx, where CLS is the start identification bit, SEQ is the segmentation identification bit, and the "x" in the middle represents a character. The embodiment does not make specific limitations on the character length. The first feature information obtained using the first-format data can be regarded as token id information, and the second-format data can be the representation form of segment embedding. For example, the second-format data can be pre-set identifier information corresponding to segment embedding. The second feature information obtained using the second-format data can be regarded as segment information, and the third-format data is the representation form of position embedding. For example, the third-format data can be pre-set position identifiers corresponding to position embedding. The third feature information obtained using the third-format data can be regarded as position information. Next, this example will be described in detail. Based on the CUDA Kernel function, the FP16 half-precision calculation instruction is used to sum token embedding, segment embedding, and position embedding. At the same time, all arithmetic operations are completed in one CUDA Kernel function to reduce the overhead generated by multiple kernel launches. After transmitting the token id, segment, and position information to the GPU, the GPU threads concurrently execute this CUDA Kernel function, parse the corresponding information, and process the loaded BERT embedding data to complete the calculation. Among them, the built-in half and half2 types in CUDA can be used to complete the data conversion between FP32 and FP16, which can double the system performance.
[0104] It should be noted that in CUDA programming, kernel launch refers to the process of executing the program code running on the GPU. The built-in half type in CUDA represents a 16-bit floating-point number, and the half2 type is a vector type representing two 16-bit floating-point numbers.
[0105] In this embodiment, the feature information of each recommended object is summed up by using the objective function and the half-precision instruction to obtain the target feature vector of each recommended object. Among them, the arithmetic processing of the feature information can be carried out together to save system overhead. At the same time, by summing up the feature information of each recommended object, the target feature vector corresponding to each recommended object can be obtained, so as to use the target feature vector to determine the matching degree corresponding to each recommended object, and based on the matching degree, appropriate recommended objects are pushed to the user, achieving the purpose of improving the user experience.
[0106] The technical solution of the embodiment of the present invention retrieves the corresponding format data by using the first preset format. After that, the search correlation information related to the search request is determined. Thus, based on the search correlation information and the corresponding format data, the first feature information, the second feature information, and the third feature information are respectively determined. Finally, the above three feature information are processed by using the objective function and the half-precision instruction to obtain the corresponding target feature vector. It solves the problems in the prior art that determining at least three feature information is executed by the CPU, which consumes a lot of time to copy the result to the GPU, and there is a problem of occupying the resource bandwidth during the copying and transmission process. It realizes directly processing the above at least three feature information based on the GPU, and then determining the target feature vector based on the processing result, avoiding the problems of occupying the resource bandwidth and wasting time due to data transmission, and achieving the technical effect of improving data efficiency. Further, since the processing is implemented by the GPU, the coupling between the GPU and the CPU can be reduced.
[0107] Figure 3 It is a schematic flowchart of a data processing method provided by an embodiment of the present invention. On the basis of the foregoing embodiment, after obtaining the target feature vector based on the objective function and the half-precision calculation instruction, matrix operations can also be performed on the target feature vector, and the updated target feature vector is input into the correlation determination model to obtain the matching degree between at least one recommended object in the object recommendation set and the search request. The specific implementation manner can refer to the technical solution of this embodiment. Among them, the same or corresponding technical terms as those in the above embodiment will not be described in detail here.
[0108] As Figure 3 shown, the method includes:
[0109] S310. Determine the search correlation information corresponding to the search request.
[0110] Among them, the search correlation information includes the search keyword and the object recommendation set corresponding to the search request.
[0111] S320. Based on the search correlation information, determine at least three feature information corresponding to the search request.
[0112] S330. Process at least three pieces of feature information based on the objective function and half-precision calculation instructions to obtain an objective feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the objective feature vector.
[0113] S340. Perform matrix operations on the objective feature vector to update the objective feature vector.
[0114] Specifically, the relevance determination model has certain requirements for its input vector. Therefore, it is necessary to perform arithmetic processing on the objective feature vector using a matrix to update the objective feature vector, so that the updated objective feature vector meets the input vector requirements of the relevance determination model.
[0115] In this embodiment, by performing matrix calculations on the objective feature vector to update the objective feature vector, the objective feature vector can better meet the requirements of the relevance determination model.
[0116] S350. Input the objective feature vector into the relevance determination model to obtain the matching degree between at least one recommended object in the object recommendation set and the search request.
[0117] In the embodiment of the present invention, the relevance determination model can be understood as a model for determining the matching degree between each recommended object in the object recommendation set and the user's search request. Among them, the matching degree can be used to characterize the user's preference for the recommended object. Optionally, the higher the matching degree value, the more matching the recommended object is with the search request, that is, the more the user likes the recommended object. On the contrary, if it is not matching, at least one recommended object can be determined based on the matching degree for the display position on the display interface. The display position can be the display order. Among them, the recommended object with a high matching degree can be placed in a relatively forward display position on the display page. Optionally, the relevance determination model can be a BERT model.
[0118] Specifically, perform matrix operations on the objective feature vector of each recommended object in the object recommendation set to update the objective feature vector. Then, input the updated objective feature vector into the relevance determination model, and use the model to process the objective feature vector to obtain the matching degree between at least one recommended object in the object recommendation set and the search request, or the relevance prediction score. Then, use the matching degree as the user's preference for the recommended object, so as to use the matching degree to determine the recommended objects that the user is interested in and improve the user experience.
[0119] In this embodiment, the objective feature vector is input into the relevance determination model to obtain the corresponding matching degree, so as to use the matching degree to determine the recommended objects that the user is interested in and improve the user experience.
[0120] In the technical solution of the embodiment of the present invention, the target feature vector is processed by the correlation determination model to obtain the matching degree between at least one recommended object in the object recommendation set and the search request, so as to determine the user's preference for the recommended object by using the matching degree. Then, based on the matching degree, at least one recommended object is displayed on the display interface, which can quickly and conveniently push the recommended objects of interest to the user and improve the user experience. In addition, since the acquisition of the target feature vector is completed on the GPU, the correlation determination model does not need to rely on the processing result of the vector determination model, solving the problem of strong coupling between the two, which is beneficial to the optimization and iteration of the correlation determination model.
[0121] Figure 4 FIG. 4 is a structural schematic diagram of a data processing device provided by an embodiment of the present invention. The device includes: an association information determination module 410, a feature information determination module 420, and a matching degree determination module 430.
[0122] The association information determination module 410 is configured to determine the search association information corresponding to the search request; wherein, the search association information includes search keywords and an object recommendation set corresponding to the search request; the feature information determination module 420 is configured to determine at least three feature information corresponding to the search request based on the search association information; the matching degree determination module 430 is configured to process the at least three feature information based on an objective function and a half-precision calculation instruction to obtain a target feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the target feature vector.
[0123] Based on the above device, the device further includes a formatted data retrieval module, and the formatted data retrieval module is configured to retrieve formatted data corresponding to the at least three feature information according to a first preset format, so as to determine at least three feature information corresponding to the search request based on the formatted data and the search association information.
[0124] Based on the above device, the feature information determination module includes a first feature information determination unit, a second feature information determination unit, and a third feature information determination unit.
[0125] The first feature information determination unit is configured to determine first feature information based on the search keywords in the search association information, the object titles corresponding to at least one recommended object in the object recommendation set, and the first formatted data in the formatted data; the second feature information determination unit is configured to determine second feature information corresponding to the search keywords based on the second formatted data in the formatted data; the third feature information determination unit is configured to determine third feature information based on the third formatted data in the formatted data and the position information of each character in the search keywords.
[0126] Among them, the character length corresponding to the first format data is fixed, and it also includes a start identification bit and a segmentation identification bit.
[0127] Based on the above device, the first feature information determination unit is specifically configured to: determine a plurality of first identifiers according to the search keywords in the search association information, and fill the first identifiers according to the first character length between the start identification bit and the segmentation identification bit; according to the object identifier of each recommended object in the object recommendation set, retrieve the corresponding object title; for each object title, determine a plurality of second identifiers based on the current object title; and fill the second identifiers according to the second character length after the segmentation identification bit to obtain the first feature information.
[0128] Based on the above device, the matching degree determination module is configured to: perform a summation process on at least three feature information corresponding to each recommended object in the object recommendation set based on the objective function and the half-precision instruction to obtain a target feature vector corresponding to each recommended object.
[0129] Based on the above device, the matching degree determination module is further configured to: perform matrix operations on the target feature vector to update the target feature vector.
[0130] Based on the above device, the matching degree determination module is further configured to: input the target feature vector into a relevance determination model to obtain the matching degree between at least one recommended object in the object recommendation set and the search request.
[0131] Based on the above device, at least one of the recommended objects in the device corresponds to an item category.
[0132] The technical solution provided by the embodiment of the present invention processes the search request association information through a graphics processing unit to obtain at least three feature information corresponding to the search request. Further, based on the objective function and the half-precision calculation instruction, the at least three feature information are processed to obtain a target feature vector, which solves the problem in the prior art that a large amount of data generated by the CPU needs to be copied to the GPU so that the GPU can process the copied data to obtain the target feature vector. At this time, a long waiting time is required, resulting in low efficiency in obtaining the target result. It realizes that the GPU only needs to obtain a small amount of data from the CPU and then can analyze and process it, that is, a large amount of calculations are executed in the GPU, saving the data copy duration and improving the efficiency and convenience of determining the target feature vector. The data processing device provided by the embodiment of the present invention can execute the data processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0133] It should be noted that the various units and modules included in the above system are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present invention.
[0134] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 5 It shows a block diagram of an exemplary electronic device 50 suitable for implementing the embodiment mode of the embodiment of the present invention. Figure 5 The displayed electronic device 50 is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present invention.
[0135] As Figure 5 shown, the electronic device 50 is presented in the form of a general-purpose computing device. The components of the electronic device 50 may include but are not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 connecting different system components (including the system memory 502 and the processing unit 501).
[0136] The bus 503 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0137] The electronic device 50 typically includes a variety of computer system-readable media. These media can be any available media accessible by the electronic device 50, including volatile and non-volatile media, removable and non-removable media.
[0138] The system memory 502 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 504 and / or cache memory 505. The electronic device 50 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 506 can be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, commonly referred to as a "hard disk drive"). Although Figure 5Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) can be provided. In these cases, each drive can be connected to the bus 503 through one or more data medium interfaces. The memory 502 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0139] A program / utility 508 having a set (at least one) of program modules 507 can be stored, for example, in the memory 502. Such program modules 507 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 507 generally perform the functions and / or methods in the embodiments described in the present invention.
[0140] The electronic device 50 can also communicate with one or more external devices 509 (such as a keyboard, a pointing device, a display 810, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 50, and / or communicate with any device that enables the electronic device 50 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 511. Moreover, the electronic device 50 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 512. As shown in the figure, the network adapter 512 communicates with other modules of the electronic device 50 through the bus 503. It should be understood that although Figure 5 not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0141] The processing unit 501 executes various functional applications and data processing by running the programs stored in the system memory 502, such as implementing the data processing method provided by the embodiments of the present invention.
[0142] The embodiments of the present invention also provide a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute a data processing method when executed by a computer processor. The method includes:
[0143] Determine the search correlation information corresponding to the search request; wherein, the search correlation information includes search keywords and an object recommendation set corresponding to the search request;
[0144] Based on the search correlation information, determine at least three feature information corresponding to the search request;
[0145] Process at least three feature information based on the objective function and the half-precision calculation instruction to obtain the target feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the target feature vector.
[0146] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0147] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0148] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including - but not limited to - wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0149] Computer program code for performing the operations of the embodiments of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by connecting through the Internet using an Internet service provider).
[0150] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data processing method, characterized in that: Applied to a graphics processor, the method includes: Determine the search correlation information corresponding to the search request; wherein, the search correlation information includes a search keyword and an object recommendation set corresponding to the search request; Based on the search correlation information, determine at least three feature information corresponding to the search request; Process the at least three feature information based on an objective function and a half-precision calculation instruction to obtain an objective feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the objective feature vector.
2. The method according to claim 1, characterized in that, Before determining the search correlation information corresponding to the search request, it includes; Retrieve format data corresponding to the at least three feature information according to a first preset format, so as to determine at least three feature information corresponding to the search request based on the format data and the search correlation information.
3. The method according to claim 2, wherein The determining, based on the search correlation information, at least three feature information corresponding to the search request includes: Based on the search keyword in the search correlation information, the object title corresponding to at least one recommended object in the object recommendation set, and the first format data in the format data, determine the first feature information; Determine the second feature information corresponding to the search keyword based on the second format data in the format data; Based on the third format data in the format data and the position information of each character in the search keyword, determine the third feature information.
4. The method according to claim 3, characterized in that, The character length corresponding to the first format data is fixed, and it further includes a start identification bit and a segmentation identification bit. The determining, based on the search keyword in the search correlation information, the object title corresponding to at least one recommended object in the object recommendation set, and the first format data in the format data, the first feature information includes: Determine a plurality of first identifiers according to the search keyword in the search correlation information, and fill the first identifiers according to the first character length between the start identification bit and the segmentation identification bit; Retrieve the corresponding object title according to the object identifier of each recommended object in the object recommendation set; For each object title, determine a plurality of second identifiers based on the current object title; Fill the second identifiers according to the second character length after the segmentation identification bit to obtain the first feature information.
5. The method according to claim 1, wherein After obtaining the objective feature vector, it further includes: Perform matrix operations on the objective feature vector to update the objective feature vector.
6. The method according to claim 5, wherein It further includes: Input the objective feature vector into a correlation determination model to obtain the matching degree between at least one recommended object in the object recommendation set and the search request.
7. A data processing device, characterized in that: The device includes: An association information determination module, configured to determine the search correlation information corresponding to the search request; wherein, the search correlation information includes a search keyword and an object recommendation set corresponding to the search request; A feature information determination module, configured to determine at least three feature information corresponding to the search request based on the search correlation information; A matching degree determination module, configured to process the at least three pieces of feature information based on an objective function and a half-precision calculation instruction to obtain an objective feature vector, so as to determine the matching degree between at least one recommended object in the object recommendation set and the search request based on the objective feature vector.
8. The device according to claim 7, characterized in that, The feature information determination module includes: A first information determination unit, configured to determine first feature information based on a search keyword in the search association information, an object title corresponding to at least one recommended object in the object recommendation set, and first format data in format data; A second information determination unit, configured to determine second feature information corresponding to the search keyword based on second format data in the format data; A third information determination unit, configured to determine third feature information based on third format data in the format data and position information of each character in the search keyword.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method according to any one of claims 1-6.
10. A storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute the data processing method according to any one of claims 1-6 when executed by a computer processor.