Model-based data prediction method, model generation method, device and product
By configuring lightweight models on the client side and acquiring embedding features on demand, the challenge of model size control in edge intelligence is solved, enabling a reduction in model size without affecting performance and improving user experience.
Patent Information
- Application Number
- CN202211740990.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In edge intelligence applications, how can we effectively control the size of the edge model without affecting the model's performance, especially given the limited storage space on mobile devices?
By requesting and configuring a lightweight model on the client side and acquiring embedding features on demand, the model size is reduced. The model prediction is achieved by gradually acquiring the embedding features corresponding to the data of the page to be displayed from the server on an on-demand basis.
Without affecting the model's performance, the size of the edge model can be effectively controlled, solving the model size limitation problem in edge intelligent applications and improving the user experience.
Smart Images

Figure CN116244580B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a model-based data prediction method, model generation method, apparatus, and product. Background Technology
[0002] With the continuous development of internet technology, edge intelligence has gradually emerged and is widely used. However, in practical applications, edge intelligence faces stringent requirements regarding the size of edge models due to the limited storage space of mobile devices. Generally, cloud-based models are trained using large datasets, ranging from a few hundred MB to several GB in size.
[0003] Currently, there are two main methods for controlling the size of the end-side model:
[0004] 1. Reducing the model training data can reduce the number of features and parameters in the model, thereby controlling the model size. However, while reducing the model training data can reduce the model size, it will affect the model performance.
[0005] 2. The model is compressed before being sent to the client, but the compression space is limited and cannot fundamentally control the model size.
[0006] Therefore, how to effectively control the size of the edge model without affecting its performance is a critical issue that urgently needs to be addressed in the implementation of edge intelligence. Summary of the Invention
[0007] This invention provides a model-based data prediction method, model generation method, device, and product to effectively control the model size of the terminal intelligence in practical applications without affecting the model's performance.
[0008] The first aspect of this invention provides a model-based data prediction method applied to a client, the method comprising:
[0009] Send a lightweight model request carrying a page identifier to the server and obtain the model information of the lightweight model returned by the server. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0010] Send an embedding feature request carrying the data identifier of each page to be displayed to the server, and obtain the embedding feature corresponding to each page data to be displayed returned by the server. The embedding feature request is used to request the server to send the embedding feature corresponding to each page data to be displayed.
[0011] Obtain user behavior data from the client;
[0012] Configure the lightweight model based on the model information of the lightweight model;
[0013] Based on the user behavior data and the embedding features corresponding to each page to be displayed, the lightweight model is used to perform model prediction to obtain the prediction result.
[0014] Optionally, sending a lightweight model request carrying a page identifier to the server includes:
[0015] Before creating the page to be displayed, send a lightweight model request carrying the page identifier of the page to be displayed to the server; or
[0016] After displaying the current page, a lightweight model request carrying the page identifier of the current page is sent to the server.
[0017] Optionally, the method further includes:
[0018] While sending an embedding feature request carrying the data identifiers of each page to be displayed to the server, a page data request is also sent to the server. The page data request is used to request the data of each page to be displayed from the server.
[0019] Optionally, when the lightweight model is a fallback and rearrangement model, the step of performing model prediction based on the user behavior data and the embedding features corresponding to each page to be displayed, using the lightweight model to obtain the prediction result, includes:
[0020] Based on the user behavior data and the embedding features corresponding to each page data to be displayed, the click-through rate of each page data to be displayed is obtained through the back-and-forth rearrangement model.
[0021] The method further includes:
[0022] The data for each page to be displayed is rearranged according to the click-through rate from highest to lowest.
[0023] When a user's back action is detected, the rearranged data of each page to be displayed is shown.
[0024] A second aspect of this invention provides a model generation method applied to a server, the method comprising:
[0025] Train the full model using sample page data and corresponding sample user behavior data;
[0026] When the full model training is complete, the embedding features of the 5 sample page data output by the intermediate layer of the full model are obtained and stored.
[0027] A lightweight model is trained using the sample user behavior data corresponding to the sample page data and the embedding features of the sample page data. When the lightweight model is trained, the model information of the lightweight model is stored.
[0028] When a lightweight model request carrying a page identifier is received from a client, the lightweight model information is returned to the client 0. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0029] Upon receiving an embedding feature request from the client carrying the data identifiers of each page to be displayed, the client inputs the data of each page to be displayed corresponding to each data identifier into the client.
[0030] The client requests the full model corresponding to the lightweight model, obtains the 5-embedding features corresponding to the data of each page to be displayed, and returns them to the client; the embedding feature request is used to request the server to send the embedding features corresponding to the data of each page to be displayed.
[0031] Optionally, acquiring and storing the embedding features of the sample page data output from the intermediate layer of the full model includes:
[0032] The map data is read and stored via API. The map data is the embedding feature of the sample page data output by the intermediate layer of the full model, which is stored in the 0HashMap of the full model.
[0033] Optionally, the input parameters of the lightweight model include at least: a HashMap parameter, which is used to pass in the embedding features of the sample page data, or the embedding features of each page data to be displayed.
[0034] 5. A third aspect of the present invention provides a model-based data prediction device applied to a client, the device comprising:
[0035] The model acquisition module is used to send a lightweight model request carrying a page identifier to the server and obtain the model information of the lightweight model returned by the server. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0036] The embedding feature acquisition module is used to send an embedding feature request carrying the data identifier of each page to be displayed to the server, and to obtain the embedding feature corresponding to each page data to be displayed returned by the server. The embedding feature request is used to request the server to send the embedding feature corresponding to each page data to be displayed.
[0037] The acquisition module is used to acquire user behavior data of the client.
[0038] The model configuration module is used to configure the lightweight model based on the model information of the lightweight model;
[0039] The model prediction module is used to perform model prediction based on the user behavior data and the embedding features corresponding to each page to be displayed, using the lightweight model to obtain the prediction result.
[0040] Optionally, the model acquisition module includes:
[0041] The first request sending module is used to send a lightweight model request carrying the page identifier of the page to be displayed to the server before creating the page to be displayed.
[0042] The second request sending module is used to send a lightweight model request carrying the page identifier of the current page to the server after displaying the current page.
[0043] Optionally, the device further includes:
[0044] The third request sending module is used to send a page data request to the server at the same time as sending an embedding feature request carrying the data identifiers of each page to be displayed. The page data request is used to request the data of each page to be displayed from the server.
[0045] Optionally, the model prediction module includes:
[0046] The click-through rate prediction module is used to obtain the click-through rate of each of the pages to be displayed based on the user behavior data and the embedding features corresponding to each page to be displayed, using the fallback and rearrangement model when the lightweight model is a fallback and rearrangement model.
[0047] The device further includes:
[0048] The rearrangement module is used to rearrange the data of each page to be displayed in descending order of click-through rate;
[0049] The display module is used to show the rearranged data of each page to be displayed when a user's back action is detected.
[0050] A fourth aspect of this invention provides a model generation apparatus applied to a server, the apparatus comprising:
[0051] The full-scale model training module is used to train the full-scale model using sample page data and corresponding sample user behavior data.
[0052] The embedding feature storage module is used to acquire and store the embedding features of the sample page data output by the intermediate layer of the full model when the full model training is completed.
[0053] The lightweight model training module is used to train a lightweight model using the sample user behavior data corresponding to the sample page data and the embedding features of the sample page data, and to store the model information of the lightweight model when the lightweight model training is completed.
[0054] The model return module is used to return the model information of the lightweight model to the client when it receives a lightweight model request carrying a page identifier from the client. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0055] The embedding feature return module is used to, upon receiving an embedding feature request from the client carrying the data identifiers of each page to be displayed, input the data of each page to be displayed corresponding to the data identifiers of each page to be displayed into the full model corresponding to the lightweight model requested by the client, obtain the embedding features corresponding to each page to be displayed, and return them to the client; the embedding feature request is used to request the server to send the embedding features corresponding to each page to be displayed.
[0056] Optionally, the embedding feature storage module includes:
[0057] The first storage module is used to read and store map data via API. The map data is the embedding feature of the sample page data output by the intermediate layer of the full model, which is stored in the HashMap of the full model.
[0058] Optionally, the input parameters of the lightweight model include at least: a HashMap parameter, which is used to pass in the embedding features of the sample page data, or the embedding features of each page data to be displayed.
[0059] A fifth aspect of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When executed by the processor, the computer program implements the steps of the model-based data prediction method as described in the first aspect of the present invention or the steps of the model generation method as described in the second aspect of the present invention.
[0060] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the model-based data prediction method as described in the first aspect of the present invention or the steps of the model generation method as described in the second aspect of the present invention.
[0061] This invention embodiment sends a lightweight model request carrying a page identifier to the server to obtain the model information of the lightweight model returned by the server, and configures the lightweight model in the client according to the model information of the lightweight model; it also sends an embedding feature request carrying the data identifier of each page to be displayed to the server to obtain the embedding features corresponding to each page data to be displayed returned by the server; it obtains user behavior data from the client, and then performs model prediction using the lightweight model based on the user behavior data and the embedding features corresponding to each page data to be displayed returned by the server to obtain the prediction result. The model-based data prediction method in this embodiment obtains a lightweight model from the server that is pre-trained and does not contain embedding features, corresponding to the page identifier. Since this lightweight model does not contain embedding features, its size is greatly reduced. The client requests embedding features corresponding to each page data to be displayed from the server on demand, allowing the client to perform model prediction based on the batch-obtained embedding features, acquired user behavior data, and the lightweight model. This enables the client to fundamentally control the model size and embedding feature data issued by the server without affecting the model's performance, based on the principle of on-demand use. This effectively solves the problem of model size limitation in practical applications of edge intelligence. Attached Figure Description
[0062] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 This is a flowchart illustrating a model-based data prediction method according to an embodiment of the present invention;
[0064] Figure 2 This is a schematic diagram illustrating a client recommendation page according to an embodiment of the present invention;
[0065] Figure 3 This is a flowchart illustrating a model generation method according to an embodiment of the present invention;
[0066] Figure 4 This is a schematic diagram of an embedding class in the Tensorflowlite source code, as shown in an embodiment of the present invention.
[0067] Figure 5 This is a structural block diagram of a model-based data prediction device provided in an embodiment of the present invention;
[0068] Figure 6 This is a structural block diagram of a model generation device provided in an embodiment of the present invention;
[0069] Figure 7 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0070] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0071] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a model-based data prediction method according to an embodiment of the present invention. The model-based data prediction method provided in this embodiment can be applied to a client. In this embodiment, the client can refer to a program that provides local services to the user, and the client can implement the same software function in different program forms; for example, the client can be an application software (APP), a mini-program, a web browser, etc. Figure 1 As shown, the model-based data prediction method in this embodiment may include the following steps:
[0072] Step S11: Send a lightweight model request carrying a page identifier to the server and obtain the model information of the lightweight model returned by the server. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0073] In this embodiment, when the client needs to implement edge intelligence functionality, it can send a lightweight model request to the server. This lightweight model request carries at least a page identifier to request model information of the lightweight model corresponding to that page identifier from the server. The client receives the model information of the lightweight model corresponding to the page identifier returned by the server. The server stores multiple trained lightweight models with different functions. In this embodiment, the lightweight model is a model without embedding features. Different lightweight models correspond to different page identifiers, and the page identifier (such as a page ID) indicates which functional page the lightweight model belongs to, thus indicating the function of the lightweight model.
[0074] Regarding embedding features, the earliest entry point for this concept in deep learning is the so-called Manifold Hypothesis. The Manifold Hypothesis states that "natural raw data is a low-dimensional manifold embedded in the high-dimensional space where the raw data resides." Therefore, the task of deep learning is to map high-dimensional raw data (images, sentences) to low-dimensional manifolds, making the high-dimensional raw data separable after mapping. This mapping is called embedding. For example, word embedding maps sentences composed of words to a representation vector.
[0075] Formally, embedding is using a low-dimensional, dense vector to "represent" an object. This object can be a word (Word2vec), an item (Item2vec), or a node in a network relationship (Graph Embedding). The word "represent" means that the embedding features can express certain characteristics of the corresponding object, and the distance between vectors reflects the similarity between objects.
[0076] Traditional embedding methods encode a feature into an ID, then use that ID to look up the corresponding embedding in a large embedding table. If the number of features is in the hundreds of millions, this table could be hundreds of gigabytes in size. In other words, embedding features actually constitute a significant portion of a model. "Splitting" embedding features out of the model creates a lightweight model that significantly reduces its size.
[0077] Step S12: Send an embedding feature request carrying the data identifier of each page to be displayed to the server, and obtain the embedding feature corresponding to each page data to be displayed returned by the server. The embedding feature request is used to request the server to send the embedding feature corresponding to each page data to be displayed.
[0078] In this embodiment, since the lightweight model requested by the client does not contain embedding features, the client can send an embedding feature request to the server after entering the specific functional page requiring end-to-end intelligence. This embedding feature request carries at least the identifiers of each page data to be displayed, requesting the embedding features corresponding to each page data to be displayed from the server. The client receives the embedding features corresponding to each page data to be displayed returned by the server. The server stores the embedding features corresponding to the page data. Specifically, the embedding features corresponding to the page data can be associated with the page data identifiers of the page data and stored on the server. In this embodiment, the page data to be displayed is the data to be displayed on the page corresponding to the page identifier, such as posts, controls, text, images, etc., on the page to be displayed.
[0079] In this embodiment, the client can request the embedding features corresponding to the page data to be displayed from the server in batches according to the on-demand usage principle and the display status of the client page, instead of requesting all the embedding features of the page data to be displayed at once, thus avoiding downloading too many embedding features at once and increasing the client's usage capacity.
[0080] Step S13: Obtain the user behavior data of the client.
[0081] In this embodiment, the user can perform actions on the client (such as the client's interface). As user actions occur continuously on the client, the client can acquire real-time user behavior data. This embodiment can either collect user behavior data first and then directly acquire it, or it can collect and acquire user behavior data in real time; there is no limitation on this. The actions in this embodiment include, but are not limited to: touch screen operations (such as clicking, swiping, dragging, etc.), voice control operations, text input operations, etc. It should be noted that the acquisition of user behavior data in this embodiment is based on obtaining user permission and ensuring user privacy.
[0082] Step S14: Configure the lightweight model according to the model information of the lightweight model.
[0083] In this embodiment, after receiving a lightweight model request, the server can determine the lightweight model corresponding to the page identifier based on the page identifier, and then send the model information of the lightweight model to the client. The model information of the lightweight model may include at least the model download URL.
[0084] After receiving the lightweight model information, the client can configure the lightweight model locally based on that information. Specifically, after obtaining the lightweight model information, the client can retrieve the lightweight model from a remote server using the model download URL and store it locally on the client.
[0085] Step S15: Based on the user behavior data and the embedding features corresponding to each page to be displayed, perform model prediction using the lightweight model to obtain the prediction result.
[0086] In this embodiment, after the client obtains user behavior data, the embedding features corresponding to each page to be displayed data sent by the server, and the lightweight model, it can perform model prediction based on the user behavior data and the embedding features corresponding to each page to be displayed data, and obtain the prediction results output by the lightweight model, thereby completing the operation of the client-side lightweight model and realizing client intelligence.
[0087] In this embodiment, the client can obtain a pre-trained lightweight model corresponding to the page identifier that does not contain embedding features from the server. Since the lightweight model does not contain embedding features, its size is greatly reduced. In addition, the client can request the embedding features corresponding to each page data to be displayed from the server step by step as needed. This allows the client to perform model prediction based on the batch-obtained embedding features, the obtained user behavior data, and the lightweight model. This enables the client to fundamentally control the model size and embedding feature data issued by the server based on the principle of on-demand use without affecting the model performance, effectively solving the problem of model size limitation in the practical application of edge intelligence.
[0088] In one optional implementation, the lightweight model in this embodiment can be a recommendation model. Using the model-based data prediction method of this embodiment, the client can obtain a recommendation model corresponding to the page identifier without embedding features from the server, and gradually obtain the embedding features corresponding to the page data to be displayed from the server. Then, the client can perform model prediction based on user behavior data, the embedding features corresponding to the page data to be displayed, and the recommendation model without embedding features, and execute the corresponding recommendation business function based on the prediction results, thereby fundamentally controlling the model size of the client-side recommendation model.
[0089] In conjunction with the above embodiments, in one implementation, this embodiment of the invention also provides a model-based data prediction method. Specifically, in this method, the "sending a lightweight model request carrying a page identifier to the server" in step S11 may include step S21 or step S22:
[0090] Step S21: Before creating the page to be displayed, send a lightweight model request carrying the page identifier of the page to be displayed to the server.
[0091] In this embodiment, the client can send a lightweight model request carrying the page identifier of the page to be displayed to the server before creating the page to be displayed. This requests the server to pre-deploy the lightweight model corresponding to the page identifier of the page to be displayed, thereby enabling the client to preload the lightweight model of the page to be displayed. In other words, the client can request and preload the lightweight model before the page is created.
[0092] Step S22: After displaying the current page, send a lightweight model request carrying the page identifier of the current page to the server.
[0093] In this embodiment, after displaying the current page, the client can also send a lightweight model request carrying the page identifier of the current page to the server, requesting the server to issue the lightweight model corresponding to the page identifier of the current page. In other words, the client can also request a lightweight model from the server when entering a functional page that requires the implementation of edge intelligence.
[0094] This embodiment can choose when to send a lightweight model request carrying a page identifier to the server based on specific business needs, and this embodiment does not impose any restrictions on this.
[0095] In this embodiment, the client can send a lightweight model request to the server after entering the page or before the page is created, thereby selecting the timing of obtaining the lightweight model according to specific business needs, making the client intelligence more closely aligned with the business and improving the user experience.
[0096] In conjunction with the above embodiments, in one embodiment, the present invention also provides a model-based data prediction method. In addition to the steps described above, this method may further include step S31:
[0097] Step S31: While sending an embedding feature request carrying the data identifiers of each page to be displayed to the server, a page data request is also sent to the server. The page data request is used to request the data of each page to be displayed from the server.
[0098] In this embodiment, all page data displayed on the client is obtained from the server. Since the client requests page data to be displayed from the server in batches according to the on-demand principle, and the server only returns a certain length of page data to be displayed each time, such as 50 pieces of page data, the client will continue to request the next batch of page data to be displayed from the server after the user has finished browsing or is about to finish browsing this part of the page data, such as 50 pieces of data, and so on in a loop.
[0099] In this embodiment, the embedding features corresponding to the page data to be displayed, which are required for prediction by the lightweight model, are also obtained by the client from the server in batches according to the principle of on-demand use. Since the embedding features corresponding to the page data to be displayed are related to the page data to be displayed sent by the server, and the amount of embedding feature data is large, in accordance with the optimal principle, the request and sending of the embedding feature data corresponding to the page data to be displayed in this embodiment need to be done together with the page data to be displayed, so as to avoid sending too much or too little.
[0100] In other words, while sending an embedding feature request carrying the identifiers of each page to be displayed to the server, the client also sends a page data request carrying the identifiers of each page to be displayed to the server. This page data request requests the page data corresponding to each identifier from the server, thereby obtaining the page data returned by the server. Specifically, in this embodiment, the identifiers of each page to be displayed carried in the page data request are the same as those carried in the embedding feature request.
[0101] In this embodiment, the client can simultaneously send an embedding feature request carrying the data identifiers of each page to be displayed and a page data request carrying the data identifiers of each page to be displayed to the server. In order to ensure that the embedding feature data request and the page data are sent together according to the optimal principle, without sending too much or too little, the client can achieve the optimal effect of limiting the size of the client-side model.
[0102] In one optional embodiment, the scale of the embedding data is optimized based on the principle of on-demand use, no unnecessary network traffic consumption, and fast distribution speed. It can be adjusted according to different intelligent application scenarios and no specific restrictions are imposed.
[0103] In conjunction with the above embodiments, in one embodiment, the present invention also provides a model-based data prediction method. In this method, when the lightweight model is a backsliding and rearrangement model, step S15 may specifically include step S41, and the method may further include steps S42 and S43:
[0104] Step S41: Based on the user behavior data and the embedding features corresponding to each page data to be displayed, the click-through rate of each page data to be displayed is obtained through the back-and-forth rearrangement model.
[0105] In this embodiment, the back-and-forth ranking scenario refers to the following: When a user browses a news feed page, clicks on an item (such as a post or an advertisement), enters the item's details page, and then returns to the news feed page, the client will treat some items below that item (or those not yet exposed below it) as objects, perform an inference prediction, obtain their click-through rates, and then rearrange them from high to low based on their click-through rate scores. Back-and-forth ranking is also one of the application methods of recommendation systems on mobile devices, such as the scenario of back-and-forth ranking when clicking on a post on a page (such as a forum, blog, or other related display page).
[0106] In one embodiment, such as Figure 2 As shown, Figure 2 This is a schematic diagram illustrating a client-side recommendation page according to an embodiment of the present invention. Figure 2 Taking a client-side community recommendation page as an example, this is a scenario example of fallback and rearrangement implemented by the client-side intelligence: The server sends out the embedding feature data associated with the client-side lightweight model and the page data to be displayed on the client. When the user browses or clicks on the recommendation list data, the model performs prediction and rearranges the local recommendation list data to improve the user's click-through rate on posts.
[0107] When the lightweight model corresponding to the page identifier is the fallback and rearrangement model, the client, based on the acquired user behavior data and the embedding features of each page to be displayed data sent by the server, executes the fallback and rearrangement model prediction through the fallback and rearrangement model configured locally on the client to obtain the click-through rate of each page to be displayed data.
[0108] Based on the above Figure 2 Taking the edge intelligence used in the recommendation function of a certain client-side community as an example, the returned embedding vector data format is as follows: where curly braces represent Map type JSON format, and square brackets represent array type JSON format.
[0109]
[0110] Step S42: Rearrange the data of each page to be displayed in descending order of click-through rate.
[0111] In this embodiment, after the client predicts the click-through rate of each page data to be displayed through a lightweight back-and-forth model, it can rearrange the page data to be displayed in descending order of click-through rate.
[0112] Step S43: When a user's back operation is detected, display the rearranged data of each page to be displayed.
[0113] In this embodiment, when the client detects the user's back operation, it can perform the model prediction of the above-mentioned back-rearrangement model to obtain the click-through rate of each page data to be displayed. The client then rearranges the page data according to the click-through rate from high to low and displays the rearranged page data, thereby achieving the effect of recommending to the user and improving the click-through rate of the page data to be displayed.
[0114] In the above Figure 2 In the click-back and rearrangement model used in the recommendation function of a certain client-side application, the data to be displayed on the page is posts. As users click on posts in the list to enter the post details page for browsing, when they return to the list page, the click-back and rearrangement model is executed to predict and rearrange the posts that the user has not viewed, placing the posts with the predicted high click-through rate at the top to improve the post click-through rate.
[0115] In this embodiment, when the lightweight model is a fallback and rearrangement model, the client can predict the click-through rate (CTR) of each page based on user behavior data and the embedding features corresponding to each page to be displayed using the fallback and rearrangement model. The client then rearranges the page data according to their CTR from highest to lowest, thus fundamentally controlling the size of the client-side fallback and rearrangement model while ensuring its effectiveness, and enabling the smooth operation of the client-side click fallback model. It should be noted that this embodiment uses the fallback and rearrangement model for illustration, but is not limited to this model.
[0116] In conjunction with the above embodiments, in one embodiment, the present invention also provides a model-based data prediction method. In this method, in addition to carrying a page identifier, the lightweight model request may also include, but is not limited to: client identifier, client version, page version (optional, empty if the page iteration and client iteration are the same), current model version (locally stored model version), and model identifier (transmitted if there is a model locally, not transmitted if there is no model locally, not required).
[0117] Some pages are dynamic and do not update with the client (such as an app). For example, pages developed using H5 or other cross-platform functionalities can be dynamically updated at any time. When a page and the client version do not iterate together and are not in a one-to-one correspondence, the page version needs to be included in the lightweight model request to request the corresponding lightweight model. If the client has the model stored locally before sending the lightweight model request, the stored model identifier and model version need to be included in the lightweight model request to avoid requesting the same model.
[0118] In this embodiment, the server can query the lightweight models stored on the server based on parameters such as client identifier, client version, page identifier, and page version carried in the lightweight model request. It then determines whether the model identifier and current model version of the model sent by the client with the lightweight model request and stored locally on the client are the same as the lightweight model queried by the server. If they are the same, the lightweight model data is not sent; if they are different, the lightweight model data is returned, which includes at least: model identifier, model version, and model download URL.
[0119] In this embodiment, the client receives the model data of the lightweight model returned by the server. If a new version of the model is available, the client retrieves the latest model from the remote server according to the model URL and stores it locally, while updating the locally stored model version.
[0120] In conjunction with the above embodiments, in one implementation, this invention also provides a model-based data prediction method. In this method, the embedding feature request, in addition to carrying the identifiers of each page to be displayed, may also include, but is not limited to: a model identifier (the model identifier of the currently used lightweight model) and a model version (the model version of the currently used lightweight model). Furthermore, in one embodiment, the identifiers of each page to be displayed carried in the embedding feature request can be replaced with: a dataset identifier for the page to be displayed. Each set of 50 pages to be displayed, issued by the aforementioned tribe each time, constitutes a dataset for each page to be displayed. Each dataset for each page to be displayed has a unique identifier, and this unique identifier changes as the data content (i.e., the page to be displayed) in the dataset changes.
[0121] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a model generation method according to an embodiment of the present invention. The model generation method provided in this embodiment can be applied to a server. In this embodiment, the server can be understood as a physical server, a server cluster of multiple physical servers, or a distributed system. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. For example, the server can be a backend server for the client, such as a computer connected to the client for communication. Figure 1 As shown, the model generation method in this embodiment may include the following steps:
[0122] Step S51: Train the full model using sample page data and corresponding sample user behavior data.
[0123] In this embodiment, the server can build a base model using a pre-packaged model creation API, and then expand and set model training parameters based on this base model to encapsulate a custom full initial model. For example, the base model can be created based on APIs provided by tensorflow.keras, DeepFM, DIN, etc., and this embodiment does not impose any restrictions on this.
[0124] Then, based on the acquired sample page data and the corresponding sample user behavior data, the initial full model is trained, thus training the full model. In this embodiment, the full model includes embedding features; the full model is contrasted with the lightweight model.
[0125] Step S52: When the full model training is complete, obtain and store the embedding features of the sample page data output by the intermediate layer of the full model.
[0126] In this embodiment, during the training of the full initial model based on sample page data and corresponding sample user behavior data, the server performs a series of processes to obtain the embedding features corresponding to the sample page data output by the intermediate layer of the full initial model. The full model continuously updates and stores the embedding features corresponding to the sample page data obtained during training. The specific implementation of these processes varies depending on the model (e.g., DeepFM, DIN), and this embodiment does not limit the method for generating embedding features.
[0127] During the full model training process, the embedding features corresponding to the sample page data output by the intermediate layers of the initial full model are not static. These embedding features are continuously adjusted as the training data is continuously trained, and what is actually adjusted is the weight of the embedding features corresponding to the sample page data.
[0128] When the server finishes training the initial full model and obtains the trained full model, the full model stores the embedding features of the sample page data output by the intermediate layer of the full model when the full model is trained.
[0129] Based on this, the server can save the full model after it has been trained, and retrieve and store the embedding features of the sample page data output from the intermediate layer of the trained full model.
[0130] Step S53: Using the sample user behavior data corresponding to the sample page data and the embedding features of the sample page data, train a lightweight model. When the lightweight model is trained, store the model information of the lightweight model.
[0131] In this embodiment, the server can train a lightweight model corresponding to the full model based on the same construction approach as when constructing the full model. For example, it can expand and set model training parameters based on the base model constructed when constructing the full model to encapsulate a custom lightweight initial model.
[0132] The lightweight model in this embodiment does not contain embedding features. Specifically, when the server builds the custom lightweight initial model, it removes operations involving embedding features that were involved in building the custom full initial model. The lightweight initial model is then trained using sample user behavior data corresponding to the sample page data and the embedding features corresponding to that sample page data. In other words, the lightweight model in this embodiment is a model that does not contain embedding features.
[0133] Once the server has completed training the lightweight initial model and obtained the trained lightweight model, the server can store the trained lightweight model and its model information. The model information of the lightweight model includes at least the model download URL.
[0134] Step S54: Upon receiving a lightweight model request carrying a page identifier sent by the client, return the model information of the lightweight model to the client. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0135] In this embodiment, when the client needs to implement end-to-end intelligence functions, it can send a lightweight model request to the server. This lightweight model request carries at least a page identifier to request model information of the lightweight model corresponding to that page identifier from the server. The server can train and store multiple trained lightweight models with different functions based on the aforementioned steps S51-S53. Different lightweight models correspond to different page identifiers, and the page identifier (such as a page ID) indicates which functional page the lightweight model belongs to, thus indicating the function of the lightweight model.
[0136] When the server receives a lightweight model request with a page identifier from the client, it can search among multiple lightweight models stored on the server. When the lightweight model corresponding to the page identifier is found, the server can return the model information of the lightweight model corresponding to the page identifier to the client.
[0137] Step S55: Upon receiving the embedding feature request sent by the client carrying the data identifiers of each page to be displayed, input the data of each page to be displayed corresponding to the data identifier of each page to be displayed into the full model corresponding to the lightweight model requested by the client, obtain the embedding feature corresponding to each page to be displayed data, and return it to the client; the embedding feature request is used to request the server to send the embedding feature corresponding to each page to be displayed data.
[0138] In this embodiment, since the lightweight model requested by the client does not contain the embedding feature, the client can send an embedding feature request to the server after entering the specific function page that requires the implementation of terminal intelligence. The embedding feature request carries at least the data identifier of each page to be displayed in order to request the embedding feature corresponding to each page data to be displayed from the server.
[0139] When the server receives an embedding feature request from the client carrying the data identifiers of each page to be displayed, it can obtain the data of each page to be displayed corresponding to each data identifier, input the data of each page to be displayed corresponding to each data identifier into the full model corresponding to the lightweight model of the page identifier requested by the client, and obtain the embedding features of each page to be displayed corresponding to each data identifier output by the intermediate layer of the full model. The server then returns the obtained embedding features of each page to be displayed to the client.
[0140] In this embodiment, the server constructs a full model based on sample page data and corresponding sample user behavior data. The full model includes the embedding features of the sample page data. The embedding features of the sample page data are extracted from the trained full model and stored on the server. Based on the same construction approach as the full model, a lightweight model without embedding features is constructed. The lightweight model is trained and stored using the sample user behavior data and the embedding features of the sample page data. When the client sends a lightweight model request and an embedding feature request, the server distributes the corresponding lightweight model and the required partial embedding features. This allows the client to perform model prediction based on user behavior data, the embedding features of the sample page data, and the lightweight model. This fundamentally controls the size of the model trained by the server without affecting the model's performance. Furthermore, it controls the size of the model and embedding feature data distributed by the server based on the principle of on-demand use, effectively solving the problem of model size limitations in practical applications of edge intelligence.
[0141] In one embodiment, the concept of this embodiment is to extract the embedding feature data from a complete cloud-based deep learning model (full model) and store it separately on the server, thus transforming the full model with the embedded features extracted into a lightweight model. That is: Full model = Lightweight model + Embedded feature data.
[0142] However, in typical business scenarios, such as the recommendation list in an app's homepage feed, each post has an embedding feature. Since the list data can be extensive in real-world applications, the size of the first model would still be very large. Therefore, this embodiment downloads the embedding data corresponding to each post from the server in the order the list is presented to the user (for example, the client requests embedding data from the server according to pagination data to avoid downloading too much data at once).
[0143] Therefore, the main technical solution proposed in this embodiment is as follows: by splitting the embedding features in the model and gradually distributing the embedding feature data; that is: full model = lightweight model + embedding feature data (first part embedding feature data + second part embedding feature data + ... + nth part embedding feature data).
[0144] However, "splitting the embedding features in the model" is not as simple as removing the embedding features to obtain a lightweight model. For model developers, the entire model is a black box during the model training process, and each deep learning framework is different. It is impossible to obtain an independently running framework by simply splitting the embedding features in the middle of the model.
[0145] Therefore, this embodiment uses the method described in the above embodiments to construct a full model and a lightweight model: the server constructs and trains the full model, which includes embedding features; the embedding features are extracted from the full model and stored on the server; the server constructs a lightweight model, which does not include embedding features, and trains the lightweight model based on the externally input embedding features, thereby realizing the construction of a lightweight model without embedding features, so as to achieve effective control over the model size while ensuring the model performance.
[0146] In conjunction with any of the above embodiments, in one embodiment, the present invention also provides a model generation method. In this method, step S52 may include step S61:
[0147] Step S61: Read and store map data through API. The map data is the embedding feature of the sample page data output by the intermediate layer of the full model stored in the HashMap of the full model.
[0148] In this embodiment, during the training of the full model, a data structure can be created to store the embedding features of the processed sample page data. This data structure is an embedding class. Based on the description of the embedding features at the data structure level, the data structure includes at least two key attributes: input feature dimension (input_dim) and output feature dimension (output_dim). Figure 4 As shown, Figure 4 This is a schematic diagram of an embedding class in the Tensorflowlite source code, as shown in an embodiment of the present invention.
[0149] In the full model, the embedding features of the sample page data output from the intermediate layers are stored as map data in the full model's HashMap. Specifically, the feature name of the sample page data's embedding feature can be used as the key, and the embedding class of the sample page data's embedding feature can be used as the value, correspondingly stored in the HashMap. That is, during the training process of the full model, each feature, after processing, will correspond to an embedding feature, and this feature name and embedding class (i.e., this data structure) will be stored in the HashMap.
[0150] Once the full model has been trained, the server can read the map data stored in the HashMap of the full model through the corresponding API and store the map data on the server.
[0151] In this embodiment, after the full model training is completed, the server can read the embedding features of the sample page data stored in the HashMap of the full model through the API and store them on the server. This is to prepare for the subsequent training of the lightweight model by providing the embedding features of the sample page data that are necessary for training the lightweight model.
[0152] In one embodiment, similar to the above-mentioned storage of embedding features during training of the full model and extraction of embedding features stored in the full model by the server, when the server receives a request from the client carrying embedding feature identifiers of each page to be displayed, the server inputs the data corresponding to each page to be displayed corresponding to each page to be displayed identifier into the full model corresponding to the lightweight model requested by the client. The full model stores the embedding features corresponding to each page to be displayed output by the intermediate layer in the HashMap of the full model. The server reads the embedding features corresponding to each page to be displayed stored in the HashMap of the full model through the API, and then returns the embedding features corresponding to each page to be displayed to the client.
[0153] In conjunction with any of the above embodiments, in one embodiment, the present invention also provides a model generation method. In this method, the input parameters of the lightweight model include at least: a HashMap parameter, which is used to input the embedding features of the sample page data, or the embedding features of each page data to be displayed.
[0154] In this embodiment, when the server builds the lightweight initial model, the input parameters of the lightweight model include at least a HashMap parameter. Specifically, when building the lightweight initial model, the server adds a HashMap parameter to the model parameters set when building the full initial model. This HashMap parameter is used to pass in the embedding features of the sample page data required for training the lightweight model, or to pass in the embedding features of each page data to be displayed required by the lightweight model in actual application.
[0155] In this embodiment, when the server builds the lightweight initial model, it adds a HashMap parameter compared to building the full initial model. This parameter is used to pass in the embedding features required by the lightweight model from the outside, thereby achieving the lightweighting of the lightweight model itself while ensuring the model performance of the trained lightweight model.
[0156] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0157] Based on the same inventive concept, one embodiment of the present invention provides a model-based data prediction device 500, which can be applied to a client-side application. (Reference) Figure 5 , Figure 5 This is a structural block diagram of a model-based data prediction device provided in an embodiment of the present invention. Figure 5 As shown, the model-based data prediction device 500 includes:
[0158] The model acquisition module 501 is used to send a lightweight model request carrying a page identifier to the server and obtain the model information of the lightweight model returned by the server. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0159] The embedding feature acquisition module 502 is used to send an embedding feature request carrying the data identifier of each page to be displayed to the server, and to acquire the embedding feature corresponding to each page data to be displayed returned by the server. The embedding feature request is used to request the server to send the embedding feature corresponding to each page data to be displayed.
[0160] The acquisition module 503 is used to acquire user behavior data of the client.
[0161] The model configuration module 504 is used to configure the lightweight model according to the model information of the lightweight model;
[0162] The model prediction module 505 is used to perform model prediction based on the user behavior data and the embedding features corresponding to each page to be displayed, using the lightweight model, to obtain the prediction result.
[0163] Optionally, the model acquisition module 501 includes:
[0164] The first request sending module is used to send a lightweight model request carrying the page identifier of the page to be displayed to the server before creating the page to be displayed.
[0165] The second request sending module is used to send a lightweight model request carrying the page identifier of the current page to the server after displaying the current page.
[0166] Optionally, the device 500 further includes:
[0167] The third request sending module is used to send a page data request to the server at the same time as sending an embedding feature request carrying the data identifiers of each page to be displayed. The page data request is used to request the data of each page to be displayed from the server.
[0168] Optionally, the model prediction module 505 includes:
[0169] The click-through rate prediction module is used to obtain the click-through rate of each of the pages to be displayed based on the user behavior data and the embedding features corresponding to each page to be displayed, using the fallback and rearrangement model when the lightweight model is a fallback and rearrangement model.
[0170] The device 500 further includes:
[0171] The rearrangement module is used to rearrange the data of each page to be displayed in descending order of click-through rate;
[0172] The display module is used to show the rearranged data of each page to be displayed when a user's back action is detected.
[0173] Based on the same inventive concept, one embodiment of the present invention provides a model generation apparatus 600, which can be applied to a server. (See reference) Figure 6 , Figure 6 This is a structural block diagram of a model generation device provided in an embodiment of the present invention. Figure 6 As shown, the model generation device 600 includes:
[0174] The full-scale model training module 601 is used to train the full-scale model using sample page data and corresponding sample user behavior data.
[0175] The embedding feature storage module 602 is used to acquire and store the embedding features of the sample page data output by the intermediate layer of the full model when the full model training is completed.
[0176] The lightweight model training module 603 is used to train a lightweight model using the sample user behavior data corresponding to the sample page data and the embedding features of the sample page data, and to store the model information of the lightweight model when the lightweight model training is completed.
[0177] The model return module 604 is used to return the model information of the lightweight model to the client when it receives a lightweight model request carrying a page identifier sent by the client. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier.
[0178] The embedding feature return module 605 is used to, upon receiving an embedding feature request from the client carrying the data identifiers of each page to be displayed, input the data of each page to be displayed corresponding to the data identifiers of each page to be displayed into the full model corresponding to the lightweight model requested by the client, obtain the embedding features corresponding to each page to be displayed, and return them to the client; the embedding feature request is used to request the server to send the embedding features corresponding to each page to be displayed.
[0179] Optionally, the embedding feature storage module 602 includes:
[0180] The first storage module is used to read and store map data via API. The map data is the embedding feature of the sample page data output by the intermediate layer of the full model, which is stored in the HashMap of the full model.
[0181] Optionally, the input parameters of the lightweight model include at least: a HashMap parameter, which is used to pass in the embedding features of the sample page data, or the embedding features of each page data to be displayed.
[0182] Based on the same inventive concept, another embodiment of the present invention provides an electronic device 700, such as... Figure 7 As shown. Figure 7 This is a schematic diagram of an electronic device according to an embodiment of the present invention. The electronic device includes a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. When executed by the processor, the computer program implements the steps in the model-based data prediction method or the model generation method described in any of the above embodiments of the present invention. For example, the client in any of the above embodiments may be a computer program running on the electronic device.
[0183] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the model-based data prediction method or the model generation method as described in any of the above embodiments of the present invention.
[0184] It should be noted that the "product" in the title of this invention, "Model-based Data Prediction Method, Model Generation Method, Apparatus and Product", can refer to the aforementioned electronic equipment and computer-readable storage medium.
[0185] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0186] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0187] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0188] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0189] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0190] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0191] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0192] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0193] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0194] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium.
[0195] The document includes several instructions to cause a computer device (which may be a personal computer, server, 5G, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0196] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited.
[0197] Therefore, any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this invention should be included within the protection scope of this invention. Thus, the protection scope of this invention should be determined by the scope of the claims.
Claims
1. A model-based data prediction method, characterized in that, Applied to a client, the method includes: Send a lightweight model request carrying a page identifier to the server and obtain the model information of the lightweight model returned by the server. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier. Send an embedding feature request carrying the data identifier of each page to be displayed to the server, and obtain the embedding feature corresponding to each page data to be displayed returned by the server. The embedding feature request is used to request the server to send the embedding feature corresponding to each page data to be displayed. Obtain user behavior data from the client; Configure the lightweight model based on the model information of the lightweight model; Based on the user behavior data and the embedding features corresponding to each page to be displayed, the lightweight model is used to perform model prediction to obtain the prediction result.
2. The model-based data prediction method according to claim 1, characterized in that, Sending a lightweight model request carrying a page identifier to the server includes: Before creating the page to be displayed, send a lightweight model request carrying the page identifier of the page to be displayed to the server; or After displaying the current page, a lightweight model request carrying the page identifier of the current page is sent to the server.
3. The model-based data prediction method according to claim 1, characterized in that, The method further includes: While sending an embedding feature request carrying the data identifiers of each page to be displayed to the server, a page data request is also sent to the server. The page data request is used to request the data of each page to be displayed from the server.
4. The model-based data prediction method according to any one of claims 1 to 3, characterized in that, In the case that the lightweight model is a fallback and rearrangement model, the step of performing model prediction based on the user behavior data and the embedding features corresponding to each page to be displayed, using the lightweight model to obtain the prediction result, includes: Based on the user behavior data and the embedding features corresponding to each page data to be displayed, the click-through rate of each page data to be displayed is obtained through the back-and-forth rearrangement model. The method further includes: The data for each page to be displayed is rearranged according to the click-through rate from highest to lowest. When a user's back action is detected, the rearranged data of each page to be displayed is shown.
5. A model generation method, characterized in that, Applied to the server side, the method includes: Train the full model using sample page data and corresponding sample user behavior data; When the full model training is complete, the embedding features of the sample page data output by the intermediate layer of the full model are obtained and stored. A lightweight model is trained using the sample user behavior data corresponding to the sample page data and the embedding features of the sample page data. When the lightweight model is trained, the model information of the lightweight model is stored. When a lightweight model request carrying a page identifier is received from a client, the lightweight model information is returned to the client. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier. Upon receiving an embedding feature request from the client carrying the data identifiers of each page to be displayed, the server inputs the data of each page to be displayed corresponding to the data identifiers of each page to be displayed into the full model corresponding to the lightweight model requested by the client, obtains the embedding features corresponding to each page to be displayed, and returns them to the client; the embedding feature request is used to request the server to issue the embedding features corresponding to each page to be displayed.
6. The model generation method according to claim 5, characterized in that, The process of acquiring and storing the embedding features of the sample page data output from the intermediate layer of the full model includes: The map data is read and stored via API. The map data is the embedding feature of the sample page data output by the intermediate layer of the full model, which is stored in the HashMap of the full model.
7. The model generation method according to claim 5, characterized in that, The input parameters of the lightweight model include at least: a HashMap parameter, which is used to pass in the embedding features of the sample page data, or the embedding features of each page data to be displayed.
8. A model-based data prediction device, characterized in that, Applied to a client, the device includes: The model acquisition module is used to send a lightweight model request carrying a page identifier to the server and obtain the model information of the lightweight model returned by the server. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier. The embedding feature acquisition module is used to send an embedding feature request carrying the data identifier of each page to be displayed to the server, and to obtain the embedding feature corresponding to each page data to be displayed returned by the server. The embedding feature request is used to request the server to send the embedding feature corresponding to each page data to be displayed. The acquisition module is used to acquire user behavior data of the client. The model configuration module is used to configure the lightweight model based on the model information of the lightweight model; The model prediction module is used to perform model prediction based on the user behavior data and the embedding features corresponding to each page to be displayed, using the lightweight model to obtain the prediction result.
9. The model-based data prediction device according to claim 8, characterized in that, The model acquisition module includes: The first request sending module is used to send a lightweight model request carrying the page identifier of the page to be displayed to the server before creating the page to be displayed. The second request sending module is used to send a lightweight model request carrying the page identifier of the current page to the server after displaying the current page.
10. The model-based data prediction device according to claim 8, characterized in that, The device further includes: The third request sending module is used to send a page data request to the server at the same time as sending an embedding feature request carrying the data identifiers of each page to be displayed. The page data request is used to request the data of each page to be displayed from the server.
11. The model-based data prediction apparatus according to any one of claims 8 to 10, characterized in that, The model prediction module includes: The click-through rate prediction module is used to obtain the click-through rate of each of the pages to be displayed based on the user behavior data and the embedding features corresponding to each page to be displayed, using the fallback and rearrangement model when the lightweight model is a fallback and rearrangement model. The device further includes: The rearrangement module is used to rearrange the data of each page to be displayed in descending order of click-through rate. The display module is used to show the rearranged data of each page to be displayed when a user's back action is detected.
12. A model generation apparatus, characterized in that, Applied to the server side, the device includes: The full-scale model training module is used to train the full-scale model using sample page data and corresponding sample user behavior data. The embedding feature storage module is used to acquire and store the embedding features of the sample page data output by the intermediate layer of the full model when the full model training is completed. The lightweight model training module is used to train a lightweight model using the sample user behavior data corresponding to the sample page data and the embedding features of the sample page data, and to store the model information of the lightweight model when the lightweight model training is completed. The model return module is used to return the model information of the lightweight model to the client when it receives a lightweight model request carrying a page identifier from the client. The lightweight model request is used to request the model information of the lightweight model corresponding to the page identifier. The embedding feature return module is used to, upon receiving an embedding feature request from the client carrying the data identifiers of each page to be displayed, input the data of each page to be displayed corresponding to the data identifiers of each page to be displayed into the full model corresponding to the lightweight model requested by the client, obtain the embedding features corresponding to each page to be displayed, and return them to the client; the embedding feature request is used to request the server to send the embedding features corresponding to each page to be displayed.
13. The model generation apparatus according to claim 12, characterized in that, The embedding feature storage module includes: The first storage module is used to read and store map data via API. The map data is the embedding feature of the sample page data output by the intermediate layer of the full model, which is stored in the HashMap of the full model.
14. The model generation apparatus according to claim 12, characterized in that, The input parameters of the lightweight model include at least: a HashMap parameter, which is used to pass in the embedding features of the sample page data, or the embedding features of each page data to be displayed.
15. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the model-based data prediction method as claimed in any one of claims 1 to 4 or the steps of the model generation method as claimed in any one of claims 5 to 7.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the model-based data prediction method as described in any one of claims 1 to 4 or the steps of the model generation method as described in any one of claims 5 to 7.
Citation Information
Patent Citations
Advertisement putting method, device and equipment
CN110222894A
Privacy data protection-based abnormal acquisition behavior identification method and device
CN110826006A