Data pushing method, electronic device, and storage medium
By constructing a data push method with message queues and queue identifiers, the problem of poor data push continuity was solved, achieving stability and continuity of data push and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI TAOXINBAO NETWORK TECHNOLOGY CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-07-03
Smart Images

Figure CN122340173A_ABST
Abstract
Description
Technical Field
[0001] This application relates to artificial intelligence technology and the field of data push, specifically to a data push method, electronic device, and storage medium. Background Technology
[0002] As knowledge-based products become increasingly popular, users' experience needs for content generated by intelligent models have shifted from outcome-oriented to process-aware, expecting to obtain real-time, progressive, and visualized knowledge presentation.
[0003] However, the relevant technologies often adopt the mode of generating all data and then returning it all at once. This may cause problems such as data push crashes, flickering, and interface lag due to non-standard data formats, disordered pushes, or uncontrolled frequency, resulting in poor continuity of data push.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a data push method, electronic device, and storage medium to at least solve the technical problem of poor continuity of pushed data in related technologies.
[0006] According to one aspect of the embodiments of this application, a data push method is provided, comprising: responding to receiving a data push instruction, sending a data acquisition request to an intelligent model based on the data push instruction, and constructing a message queue and a queue identifier of the message queue based on the data push instruction; receiving a data fragment stream returned by the intelligent model, wherein the data fragment stream consists of multiple data fragments generated by the intelligent model during data processing; writing the data fragment stream to the message queue based on the queue identifier; sequentially reading data fragments to be pushed from the data fragments stored in the message queue; and pushing the data fragments to be pushed.
[0007] According to another aspect of the embodiments of this application, a data push method is also provided, comprising: responding to a data push instruction applied to an operation interface, acquiring a data segment to be pushed, wherein the data push instruction is used to instruct a queue identifier based on a message queue to write a data segment stream to a message queue, and sequentially reading the data segment to be pushed from the data segments stored in the message queue, the data segment stream being composed of multiple data segments generated during data processing returned by a smart model instructing a data acquisition request, and the data acquisition request, message queue, and queue identifier being constructed by the data push instruction; rendering the data segment to be pushed; and outputting the rendering result of the data segment to be pushed on the operation interface.
[0008] According to another aspect of the embodiments of this application, a data push method is also provided, comprising: responding to an input command applied to an operation interface, displaying a data push command on the operation interface, wherein the data push command is used to instruct a backend server to write a data fragment stream to a message queue based on a queue identifier of a message queue, and to read a data fragment to be pushed from the data fragments stored in the message queue, wherein the data fragment stream is obtained by the backend server instructing an intelligent model to return data fragments generated during data processing based on a data acquisition request, and the data acquisition request, message queue, and queue identifier are constructed by the backend server based on the data push command; and responding to a processing command applied to the operation interface, displaying a rendering result of the data fragment to be pushed on the operation interface.
[0009] According to another aspect of the embodiments of this application, a computing device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0010] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory storing an executable program; and a processor connected to the memory via a bus for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0011] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0012] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0013] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0014] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of this application.
[0015] In this embodiment, in response to receiving a data push instruction, a data acquisition request is sent to the intelligent model based on the data push instruction, and a message queue and a queue identifier for the message queue are constructed based on the data push instruction. After receiving the data segment stream returned by the intelligent model, the data segment stream is written to the message queue based on the queue identifier, and the data segments to be pushed are read sequentially from the data segments stored in the message queue. Finally, the data segments to be pushed are pushed. Upon receiving a data push instruction, this application triggers the data push process and constructs a message queue based on the data push instruction to buffer the generated data segment stream. That is, after receiving the data segment stream obtained by the intelligent model through data processing, the data segment stream is written to the message queue based on the queue identifier, and then the data segments to be pushed are read and pushed. This decouples the data processing and push processes, avoiding interruptions in data push caused by unstable data generation, thus ensuring the continuity of data push and achieving the technical effect of improving the continuity of data push. This solves the technical problem of poor data push continuity in related technologies.
[0016] The above general description and the following detailed description are for illustrative and explanatory purposes only and do not constitute a limitation thereof. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 This is a schematic diagram of a data push method according to an embodiment of this application;
[0019] Figure 2 This is a flowchart of a data push method according to an embodiment of this application;
[0020] Figure 3 This is a schematic diagram of a data processing architecture according to an embodiment of this application;
[0021] Figure 4 This is an interactive diagram of data processing according to an embodiment of this application;
[0022] Figure 5 This is a flowchart of a data push method according to an embodiment of this application;
[0023] Figure 6 This is a flowchart of a data push method according to an embodiment of this application;
[0024] Figure 7 This is a schematic diagram of a data push device according to an embodiment of this application;
[0025] Figure 8 This is a schematic diagram of a data push device according to an embodiment of this application;
[0026] Figure 9 This is a schematic diagram of a data push device according to an embodiment of this application;
[0027] Figure 10 This is a structural block diagram of a computing device according to an embodiment of this application;
[0028] Figure 11 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some, not all, of the embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort should fall within the scope of protection of the present application.
[0030] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in other orders. Wherein, "other orders" refers to orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such as a process, method, system, product, or apparatus that comprises a series of steps or units, not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed, or inherent to such processes, methods, products, or apparatus.
[0031] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0032] The technical solution provided in this application is mainly implemented using a deep learning model. Deep learning models can be widely applied in fields such as Natural Language Processing (NLP), computer vision, and speech processing. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and image generation, as well as to natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. Therefore, the main application scenarios of this application include, but are not limited to, digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design. In the embodiments of this application, data processing using an intelligent model in a data interaction scenario is used as an example for explanation and illustration.
[0033] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0034] Streaming output refers to a technique where a large model generates content and returns fragments of data in real time, without waiting for the entire result to complete. Streaming output is suitable for the gradual transmission of formats such as text and JSON. JSON (JavaScript Object Notation) is a lightweight data-interchange format that uses a key-value pair structure to represent data.
[0035] Server-Sent Events (SSE) is a communication protocol that allows servers to push events to clients. It supports long connections and real-time message passing and is suitable for one-way streaming data transmission scenarios.
[0036] According to an embodiment of this application, a data push method is provided. The steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than that shown here.
[0037] The technical solutions provided in this application can employ deep learning models with relatively large parameter scales, such as large models containing billions or even more model parameters. Here, "large model" is just one example; this application does not limit the number of model parameters supported by the deep learning model used, aiming to meet actual needs. The deep learning models involved in this application can be artificial intelligence-based language models (LM) or multimodal models (MM).
[0038] Considering the limited computing resources of mobile terminals, the methods described above in this application embodiment can be applied to, for example... Figure 1 The application scenarios shown are as follows. In, for example... Figure 1 In the application scenario shown, the deep learning model is deployed on server 10. Server 10 can connect to one or more client devices 20 via a local area network (LAN), wide area network (WAN), internet connection, or other types of data network. Client devices 20 may include, but are not limited to, smartphones, tablets, laptops, PDAs, personal computers, smart home devices, and in-vehicle devices. Client devices 20 can interact with users through a graphical user interface to invoke the deep learning model, thereby implementing the method provided in this embodiment.
[0039] In this embodiment, the system consisting of a client device and a server can perform the following steps: The client device interacts with the server and receives data fragments to be pushed by the server. The server, in response to receiving a data push instruction, sends a data acquisition request to the intelligent model based on the data push instruction, constructs a message queue and a queue identifier for the message queue based on the data push instruction, and receives the data fragment stream returned by the intelligent model; it writes the data fragment stream to the message queue based on the queue identifier, sequentially reads the data fragments to be pushed from the data fragments stored in the message queue, and then pushes the data fragments to be pushed to the client device.
[0040] With the rapid development of high-performance computing units, the methods provided in this application embodiment can also be applied to model-in-the-loop machines in other application scenarios. In one optional embodiment, the model-in-the-loop machine has multiple built-in models. Users can select a model to adjust as needed to obtain their own model. The high-performance computing unit built into the model-in-the-loop machine can then directly call the adjusted model to execute the methods provided in this application embodiment. In another optional embodiment, the deep learning model-in-the-loop machine has a pre-trained model built-in. The high-performance computing unit built into the model-in-the-loop machine can then directly call this model to execute the methods provided in this application embodiment.
[0041] Furthermore, when users need to train their own models, they can upload their own datasets via the client. This dataset is sent from the client to the server. The server can then use this dataset to fine-tune the pre-trained model, resulting in the user's customized model, which can then be deployed to the production environment. To facilitate user adjustments, the server provides complete adjustment tools, development frameworks, and processes, supporting various adjustment strategies. This allows the adjusted model to better adapt to different application domains and achieve a high degree of customization.
[0042] Under the aforementioned operating environment, this application provides the following: Figure 2 The data push method shown. Figure 2 This is a flowchart of a data push method according to an embodiment of this application. For example... Figure 2 As shown, the method may include the following steps:
[0043] Step S202: In response to receiving a data push instruction, a data acquisition request is sent to the intelligent model based on the data push instruction, and a message queue and a queue identifier of the message queue are constructed based on the data push instruction.
[0044] The aforementioned data push commands can be used to initiate visualizations, triggering the visualization of data pushed to the front end. Data push commands can include, but are not limited to, the required data content, push time, and push format. Data push commands can trigger data visualizations, enhancing user trust and reducing invalid updates. Data push commands can be user-triggered or automatically generated by the data push system.
[0045] The aforementioned intelligent model can refer to a large language model (LLM) used to generate structured knowledge. The intelligent model is the source engine of the data push output system. It can serve various scenarios such as text generation, chart generation, and report generation. It can output structured data fragments segment by segment in a streaming manner, rather than returning the complete result all at once, thereby reducing memory usage spikes and response time. The intelligent model can output data fragment streams in an asynchronous, non-blocking manner. It can be decoupled from the front-end or back-end, deployed independently, and elastically scaled, supporting multi-instance load balancing. Upon receiving a data retrieval request, it generates a data fragment stream based on the request and returns it.
[0046] The aforementioned data acquisition request can be generated immediately upon receiving a data push instruction, instructing the intelligent model to process the data. Data acquisition requests can include, but are not limited to, acquisition requirements, context parameters, and data identifiers. Data acquisition requests can be generated for different data needs.
[0047] The aforementioned message queue can be an in-memory persistent data structure used to cache streaming data fragments generated by intelligent models. The message queue can adopt a streaming data structure, isolating different data retrieval tasks through queue identifiers, such as unique keys (stream keys). The message queue can be implemented based on an in-memory database, supporting high-concurrency writes and low-latency reads. Different data push tasks can be treated as independent streams for subsequent continuous consumption, supporting blocking waits and batch reads. Furthermore, message queue replicas and persistence strategies can be configured to ensure data is not lost after service restarts. Moreover, multiple push services can be deployed to concurrently consume the same queue, improving throughput and achieving asynchronous scaling. Using message queues, instead of directly sending data fragment streams, data consistency can be maintained through message queues, while avoiding data loss and ensuring the continuity, real-time nature, and fidelity of data pushes.
[0048] The queue identifier mentioned above can be a globally unique identifier or service code dynamically generated for visualization tasks. It is used to bind data retrieval requests and data push instructions, serving as the core index for achieving task-level isolation and status tracking. The queue identifier can be constructed based on a timestamp, random number, or service serial number. It can be stored in a memory cache or database. The queue identifier facilitates data subscription and retrieval of corresponding data fragments. Data binding via queue identifiers avoids crosstalk from multiple user requests, ensuring data security.
[0049] In one optional embodiment, upon receiving a data push instruction, such as when a user clicks the "Generate Visualization" button, the instruction is encapsulated into a structured event message and published. Upon listening to this message, a data retrieval request is generated, and structured prompts conforming to the intelligent model's input specifications are constructed to trigger data processing by the intelligent model. The data push instruction is parsed, and a suitable queue structure template is matched based on a pre-built queue template library. The queue structure template may include, but is not limited to, message format, retention strategy, and consumer group configuration. Thus, the message queue and its queue identifier are obtained by filling the queue structure template based on the data push instruction. High concurrency and low latency are achieved through event decoupling, avoiding main thread blocking.
[0050] In another alternative embodiment, a data push command can be automatically generated upon detecting user input or based on historical user activity. Then, after determining the data retrieval request based on the data push command, the request is sent to the intelligent model for data processing. Alternatively, the data push command can be sent to a gateway, which queries the deployment instance list of the target data processing service. Based on a load balancing strategy, an available service node is selected, and a queue creation command is sent to that node. Then, queue connection information is dynamically obtained through service discovery, thereby determining the message queue and its queue identifier.
[0051] Step S204: Receive the data segment stream returned by the intelligent model.
[0052] The data fragment stream consists of multiple data fragments generated by the intelligent model during data processing.
[0053] The aforementioned data fragment stream can be multiple data fragments directly output by the intelligent model during the data generation process. The data fragment stream may contain, but is not limited to, the root structure or meta-information required for visualization rendering. The data fragment stream may contain incomplete syntax, missing parentheses, garbled characters, or interference from Chinese line breaks. The data fragment stream can be used to determine the visualization type and context; failure to do so may indicate that the data fragment is invalid.
[0054] In one optional embodiment, after the intelligent model is started and generated, data fragments returned by the intelligent model are received via long polling or a network socket protocol, and the data fragment stream is continuously received by listening to message events. For example, by listening to the data fragment stream, automatic reconnection and reception in event order are possible.
[0055] In another alternative embodiment, the data push system is viewed as a group of consumers, and the intelligent model as a message publisher. The data push system subscribes to data topics and pulls and processes streams of data fragments in real time.
[0056] Step S206: Write the data fragment stream to the message queue based on the queue identifier.
[0057] In one alternative embodiment, when a data fragment stream is written according to a queue identifier, the queue identifier can be used as the message key. A hash algorithm is used to calculate the key, routing the message to the corresponding partition of the message queue, ensuring that data with the same identifier is sent to the same partition, thus achieving ordering and isolation.
[0058] In another alternative embodiment, data is written to a message queue via a message middleware, and a queue identifier is used to map the data to a target node. When a data stream segment arrives, the target node is located using the queue identifier, and then the data segment stream is written to the local message queue.
[0059] Step S208: Read the data segments to be pushed from the data segments stored in the message queue in sequence.
[0060] The aforementioned data segments to be pushed are data segments output sequentially by the intelligent model during the generation process, following the data segment stream. These data segments can be incremental additions to the visualization rendering state or structural refinements. The data segments to be pushed are consumed, validated, and pushed to the client in sequence via a message queue to ensure the continuity, progression, and consistency of the push process. The data segments to be pushed can be partial data, such as newly added, modified, or expanded fields.
[0061] By using a consumption mechanism or read commands, data fragments to be pushed can be output sequentially from the message queue, ensuring the time consistency of the data stream. Outputting data fragments sequentially resolves issues such as out-of-order content, jumps, and reversals caused by the instability of the intelligent model's intermediate state during data push, improving user trust. This allows users to perceive a natural evolution process, rather than fragmented jumps, greatly alleviating waiting anxiety.
[0062] By outputting data segments to be pushed through a message queue, even if the intelligent model encounters local errors or retries during the generation process, the message queue can still retain the segments in order. The backend can skip invalid segments and wait for valid increments, preventing the entire data push task from failing. Furthermore, in concurrent scenarios with large amounts of data, the sequential processing mechanism of the data segments to be pushed ensures that the data flow within different data push tasks is strictly ordered and does not interfere with each other, achieving stable push and accurate rendering.
[0063] In one optional embodiment, when reading data segments stored in the message queue, the data segments to be pushed can be read according to priority or time order to ensure the continuity of data push.
[0064] In another alternative embodiment, when writing data fragments to a stream, the system not only creates a queue identifier but also simultaneously creates a consumer group and registers multiple consumers. When reading data fragments to be pushed, each consumer uses its own consumer name and group name as parameters to sequentially pull data fragments from the message queue.
[0065] Step S210: Push the data segment to be pushed.
[0066] In one optional embodiment, priority tags are marked for the data segments to be pushed, and the data segments to be pushed are pushed in priority order, such as high priority (e.g., coordinate axis configuration) being pushed immediately, medium priority (e.g., data sequence) being pushed with a delay, and low priority (e.g., annotation description) being pushed in batches.
[0067] In another alternative embodiment, a network socket protocol is established to reuse the heartbeat channel for transmitting data segments to be pushed. That is, the data segments to be pushed are encapsulated into message frames to achieve redundancy-free pushing via the network socket protocol, reducing server load and supporting bidirectional communication.
[0068] In this embodiment, in response to receiving a data push instruction, the intelligent model sends a data acquisition request and constructs a message queue and a queue identifier based on the data push instruction. After receiving the data segment stream returned by the intelligent model, the data segment stream is written to the message queue based on the queue identifier, and the data segments to be pushed are read sequentially from the data segments stored in the message queue. Finally, the data segments to be pushed are pushed. Upon receiving a data push instruction, this application triggers the data push process and constructs a message queue based on the instruction to buffer the generated data segment stream. That is, it receives the data segment stream obtained by the intelligent model through data processing, writes the data segment stream to the message queue based on the queue identifier, and then reads and pushes the data segments to be pushed. This decouples the data processing and push processes, avoiding interruptions in data push caused by unstable data generation, thus ensuring the continuity of data push and achieving the technical effect of improving the continuity of data push. This solves the technical problem of poor data push continuity in related technologies.
[0069] In the embodiments of this application, the above method further includes: parsing the data push instruction to determine the data transmission method of the intelligent model and the queue component corresponding to the message queue, wherein the data transmission method is used to characterize the way the intelligent model returns a data fragment stream, and the queue component is used to characterize the component used when storing data using the message queue; initializing the queue component; and constructing a data acquisition request based on the initialized queue component and the data transmission method.
[0070] The aforementioned data transmission method refers to the transmission mechanism used to push data fragments after the intelligent model generates structured data. This embodiment can employ a streaming transmission method, which transmits data segment by segment in real time without waiting for complete output, achieving a low-latency "generate and render simultaneously" experience and supporting unidirectional, ordered, and automatically reconnected event stream transmission. Streaming transmission allows for continuous data push, ensuring that the data stream is synchronized with the user's perception.
[0071] The aforementioned queue component can refer to an independent runtime environment used to carry and manage streaming data fragments. The queue component can build task-level context isolation, such as an environment for building message queues, ensuring the independence of message queues and preventing data from being mixed or interfered with between multiple tasks. The queue component can be based on a memory-based persistent queue system, dynamically creating a unique message stream for each visualization task and binding it to relevant contexts (such as user identifiers, request parameters, and timeout policies). The runtime environment of the queue component can include independent namespaces, access permissions, lifecycle managers, and cleanup policies, ensuring resource isolation and stability under high concurrency, thereby achieving three-level decoupling between the intelligent model, push service, and frontend, and supporting breakpoint resumption and data replay.
[0072] In one optional embodiment, the data push command is parsed, such as through semantic analysis or by using a parser to identify the configuration parameters corresponding to the data push command, such as data source type, output format, and target front-end rendering method, thereby determining which transmission mechanism the subsequent intelligent model should use to return the data fragment stream. Through dynamic adaptation of requests, different data transmission methods can be automatically determined according to different application scenarios, improving the flexibility and compatibility of data transmission.
[0073] Furthermore, parsing data push commands reveals configuration parameters in the message queue, such as queue name, persistence strategy, and partitioning method, thus identifying the queue component. This allows the queue component to establish a precise mapping between the backend service and the underlying message storage system, ensuring that data fragments can be written and read correctly and efficiently, providing infrastructure support for subsequent decoupled architectures.
[0074] Then, the queue component is initialized, such as verifying the existence of the queue, creating a namespace, setting up consumer groups, and configuring timeout and retry policies, to ensure that the message queue is available, clean, and correctly configured before use, so as to avoid write failures or data loss due to the message queue not being ready or being misconfigured, thereby improving the robustness of system startup and operation.
[0075] Finally, based on the initialized queue components and data transmission methods, data retrieval requests can be constructed. These requests allow for continuous data monitoring and real-time forwarding of the monitored data. This avoids request construction errors or queue read / write failures caused by incompatibility between the transmission protocol and the queue component type. It ensures that the data fragment stream returned by the intelligent model is correctly written into the message queue and reliably read by subsequent processes as data fragments to be pushed. This effectively reduces problems such as data fragment loss, disordered order, or push interruptions caused by incompatibility between the transmission method and the queue component, ensuring the orderly, stable, and highly reliable push of structured data during data transmission.
[0076] In embodiments of this application, writing a data segment stream to a message queue based on a queue identifier includes: obtaining the current processing state of the intelligent model, wherein the current processing state is used to indicate whether the intelligent model is in the process of data processing; in response to the current processing state indicating that the intelligent model is in the process of data processing, writing the data segment stream to the message queue based on the queue identifier; in response to the current processing state indicating that the intelligent model is not in the process of data processing, concatenating the data segment stream and a first prompt message to obtain a first concatenated data segment, and determining the first concatenated data segment as a new data segment stream, and writing the data segment stream to the message queue based on the queue identifier, wherein the first prompt message is used to indicate that the data processing process has ended.
[0077] The aforementioned first prompt message indicates that the intelligent model has not processed the data. This first prompt message can be a predefined structured marker. For example, it may include, but is not limited to, metadata such as status codes, timestamps, total data volume, and error codes.
[0078] The aforementioned current processing status refers to the running state of the intelligent model, reflecting whether the model is processing data. The current processing status can reflect the dynamic running stage of a specific visualization task during data processing, used for monitoring, scheduling, and error recovery. The current processing status can be an enumeration of states, such as initializing, generating, pushing, paused, successfully completed, failed, or user-aborted. The current processing status can be updated in real-time by the backend service throughout the task lifecycle and stored in a memory cache or database. Determining the current processing status supports front-end visualization progress bar display, server-side circuit breaking, task retries, and multi-terminal status synchronization. The current processing status can be determined through polling, event streams, model response status, and message queue consumption progress.
[0079] In one optional embodiment, before receiving the data segment stream returned by the intelligent model or during processing, the internal operating status of the intelligent model is actively queried or monitored to determine whether the intelligent model is still generating content. If no end marker is returned or no termination signal is triggered, it is in the process of data processing. The current processing status can be returned by the model server through a heartbeat, streaming end marker, or status callback interface to provide a basis for decision-making regarding subsequent data writing strategies.
[0080] If the current processing status indicates that the intelligent model is in the process of data processing, the data fragment stream returned by the intelligent model is directly written to the message queue based on the queue identifier to ensure that the data is not lost during transmission and can be retried, thus providing a safe and reliable data source for data push.
[0081] If the current processing status indicates that the intelligent model is not in the process of data processing (e.g., returning an end marker or closing the stream), it means that the intelligent model has completed data processing and will no longer perform data processing. The first notification message indicating the end of data processing can be used to indicate this. The data segment stream and the first notification message are concatenated to obtain the first concatenated data segment. This first concatenated data segment indicates the end of processing. Furthermore, the queue identifier is combined with this first concatenated data segment and written to the message queue. This clearly conveys the end of processing to the frontend, preventing the frontend from waiting indefinitely due to not receiving the termination event, thus improving rendering stability and user experience.
[0082] In embodiments of this application, pushing a data segment to be pushed includes: in response to the current processing state indicating that the intelligent model is not in the process of data processing, identifying the data segment to be pushed to obtain a first identification result, wherein the first identification result is used to indicate whether the data segment to be pushed contains a first prompt information; in response to the first identification result indicating that the data segment to be pushed does not contain the first prompt information, pushing the data segment to be pushed based on a preset pushing method; in response to the first identification result indicating that the data segment to be pushed contains the first prompt information, splicing the data segment to be pushed and the second prompt information to obtain a second spliced data segment, and determining the second spliced data segment as a new data segment to be pushed, pushing the data segment to be pushed based on the preset pushing method, wherein the second prompt information is used to indicate that the data pushing process corresponding to the data pushing instruction has ended.
[0083] The aforementioned first identification result can refer to the logical judgment result made during the message queue consumption process regarding whether the data segment to be pushed is pushable. Since the first prompt message reflects whether the data processing process has ended, by identifying whether the data segment to be pushed contains the first prompt message, the first identification result can be used to indicate whether the entire push process can be terminated. The first identification result can be represented by a Boolean value or a status code.
[0084] The aforementioned preset push method refers to a predefined strategy adopted by the backend service after consuming the message queue to push data. For example, the preset push method could be direct push, where each read segment is sent immediately. Alternatively, it could be a merge-then-push approach, where multiple data segments are cached and merged into a single complete update package before being pushed, once the minimum increment threshold or time window is reached. The preset push method can be determined by system parameters or task type. By using preset push methods, latency and performance can be balanced; for instance, direct push ensures low latency, while merged push reduces frontend redraw overhead.
[0085] The aforementioned second notification could be a final event notification generated after data generation is complete, used to clearly inform the user of the final status of the push process, such as success, failure, or user interruption. This second notification can trigger the front-end to complete rendering, release resources, display the final result, or indicate the error reason to the user, avoiding infinite waiting. The second notification can help ensure a closed-loop user experience.
[0086] In one optional embodiment, if the current processing state indicates that the intelligent model is not currently processing data, it means that the intelligent model's data processing process has ended. The read data segment to be pushed is then identified to analyze whether it carries a "processing completed" identifier (i.e., the first prompt message). This identification process can be implemented through string matching, field validation, or protocol header detection. The first identification result reflects whether the data segment in the message queue has been completely read, and indicates whether data can be pushed. The identification process is only performed when the intelligent model's data processing process has ended, thus avoiding resource consumption caused by performing identification every time a data segment to be pushed is read. In other words, if the intelligent model's data processing process has not ended, identification can be skipped, and the data segment to be pushed can be pushed directly.
[0087] If the first identification result indicates that the data segment to be pushed does not contain the first prompt information, it means that there are still unread data segments in the message queue. At this time, the read data segments to be pushed can still be pushed according to the preset push method, instead of pushing the data only after reading all data segments. That is, this embodiment adopts a variable reading and pushing mechanism, which can also ensure the integrity of the pushed data and avoid content truncation due to premature termination.
[0088] If the first identification result indicates that the data segment to be pushed contains the first prompt information, it means that the data segment to be pushed already contains the "processing completed" identifier. When pushing the data segment to be pushed, a second prompt information can be attached to indicate that the push process has ended. For example, the data segment to be pushed and the second prompt information can be spliced together to obtain a second spliced data segment, so as to push the second spliced data segment according to the preset push method. This can clearly indicate that the push task has been completed.
[0089] In the embodiments of this application, the preset push method includes any one of the following: encapsulating the data segment to be pushed and pushing the encapsulated data segment to be pushed; merging the data segment to be pushed and at least one third data segment to obtain a merged data segment, and using the merged data segment as a new data segment to be pushed; encapsulating the data segment to be pushed and pushing the encapsulated data segment to be pushed, wherein the write position of at least one third data segment and the write position of the data segment to be pushed are continuous in the message queue.
[0090] In one optional embodiment, a unified communication protocol wrapping layer can be added to the data fragment to be pushed before pushing, such as encapsulating it into SSE event format, to ensure that the front end can stably parse and securely process the data, avoid parsing errors or rendering crashes caused by incomplete original data fragment format or the presence of special characters, and improve the standardization and fault tolerance of data transmission.
[0091] In another optional embodiment, if it is found that multiple adjacent data segments have been written and not consumed, the adjacent data segments can be spliced into a larger data segment for encapsulation and push. This can reduce the network overhead and front-end re-rendering pressure caused by high-frequency small packet push, improve transmission efficiency and rendering performance while ensuring data order and integrity, and achieve the push effect of batch push and reduced jitter.
[0092] The third data fragment and the data fragment to be pushed can be adjacent identifiers or timestamps, because this means that the third data fragment and the data fragment to be pushed may belong to the fragments generated consecutively in the same data push task. Therefore, merging the two can avoid semantic confusion caused by cross-task or out-of-order splicing, and ensure the logical correctness of the merging operation.
[0093] In the embodiments of this application, before pushing the data segment to be pushed, the method further includes: in response to receiving an interface connection request, parsing the interface connection request to obtain the interface identifier of the data transmission interface; and establishing a communication link through the data transmission interface based on the interface identifier, wherein the communication link is used to push the data segment to be pushed.
[0094] The aforementioned interface connection request can be used to indicate a command to connect to an interface for data transmission. The interface connection request may include, but is not limited to, interface parameters, data types, task identifiers, and visualization types. The interface connection request can be generated based on the data processing status of the intelligent model or based on the writing status of data fragments.
[0095] The aforementioned data transmission interface can refer to a server sending interface that provides real-time data transmission for the data fragments to be pushed. In this embodiment, for example, the data transmission interface can be a server-sending event interface used to transmit the data fragments to be pushed, thereby enabling low-latency, ordered pushes from the server to the client. By establishing a stable, lightweight, browser-natively supported unidirectional communication link, a rendering experience of simultaneous generation and display is ensured, supporting automatic reconnection, resume interrupted downloads, and cross-domain access. Upon receiving an interface connection request, a communication link can be established based on the interface identifier corresponding to the connection request to push the data fragments to be pushed.
[0096] In one optional embodiment, before pushing the data segment to be pushed, the interface identifier of the data transmission interface can be determined based on the received interface connection request. For example, the interface connection request can be parsed to determine the interface identifier of the data transmission interface, which is used to distinguish the concurrent requests of different users. In this way, a binding relationship between the interface connection request and the specific data stream to be pushed can be established for different users, ensuring that the data pushed later is accurately delivered to the target user and avoiding cross-user data mixing.
[0097] Then, based on the interface identifier, the corresponding communication protocol channel, such as a long connection or a bidirectional channel, can be initialized to construct a transmission channel for data push. This ensures the exclusivity, orderliness, and real-time nature of data transmission, guaranteeing that the user-perceived streaming rendering process is coherent, error-free, and uninterrupted, enabling simultaneous generation and push.
[0098] The technical solution proposed in this application will be described below with reference to an optional embodiment. This application proposes a method for achieving low-latency, high-reliability streaming output and real-time front-end rendering of structured knowledge while ensuring data integrity and order. This embodiment adopts the following... Figure 3 The data processing architecture shown employs a large model service followed by an application message queue, enabling backend push services and a frontend rendering engine. Specifically, the large model can generate data fragments, utilizing message queues for persistence and decoupling. The backend push service establishes a connection via a server-side event protocol and pushes services through consumption and delivery. It is clear that the large model here can be the intelligent model described in the above embodiments.
[0099] This method adjusts the interactive format of knowledge output, allowing users to see the knowledge stream output in a browser, alleviating the "anxiety" and "uncertainty" of waiting. Based on reactive programming, this method parses and repairs the JSON results from the streaming output of a large model, caching them in a message queue data structure, thus decoupling large model calls from result consumption. JSON is a lightweight data exchange format that represents structured data in text form.
[0100] The data output process in this embodiment includes:
[0101] The user initiates a request, such as triggering a "visualization" action in their browser. Then, the browser sends a request to the backend service, specifically a request to initiate the visualization process.
[0102] The backend initializes the context and generates a unique message queue identifier for this visualization task. It then employs parallel processing, asynchronously calling the large model and writing data to the message queue. Specifically, the backend service initiates a streaming generation request to the large language model, which returns structured data fragments in a streaming manner, such as incremental or partial definitions of the visualization message queue. The backend service writes each received data fragment to the message stream corresponding to the message queue identifier in memory using a write command. The write command can be XADD (eXtended ADD). XADD is a command in the message queue data structure used to append new messages to a specified stream key. The browser establishes a connection; that is, after the request is initiated, the browser simultaneously connects to the SSE interface provided by the backend, preparing to receive real-time push notifications.
[0103] The backend consumes the message queue and pushes it to the frontend. Specifically, the backend continuously listens for new messages in the message queue using XREAD (READ Stream) or a consumer group mechanism. While the large model is still generating content, the backend continuously reads new streaming data fragments from memory. Upon reading each fragment, the backend immediately pushes it to the browser via a communication protocol. It can also choose to push the fragment directly or merge it first before pushing. After receiving the communication data, the browser uses its local software development kit to render the streaming data fragments into a visualization in real time, achieving a "generate and display simultaneously" effect. When the large model has completed all output, the backend sends a completion event to the browser, which can indicate success, failure, or user interruption. The browser processes the status based on the received completion event and presents the complete visualization to the user.
[0104] This embodiment addresses the issue of JSON fragment errors causing parsing failures by introducing a JSON repair library and fault tolerance checks, ensuring the frontend always receives valid JSON and preventing crashes. Regarding the issue of rendered content "regressing" or becoming disorganized, the length after repair is verified to be greater than or equal to the previous valid length, guaranteeing that rendering progress only advances and improving reliability. To address the performance impact of excessively frequent pushes, this embodiment controls the push rhythm by setting a minimum incremental threshold, reducing invalid updates and lowering pressure on the frontend and backend. Furthermore, to address the issue of tightly coupled modules making expansion difficult, a message queue is introduced for decoupling, and large models and push services can be deployed and scaled independently. Finally, to address the issues of garbled Chinese characters and line break conflicts, a variable-length character encoding and line break escaping are used, ensuring compatibility with multilingual content and guaranteeing the implementation of communication protocols.
[0105] In summary, this embodiment can shorten the average first frame rendering time, provide a smooth user experience during the complete streaming data generation process without lag or crashes, ensure high system availability, support stable push notifications in high-concurrency scenarios, implement a memory message retention strategy, and support breakpoint resume and multi-terminal synchronous viewing.
[0106] This embodiment utilizes a three-level decoupled architecture based on message queues to decouple large model services, result processing, and front-end push, thereby improving system elasticity and maintainability. A progressive repair and verification mechanism for streaming JSON fragments is proposed, employing a dual-condition push strategy combining non-decreasing length with minimum increment triggering to ensure front-end rendering continuity and efficiency. Furthermore, a real-time rendering channel integrating communication protocols and structured streaming data is integrated to construct an end-to-end low-latency pipeline from large model output to front-end visualization, supporting the gradual presentation of dynamic content.
[0107] like Figure 4The diagram illustrates an interactive data processing mechanism. After a user initiates visualization in the browser, the browser sends a visualization request to the backend service. The backend service initializes the context and identifies the streaming data. It then calls a large model in parallel and writes the data to a message queue in memory. Specifically, the backend service calls the large model to generate streaming data, the large model generates streaming data fragments and sends them to the backend service, which then writes them to a message queue in memory. The generation and return of streaming data fragments, as well as the writing to the message queue, are executed cyclically.
[0108] After the browser establishes a connection with the backend service, the backend service can subscribe to or read message queues from memory. The following process is executed in a loop: after the backend service reads streaming data fragments from memory, it pushes the data to the browser and renders it as a visualization. The backend service sends a completion event to the browser to indicate success, failure, or termination. Finally, the browser presents the visualization to the user.
[0109] This application provides, as follows: Figure 5 The data push method shown. Figure 5 This is a flowchart of a data push method according to an embodiment of this application. For example... Figure 5 As shown, the method may include the following steps:
[0110] Step S502: Respond to the data push command applied to the operation interface and obtain the data segment to be pushed.
[0111] The data push instruction is used to instruct the queue identifier based on the message queue to write the data fragment stream to the message queue, and to read the data fragments to be pushed from the data fragments stored in the message queue in sequence. The data fragment stream consists of multiple data fragments generated during the data processing process returned by the intelligent model instructing the data acquisition request. The data acquisition request, message queue and queue identifier are constructed by the data push instruction.
[0112] The aforementioned user interface refers to a front-end visual window through which the user interacts with the system. For example, the user interface could be a webpage in a browser, encompassing all human-computer interaction functions such as user input, viewing system responses, and receiving data pushes. In this embodiment, the user interface serves as the entry point for the user to initiate visualization requests and receive and perceive data pushes. Interactive controls can be provided on the user interface, such as a "Start Visualization" button, pause / reset controls, and progress indicators. Through the user interface, an interactive entry point can be provided, offering users a simultaneous generation and rendering experience, thereby improving user satisfaction.
[0113] In one optional embodiment, data processing is triggered by a data push command on the user interface, constructing a data acquisition request, a message queue, and a message identifier to obtain the data fragments to be pushed. The data acquisition request can trigger data processing, and then the data fragment stream processed by the intelligent model is written to the message queue based on the queue identifier, allowing for the sequential reading of the data fragments to be pushed from the message queue. This enables synchronous retrieval of streaming data between the front-end and back-end, ensuring that the user interface can promptly obtain the content generated by the intelligent model. Furthermore, the data push command decouples intelligent model generation from data consumption, making the generation process independent of data push speed, thus improving system concurrency and fault tolerance. The data processing initiated to the intelligent model through the data acquisition request transforms the intelligent model's generation behavior into structured data units that can be captured, cached, and transmitted, supporting subsequent push processing.
[0114] Step S504: Render the data fragment to be pushed.
[0115] In one alternative embodiment, after obtaining the data fragment to be pushed, in order to improve user readability, the data fragment to be pushed can be rendered, such as converting the data fragment to be pushed into graphics or structured display elements, so that users can understand and perceive it.
[0116] Step S506: Output the rendering result of the data fragment to be pushed on the operation interface.
[0117] The rendering results mentioned above refer to the visual content finally presented on the user interface after data processing and push. Rendering results are the final form of the structured knowledge generated by the intelligent model, after push processing, repair, and rendering, output to the user in the form of graphics, text, or interactive elements. Rendering results can include dynamically updated bar charts, knowledge node graphs, process step trees, segmented text summaries, highlighted keywords, etc. They can also include current rendering progress indicators, data version numbers, timestamps, etc. By displaying rendering results, originally abstract and fragmented streaming data can be transformed into structured knowledge expressions that users can understand and interact with.
[0118] In one alternative embodiment, the rendered visualization content is displayed in real time in a designated area of the user interface, such as text appending, chart updating, and node highlighting. This can provide immediate feedback, reduce user anxiety while waiting, and enhance the credibility of the interaction.
[0119] This embodiment uses data push commands on the user interface and message queue identifiers to achieve asynchronous writing and consumption of data fragments. By writing the data fragment stream generated by the intelligent model to the message queue and reading the data fragments to be pushed from it for rendering, the logical separation of data generation, caching, and rendering is achieved, improving the stability and scalability of the system response and enabling front-end rendering. Simultaneously, by using the message queue as a data buffer layer, the difference between the intelligent model generation speed and the front-end rendering capability is effectively smoothed out, avoiding rendering interruptions caused by incomplete data fragments or transmission delays. This ensures continuous presentation on the browser side and enhances the user's perception of the smoothness and interactivity of the gradual data generation process.
[0120] In embodiments of this application, rendering the data segment to be pushed includes: identifying the data segment to be pushed to obtain a second identification result, wherein the second identification result is used to characterize whether the data segment to be pushed contains a second prompt message, and the second prompt message is used to indicate that the data push process corresponding to the data push instruction has ended; if the second identification result indicates that the data segment to be pushed does not contain the second prompt message, rendering the data segment to be pushed based on a preset rendering method; if the second identification result indicates that the data segment to be pushed contains the second prompt message, rendering the target data segment and the second prompt message contained in the data segment to be pushed based on the preset rendering method, wherein the target data segment is used to characterize the data segment in the data segment to be pushed other than the second prompt message, and the push order of the rendering result corresponding to the second prompt message is after the push order of the rendering result corresponding to the target data segment.
[0121] In one optional embodiment, the data fragment to be pushed is identified, such as by performing structured parsing or semantic detection, to determine whether a second prompt message for marking the end of the output is embedded therein, thereby obtaining a second identification result, so as to accurately identify the boundary of the data stream, ensure that the rendering process terminates at the correct time, and avoid repeating the processing of the finished data.
[0122] If the second identification result indicates that the data segment to be pushed does not contain the second prompt information, the data segment to be pushed can be rendered based on a preset rendering method, such as incremental update, semantic merging or animation transition, so as to ensure that the user continuously perceives the output content.
[0123] When the second recognition result indicates that the data segment to be pushed contains the second prompt information, the target data segment and the second prompt information contained in the data segment to be pushed can be rendered separately based on a preset rendering method. The second prompt information is rendered only after ensuring that the content of the target data segment is fully presented on the operation interface, such as displaying a "Generation Completed" status label, playing a completion sound effect, or enabling the export button. This achieves a content-first, status-later rendering order, avoiding the second prompt information interfering with the user's perception of the content being generated, ensuring that the user's visual focus is on the effective information, and improving the clarity of the interface logic and the rigor of the user experience.
[0124] Furthermore, the second prompt message is only rendered after the target data fragment is rendered, to prevent the completion signal from being displayed in advance and causing users to mistakenly believe that the content is complete and terminate the interaction or close the page prematurely. This ensures that users ultimately see a complete, accurate, and verified visualization result, rather than a half-finished product or a misleading status, thereby enhancing the credibility of the system and the reliability of the interaction.
[0125] This application provides, as follows: Figure 6 The data push method shown. Figure 6 This is a flowchart of a data push method according to an embodiment of this application. For example... Figure 6 As shown, the method may include the following steps:
[0126] Step S602: In response to the input command applied to the operation interface, display the data push command on the operation interface.
[0127] The data push instruction is used to instruct the backend server to write the data fragment stream to the message queue based on the queue identifier of the message queue, and to read the data fragments to be pushed from the data fragments stored in the message queue in sequence. The data fragment stream is composed of multiple data fragments generated during the data processing process, which are instructed by the backend server based on the data acquisition request. The data acquisition request, message queue and queue identifier are constructed by the backend server based on the data push instruction.
[0128] The input commands mentioned above can be user-inputted or automatically acquired. Input commands can be determined by listening to and parsing button presses or inputs on the user interface. Once a command is detected, it can be parsed to determine a data push command, triggering data processing and delivery.
[0129] Step S604: In response to the processing command applied to the operation interface, display the rendering result of the data fragment to be pushed on the operation interface.
[0130] The aforementioned processing instructions can be user-inputted or automatically retrieved. These instructions can be used to trigger front-end rendering.
[0131] This embodiment decouples the data fragments generated by the intelligent model from the rendering process by triggering data push behavior in response to input commands on the user interface. Specifically, it dynamically constructs a message queue based on the data push command and associates it with a queue identifier. This allows the data fragment stream to be written to the message queue immediately after generation. Subsequently, stored data fragments to be pushed are continuously read from the message queue and pushed. This ensures the continuity and stability of front-end rendering without relying on the temporal integrity of the intelligent model output. Furthermore, the buffering mechanism of the message queue mitigates the direct impact of intelligent model generation delay on the user interface, improving the system's response resilience and resource scheduling flexibility in high-concurrency scenarios.
[0132] For the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions. This is because, according to this application, certain steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0133] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, or by hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0134] According to an embodiment of this application, a data push device for implementing the above-described data push method is also provided, such as... Figure 7 As shown, the device 700 includes:
[0135] The transmission module 702 is used to respond to receiving a data push instruction, send a data acquisition request to the intelligent model based on the data push instruction, and construct a message queue and a queue identifier for the message queue based on the data push instruction.
[0136] The receiving module 704 receives the data segment stream returned by the intelligent model, wherein the data segment stream consists of multiple data segments generated by the intelligent model during data processing.
[0137] The write module 706 is used to write a data fragment stream to a message queue based on a queue identifier.
[0138] The reading module 708 is used to read the data segments to be pushed from the data segments stored in the message queue in sequence.
[0139] The push module 710 is used to push data segments to be pushed.
[0140] The aforementioned transmission module 702, receiving module 704, writing module 706, reading module 708, and push module 710 correspond to steps S202 to S210 in the above embodiments. The instances and application scenarios implemented by the two modules and their corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. The aforementioned modules or units may be hardware or software components stored in memory and processed by one or more processors. The aforementioned modules may also be part of a device and may run in the server 10 provided in the above embodiments.
[0141] In embodiments of this application, the above-mentioned device further includes an acquisition module, configured to: parse the data push instruction, determine the data transmission method of the intelligent model, and the queue component corresponding to the message queue, wherein the data transmission method is used to characterize the way the intelligent model returns a data fragment stream, and the queue component is used to characterize the component used when storing data using the message queue; initialize the queue component; and construct a data acquisition request based on the initialized queue component and the data transmission method.
[0142] In embodiments of this application, the writing module is further configured to: obtain the current processing state of the intelligent model, wherein the current processing state is used to characterize whether the intelligent model is in the process of data processing; in response to the current processing state indicating that the intelligent model is in the process of data processing, write the data fragment stream to the message queue based on the queue identifier; in response to the current processing state indicating that the intelligent model is not in the process of data processing, concatenate the data fragment stream and the first prompt information to obtain a first concatenated data fragment, determine the first concatenated data fragment as a new data fragment stream, and write the data fragment stream to the message queue based on the queue identifier, wherein the first prompt information is used to indicate that the data processing process has ended.
[0143] In embodiments of this application, the push module is further configured to: in response to the current processing state indicating that the intelligent model is not in the process of data processing, identify the data segment to be pushed and obtain a first identification result, wherein the first identification result is used to indicate whether the data segment to be pushed contains a first prompt message; in response to the first identification result indicating that the data segment to be pushed does not contain the first prompt message, push the data segment to be pushed based on a preset push method; in response to the first identification result indicating that the data segment to be pushed contains the first prompt message, splice the data segment to be pushed and the second prompt message to obtain a second spliced data segment, and determine the second spliced data segment as a new data segment to be pushed, and push the data segment to be pushed based on a preset push method, wherein the second prompt message is used to indicate that the data push process corresponding to the data push instruction has ended.
[0144] In the embodiments of this application, the preset push method includes any one of the following: encapsulating the data segment to be pushed and pushing the encapsulated data segment to be pushed; merging the data segment to be pushed and at least one third data segment to obtain a merged data segment, and using the merged data segment as a new data segment to be pushed; encapsulating the data segment to be pushed and pushing the encapsulated data segment to be pushed, wherein the write position of at least one third data segment and the write position of the data segment to be pushed are continuous in the message queue.
[0145] In embodiments of this application, the above-mentioned apparatus further includes: an interface module, configured to, in response to receiving an interface connection request, parse the interface connection request to obtain an interface identifier of the data transmission interface before pushing the data segment to be pushed; and establish a communication link through the data transmission interface based on the interface identifier, wherein the communication link is used to push the data segment to be pushed.
[0146] According to an embodiment of this application, a data push device for implementing the above-described data push method is also provided, such as... Figure 8 As shown, the device includes:
[0147] The acquisition module 802 is used to respond to the data push command applied to the operation interface and acquire the data fragment to be pushed. The data push command is used to instruct the queue identifier based on the message queue to write the data fragment stream to the message queue and read the data fragment to be pushed from the data fragments stored in the message queue in sequence. The data fragment stream consists of multiple data fragments returned by the intelligent model in accordance with the data acquisition request and generated during the data processing. The data acquisition request, message queue and queue identifier are constructed by the data push command.
[0148] Rendering module 804 is used to render the data fragments to be pushed.
[0149] Output module 806 is used to output the rendering result of the data fragment to be pushed on the operation interface.
[0150] In embodiments of this application, the rendering module is further configured to: identify the data segment to be pushed and obtain a second identification result, wherein the second identification result is used to characterize whether the data segment to be pushed contains a second prompt message, and the second prompt message is used to indicate that the data push process corresponding to the data push instruction has ended; if the second identification result indicates that the data segment to be pushed does not contain the second prompt message, render the data segment to be pushed based on a preset rendering method; if the second identification result indicates that the data segment to be pushed contains the second prompt message, render the target data segment and the second prompt message contained in the data segment to be pushed based on the preset rendering method, wherein the target data segment is used to characterize the data segment in the data segment to be pushed other than the second prompt message, and the push order of the rendering result corresponding to the second prompt message is after the push order of the rendering result corresponding to the target data segment.
[0151] According to an embodiment of this application, a data push device for implementing the above-described data push method is also provided, such as... Figure 9 As shown, the device includes:
[0152] Display module 902 is used to respond to input commands applied to the operation interface and display data push commands on the operation interface. The data push commands are used to instruct the backend server to write a data fragment stream to the message queue based on the queue identifier of the message queue, and to read the data fragments to be pushed from the data fragments stored in the message queue. The data fragment stream is composed of multiple data fragments generated during the data processing process, which are instructed by the backend server based on the data acquisition request. The data acquisition request, message queue, and queue identifier are constructed by the backend server based on the data push commands.
[0153] The rendering module 904 is used to respond to processing commands applied to the operation interface and display the rendering results of the data fragment to be pushed on the operation interface.
[0154] The preferred embodiments involved in the above embodiments of this application are the same as the solutions, application scenarios and implementation processes provided in the above embodiments, and will not be repeated here.
[0155] Embodiments of this application may provide a computing device. Figure 10 This is a structural block diagram of a computing device according to an embodiment of this application. Figure 10 As shown, the computing device 100 may include one or more (one shown in the figure) processors 102, memory 104, memory controller, and peripheral interfaces.
[0156] The aforementioned computing device can be understood as an integrated intelligent terminal, including but not limited to servers, desktop computers, PCs (Personal Computers), and all-in-one model machines. Furthermore, the computing device may pre-install the model described in the above embodiments of this application.
[0157] Specifically, this computing device can pre-install various types of models, including but not limited to models in fields such as natural language processing, visual processing, speech processing, code processing, and multimodal task processing, thus providing diverse model choices. In different product forms, this computing device can support one or more model usage methods, including but not limited to model training, model invocation, model fine-tuning, model deployment, model inference, and application. In some product forms, this computing device also supports model management, including but not limited to multi-type model management (supporting the management of discriminative, generative, and other model types), model version control (supporting the control of different model versions), and model evaluation (evaluating model performance and effectiveness based on model evaluation tools). In other product forms, this computing device can also create applications based on models, providing API calling capabilities. Models can be called into created applications through API interfaces, and application management tools are provided to control and manage applications.
[0158] Furthermore, this computing device can also include data management (supporting the creation and management of model tuning datasets), a training center (providing abundant training resources to help users learn and master AI technologies), and basic control capabilities (providing enterprise-level basic control capabilities to ensure system security and efficient operation). Through these functions, it provides a comprehensive, integrated device for AI development, training, deployment, and application.
[0159] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks (LANs), mobile communication networks, and combinations thereof.
[0160] The processor can invoke an executable program stored in memory via a transmission device to execute the method described in any of the above embodiments.
[0161] Embodiments of this application may provide an electronic device. Figure 11 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 11 As shown, the electronic device may include: an input / output device 112; a memory 114; and a processor 116, wherein the processor 116 is connected to the input / output device 112 and the memory 114 via a bus 118.
[0162] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks (LANs), mobile communication networks, and combinations thereof.
[0163] The processor can invoke an executable program stored in memory via a transmission device to execute the method described in any of the above embodiments.
[0164] Those skilled in the art will understand that, Figure 11 The structure shown is illustrative. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. This diagram does not limit the structure of the aforementioned electronic devices. For example, electronic devices may include more or fewer components (such as network interfaces, display devices, etc.) than shown in the diagram, or have a different configuration than shown in the diagram.
[0165] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: a flash drive, read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0166] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the aforementioned computer-readable storage medium can be used to store program code executed by the method provided in the above embodiments.
[0167] Optionally, in this embodiment, the storage medium may be located in a computing device or an electronic device.
[0168] Optionally, in this embodiment, the computer-readable storage medium is configured to store an executable program. When the executable program runs, it controls the device where the computer-readable storage medium is located to perform the method described in any of the above embodiments.
[0169] Embodiments of this application also provide a computer program product. Optionally, in this embodiment, the computer program product may include a computer program. When executed by a processor, the computer program implements the methods provided in the above embodiments.
[0170] Embodiments of this application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium can be used to store a computer program. When the computer program is executed by a processor, it implements the method provided in the above embodiments.
[0171] Embodiments of this application also provide a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it implements the method provided in the above embodiments.
[0172] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0173] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are illustrative; for example, the division of units is a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined, integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling, direct coupling, or communication connection shown or discussed may be through some interfaces, indirect coupling of units or modules, or communication connection, and may be electrical or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of this embodiment.
[0175] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0176] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0177] The above description represents the preferred embodiments of this application. For those skilled in the art, various improvements and modifications can be made without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data push method, characterized in that, include: In response to receiving a data push instruction, a data acquisition request is sent to the intelligent model based on the data push instruction, and a message queue and a queue identifier of the message queue are constructed based on the data push instruction. Receive the data fragment stream returned by the intelligent model, wherein the data fragment stream consists of multiple data fragments generated by the intelligent model during data processing; write the data fragment stream to the message queue based on the queue identifier; Read the data segments to be pushed sequentially from the data segments stored in the message queue; The data segment to be pushed is pushed.
2. The method according to claim 1, characterized in that, The method further includes: The data push instruction is parsed to determine the data transmission method of the intelligent model and the queue component corresponding to the message queue. The data transmission method is used to characterize the way the intelligent model returns the data fragment stream, and the queue component is used to characterize the component used when storing data using the message queue. Initialize the queue component; Based on the initialized queue component and the data transmission method, the data acquisition request is constructed.
3. The method according to claim 1, characterized in that, The step of writing the data fragment stream to the message queue based on the queue identifier includes: Obtain the current processing state of the intelligent model, wherein the current processing state is used to characterize whether the intelligent model is in the process of data processing; In response to the current processing state indicating that the intelligent model is in the process of data processing, the data fragment stream is written to the message queue based on the queue identifier; In response to the current processing state indicating that the intelligent model is not in the process of data processing, the data fragment stream and the first prompt information are concatenated to obtain a first concatenated data fragment, and the first concatenated data fragment is identified as a new data fragment stream. Based on the queue identifier, the data fragment stream is written to the message queue, wherein the first prompt information is used to indicate that the data processing process has ended.
4. The method according to claim 3, characterized in that, The process of pushing the data segment to be pushed includes: In response to the current processing state indicating that the intelligent model is not in the process of data processing, the data segment to be pushed is identified to obtain a first identification result, wherein the first identification result is used to indicate whether the data segment to be pushed contains the first prompt information; In response to the first identification result indicating that the data segment to be pushed does not contain the first prompt information, the data segment to be pushed is pushed based on a preset push method; In response to the first identification result indicating that the data segment to be pushed contains the first prompt information, the data segment to be pushed and the second prompt information are spliced together to obtain a second spliced data segment, and the second spliced data segment is determined as a new data segment to be pushed. The data segment to be pushed is pushed based on the preset push method, wherein the second prompt information is used to indicate that the data push process corresponding to the data push instruction has ended.
5. The method according to claim 4, characterized in that, The preset push method includes any one of the following: The data segment to be pushed is encapsulated, and the encapsulated data segment to be pushed is pushed. The data segment to be pushed and at least one third data segment are merged to obtain a merged data segment, and the merged data segment is used as a new data segment to be pushed. The data segment to be pushed is encapsulated, and the encapsulated data segment to be pushed is pushed. In the message queue, the write position of the at least one third data segment and the write position of the data segment to be pushed are continuous.
6. The method according to claim 1, characterized in that, Before pushing the data segment to be pushed, the method further includes: In response to receiving an interface connection request, the interface connection request is parsed to obtain the interface identifier of the data transmission interface; Based on the interface identifier, a communication link is established through the data transmission interface, wherein the communication link is used to push the data segment to be pushed.
7. A data push method, characterized in that, include: In response to a data push command applied to the operation interface, the system retrieves the data fragments to be pushed. The data push command is used to instruct a queue identifier based on a message queue to write the data fragment stream to the message queue and sequentially read the data fragments to be pushed from the data fragments stored in the message queue. The data fragment stream consists of multiple data fragments generated during data processing returned by the intelligent model instructing the data retrieval request. The data retrieval request, the message queue, and the queue identifier are constructed by the data push command. Render the data segment to be pushed; The rendering result of the data fragment to be pushed is output on the operation interface.
8. The method according to claim 7, characterized in that, The rendering of the data segment to be pushed includes: The data segment to be pushed is identified to obtain a second identification result, wherein the second identification result is used to characterize whether the data segment to be pushed contains a second prompt information, and the second prompt information is used to indicate that the data push process corresponding to the data push instruction has ended; If the second identification result indicates that the data segment to be pushed does not contain the second prompt information, the data segment to be pushed is rendered based on a preset rendering method; When the second identification result indicates that the data segment to be pushed contains the second prompt information, the data segment to be pushed and the second prompt information contained in the data segment to be pushed are rendered based on the preset rendering method, wherein the data segment to be pushed is used to represent the data segment in the data segment to be pushed except for the second prompt information, and the pushing order of the rendering result corresponding to the second prompt information is after the pushing order of the rendering result corresponding to the data segment to be pushed.
9. A data push method, characterized in that, include: In response to an input command applied to the operation interface, a data push command is displayed on the operation interface. The data push command instructs the backend server to write a data fragment stream to the message queue based on the queue identifier of the message queue, and to sequentially read the data fragments to be pushed from the data fragments stored in the message queue. The data fragment stream is composed of multiple data fragments generated during data processing, which are returned by the intelligent model based on the data acquisition request. The data acquisition request, the message queue, and the queue identifier are constructed by the backend server based on the data push command. In response to the processing instructions applied to the operation interface, the rendering result of the data fragment to be pushed is displayed on the operation interface.
10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor, connected to a memory via a bus, is used to run the program, wherein the program, when running, executes the method described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 9.
12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9.