An information prediction method, device, apparatus and computer readable storage medium
By calling the target prediction module and the target output processing module through a public interface, feature processing, model prediction, and result processing are decoupled, solving the problem of low information prediction efficiency and achieving more efficient and scalable information prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2020-10-14
- Publication Date
- 2026-05-29
AI Technical Summary
In the information prediction process, the high degree of coupling between feature processing, model prediction, and result processing leads to low information prediction efficiency, high complexity, and poor module scalability and maintainability.
By calling the target prediction module and target output processing module corresponding to various model configuration information through the public prediction interface and public output processing interface, feature processing, model prediction and result processing are decoupled, and the coupling between modules is reduced.
It reduces the complexity of information forecasting, improves the efficiency and scalability of information forecasting, and reduces the cost of information forecasting.
Smart Images

Figure CN112053013B_ABST
Abstract
Description
Technical Field
[0001] This application relates to information processing technology in the field of artificial intelligence, and more particularly to an information prediction method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] In a business domain, there are usually multiple models with different training objectives. For example, in the recommendation domain, there are models with time as the training objective, models with reading completion rate as the training objective, and models with page views as the training objective. Therefore, a business domain includes multiple models, and information prediction in the business domain is usually achieved based on any one of these models.
[0003] Generally, when a request for information prediction is received, model configuration information is usually determined based on the request, and feature processing, model prediction, and result processing are then performed using this information. However, in the above-mentioned information prediction process, the coupling between feature processing, model prediction, and result processing is high, resulting in high complexity and low efficiency. Summary of the Invention
[0004] This application provides an information prediction method, apparatus, device, and computer-readable storage medium that can improve the efficiency of information prediction.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides an information prediction method, including:
[0007] Obtain the model configuration information corresponding to the prediction task;
[0008] Through the public prediction interface, the target prediction module adapted to the model configuration information is called, wherein the public prediction interface is the calling interface of the prediction module of the model corresponding to various model configuration information.
[0009] Based on the target prediction module, the information to be predicted corresponding to the prediction task is predicted to obtain prediction output information.
[0010] Through a public output processing interface, the target output processing module adapted to the model configuration information is called, wherein the public output processing interface is the calling interface of the output processing module of the model corresponding to the various model configuration information;
[0011] Based on the target output processing module, the predicted output information is processed to obtain the target prediction result, and information recommendation is performed based on the target prediction result.
[0012] This application provides an information prediction device, including:
[0013] The information acquisition module is used to acquire model configuration information corresponding to the prediction task;
[0014] The first calling module is used to call the target prediction module adapted to the model configuration information through a public prediction interface, wherein the public prediction interface is the calling interface of the prediction module of the model corresponding to various model configuration information.
[0015] The information prediction module is used to predict the information to be predicted corresponding to the prediction task based on the target prediction module, and obtain prediction output information.
[0016] The second calling module is used to call the target output processing module adapted to the model configuration information through a public output processing interface, wherein the public output processing interface is the calling interface of the output processing module of the model corresponding to the various model configuration information.
[0017] The result processing module is used to process the prediction output information based on the target output processing module to obtain the target prediction result, and to make information recommendations based on the target prediction result.
[0018] In this embodiment of the application, the target prediction module includes a target feature processing module and a target feature prediction module; the information prediction module is further configured to obtain, based on the target feature processing module, a feature to be predicted corresponding to the information to be predicted; and to predict the feature to be predicted based on the target feature prediction module to obtain the prediction output information.
[0019] In this embodiment of the application, the information prediction device further includes a model addition module, used to respond to a model addition request, obtain the model configuration information; construct the target prediction module adapted to the model configuration information, and the target output processing module adapted to the model configuration information; add a calling interface for the target prediction module to the initial public prediction interface to obtain the public prediction interface; add a calling interface for the target output processing module to the initial public output processing interface to obtain the public output processing interface.
[0020] In this embodiment of the application, the first calling module is further configured to obtain a target prediction interface adapted to the model configuration information from the public prediction interface, wherein the target prediction interface is the calling interface of the target prediction module; and obtain the implementation information of the target prediction interface to obtain the target prediction module.
[0021] In this embodiment of the application, the information prediction device further includes a model modification module, which is used to modify the target prediction module and / or the target output processing module in response to a model modification request, so as to perform information prediction based on the modified target prediction module and / or the modified output processing module.
[0022] In this embodiment of the application, the model configuration information further includes prediction parameters, which include at least one of debug mode parameters, model output parameters, and prediction feature parameters; wherein, the debug mode parameters are used to determine the saving and processing of intermediate data, the model output parameters are used to indicate the model nodes of the output data, and the prediction feature parameters are used to determine the feature processing of the information to be predicted.
[0023] In this embodiment, the information prediction device further includes a model addition module, used to respond to a new model addition request, obtain configuration information of the model to be added; construct a prediction module adapted to the type of the model to be added, and an output processing module adapted to the type of the model to be added; add a calling interface for the prediction module to be added to the public prediction interface, and add a calling interface for the output processing module to be added to the public output processing interface, so as to call the prediction module to be added through the added public prediction interface, and call the output processing module to be added according to the added public output processing interface, thereby realizing information prediction corresponding to the configuration information of the model to be added.
[0024] In this embodiment of the application, the information prediction device further includes a sample splitting module for obtaining a sample batch size, wherein the sample batch size is the number of samples for performing one information prediction; based on the sample batch size, the sequence of samples to be predicted is split to obtain at least one piece of information to be predicted, wherein the number of samples to be predicted included in one of the at least one pieces of information to be predicted is the sample batch size;
[0025] In this embodiment of the application, the result processing module is further configured to obtain at least one target prediction result corresponding to the at least one piece of information to be predicted.
[0026] In this embodiment of the application, the sample splitting module is further configured to determine the sample batch size as the first batch size threshold when the output type corresponding to the model configuration information is a vector type; and to determine the sample batch size as the second batch size threshold when the output type corresponding to the model configuration information is a non-vector type, wherein the first batch size threshold is greater than the second batch size threshold.
[0027] In this embodiment of the application, the information prediction device further includes an information recommendation module, which is used to obtain the user identifier corresponding to the prediction task; send the combination information of the at least one target prediction result and the target user corresponding to the user identifier to a display device, so that the display device displays the combination information, so as to determine the recommended information of the target user from the recommended information sequence corresponding to the sample sequence to be predicted based on the displayed combination information.
[0028] This application provides an information prediction device, including:
[0029] Memory, used to store executable instructions;
[0030] The processor, when executing executable instructions stored in the memory, implements the information prediction method provided in the embodiments of this application.
[0031] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute and implement the information prediction method provided in this application.
[0032] The embodiments of this application have at least the following beneficial effects: When performing prediction tasks to achieve information prediction, since the calls to the prediction modules of the models corresponding to various model configuration information and the calls to the output processing modules of the models corresponding to various model configuration information are all implemented through public interfaces, the prediction modules of the models corresponding to various model configuration information and the output processing modules of the models corresponding to various model configuration information are all independent; therefore, the coupling between feature processing, model prediction and result processing is low, thereby reducing the complexity of information prediction and improving the efficiency of information prediction. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating an exemplary information prediction method;
[0034] Figure 2 This is an optional architecture diagram of the information prediction system provided in the embodiments of this application;
[0035] Figure 3 This is provided by the embodiments of this application. Figure 2 A schematic diagram of the composition structure of a server;
[0036] Figure 4 This is an optional flowchart illustrating the information prediction method provided in the embodiments of this application;
[0037] Figure 5 This is another optional flowchart illustrating the information prediction method provided in the embodiments of this application;
[0038] Figure 6 This is another optional flowchart illustrating the information prediction method provided in the embodiments of this application;
[0039] Figure 7 This is a schematic diagram of an information prediction architecture provided in an embodiment of this application;
[0040] Figure 8 This is another optional flowchart of the information prediction method provided in the embodiments of this application;
[0041] Figure 9 This is another optional flowchart of the information prediction method provided in the embodiments of this application;
[0042] Figure 10 This is a schematic diagram of an exemplary information prediction architecture provided in an embodiment of this application;
[0043] Figure 11 This is an exemplary flowchart of information prediction provided in an embodiment of this application;
[0044] Figure 12 This is a schematic diagram of an exemplary information prediction process provided in an embodiment of this application;
[0045] Figure 13 This is a flowchart illustrating an initialization prediction interface provided in an embodiment of this application;
[0046] Figure 14 This is a flowchart illustrating an initialization formatting interface provided in an embodiment of this application;
[0047] Figure 15 This is an exemplary flowchart illustrating information prediction based on prediction objects and formatted objects, provided in an embodiment of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0050] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0052] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0053] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0054] 1) Artificial Intelligence (AI): The theory, methods, technologies and application systems that use digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0055] 2) Machine Learning (ML): This is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills; and how to reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning typically includes techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, and inductive learning; the model in the embodiments of this application is based on machine learning.
[0056] 3) Samples to be predicted: also known as scoring samples or scoring items, refers to information that needs to be scored, such as articles and videos in information flow recommendations.
[0057] 4) Model: A network model used to score the samples to be predicted; usually, the model's output results are obtained by requesting the model service through the model's API (Application Programming Interface).
[0058] 5) Prediction Agent Module: This module is used to perform a series of logical processes, such as processing sample features, requesting model services, and processing model output results.
[0059] It should be noted that artificial intelligence (AI) is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines capable of reacting in a manner similar to human intelligence. AI, in essence, studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0060] Furthermore, artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0061] With the research and advancement of artificial intelligence (AI) technology, it has been studied and applied in various fields, such as smart homes, wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, and smart customer service. As technology develops, AI will be applied in even more areas and play an increasingly important role; for example, it can also be applied to recommendation systems. The application of AI in recommendation systems described in this application will be explained later.
[0062] Generally, in information prediction applications, the features of a batch of samples to be predicted are first obtained, then these features are input into a model for information prediction, ultimately yielding a score for each sample. Information prediction involves category recommendations covering multiple business types across three platforms (Kankan, Kuaibao, and browser), short content, and novels, each involving various types of information prediction. The acquisition of features for the samples to be predicted can be achieved, for example, through the following three methods: a, b, and c.
[0063] a. The prediction agent module first extracts the original features of the sample to be predicted, then processes the extracted original features, and finally calls the model to predict the information of the processed original features and outputs the results.
[0064] b. The business-side prediction agent module transmits the original features of the sample to be predicted. The prediction agent module processes the transmitted original features internally, and finally calls the model to predict the information of the processed original features and outputs the results.
[0065] c. The business-side prediction agent module transmits the processed original features of the sample to be predicted (features that can be used for prediction). The prediction agent module internally performs information prediction on the transmitted processed original features and outputs the results.
[0066] Furthermore, there are various types of models used for information prediction, such as prediction models, regression models, single-objective models, and multi-objective models.
[0067] In addition, the output results of the model also involve various different formats; for example, the score result of each sample to be predicted, the vector of each sample to be predicted (used for vector recall), the original output of the model corresponding to each sample to be predicted (used for reinforcement learning), the multi-way score result of each sample to be predicted, and the fused score result of the multi-way score result of each sample to be predicted, etc.
[0068] In information prediction scenarios involving multiple feature processing methods, multiple model prediction methods, and multiple output result processing methods, when the prediction agent module receives a request to perform information prediction, it typically determines the model configuration information based on the request and uses the model configuration information to perform feature processing, model prediction, and result processing. However, in the above-mentioned information prediction process, the coupling between feature processing, model prediction, and result processing is high, resulting in high information prediction complexity and low efficiency.
[0069] For example, see Figure 1 , Figure 1 This is a flowchart illustrating an exemplary information prediction method; such as Figure 1 As shown, this exemplary information prediction method includes the following steps:
[0070] S101, Receive information prediction request.
[0071] S102, respond to the information prediction request and pull the model configuration information.
[0072] Here, the information prediction request usually carries a model identifier, and the model configuration information is retrieved through the model identifier.
[0073] S103. Determine whether the model configuration information was successfully retrieved; if the retrieval fails, execute S104; if the retrieval succeeds, execute S105.
[0074] S104, Return to the message indicating that the fetch failed.
[0075] S105. Determine whether the model type in the model configuration information is supported; if not, proceed to S106; if supported, proceed to S107.
[0076] S106, Returns a message indicating that the service is not supported.
[0077] S107. Determine if the model type corresponds to the infinite model; if not, execute S108; if they correspond, execute S109.
[0078] S108. Determining whether the model type corresponds to other models.
[0079] Here, we will take the information prediction of the Wuliang model as an example. The information prediction of other models, such as the "tensorflow" model, is similar to that of the Wuliang model. The differences are that the APIs called are different, the format of the output results are different, and the processing of the output results is different.
[0080] S109. Obtain features based on the infinite model; execute S110 and S113.
[0081] S110. Determine whether to save the acquired features; if yes, execute S111; if no, execute S112.
[0082] S111, Preserve features.
[0083] Here, we preserve both the original features and the features after processing the original features.
[0084] S112, Features are not saved.
[0085] S113. Determine whether the output of the infinite model is a vector; if yes, execute S114; if no, execute S115.
[0086] S114. Set the batch size to infinity; execute S116.
[0087] Here, since the output result is a vector, the output result for a batch of samples to be predicted is the concatenation of the vectors corresponding to each sample to be predicted, and the output result for multiple batches of samples to be predicted is the concatenation of the concatenation results of each batch. Since the information prediction is performed in batches, there may be cases where the information prediction of some batches is successful and the information prediction of some batches fails. Therefore, in order to ensure the consistency of the overall output result with multiple batches of samples to be predicted, when the output result is a vector, the batch size is set to positive infinity, and the sequence of samples to be predicted is treated as a batch for information prediction.
[0088] S115. Set the batch size to the batch size threshold.
[0089] Here, the batch size threshold is, for example, 50, 30, or 100.
[0090] S116. Split the sequence of samples to be predicted according to the set batch size.
[0091] S117. Determine whether the Wuliang model is a multi-objective model based on the model type; if yes, execute S118; if no, execute S122.
[0092] S118. Call the multi-objective model interface to perform information prediction on a batch of information to be predicted.
[0093] S119. Determine whether multiple scoring results are predicted by merging information; if yes, proceed to S120; if no, proceed to S123.
[0094] S120, parse the parameters of the multi-objective model; this involves obtaining the weight information corresponding to each objective in the multi-objective model. For example, the weight of the duration objective is 0.5, the weight of the reading completion rate objective is 0.3, and the weight of the page view count objective is 0.2. Execute S121.
[0095] S121. Based on the multi-objective model parameters, fuse multiple scoring results. Execute S123.
[0096] S122. Call the single-objective model interface to perform information prediction on a batch of information to be predicted.
[0097] S123. Record the output results; that is, record a single scoring result or multiple scoring results after fusion.
[0098] S124. Determine whether the output of the record is a vector; if yes, execute S125; if no, execute S126.
[0099] S125. Save the concatenated output results; execute S129.
[0100] S126. Determine whether the recorded output is multiple scoring results of a multi-objective model; if yes, execute S127; if no, execute S128.
[0101] S127. Save multiple scoring results; execute S129.
[0102] S128. Save the scoring results; execute S129.
[0103] Here, concurrent execution of S117-S128 means concurrent invocation of the model for information prediction.
[0104] S129. Determine whether the information prediction for all batches of information to be predicted has failed; if yes, proceed to S130; if no, proceed to S131.
[0105] S130, Returns a message indicating that the prediction failed.
[0106] S131. Determine whether to save the output results of each batch that successfully predicted the information; if yes, execute S132; if no, execute S133.
[0107] This section stores the output results of all successfully completed information predictions, which can be used for debugging.
[0108] S132. Save the output results of each batch that was successfully predicted.
[0109] S133. Determine whether the output results of each batch that was successfully predicted are vectors; if yes, execute S134; if no, execute S135.
[0110] S134. Output the results of each batch that successfully predicted the splicing information. Execute S136.
[0111] S135. Sort the output results of each batch of successfully predicted information into the sequence of samples to be predicted.
[0112] S136, Return Processing: This involves returning the spliced output or the sorted sequence of samples to be predicted.
[0113] Here, after determining the batch size, the sample sequence to be predicted is split according to the batch size. For each split, the model is requested to perform information prediction. Upon the model's response, a record is made of the result for the current batch and whether it failed. After all batches have been requested, different aggregation and summarization methods are used based on the different output results. Finally, the prediction result is responded to the business side. In addition, to facilitate rapid model debugging, the prediction agent module checks whether data needs to be saved at each stage of the above information prediction process: feature acquisition, single batch output results, and output results for all batches. It is clear that during model debugging, data from each of these stages is saved, allowing for review of data at each stage of the information prediction chain to quickly locate and debug the model.
[0114] Based on the information prediction method described in S101-S136, it is easy to see that the entire prediction module process is filled with judgment logic. For example, a judgment that the output result is a vector is executed in several places. The prediction process logic is relatively complex and difficult to debug in a concurrent environment. The prediction processes of different types of models are similar, resulting in duplicated code logic in the prediction of different types of models. The various links in the prediction proxy module are tightly coupled, which is not conducive to the iteration and expansion of requirements. In other words, the module has low scalability, which is not conducive to subsequent requirement iteration; the modules are tightly coupled: feature retrieval, model request, and formatted output are coupled together; the code logic is complex, the handover cost is high, and the feasibility of module expansion and maintenance is low.
[0115] Based on this, embodiments of this application provide an information prediction method, apparatus, device, and computer-readable storage medium, which can reduce the complexity of information prediction, improve the efficiency of information prediction, enhance the scalability and maintainability of information prediction, and reduce the cost of information prediction.
[0116] The following describes exemplary applications of the information prediction device provided in this application. This information prediction device can be implemented as various types of user terminals such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), or as a server. The following will describe exemplary applications of the information prediction device when implemented as a server.
[0117] See Figure 2 , Figure 2 This is a schematic diagram of an optional architecture of the information prediction system provided in this application embodiment; as shown... Figure 2 As shown, to support an information prediction application, in the information prediction system 100, server 200 (information prediction device) is connected to terminal 400 (display device) via network 300. Network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both. Additionally, the information prediction system 100 includes a database 500 for providing data support to server 200; and terminal 600 is also included, connected to terminal 400 via network 300.
[0118] Server 200 is used to receive prediction tasks sent by terminal 400 via network 300, obtain model configuration information corresponding to the prediction tasks, and call target prediction modules adapted to the model configuration information through a public prediction interface. The public prediction interface is the calling interface for the prediction modules of models corresponding to various model configuration information. Based on the target prediction module, it predicts the information to be predicted corresponding to the prediction task, obtaining prediction output information. Through a public output processing interface, it calls target output processing modules adapted to the model configuration information. The public output processing interface is the calling interface for the output processing modules of models corresponding to various model configuration information. Based on the target output processing module, it processes the prediction output information to obtain target prediction results, which are then used for information recommendation. Server 200 is also used to send the target prediction results to terminal 400 via network 300.
[0119] Terminal 400 is used to receive operations applied to the information prediction control, and in response to the operations, send a prediction task to server 200 via network 300. It is also used to receive target prediction results sent by server 200 via network 300, and based on the target prediction results, send recommendation information to terminal 600 via network 300.
[0120] Terminal 600 is used to receive recommendation information sent by terminal 400 based on target prediction results via network 300, and to display the recommendation information on a graphical interface.
[0121] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or 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. Terminals 400 and 600 may be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, etc., but are not limited to these. Terminals and servers can be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment of the invention.
[0122] See Figure 3 , Figure 3 This is provided by the embodiments of this application. Figure 2 A schematic diagram of the composition structure of a server. Figure 3The server 200 shown includes at least one processor 210, memory 250, at least one network interface 220, and a user interface 230. The various components in server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 3 The general labeled all buses as Bus System 240.
[0123] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0124] User interface 230 includes one or more output devices 231 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0125] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.
[0126] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.
[0127] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0128] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0129] The network communication module 252 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, Wi-Fi, and Universal Serial Bus (USB).
[0130] Presentation module 253 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 231 associated with user interface 230 (e.g., a display screen, a speaker, etc.).
[0131] The input processing module 254 is used to detect and translate one or more user inputs or interactions from one or more input devices 232.
[0132] In some embodiments, the information prediction device provided in this application can be implemented in software. Figure 3 An information prediction device 255 stored in memory 250 is shown. It can be software in the form of programs and plug-ins, including the following software modules: information acquisition module 2551, first calling module 2552, information prediction module 2553, second calling module 2554, result processing module 2555, model addition module 2556, model modification module 2557, sample splitting module 2558, and information recommendation module 2559. These modules are logically connected and can therefore be arbitrarily combined or further split according to the functions they implement.
[0133] The functions of each module will be explained below.
[0134] In other embodiments, the information prediction device provided in this application can be implemented in hardware. As an example, the information prediction device provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the information prediction method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0135] The information prediction method provided in this application will be described below with reference to exemplary applications and implementations of the server provided in the embodiments of this application.
[0136] See Figure 4 , Figure 4 This is an optional flowchart illustrating the information prediction method provided in the embodiments of this application, which will be combined with... Figure 4 The steps shown are explained.
[0137] S401. Obtain the model configuration information corresponding to the prediction task.
[0138] In this embodiment of the application, when the business side requests the scoring of the information to be predicted through the terminal, the server receives the prediction task; since the prediction task is executed by the model, the server can obtain the model configuration information corresponding to the prediction task.
[0139] It should be noted that a prediction task refers to a task that performs prediction processing on the information to be predicted based on a specified model; model configuration information refers to relevant information about the model involved in performing the prediction task, such as the input feature format, model name, and output result format of the model.
[0140] S402. Call the target prediction module that is adapted to the model configuration information through the public prediction interface.
[0141] In this embodiment of the application, the server has a public prediction interface pre-set, or the server is able to obtain the public prediction interface. The public prediction interface is the calling interface of the prediction module of the model corresponding to various model configuration information. Therefore, after the server obtains the prediction task and the model configuration information corresponding to the prediction task, it can call the target prediction module that is adapted to the model configuration information through the public prediction interface.
[0142] It should be noted that the server, as a prediction agent module, can request one of multiple models to perform information prediction. Each model corresponds to one prediction module. In addition, the public prediction interface is a common calling interface for all prediction modules. Each prediction module corresponds one-to-one with various model configuration information, and one type of model configuration information corresponds to one model. The target prediction module is one of the prediction modules, which corresponds to the model configuration information and is used to perform prediction of the information to be predicted.
[0143] S403. Based on the target prediction module, the information to be predicted corresponding to the prediction task is predicted to obtain the prediction output information.
[0144] It should be noted that since the prediction task refers to the task of performing information prediction on the information to be predicted, the prediction task also corresponds to the information to be predicted; in addition, since the target prediction module is used to perform prediction processing on the information to be predicted, after the server obtains the target prediction module, it makes predictions on the information to be predicted based on the target prediction module, and the obtained prediction result is the prediction output information.
[0145] Here, the information to be predicted can be a feature that can be directly predicted using the model, or it can be information about features to be extracted, or it can be extracted features to be processed, etc. This application embodiment does not specifically limit this; however, when the information to be predicted is not a feature that can be directly predicted using the model, it is necessary to use the target prediction module to obtain the feature that can be directly predicted using the model corresponding to the information to be predicted; thus, the target prediction module includes the model corresponding to the model configuration information, and may also include a feature processing module.
[0146] S404. Call the target output processing module that is adapted to the model configuration information through the public output processing interface.
[0147] It should be noted that different models output results in different formats—some are vectors, some are single scores, some are multiple scores, and so on. Therefore, the server needs to process the predicted output information to obtain the final prediction result, such as vector concatenation, fusion of multiple scores, or sorting. Here, the server has a pre-set common output processing interface, or the server can obtain a common output processing interface. This common output processing interface is the calling interface for the output processing module of the model corresponding to various model configuration information. Therefore, after obtaining the predicted output information, the server can call the target output processing module adapted to the model configuration information through the common output processing interface.
[0148] Here, the common output processing interface is the common calling interface of each output processing module, and each output processing module corresponds one-to-one with various model configuration information; while the target output processing module is one of the output processing modules, which corresponds to the model configuration information and is used to process the predicted output information.
[0149] S405. Based on the target output processing module, the prediction output information is processed to obtain the target prediction result, and information recommendation is performed based on the target prediction result.
[0150] In this embodiment of the application, after the server obtains the target output processing module, it performs processing such as formatting, integrating, sorting or splicing on the predicted output information based on the target output processing module, and the obtained processing result is the target prediction result.
[0151] It should be noted that the target prediction result is the information prediction result of the prediction task. Recommended information can be determined based on the target prediction result to achieve information recommendation.
[0152] It is understood that the embodiments of this application call the target prediction module and the target output processing module adapted to the model configuration information corresponding to the prediction task through two public call interfaces (public prediction interface and public output processing interface) to perform information prediction on the information to be predicted, thereby achieving decoupling between prediction and output processing; thus, the coupling between the modules is low, thereby reducing the complexity of information prediction and improving the efficiency of information prediction.
[0153] In this embodiment of the application, the target prediction module includes a target feature processing module and a target feature prediction module; wherein, the target feature processing module is used to obtain features of the information to be predicted that can be directly predicted using the model, and the target feature prediction module is used to perform prediction by taking the output of the target feature processing module as input.
[0154] Accordingly, see Figure 5 , Figure 5 This is another optional flowchart illustrating the information prediction method provided in the embodiments of this application; as shown below. Figure 5 As shown in the embodiment of this application, S403 can be implemented through S4031 and S4032; that is, the server predicts the information to be predicted corresponding to the prediction task based on the target prediction module, and obtains the prediction output information, including S4031 and S4032. The steps are described below.
[0155] S4031. Based on the target feature processing module, obtain the features to be predicted corresponding to the information to be predicted.
[0156] It should be noted that the public prediction interface is the calling interface for the prediction module of the model corresponding to various model configuration information. This means that the public prediction interface is either the calling interface for the feature processing module of the model corresponding to various model configuration information, or the calling interface for the feature prediction module of the model corresponding to various model configuration information. In other words, various model configuration information corresponds to various feature processing modules, and various model configuration information corresponds to various feature prediction modules; while the target feature processing module is one of these feature processing modules, corresponding to the model configuration information; furthermore, the feature to be predicted is a feature that can be directly predicted using the model.
[0157] S4032. Based on the target feature prediction module, the feature to be predicted is predicted to obtain the prediction output information.
[0158] It should be noted that the target feature prediction module is one of the feature prediction modules and corresponds to the model configuration information.
[0159] Understandably, by calling the information involved in each processing step through a public interface, the coupling between feature processing, model prediction, and result processing is reduced, thereby reducing the complexity of information prediction and improving its efficiency.
[0160] See Figure 6 , Figure 6 This is another optional flowchart illustrating the information prediction method provided in the embodiments of this application; as shown below. Figure 6 As shown in the embodiment of this application, S406-S409 are included before S401; that is, before the server obtains the model configuration information corresponding to the prediction task, the information prediction method also includes S406-S409. Each step is described below.
[0161] S406: Respond to the model addition request and obtain model configuration information.
[0162] In this embodiment, when model registration is performed, a model addition operation is received on the model registration interface of the terminal, acting on the model addition control (e.g., the input control of the feature list and the OK button to submit input information). In response to this operation, the server receives a model addition request, which requests the addition of various processing modules corresponding to the model. First, the server responds to the model addition request by obtaining the model configuration information, because the requested processing modules corresponding to the model are adapted to the model configuration information.
[0163] In addition, model addition requests can also be generated by receiving operations on the model modification interface on the response server itself.
[0164] S407, Construct a target prediction module adapted to the model configuration information, and a target output processing module adapted to the model configuration information.
[0165] In this embodiment of the application, after the server obtains the model configuration information, it constructs a module adapted to the model configuration information to implement the prediction function, thus obtaining the target prediction module; and constructs a module adapted to the model configuration information to implement the processing of the output results, thus obtaining the target output processing module.
[0166] It should be noted that the target prediction module and the target output processing module can also be transmitted to the server by other devices. In this case, the server no longer needs to build the target prediction module and the target output processing module.
[0167] S408. In the initial public prediction interface, add the calling interface of the target prediction module to obtain the public prediction interface.
[0168] In this embodiment of the application, after the server obtains the target prediction module that is compatible with the model configuration information, it adds a call interface for the target prediction module to the initial public prediction interface, thus obtaining the public prediction interface. Therefore, the target prediction module can be called through the public prediction interface.
[0169] It should be noted that the initial public prediction interface is similar to the public prediction interface, used to call the prediction module. The difference is that the public prediction interface includes an additional calling interface for the target prediction module, which is not present in the initial public prediction interface.
[0170] S409. In the initial common output processing interface, add a call interface with the target output processing module to obtain the common output processing interface.
[0171] In this embodiment of the application, after the server obtains the target output processing module that is adapted to the model configuration information, it adds a calling interface for the target output processing module to the initial public output processing interface, thus obtaining the public output processing interface; thereby, the target output processing module can be called through the public output processing interface.
[0172] It should be noted that the initial public output processing interface is similar to the public output processing interface, used to call the output processing module. The difference is that the public output processing interface includes the calling interface of the target output processing module, which is not present in the initial public output processing interface.
[0173] In this embodiment of the application, the information involved in the information prediction process is hierarchically layered; see [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of an information prediction architecture provided in an embodiment of this application; as shown... Figure 7 As shown, the architecture of information prediction includes: feature prediction layer 7-1, feature processing layer 7-2, prediction invocation layer 7-3, and result processing layer 7-4, and the execution order of each layer is as follows 7-5. Figure 7 As indicated by the arrows. The feature prediction layer 7-1 corresponds to various feature prediction modules, including models of various types: Model 7-11, Model 7-12, Model 7-13, Model 7-14, ...; the feature processing layer 7-2 corresponds to various feature processing modules: Extraction and processing module 7-21, Processing module 7-22, Module 7-23 for obtaining transmitted features, ...; the prediction call layer 7-3 corresponds to the respective interfaces of each feature prediction module: Model interface 7-31, Model interface 7-32, Model interface 7-33, Model interface 7-34, ...; the result processing layer 7-4 corresponds to various output processing modules: Output vector module 7-41, Output scoring module 7-42, ...
[0174] Understandably, by stratifying the information involved in the information prediction process, the information prediction process is solidified for each step, thereby simplifying the logic of information prediction and decoupling the various stages of information prediction.
[0175] In this embodiment, S402 can be implemented through S4023 and S4024; that is, the server calls the target prediction module adapted to the model configuration information through the public prediction interface, including S4023 and S4024. Each step is described below.
[0176] S4023. Obtain the target prediction interface that matches the model configuration information from the public prediction interface.
[0177] It should be noted that the public prediction interface includes various prediction interfaces corresponding to the configuration information of each model. Therefore, the server can obtain the prediction interface adapted to the model configuration information corresponding to the prediction task from the public prediction interface; this is called the target prediction interface. Here, the target prediction interface is the calling interface of the target prediction module.
[0178] S4024. Obtain the implementation information of the target prediction interface to obtain the target prediction module.
[0179] It should be noted that the target prediction module is the implementation of the target prediction interface.
[0180] Similarly, in this embodiment of the application, in S404, the server calls the target output processing module adapted to the model configuration information through the public output processing interface, including: the server obtains the target output processing interface adapted to the model configuration information from the public output processing interface, wherein the target output processing interface is the calling interface of the target output processing module; and obtains the implementation information of the target output processing interface to obtain the target output processing module.
[0181] See Figure 8 , Figure 8 This is another optional flowchart illustrating the information prediction method provided in the embodiments of this application; as shown below. Figure 8 As shown in the embodiment of this application, after S409, S410 is also included; that is, after the server adds a call interface with the target output processing module in the initial public output processing interface to obtain the public output processing interface, the information prediction method further includes S410. The following describes each step separately.
[0182] S410. In response to the model modification request, modify the target prediction module and / or the target output processing module to perform information prediction based on the modified target prediction module and / or the modified output processing module.
[0183] In this embodiment, when a model is modified, a model modification operation is received on the model modification interface of the terminal, acting on the model modification controls (e.g., input controls in the feature list and modification buttons for submitting modification input information). In response to this operation, the server receives a model modification request, which requests modification of at least one processing module corresponding to the model. Here, the server responds to the model modification request by modifying the modification information of the target prediction module and / or target output processing module adapted to the model configuration information. For example, the target output processing module may be modified by adding an indicator to indicate whether each piece of information was predicted successfully or not.
[0184] Alternatively, a model modification request can also be generated by receiving operations on the model modification interface of the response server itself.
[0185] Understandably, since each prediction module and each output processing module is independent, when business requirements need to be modified, the corresponding modules can be modified directly, thus ensuring high maintainability.
[0186] In this embodiment, the model configuration information further includes prediction parameters, which include at least one of debug mode parameters, model output parameters, and prediction feature parameters. The debug mode parameters determine the storage and processing of intermediate data; that is, the debug mode parameters indicate whether the current information prediction is in debug mode. If it is in debug mode, intermediate data at each stage needs to be saved. Generally, debug mode is used in the inference stage. The model output parameters indicate the model nodes that output the data; that is, the model output parameters are the identifiers of the model nodes in the model (feature prediction module), and the output of the model node represented by this identifier is the model's output result. The prediction feature parameters determine the feature processing of the information to be predicted; that is, the prediction feature parameters indicate whether feature processing is required for the information to be predicted. Specifically, the prediction feature parameters indicate whether the features of the information to be predicted are directly predictable or require processing before they can be directly predicted.
[0187] In this embodiment of the application, S405 is followed by S411-S413; that is, after the server processes the predicted output information based on the target output processing module to obtain the target prediction result, the information prediction method further includes S411-S413. Each step is described below.
[0188] S411. Respond to the request to add a new model and obtain the configuration information of the model to be added.
[0189] In this embodiment, when a model is added, the terminal's model addition interface receives a model addition operation applied to the model addition controls (e.g., the input controls in the feature list and the "Confirm" button to submit input information). In response to this operation, the server receives a new model addition request, which requests the addition of the various processing modules corresponding to the model to be added. First, the server responds to the new model addition request by obtaining the configuration information of the model to be added, because the requested processing modules corresponding to the model to be added are adapted to the configuration information of the model to be added.
[0190] S412. Construct a prediction module that is compatible with the type of model to be added, and an output processing module that is compatible with the type of model to be added.
[0191] In this embodiment of the application, after the server obtains the configuration information of the model to be added, it constructs a module adapted to the configuration information of the model to be added for implementing the prediction function, thus obtaining the prediction module to be added; and constructs a module adapted to the configuration information of the model to be added for implementing the processing of the output results, thus obtaining the output processing module to be added.
[0192] It should be noted that the prediction module and output processing module to be added can also be transmitted to the server by other devices. In this case, the server no longer needs to build the prediction module and output processing module to be added.
[0193] S413. In the public prediction interface, add a calling interface for the prediction module to be added, and in the public output processing interface, add a calling interface for the output processing module to be added, so as to call the prediction module to be added through the added public prediction interface and call the output processing module to be added according to the added public output processing interface, so as to realize the information prediction corresponding to the model type to be added.
[0194] In this embodiment, after the server obtains the prediction module and output processing module to be added that are adapted to the configuration information of the model to be added, it adds a calling interface for the prediction module to be added to the public prediction interface and a calling interface for the output processing module to be added to the public output processing interface. Thus, it is possible to call the prediction module to be added through the added public prediction interface and to call the output processing module to be added according to the added public output processing interface, thereby realizing information prediction corresponding to the type of model to be added.
[0195] Understandably, the low coupling between the processing modules improves scalability; when adding new modules, it avoids new problems caused by expanding functionality, reducing the cost and time required for expansion.
[0196] In this embodiment, S401 can be implemented through S4011 and S4012; that is, the server obtains the model configuration information corresponding to the prediction task, including S4011 and S4012. The steps are described below.
[0197] S4011. Obtain the model identifier from the prediction task.
[0198] In this embodiment of the application, when the server obtains a prediction task, it can obtain a model identifier based on the prediction task. The model identifier is used to characterize a model.
[0199] S4012. Obtain the model configuration information that matches the model identifier from each model configuration information.
[0200] See Figure 9 , Figure 9 This is another optional flowchart illustrating the information prediction method provided in the embodiments of this application; as shown below. Figure 9 As shown in the embodiment of this application, S403 is preceded by S414 and S415; that is, before the server predicts the information to be predicted corresponding to the prediction task based on the target prediction module and obtains the prediction output information, the information prediction method further includes S414 and S415. Each step is described below.
[0201] S414. Obtain the sample batch size.
[0202] It should be noted that the sample batch size is the number of samples used to perform one information prediction.
[0203] S415. Based on the sample batch size, split the sample sequence to be predicted to obtain at least one piece of information to be predicted.
[0204] It should be noted that the number of samples to be predicted included in at least one of the information to be predicted is the sample batch size.
[0205] See also Figure 9 Accordingly, in the embodiments of this application, S405 is followed by S416; that is, after the server processes the predicted output information based on the target output processing module to obtain the target prediction result, the information prediction method further includes S416, which will be described below.
[0206] S416. Obtain at least one target prediction result corresponding to at least one piece of information to be predicted.
[0207] It should be noted that after the server has completed the information prediction for all the information to be predicted, it has obtained at least one target prediction result corresponding to at least one piece of information to be predicted. Additionally, at this point, the server may need to call the target output processing module through the public output processing interface to process at least one target prediction result.
[0208] In this embodiment of the application, S414 can be implemented by S4141 or S4142; that is, the server obtains the sample batch size, including S4141 or S4142. The steps are described below.
[0209] S4141. When the output type corresponding to the model configuration information is vector type, determine the sample batch size as the first batch size threshold.
[0210] It should be noted that the server determines the sample batch size based on the output type of the target prediction module adapted by the model configuration information, that is, the output type corresponding to the model configuration information. Here, when the output type corresponding to the model configuration information is a vector type, in order to ensure the consistency between the server's input and output, the sample batch size is determined to be the first batch size threshold, for example, it is determined to be positive infinity, which is a value greater than the total number of samples in the sample sequence to be predicted.
[0211] S4142. When the output type corresponding to the model configuration information is a non-vector type, determine the sample batch size as the second batch size threshold.
[0212] It should be noted that when the output type corresponding to the model configuration information is vector type, in order to reduce the computation time of the target prediction module and the amount of data exchanged between modules, the server splits the sequence of samples to be predicted based on a second batch size threshold; here, the second batch size threshold is, for example, 50 or 30, etc. Furthermore, the first batch size threshold is greater than the second batch size threshold.
[0213] See also Figure 9 In this embodiment of the application, S416 is followed by S417 and S418; that is, after the server obtains at least one target prediction result corresponding to at least one piece of information to be predicted, the information prediction method further includes S417 and S418. Each step is described below.
[0214] S417. Obtain the user identifier corresponding to the prediction task.
[0215] It should be noted that the purpose of the prediction task is to determine the user's recommendation information. As a result, the server can also obtain the user identifier corresponding to the prediction task, which is used to represent the user.
[0216] S418. Send the combination information of at least one target prediction result and the target user corresponding to the user identifier to the display device, so that the display device displays the combination information, and determines the recommended information of the target user from the recommended information sequence corresponding to the sample sequence to be predicted based on the displayed combination information.
[0217] It should be noted that after obtaining the user identifier, the server determines the target user based on the user identifier; then, it combines at least one target prediction result with the target user to obtain combined information. Here, the server can send this combined information to a display device for display, or it can display it on its own display device.
[0218] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0219] See Figure 10 , Figure 10 This is a schematic diagram of an exemplary information prediction architecture provided in an embodiment of this application; as shown below. Figure 10 In the field of information recommendation, the architecture of information prediction includes: model layer 10-1 (feature prediction layer), feature layer 10-2 (feature processing layer), prediction layer 10-3 (prediction invocation layer), and processing layer 10-4 (result processing layer), and the execution order of the multiple layers is as follows: Figure 10As indicated by the arrows in the diagram. Model layer 10-1 includes: classification model 10-111, prediction model 10-112, single-objective model 10-121, and multi-objective model 10-122. Classification model 10-111 and prediction model 10-112 belong to "Tensorflow" model 10-11, while single-objective model 10-121 and multi-objective model 10-122 belong to the infinite model 10-12. In other words, the various models trained with different objectives within a business domain are independent of each other. Feature layer 10-2 includes: feature extraction and processing 10-21, feature processing 10-22, and prediction feature acquisition 10-23. Feature extraction and processing 10-21 is used to extract features from information provided by the business party and process the extracted features. Feature processing 10-22 is used to process the features provided by the business party. Prediction feature acquisition 10-23 refers to acquiring features provided by the business party that can be directly predicted. The prediction layer 10-3 includes: a classification model interface 10-31, a prediction model interface 10-32, a single-objective model interface 10-33, and a multi-objective model interface 10-34. Classification model interface 10-31 corresponds to classification model 10-111, prediction model interface 10-32 corresponds to prediction model 10-112, single-objective model interface 10-33 corresponds to single-objective model 10-121, and multi-objective model interface 10-34 corresponds to multi-objective model 10-122. When a new model is added, the corresponding model is added to model layer 10-1, and the interface for the added model is added to the prediction layer. Each model is called independently through its corresponding model interface. The processing layer 10-4 includes: output vector 10-41, output score 10-42, output the result of the original model 10-43, and output multi-objective multi-path score 10-44.
[0220] based on Figure 10 As shown in the schematic diagram, in the scoring (information prediction) process in the field of information recommendation, different models can be called through different model interfaces, and different feature processing and output processing can be performed. However, the steps for each scoring are: determining features, calling the model for prediction, and processing the results. Therefore, the idea of using the template design pattern is to solidify the processing steps of the scoring process, while the specific implementation method of each step corresponds to different processing based on different situations.
[0221] See Figure 11 , Figure 11 This is an exemplary flowchart of information prediction provided in an embodiment of this application; as shown... Figure 11In the information prediction process 11-1 shown, based on the user's recommendation needs, an information prediction request 11-2 (a request to execute the prediction task) is generated. This information prediction request includes: model name 11-21, model debugging information 11-22 (debugging mode parameters), request type 11-23 (model output parameters), and processing predictable features 11-24 (predictive feature parameters). The model debugging information 11-22, request type 11-23, and processing predictable features 11-24 can be implemented through a functional tabbed mode. Furthermore, model name 11-21, model debugging information 11-22, request type 11-23, and processing predictable features 11-24 all belong to model configuration information. In addition, the information prediction request also includes information on features to be processed, processed features, and features to be retrieved (not shown in the figure).
[0222] First, feature 11-3 is determined based on information prediction request 11-2; that is, using... Figure 10 The middle feature layer extracts and processes features. 10-21 Extracts original features and processes them to obtain the features to be predicted, or uses... Figure 10 The middle feature layer processes features 10-22 to obtain the features to be predicted from the original features, or uses... Figure 10 The middle feature layer obtains the predicted features 10-23 directly from the transmitted features to be predicted.
[0223] Then, based on information prediction request 11-2, the model is invoked to execute prediction 11-4; that is, using... Figure 10 The classification model interface 10-31 in the prediction layer is called. Figure 10 Classification models 10-111 in the middle model layer are used for information prediction; or, alternatively, classification models 10-111 are used. Figure 10 The prediction model interface 10-32 in the middle prediction layer is called. Figure 10 Information prediction is performed using prediction models 10-112 in the middle model layer; or, alternatively, the following methods are used: Figure 10 Interface 10-33 of the single-objective model in the prediction layer, calling Figure 10 Information prediction is performed using a single-objective model 10-121 in the middle model layer; or, using... Figure 10 The multi-objective model interface 10-41 in the prediction layer is called. Figure 10 Information prediction is performed using the multi-objective model 10-122 in the middle model layer.
[0224] Next, based on the information prediction request 11-2, format the scoring data 11-5; that is, adopt... Figure 10 The output vector 10-41 in the processing layer 10-4, or, using Figure 10 The output scoring in the processing layer 10-4 is 10-42, or, using... Figure 10The output of the processing layer 10-4 in the model 10-43 is the result of the original model, or it can be processed using... Figure 10 The multi-target multi-path scoring is output in the processing layer 10-4 and the multi-target multi-path scoring is output in layer 10-44.
[0225] Finally, the prediction result 11-6 is returned; that is, the formatted score data is returned.
[0226] It should be noted that the determination of features 11-3 and the calling of the model to perform prediction 11-4 can be abstracted into prediction interface 11-71 (public prediction interface), and the formatting of scoring data 11-5 can be abstracted into formatting interface 11-72 (public output processing interface). Each prediction request for scoring information is responded to by calling the specific implementation module through prediction interface 11-71 and formatting interface 11-72.
[0227] based on Figure 10 and Figure 11 See Figure 12 , Figure 12 This is a schematic diagram of an exemplary information prediction process provided in an embodiment of this application; as shown below. Figure 12 As shown, this exemplary information prediction method includes the following steps:
[0228] S1201, Receive information prediction request.
[0229] S1202, respond to the information prediction request and pull the model configuration information.
[0230] Here, the information prediction request usually carries a model identifier, which is used to retrieve model configuration information from various model configuration information.
[0231] S1203. Determine whether the model configuration information was successfully retrieved; if the retrieval fails, execute S1204; if the retrieval succeeds, execute S1205.
[0232] S1204, Returns a message indicating a failed fetch.
[0233] S1205. Determine the sample batch size.
[0234] S1206. Split the sequence of samples to be predicted according to the set sample batch size.
[0235] S1207. Initialize the prediction interface based on the model configuration information to obtain the prediction object (target prediction module).
[0236] Here, the process of initializing the prediction interface is the process of calling the target prediction module adapted to the model configuration information through the public prediction interface in this embodiment of the application.
[0237] See Figure 13 , Figure 13 This is a flowchart illustrating an initialization prediction interface provided in an embodiment of this application; as shown... Figure 13 As shown, prediction interface 13-1 includes a feature retrieval interface 13-11 (the model's prediction module), a prediction execution interface 13-12 (the model's prediction module), and a model output result type acquisition interface 13-13 (the model's prediction module). When initializing prediction interface 13-1 based on model configuration information 13-2, an interface is selected from the feature retrieval interface 13-11, the prediction execution interface 13-12, and the model output result type acquisition interface 13-13 for initialization to obtain the prediction object 13-3 for the corresponding interface.
[0238] S1208. Initialize the formatting interface based on the model configuration information to obtain the formatted object (target output processing module).
[0239] Here, the process of initializing the formatting interface is the process in this embodiment of the application of calling the target output processing module adapted to the model configuration information through the public output processing interface.
[0240] See Figure 14 , Figure 14 This is a flowchart illustrating an initialization formatting interface provided in an embodiment of this application; as shown... Figure 14 As shown, the formatting interface 14-1 includes a single-objective prediction result output interface 14-11 (model output processing module), a multi-objective prediction result output interface 14-12 (model output processing module), a vector output interface 14-13 (model output processing module), a vector output interface 14-14 (model output processing module), a multi-objective model interface 14-15 (model output processing module), and a multi-objective model custom weighted fusion strategy interface 14-16 (model output processing module). When initializing the formatting interface 14-1 based on the model configuration information 14-2, an interface is selected from the single-objective prediction result output interface 14-11, multi-objective prediction result output interface 14-12, vector output interface 14-13, vector output interface 14-14, multi-objective model interface 14-15, and multi-objective model custom weighted fusion strategy interface 14-16 for initialization to obtain the formatting object 14-3 of the corresponding interface.
[0241] S1209. Perform information prediction on a batch of information to be predicted based on the prediction object and the formatted object.
[0242] Here, corresponding to the target prediction module in this application embodiment, the prediction output information is obtained by predicting the information to be predicted corresponding to the prediction task; and the target output processing module is used to process the prediction output information to obtain the target prediction result.
[0243] See Figure 15 , Figure 15 This is an exemplary flowchart illustrating information prediction based on prediction objects and formatted objects, provided in an embodiment of this application; for example... Figure 15 As shown, this exemplary process for information prediction based on prediction objects and formatted objects includes the following steps:
[0244] S1501. Determine whether the predicted object and the formatted object are valid; if yes, execute S1503; if no, execute S1502.
[0245] S1502, Return information: Error prediction message.
[0246] S1503. Obtain the features to be predicted through the object to be predicted.
[0247] S1504. Determine whether the prediction of the feature to be predicted by the prediction object is successful; if yes, execute S1505; if no, execute S1502.
[0248] S1505. Output prediction results (target prediction results) based on formatted objects.
[0249] It should be noted that, in the embodiments of this application, the process of obtaining the prediction object and the formatted object through initialization can also be optimized using a strategy model.
[0250] S1210. Obtain the prediction output results for all batches.
[0251] S1211, Packet return processing; that is, returning the prediction output results of all batches for information recommendation.
[0252] Understandably, the model-based prediction module and output processing module offer high flexibility in information prediction. Furthermore, each time a new model is added, only the prediction and formatting interfaces need to be implemented, without affecting other modules in the prediction agent module, resulting in high scalability, maintainability, and manageability.
[0253] The following description continues to illustrate the exemplary structure of the information prediction device 255 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 3 As shown, the software module stored in the information prediction device 255 of the memory 250 may include:
[0254] The information acquisition module 2551 is used to acquire model configuration information corresponding to the prediction task;
[0255] The first calling module 2552 is used to call the target prediction module adapted to the model configuration information through the public prediction interface, wherein the public prediction interface is the calling interface of the prediction module of the model corresponding to various model configuration information.
[0256] The information prediction module 2553 is used to predict the information to be predicted corresponding to the prediction task based on the target prediction module, and obtain prediction output information.
[0257] The second calling module 2554 is used to call the target output processing module adapted to the model configuration information through a public output processing interface, wherein the public output processing interface is the calling interface of the output processing module of the model corresponding to the various model configuration information.
[0258] The result processing module 2555 is used to process the prediction output information based on the target output processing module to obtain the target prediction result, and to make information recommendations based on the target prediction result.
[0259] In this embodiment of the application, the target prediction module includes a target feature processing module and a target feature prediction module; the information prediction module 2553 is further configured to obtain the feature to be predicted corresponding to the information to be predicted based on the target feature processing module; and to predict the feature to be predicted based on the target feature prediction module to obtain the prediction output information.
[0260] In this embodiment of the application, the information prediction device 255 further includes a model addition module 2556, which is used to respond to a model addition request, obtain the model configuration information; construct the target prediction module adapted to the model configuration information and the target output processing module adapted to the model configuration information; add a calling interface for the target prediction module to the initial public prediction interface to obtain the public prediction interface; and add a calling interface for the target output processing module to the initial public output processing interface to obtain the public output processing interface.
[0261] In this embodiment of the application, the first calling module 2552 is further configured to obtain a target prediction interface adapted to the model configuration information from the public prediction interface, wherein the target prediction interface is the calling interface of the target prediction module; and obtain the implementation information of the target prediction interface to obtain the target prediction module.
[0262] In this embodiment of the application, the information prediction device 255 further includes a model modification module 2557, which is used to modify the target prediction module and / or the target output processing module in response to a model modification request, so as to perform information prediction based on the modified target prediction module and / or the modified output processing module.
[0263] In this embodiment of the application, the model configuration information further includes prediction parameters, which include at least one of debug mode parameters, model output parameters, and prediction feature parameters; wherein, the debug mode parameters are used to determine the saving and processing of intermediate data, the model output parameters are used to indicate the model nodes of the output data, and the prediction feature parameters are used to determine the feature processing of the information to be predicted.
[0264] In this embodiment, the information prediction device 255 further includes a model addition module 2556, used to respond to a new model addition request, obtain configuration information of the model to be added; construct a prediction module to be added adapted to the type of the model to be added, and an output processing module to be added adapted to the type of the model to be added; add a calling interface for the prediction module to be added to the public prediction interface, and add a calling interface for the output processing module to be added to the public output processing interface, so as to call the prediction module to be added through the added public prediction interface, and call the output processing module to be added according to the added public output processing interface, thereby realizing information prediction corresponding to the configuration information of the model to be added.
[0265] In this embodiment of the application, the information prediction device 255 further includes a sample splitting module 2558, used to obtain a sample batch size, wherein the sample batch size is the number of samples to be predicted in one information prediction; based on the sample batch size, the sequence of samples to be predicted is split to obtain at least one piece of information to be predicted, wherein the number of samples to be predicted included in one of the at least one pieces of information to be predicted is the sample batch size;
[0266] In this embodiment of the application, the result processing module 2555 is further configured to obtain at least one target prediction result corresponding to the at least one piece of information to be predicted.
[0267] In this embodiment of the application, the sample splitting module 2558 is further configured to determine the sample batch size as the first batch size threshold when the output type corresponding to the model configuration information is a vector type; and to determine the sample batch size as the second batch size threshold when the output type corresponding to the model configuration information is a non-vector type, wherein the first batch size threshold is greater than the second batch size threshold.
[0268] In this embodiment of the application, the information prediction device 255 further includes an information recommendation module 2559, which is used to obtain the user identifier corresponding to the prediction task; send the combination information of the at least one target prediction result and the target user corresponding to the user identifier to a display device, so that the display device displays the combination information, so as to determine the recommended information of the target user from the recommended information sequence corresponding to the sample sequence to be predicted based on the displayed combination information.
[0269] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the information prediction method described in this application.
[0270] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the information prediction method provided in this application. For example, ... Figure 4 The information prediction method is shown.
[0271] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0272] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0273] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0274] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0275] In summary, through the embodiments of this application, when performing prediction tasks to achieve information prediction, the invocation of the prediction modules of the models corresponding to various model configuration information, as well as the invocation of the output processing modules of the models corresponding to various model configuration information, are all implemented through common interfaces. This ensures that the prediction modules of the models corresponding to various model configuration information, and the output processing modules of the models corresponding to various model configuration information, are independent. Therefore, the coupling between feature processing, model prediction, and result processing is low, thereby reducing the complexity of information prediction and improving its efficiency. Furthermore, it also enhances scalability and maintainability.
[0276] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. An information prediction method, characterized in that, include: Obtain the model configuration information corresponding to the prediction task; The prediction interface is initialized based on the model configuration information. From the public prediction interface, the target prediction interface adapted to the model configuration information is obtained, as well as the implementation information of the target prediction interface, to obtain the target prediction module. The public prediction interface is the calling interface of the prediction module of the model corresponding to various model configuration information, and the prediction modules of the models corresponding to various model configuration information are decoupled. The target prediction module includes a target feature processing module and a target feature prediction module. Based on the target feature processing module, the features to be predicted corresponding to the information to be predicted corresponding to the prediction task are obtained; based on the target feature prediction module, the features to be predicted are predicted to obtain prediction output information. Based on the model configuration information, an initialization formatting interface is performed. From the common output processing interface, a target output processing interface adapted to the model configuration information is obtained, as well as the implementation information of the target output processing interface, to obtain the target output processing module. The common output processing interface is the calling interface of the output processing module of the model corresponding to the various model configuration information, and the various output processing modules of the model corresponding to the various model configuration information are decoupled. Based on the target output processing module, the predicted output information is processed to obtain the target prediction result, and information recommendation is performed based on the target prediction result.
2. The method according to claim 1, characterized in that, Before obtaining the model configuration information corresponding to the prediction task, the method further includes: Respond to the model add request and obtain the model configuration information; Construct the target prediction module and the target output processing module adapted to the model configuration information; In the initial public prediction interface, the calling interface of the target prediction module is added to obtain the public prediction interface; In the initial common output processing interface, a calling interface with the target output processing module is added to obtain the common output processing interface.
3. The method according to claim 2, characterized in that, After adding a calling interface with the target output processing module to the initial common output processing interface to obtain the common output processing interface, the method further includes: In response to a model modification request, the target prediction module and / or the target output processing module are modified to perform information prediction based on the modified target prediction module and / or the modified output processing module.
4. The method according to claim 1 or 2, characterized in that, The model configuration information also includes prediction parameters, which include at least one of debug mode parameters, model output parameters, and prediction feature parameters. The debug mode parameters are used to determine the saving and processing of intermediate data, the model output parameters are used to indicate the model nodes of the output data, and the prediction feature parameters are used to determine the feature processing of the information to be predicted.
5. The method according to claim 1 or 2, characterized in that, After processing the predicted output information based on the target output processing module to obtain the target prediction result, the method further includes: Respond to the request to add a new model and obtain the configuration information of the model to be added; Construct a prediction module adapted to the type of model to be added, and an output processing module adapted to the type of model to be added; In the public prediction interface, a calling interface for the prediction module to be added is added, and in the public output processing interface, a calling interface for the output processing module to be added is added, so that the prediction module to be added can be called through the added public prediction interface, and the output processing module to be added can be called according to the added public output processing interface, so as to realize information prediction corresponding to the configuration information of the model to be added.
6. The method according to claim 1 or 2, characterized in that, Before obtaining the features to be predicted corresponding to the information to be predicted corresponding to the prediction task based on the target feature processing module, the method further includes: Obtain the sample batch size, wherein the sample batch size is the number of samples for one information prediction; Based on the sample batch size, the sequence of samples to be predicted is split to obtain at least one piece of information to be predicted, wherein the number of samples to be predicted included in one of the at least one pieces of information to be predicted is the sample batch size. After processing the predicted output information based on the target output processing module to obtain the target prediction result, the method further includes: Obtain at least one target prediction result corresponding to the at least one piece of information to be predicted.
7. The method according to claim 6, characterized in that, The process of obtaining the sample batch size includes: When the output type corresponding to the model configuration information is a vector type, the sample batch size is determined to be the first batch size threshold; When the output type corresponding to the model configuration information is a non-vector type, the sample batch size is determined to be the second batch size threshold, wherein the first batch size threshold is greater than the second batch size threshold.
8. The method according to claim 6, characterized in that, After obtaining at least one target prediction result corresponding to the at least one piece of information to be predicted, the method further includes: Obtain the user identifier corresponding to the prediction task; The combination information of the at least one target prediction result and the target user corresponding to the user identifier is sent to the display device so that... The display device displays the combined information to determine the recommended information for the target user from the recommended information sequence corresponding to the sample sequence to be predicted, based on the displayed combined information.
9. An information prediction device, characterized in that, include: The information acquisition module is used to acquire model configuration information corresponding to the prediction task; The first calling module is used to initialize the prediction interface based on the model configuration information, obtain the target prediction interface adapted to the model configuration information from the public prediction interface, and obtain the implementation information of the target prediction interface to obtain the target prediction module; wherein, the public prediction interface is the calling interface of the prediction module of the model corresponding to various model configuration information, and the prediction modules of the models corresponding to various model configuration information are decoupled from each other, and the target prediction module includes a target feature processing module and a target feature prediction module; The information prediction module is used to obtain the features to be predicted corresponding to the information to be predicted corresponding to the prediction task based on the target feature processing module; and to predict the features to be predicted based on the target feature prediction module to obtain prediction output information. The second calling module is used to initialize the formatting interface based on the model configuration information, obtain the target output processing interface adapted to the model configuration information from the common output processing interface, and obtain the implementation information of the target output processing interface to obtain the target output processing module; wherein, the common output processing interface is the calling interface of the output processing module of the model corresponding to the various model configuration information, and the various output processing modules of the model corresponding to the various model configuration information are decoupled from each other; The result processing module is used to process the prediction output information based on the target output processing module to obtain the target prediction result, and to make information recommendations based on the target prediction result.
10. The apparatus according to claim 9, characterized in that, The device further includes: The model addition module is used to respond to model addition requests and obtain the model configuration information; Construct the target prediction module and the target output processing module adapted to the model configuration information; In the initial public prediction interface, the calling interface of the target prediction module is added to obtain the public prediction interface; In the initial common output processing interface, a calling interface with the target output processing module is added to obtain the common output processing interface.
11. An information prediction device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the method of any one of claims 1 to 8 when executed by a processor.
13. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method described in any one of claims 1 to 8.