Data processing method and device based on large model service, equipment and storage medium
By obtaining historical prompt words when the big model service is started and determining the target prompt words from the Kafka queue, the problems of low stability of single point Agent and data inconsistency are solved, and the data processing efficiency and stability of the big model service are improved.
Patent Information
- Application Number
- CN202411231409.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-20
AI Technical Summary
Single-point Agents are difficult to withstand a large amount of traffic in large-scale services, resulting in low stability and inconsistent prompt word data between different agents, affecting the normal operation of the service.
When starting the big model service, historical prompt words are obtained and consumption processing is performed. The target prompt words are determined from the preset Kafka queue based on the historical prompt words, so as to perform consumption processing to ensure that the data consumption between each agent is consistent.
Improve the data processing efficiency of prompt words, ensure the normal operation and stability of large-scale model services, avoid data inconsistency among agents, and save data consumption time.
Smart Images

Figure CN119166346A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big models in the field of artificial intelligence, and in particular to a data processing method, device, equipment and storage medium based on big model services. Background Art
[0002] With the application of large model services, single-point Agents cannot withstand large traffic. Therefore, multiple Agents are needed to execute large model services to improve the stability of large model services.
[0003] Each Agent corresponds to a large model service. Each large model service needs to consume multiple prompt word data during training or work to ensure the normal operation of the large model service. Therefore, how to quickly process the prompt word data when starting the large model service and improve the working efficiency of the large model service is an urgent problem to be solved. Summary of the invention
[0004] The present invention provides a data processing method, device, equipment and storage medium based on a large model service.
[0005] According to a first aspect of the present disclosure, a data processing method based on a large model service is provided, the method being applied to an intelligent agent, the method comprising:
[0006] When the big model service is started, historical prompt words are obtained, and consumption processing is performed on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period;
[0007] According to the historical prompt words, a target prompt word is determined from a preset Kafka queue; wherein the preset Kafka queue includes a full amount of prompt words, and the target prompt word represents a prompt word other than the historical prompt words;
[0008] The target prompt word is consumed based on the large model service.
[0009] According to a second aspect of the present disclosure, a data processing device based on a large model service is provided, the device is applied to an intelligent agent, and the device includes:
[0010] An acquisition unit, used for acquiring historical prompt words when starting the big model service, and performing consumption processing on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period;
[0011] A determination unit, configured to determine a target prompt word from a preset Kafka queue according to the historical prompt words; wherein the preset Kafka queue includes all prompt words, and the target prompt word represents a prompt word other than the historical prompt words;
[0012] A processing unit is used to perform consumption processing on the target prompt word based on the large model service.
[0013] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0014] at least one processor; and
[0015] a memory communicatively coupled to the at least one processor;
[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect of the present disclosure.
[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method according to the first aspect of the present disclosure.
[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the steps of the method described in the first aspect of the present disclosure when executed by a processor.
[0019] According to the technology disclosed in the present invention, the data processing efficiency of prompt words is improved, ensuring the normal operation of large model services.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0022] Figure 1 It is a flowchart of a data processing method based on a large model service provided according to an embodiment of the present disclosure;
[0023] Figure 2 It is a flowchart of a data processing method based on a large model service provided according to an embodiment of the present disclosure;
[0024] Figure 3It is a flowchart of a data processing method based on a large model service provided according to an embodiment of the present disclosure;
[0025] Figure 4 is a schematic diagram of a prompt word data processing process of a large model service provided according to an embodiment of the present disclosure;
[0026] Figure 5 It is a structural block diagram of a data processing device based on a large model service provided according to an embodiment of the present disclosure;
[0027] Figure 6 It is a structural block diagram of a data processing device based on a large model service provided according to an embodiment of the present disclosure;
[0028] Figure 7 is a block diagram of an electronic device for implementing the data processing method based on a large model service according to an embodiment of the present disclosure;
[0029] Figure 8 It is a block diagram of an electronic device used to implement the data processing method based on the big model service of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0031] With the widespread application of large model services, single-point Agents are often unable to withstand large amounts of traffic, and this problem needs to be solved by expanding resources. However, there is an upper limit to the expansion of resources and the stability of single-point Agents is low. Therefore, consider using multiple copies of Agents to handle large amounts of traffic.
[0032] Each Agent corresponds to a process of a large model service. When creating or starting an instance of a large model service, it is necessary to consume multiple prompt word data through the large model service to ensure the normal operation of the large model service. If the prompt word data consumed by different large model services are inconsistent, there will be inconsistent operating effects between multiple Agents, affecting the normal operation of the large model service. Therefore, it is necessary to process the prompt word data when starting the large model service. While ensuring the consistency between large model services, the efficiency of prompt word data processing is improved.
[0033] The present invention discloses a data processing method, device, equipment and storage medium based on a big model service, which are applied to the big model field in the field of artificial intelligence to improve the data processing efficiency of prompt words.
[0034] It should be noted that the model in this embodiment is not a model for a specific user and cannot reflect the personal information of a specific user. It should be noted that the data in this embodiment comes from a public data set.
[0035] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0036] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 1-Figure 8 The embodiment is further refined.
[0037] Figure 1 FIG. 1 is a flow chart of a data processing method based on a large model service provided according to an embodiment of the present disclosure. The method is applied to an intelligent agent and can be executed by a data processing device based on a large model service. Figure 1 As shown, the method comprises the following steps:
[0038] S101. When starting the big model service, obtain historical prompt words, and perform consumption processing on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period.
[0039] For example, the Agent of the large model can be used to execute the process of the large model service. If only one Agent is set, the traffic of the large model service in different regions is sent to the Agent for processing. It is difficult for a single-point Agent to handle a large amount of traffic, and the stability of a single-point Agent is low, which affects the normal operation of the large model service. Therefore, multiple copies of the Agent can be added to improve the stability of the service and realize the processing of a large amount of traffic.
[0040] Each Agent corresponds to a large model service process. Different Agents can be set up in different regions, and the large model services corresponding to each Agent can be the same. For example, an Agent can be set up in different cities to take over the traffic of the large model service in the city. When an Agent fails, the service request sent to the Agent can be forwarded to the normally working Agent for response, improving the stability of the large model service.
[0041] You can create or start a new big model service at any time according to the actual needs of different regions for big model services, that is, set up a new Agent. For example, the big model service was originally provided in City A, and City A has a corresponding Agent; if City B also needs the big model service, you can start the big model service in City B and set up an Agent to respond to the service request of the big model service in City B.
[0042] After the big model service is started, it can be improved by continuously consuming prompt words. For example, the big model can be trained and updated by consuming prompt words. The consumption of prompt words refers to data processing of prompt words. Prompt words are pre-set text data. The big model service can be improved and updated by consuming prompt words. For example, the big model can be trained. Big model services in different regions can be started at different times. The big model service that starts first consumes prompt words first. Therefore, when a new big model service is created and started, the old big model service has already consumed some prompt words. At this time, the data consumption of different big model services is inconsistent. The new big model service needs to quickly catch up with the progress of the old big model service to ensure the effective operation of the big model service.
[0043] For any large model service, the prompt words that have been consumed can be stored as historical prompt words. When a new large model service is started, the agent of the large model service can obtain historical prompt words, that is, determine the prompt words that have been consumed by other large model services. The agent corresponding to the large model service directly consumes data on the acquired historical prompt words. For example, the historical prompt words can be input into the large model, and the large model can be iteratively trained through the historical prompt words. In this embodiment, the process of data consumption is not specifically limited.
[0044] S102, determining a target prompt word from a preset Kafka queue according to the historical prompt words; wherein the preset Kafka queue includes a full amount of prompt words, and the target prompt word represents the prompt word other than the historical prompt word.
[0045] For example, a Kafka queue is pre-set, and the Kafka queue is a sequence storing all prompt words, that is, both consumed and unconsumed prompt words are stored in the Kafka queue. The prompt words in the Kafka queue can be uploaded by users, and can be arranged according to the time sequence of user uploads to obtain a sequence of prompt words.
[0046] Based on the historical prompt words, the prompt words that need to be consumed next can be found in the Kafka queue as the target prompt words, that is, the target prompt words are prompt words other than the historical prompt words, and are also prompt words that the large model service needs to consume next. For example, the historical prompt words can be compared with the prompt words in the Kafka queue, and any prompt words in the Kafka queue other than the historical prompt words can be determined as the target prompt words.
[0047] For the first large model service started, if there is no historical prompt word, the large model service can obtain prompt words from the Kafka queue in sequence as the target prompt words, that is, consume the prompt words in the Kafka queue from the beginning.
[0048] S103: Consumption processing of the target prompt word is performed based on the large model service.
[0049] For example, the agent consumes the pre-stored historical prompt words through the large model service, and then consumes the target prompt words in the Kafka queue. Each time a target prompt word is consumed, after consuming a target prompt word, a new target prompt word can be determined and consumed again. That is, after consuming the historical prompt words, the prompt words that have not been consumed can be consumed from the Kafka queue in sequence.
[0050] The consumed target prompt words are stored as new historical prompt words, so that when there is a new large model service in the future, all the consumed prompt words can be directly obtained for consumption. The historical prompt words can be stored in a preset location, and when the historical prompt words are obtained, they can be obtained from the preset location.
[0051] In the disclosed embodiment, when starting the big model service, you can first obtain the historical prompt words that have been consumed in the historical time, and then perform consumption processing on the historical prompt words based on the big model service. According to the historical prompt words, determine the target prompt words from the preset Kafka queue, and then perform consumption processing on the target prompt words based on the big model service. After the big model service is started, it is realized that the prompt words are quickly restored, so that the consumption of prompt words of each big model service is consistent. And the big model service does not need to consume the prompt word data in the Kafka queue from scratch, which saves a lot of data consumption time, improves data processing efficiency, and ensures that the big model provides services quickly. By starting a new big model service, a large number of traffic requests can be met, ensuring the stability of the service and user experience.
[0052] Figure 2 A flowchart of a data processing method based on a large model service provided in an embodiment of the present disclosure.
[0053] In this embodiment, the data to be distributed is video data; the data to be distributed is format converted according to a preset format to obtain target data, including: decoding the data to be distributed to obtain decoded data to be distributed; encoding the decoded data to be distributed according to a preset video resolution to obtain target data.
[0054] like Figure 2 As shown, the method comprises the following steps:
[0055] S201. When starting the big model service, obtain historical prompt words, and perform consumption processing on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period.
[0056] For example, a large model service is currently started or created, and the Agent of the large model service obtains historical prompt words consumed by other large model services. The current large model service does not need to obtain these consumed prompt words from the Kafka queue from scratch, and can directly consume the historical prompt words.
[0057] In this embodiment, the consumption processing of the historical prompt words is performed based on the big model service, including: according to the identification information of the historical prompt words, the consumption processing of the historical prompt words is performed based on the big model service in sequence.
[0058] Specifically, after obtaining the historical prompt words, the obtained historical prompt words can be directly consumed. The Kafka queue includes all prompt words, among which the historical prompt words are also stored separately. When obtaining the historical prompt words, it is not necessary to obtain them from the Kafka queue, but to obtain the historical prompt words from the preset storage location.
[0059] Each historical prompt word corresponds to an identification information. According to the identification information of the historical prompt word, the order in which the historical prompt word was consumed in the table during the historical time period can be determined. Based on the big model service, the historical prompt words are consumed in order to maintain consistency between big model services. For example, if the identification information of the historical prompt word is 1 to 10, the historical prompt words are consumed in order starting from 1.
[0060] The beneficial effect of this setting is that the historical prompt words are consumed in sequence first, and then the prompt words in the Kafka queue are continued to be consumed. This ensures that even if the prompt words in the Kafka queue are not consumed from the beginning, data can be restored in the order of prompt word consumption, thereby maintaining consistency between large model services.
[0061] S202: Determine identification information of the historical prompt word; wherein the identification information represents the sorting position of the prompt word in a preset Kafka queue.
[0062] Exemplarily, when each prompt word is written into the Kafka queue, unique identification information is generated. The identification information can represent the sorting position of the prompt word in the preset Kafka queue. For example, the identification information can be the sorting number of the prompt word in the Kafka queue, or it can be a timestamp indicating the time when the prompt word is written into the Kafka queue.
[0063] After each agent of the large model service consumes a prompt word from the Kafka queue, it will store the prompt word as a historical prompt word and store the identification information corresponding to the prompt word. Therefore, when obtaining a historical prompt word, the identification information of the historical prompt word can be obtained. For example, the historical prompt word is the first ten prompt words in the Kafka queue, and the corresponding identification information can be a natural number from 1 to 10.
[0064] S203: Determine a target prompt word from a preset Kafka queue according to the identification information of the historical prompt word.
[0065] Exemplarily, each historical prompt word has corresponding identification information, and each prompt word in the Kafka queue also has corresponding identification information. According to the identification information corresponding to the historical prompt word and the identification information corresponding to the prompt word in the Kafka queue, a prompt word can be determined from the Kafka queue as the target prompt word. For example, a prompt word with identification information that is not a historical prompt word can be randomly selected as the target prompt word. Alternatively, a target sorting position in the Kafka queue can be determined according to the sorting position represented by the identification information of the historical prompt word, and the prompt word at the target sorting position can be determined as the target prompt word. For example, there are multiple historical prompt words, and the last position among the multiple historical prompt words is determined, and a prompt word after the position is selected from the Kafka queue as the target prompt word.
[0066] In this embodiment, the prompt word to be consumed next is determined according to the position of the historical prompt word in Kafka, so as to realize the orderly consumption of the prompt word, avoid the omission of the prompt word, and improve the efficiency and accuracy of data processing.
[0067] In this embodiment, according to the identification information of the historical prompt word, the target prompt word is determined from the preset Kafka queue, including: according to the identification information of the historical prompt word, the target historical data is determined; wherein the target historical data is the historical prompt word; according to the identification information of the target historical data, the target prompt word is determined from the preset Kafka queue.
[0068] Specifically, according to the identification information corresponding to the multiple historical prompt words, one of the historical prompt words is selected from the multiple historical prompt words, and one of the historical prompt words is determined as the target historical data. For example, the identification information is a timestamp, indicating the time when the prompt word was written into the Kafka queue. The timestamps of the various historical prompt words are compared, and the last historical prompt word written into the Kafka queue is determined as the target historical data.
[0069] The identification information of the target historical data is determined, and a prompt word is determined from a preset Kafka queue according to the identification information of the target historical data as the target prompt word. For example, if the identification information is a timestamp, the prompt word written into the Kafka queue after the time indicated by the timestamp is determined as the target prompt word.
[0070] The beneficial effect of this setting is that the prompt word data that has not been consumed can be found from the Kafka queue according to the identification information, so as to realize the orderly training and updating of the large model and improve the accuracy of data processing.
[0071] In this embodiment, the target historical data is determined according to the identification information of the historical prompt words, including: sorting the historical prompt words according to the sorting positions corresponding to the identification information of the historical prompt words; and determining the historical prompt words at the preset position as the target historical data according to the sorting results.
[0072] Specifically, each identification information corresponds to a sorting position in the Kafka queue, and the historical prompt words are sorted according to the identification information of the historical prompt words. For example, the historical prompt words can be sorted from small to large according to the numerical value of the identification information to obtain a sorting result.
[0073] According to the sorting result, the historical prompt word ranked at the preset position is determined, and the historical prompt word ranked at the preset position is determined as the target historical data. For example, the preset position is the last one. That is, the historical prompt word ranked at the last one in the sorting result is determined as the target historical data. For example, if the identification information is 1 to 10, the historical prompt word corresponding to the identification information 10 is the target historical data.
[0074] The beneficial effect of such a setting is that the target historical data can be quickly determined, so that the target prompt words can be determined, the consumption speed of the prompt words can be increased, and the data recovery efficiency of the large model service can be improved.
[0075] In this embodiment, the target prompt word is determined from a preset Kafka queue according to the identification information of the target historical data, including: determining the target identifier from the preset Kafka queue according to the identification information of the target historical data; wherein the target identifier is arranged after the identification information of the target historical data; and determining the prompt word data corresponding to the target identifier as the target prompt word.
[0076] Specifically, the identification information of the target historical data is determined, and according to the identification information of the target historical data, an identification information is determined from the preset Kafka queue as the target identification. The target identification is arranged after the identification information of the target historical data. In this embodiment, the target identification is the identification information that is arranged after the identification information of the target historical data and is adjacent to the identification information of the target historical data. For example, if the identification information of the target historical data is 10, the target identification is 11.
[0077] Determine the prompt word corresponding to the target identifier in the Kafka queue. Determine the prompt word data corresponding to the target identifier as the target prompt word.
[0078] The beneficial effect of this setting is that the identification information is simpler than the prompt word and is easier to compare. By first determining the target identification and then the target prompt word, the Agent is prompted to continue consuming from the Kafka queue. The accuracy and efficiency of determining the target prompt word are improved, thereby improving the accuracy and efficiency of data processing.
[0079] S204: Consumption processing is performed on the target prompt word based on the large model service.
[0080] Exemplarily, this step may refer to the above-mentioned step S103 and will not be described in detail.
[0081] In the disclosed embodiment, when starting the big model service, you can first obtain the historical prompt words that have been consumed in the historical time, and then perform consumption processing on the historical prompt words based on the big model service. According to the historical prompt words, determine the target prompt words from the preset Kafka queue, and then perform consumption processing on the target prompt words based on the big model service. After the big model service is started, it is realized that the prompt words are quickly restored, so that the consumption of prompt words of each big model service is consistent. And the big model service does not need to consume the prompt word data in the Kafka queue from scratch, which saves a lot of data consumption time, improves data processing efficiency, and ensures that the big model provides services quickly. By starting a new big model service, a large number of traffic requests can be met, ensuring the stability of the service and user experience.
[0082] Figure 3 A flowchart of a data processing method based on a large model service provided in an embodiment of the present disclosure.
[0083] In this embodiment, obtaining the historical prompt word includes: obtaining the historical prompt word from a preset data packet.
[0084] like Figure 3 As shown, the method comprises the following steps:
[0085] S301. When starting the big model service, obtain historical prompt words from a preset data package, and perform consumption processing on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period.
[0086] For example, a data packet is pre-set, and each large model service consumes a prompt word, and the prompt word is stored in the preset data packet as a historical prompt word. When the large model service is started, the historical prompt word can be obtained from the preset data packet. If the historical prompt word to be stored in the preset data packet has been stored in the preset data packet, it can be stored repeatedly, or only one historical prompt word can be stored for the same.
[0087] In this embodiment, the historical prompt words are stored in a preset data packet, which is a local data packet stored locally; obtaining the historical prompt words includes: if it is determined that there is a local data packet, obtaining the historical prompt words in the local data packet.
[0088] Specifically, the preset data packet may be a local data packet, which refers to a data packet containing historical prompt words stored locally. When starting the large model service, first determine whether there is a local data packet locally, or determine whether the local data packet is damaged. If it is determined that there is a local data packet locally and the local data packet is not damaged, the local data packet may be obtained, and the historical prompt words may be obtained from the local data packet.
[0089] If it is determined that there is no local data packet locally, or if there is a local data packet locally but the local data packet is damaged, you can get the prompt words from the Kafka queue again and consume them in sequence.
[0090] The beneficial effect of this setting is that the large model service can store historical prompt words locally, making it easy to quickly obtain historical prompt words without having to consume from the Kafka queue from scratch, thereby improving data processing efficiency.
[0091] In this embodiment, the preset data packet is an online data packet stored in a preset platform, and the preset platform is used to receive prompt words uploaded by users and send the prompt words uploaded by users to a preset Kafka queue; obtaining historical prompt words includes: if it is determined that there is no local data packet, obtaining an online data packet from the preset platform; storing the online data packet locally, and obtaining historical prompt words in the online data packet.
[0092] Specifically, the preset data packet may also be an online data packet, which refers to a data packet containing historical prompt words stored in a preset platform. The preset platform is a management platform for prompt words, which can be used to receive prompt words uploaded by users and write the prompt words uploaded by users into a preset Kafka queue. The preset platform stores online data packets, that is, after consuming the prompt words, the large model service can upload the historical prompt words to the preset platform and store them in the online data packet. For example, a local data packet can be directly uploaded to the preset platform and stored as an online data packet, that is, the historical prompt words in the local data packet and the online data packet are consistent.
[0093] When starting the large model service, first determine whether there is a local data package. If not, then determine whether there is an online data package stored in the preset platform. If so, obtain the online data package from the preset platform and obtain the historical prompt words from the online data package.
[0094] When the online data packet does not exist, the online data packet is obtained. After the online data packet is obtained, the online data packet can be stored locally as the local data packet, so that the local data packet exists locally.
[0095] The beneficial effect of this setting is that online data packets are obtained from the preset platform, ensuring that pre-stored historical prompt words can be obtained, and online data packets are stored locally, so that when new large model services are started later, local data packets can be directly obtained, reducing resource consumption and improving data processing efficiency.
[0096] In this embodiment, it also includes: if there is no online data packet in the preset platform, obtaining the target prompt word from the preset Kafka queue according to the sorting position of the prompt word in the preset Kafka queue; and storing the target prompt word in the local data packet and the online data packet respectively.
[0097] Specifically, if there is no online data package in the preset platform, the historical prompt words cannot be directly obtained from the preset data package. All prompt words exist in the Kafka queue. If the historical prompt words cannot be obtained, the target prompt words can be obtained from the Kafka queue in sequence according to the sorting position of the prompt words in the Kafka queue. The target prompt word can be every prompt word in the Kafka queue, whether it has been consumed or not, and can be used as the target prompt word.
[0098] You can start from the first prompt word in the Kafka queue and determine the target prompt words in sequence. That is, first determine the first prompt word as the target prompt word, and after the first prompt word is consumed, determine the second prompt word as the target prompt word, and so on, and consume each prompt word.
[0099] After the target prompt word is consumed, the target prompt word becomes a historical prompt word, and the historical prompt word is stored. The historical prompt word can be stored in a preset data package, for example, in a local data package and an online data package.
[0100] The beneficial effect of this setting is that if there is no data packet in the preset platform, the prompt word data will be consumed in sequence according to the Kafka sequence, and the consumption status will be stored locally and online, so that data recovery can be achieved through the Kafka queue, which is convenient for the subsequent use of other large model services.
[0101] In this embodiment, the target prompt words are stored in the local data package and the online data package respectively, including: storing the target prompt words in the local data package; uploading the local data package to the preset platform according to the preset data package upload cycle, and storing it as the online data package.
[0102] Specifically, the consumed target prompt words, that is, the newly obtained historical prompt words are stored. The newly obtained historical prompt words can be stored in the local data packet and the online data packet at the same time, or can be stored in the local data packet first and then in the online data packet.
[0103] A data packet upload cycle can be preset. After the target prompt word is stored in the local data packet, the local data packet is regularly uploaded to the preset platform according to the preset data packet upload cycle and stored as an online data packet.
[0104] The beneficial effect of this setting is that it is first stored locally to ensure the real-time update of the local data package, improving the accuracy and efficiency of data recovery for large model services. The local data package is uploaded to the preset platform to ensure that there is a data package backup of the historical prompt words in the preset platform, providing a guarantee for the rapid recovery of data for large model services.
[0105] In this embodiment, the preset platform is used to batch store the prompt words uploaded by the user as batch data packets; the method also includes: if it is determined that there is no local data packet, obtaining an online data packet and a batch data packet from the preset platform; and determining a preset data packet from the online data packet and the batch data packet.
[0106] Specifically, the preset platform may also store a batch data package, which is used to store prompt words uploaded by the user to the preset platform, and the batch data package may include multiple prompt words. The batch data package may be updated regularly, for example, the user uploads multiple prompt words in batches at one time, and the prompt words uploaded in batches by the user are stored in the batch data package. After a preset time period, a new prompt word may be added to the batch data package.
[0107] After determining that there is no local data packet, an online data packet and a batch data packet can be obtained from a preset platform, and a data packet can be selected from the online data packet and the batch data packet as a preset data packet, and a prompt word in the preset data packet can be obtained as a historical prompt word. For example, a data packet whose generation time is closer to the current time can be determined as a preset data packet.
[0108] If there is no online data packet in the preset platform, the batch data packet can be directly determined as the preset data packet to avoid re-obtaining the prompt word from the Kafka queue for consumption.
[0109] The beneficial effect of such a setting is that the received prompt words can be stored in batches in the preset platform, and a better data packet can be selected from the batch data packet and the online data packet, thereby improving the accuracy of data processing.
[0110] In this embodiment, determining a preset data packet from online data packets and batch data packets includes: determining the data volume in the online data packet as a first data volume, and determining the data volume in the batch data packet as a second data volume; determining the preset data packet from the online data packet and the batch data packet based on the first data volume and the second data volume.
[0111] Specifically, when selecting the online data packet and the batch data packet, the number of prompt words in the online data packet may be determined as the first data amount, and the number of prompt words in the batch data packet may be determined as the second data amount.
[0112] Compare the first data volume and the second data volume, and determine the data packet corresponding to the larger data volume as the preset data packet. For example, if there are 20 prompt words in the online data packet and 10 prompt words in the batch data packet, the preset data packet is the online data packet. The batch data packet may include prompt words that have been consumed and prompt words that have not been consumed. However, due to the limitation of storage space on the preset platform, the prompt words may be lost or cannot be stored in the batch data packet. Therefore, the data volume of the batch data packet may be smaller than the data volume of the online data packet.
[0113] The beneficial effect of this setting is that by comparing the data size, a better data packet can be selected, the number of prompt words consumed from Kafka can be reduced, the consumption efficiency of prompt words can be improved, and data recovery of large model services can be quickly achieved.
[0114] S302: Determine a target prompt word from a preset Kafka queue according to the historical prompt words; wherein the preset Kafka queue includes a full amount of prompt words, and the target prompt word represents the prompt word other than the historical prompt word.
[0115] Exemplarily, this step may refer to the above-mentioned step S102 and will not be described in detail.
[0116] S303: Consumption processing is performed on the target prompt word based on the large model service.
[0117] Exemplarily, this step may refer to the above-mentioned step S103 and will not be described in detail.
[0118] Figure 4 Schematic diagram of the prompt word data processing process serving the large model. Figure 4 In the example, the large model agent corresponds to a large model service. The upstream prompt word refers to the prompt word set by the user. The user uploads the written prompt word to the preset platform, and the preset platform writes the received prompt word to the Kafka queue. The large model agent can obtain prompt words from the Kafka queue for consumption. It can also obtain historical prompt words from the local disk or from the preset platform for consumption. After the historical prompt words are consumed, it can obtain new prompt words from the Kafka queue for consumption. The large model agent can also store the consumed prompt words as historical prompt words on the local disk, or upload them to the preset platform for storage.
[0119] In the disclosed embodiment, when starting the big model service, you can first obtain the historical prompt words that have been consumed in the historical time, and then perform consumption processing on the historical prompt words based on the big model service. According to the historical prompt words, determine the target prompt words from the preset Kafka queue, and then perform consumption processing on the target prompt words based on the big model service. After the big model service is started, it is realized that the prompt words are quickly restored, so that the consumption of prompt words of each big model service is consistent. And the big model service does not need to consume the prompt word data in the Kafka queue from scratch, which saves a lot of data consumption time, improves data processing efficiency, and ensures that the big model provides services quickly. By starting a new big model service, a large number of traffic requests can be met, ensuring the stability of the service and user experience.
[0120] Figure 5 The structure block diagram of a data processing device based on a large model service provided by an embodiment of the present disclosure is applied to an intelligent agent. For the convenience of explanation, only the part related to the embodiment of the present disclosure is shown. Figure 5 The device is applied to the intelligent agent device 500 and includes: an acquisition unit 501, a determination unit 502 and a processing unit 503.
[0121] The acquisition unit 501 is used to acquire historical prompt words when starting the big model service, and perform consumption processing on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period;
[0122] A determination unit 502 is used to determine a target prompt word from a preset Kafka queue according to the historical prompt words; wherein the preset Kafka queue includes all prompt words, and the target prompt word represents the prompt word other than the historical prompt word;
[0123] The processing unit 503 is used to perform consumption processing on the target prompt word based on the large model service.
[0124] Figure 6 A structural block diagram of a data processing device based on a large model service provided by an embodiment of the present disclosure, such as Figure 6 As shown, the data processing device 600 based on the large model service includes an acquisition unit 601, a determination unit 602 and a processing unit 603, wherein the determination unit 602 includes an identification determination module 6021 and a target determination module 6022.
[0125] The identification determination module 6021 is used to determine the identification information of the historical prompt word; wherein the identification information represents the sorting position of the prompt word in the preset Kafka queue;
[0126] The target determination module 6022 is used to determine the target prompt word from the preset Kafka queue according to the identification information of the historical prompt word.
[0127] In one example, the target determination module 6022 includes:
[0128] A first determination submodule is used to determine target historical data according to the identification information of the historical prompt word; wherein the target historical data is the historical prompt word;
[0129] The second determination submodule is used to determine the target prompt word from the preset Kafka queue according to the identification information of the target historical data.
[0130] In one example, the first determination submodule is specifically used to:
[0131] sorting the historical prompt words according to the sorting positions corresponding to the identification information of the historical prompt words;
[0132] According to the sorting result, the historical prompt words arranged at the preset position are determined as the target historical data.
[0133] In one example, the second determination submodule is specifically used to:
[0134] According to the identification information of the target historical data, determine the target identifier from the preset Kafka queue; wherein the target identifier is arranged after the identification information of the target historical data;
[0135] The prompt word data corresponding to the target identifier is determined as the target prompt word.
[0136] In one example, the acquisition unit 601 includes:
[0137] The history consumption module is used to consume the history prompt words in sequence based on the large model service according to the identification information of the history prompt words.
[0138] In one example, the historical prompt words are stored in a preset data packet, and the preset data packet is a local data packet stored locally; the acquisition unit 601 includes:
[0139] The local acquisition module is used to acquire the historical prompt words in the local data packet if it is determined that there is a local data packet.
[0140] In one example, the preset data packet is an online data packet stored in a preset platform, and the preset platform is used to receive the prompt words uploaded by the user and send the prompt words uploaded by the user to a preset Kafka queue; the acquisition unit 601 includes:
[0141] An online acquisition module, used to acquire an online data packet from the preset platform if it is determined that no local data packet exists;
[0142] The online storage module is used to store the online data package locally and obtain the historical prompt words in the online data package.
[0143] In one example, it also includes:
[0144] A queue acquisition unit, configured to acquire a target prompt word from the preset Kafka queue according to the sorting position of the prompt word in the preset Kafka queue if the online data packet does not exist in the preset platform;
[0145] The data storage unit is used to store the target prompt word in the local data package and the online data package respectively.
[0146] In one example, the data storage unit includes:
[0147] A local storage module, used for storing the target prompt word in the local data packet;
[0148] The data uploading module is used to upload the local data packet to the preset platform according to the preset data packet uploading cycle, and store it as an online data packet.
[0149] In one example, the preset platform is used to batch store the prompt words uploaded by the user as batch data packets; the device also includes:
[0150] A data packet acquisition unit, configured to acquire the online data packet and the batch data packet from the preset platform if it is determined that no local data packet exists;
[0151] The data packet determining unit is used to determine a preset data packet from the online data packet and the batch data packet.
[0152] In one example, the data packet determination unit includes:
[0153] A data volume determination module, configured to determine the data volume in the online data packet as a first data volume, and determine the data volume in the batch data packet as a second data volume;
[0154] The data packet determination module is used to determine a preset data packet from the online data packet and the batch data packet according to the first data amount and the second data amount.
[0155] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device.
[0156] Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device may be a terminal device, a processor or a server. Figure 7 As shown, the electronic device 70 includes: at least one processor 702; and a memory 701 communicatively connected to the at least one processor 702; wherein the memory stores instructions executable by the at least one processor 702, and the instructions are executed by the at least one processor 702 so that the at least one processor 702 can execute the data processing method based on the big model service disclosed in the present invention.
[0157] The electronic device 70 further includes a receiver 703 and a transmitter 704. The receiver 703 is used to receive instructions and data sent by other devices, and the transmitter 704 is used to send instructions and data to external devices.
[0158] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0159] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0160] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0161] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0162] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0163] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a data processing method based on a large model service. For example, in some embodiments, the data processing method based on a large model service may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the data processing method based on the large model service described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the data processing method based on the large model service in any other appropriate manner (for example, by means of firmware).
[0164] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0165] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0166] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0167] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0168] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0169] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0170] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0171] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data processing method based on a large model service, the method being applied to an intelligent agent, the method comprising: When the big model service is started, historical prompt words are obtained, and consumption processing is performed on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period; According to the historical prompt words, a target prompt word is determined from a preset Kafka queue; wherein the preset Kafka queue includes a full amount of prompt words, and the target prompt word represents a prompt word other than the historical prompt words; The target prompt word is consumed based on the large model service.
2. The method according to claim 1, wherein: Determining the target prompt word from a preset Kafka queue according to the historical prompt word includes: Determine identification information of the historical prompt word; wherein the identification information represents the sorting position of the prompt word in a preset Kafka queue; According to the identification information of the historical prompt word, a target prompt word is determined from the preset Kafka queue.
3. The method according to claim 2, wherein: The step of determining the target prompt word from the preset Kafka queue according to the identification information of the historical prompt word includes: Determine target historical data according to the identification information of the historical prompt word; wherein the target historical data is the historical prompt word; According to the identification information of the target historical data, the target prompt word is determined from the preset Kafka queue.
4. The method according to claim 3, wherein: The step of determining target historical data according to the identification information of the historical prompt word includes: sorting the historical prompt words according to the sorting positions corresponding to the identification information of the historical prompt words; According to the sorting result, the historical prompt words arranged at the preset position are determined as the target historical data.
5. The method according to claim 3 or 4, wherein: Determining the target prompt word from the preset Kafka queue according to the identification information of the target historical data includes: According to the identification information of the target historical data, determine the target identifier from the preset Kafka queue; wherein the target identifier is arranged after the identification information of the target historical data; The prompt word data corresponding to the target identifier is determined as the target prompt word.
6. The method according to any one of claims 2 to 5, wherein: The historical prompt words are consumed based on the large model service, including: According to the identification information of the historical prompt words, the historical prompt words are consumed in sequence based on the large model service.
7. The method according to any one of claims 1 to 6, wherein: The historical prompt words are stored in a preset data packet, and the preset data packet is a local data packet stored locally; The obtaining of historical prompt words includes: If it is determined that there is a local data package, the historical prompt words in the local data package are obtained.
8. The method according to claim 7, wherein: The preset data packet is an online data packet stored in a preset platform, and the preset platform is used to receive the prompt words uploaded by the user and send the prompt words uploaded by the user to a preset Kafka queue; The obtaining of historical prompt words includes: If it is determined that there is no local data packet, obtaining an online data packet from the preset platform; The online data package is stored locally, and the historical prompt words in the online data package are obtained.
9. The method according to claim 8, further comprising: If the online data packet does not exist in the preset platform, obtaining the target prompt word from the preset Kafka queue according to the sorting position of the prompt word in the preset Kafka queue; The target prompt word is stored in the local data package and the online data package respectively.
10. The method according to claim 9, wherein: The step of storing the target prompt word in the local data package and the online data package respectively includes: Storing the target prompt word in the local data packet; According to a preset data packet upload cycle, the local data packet is uploaded to the preset platform and stored as an online data packet.
11. The method according to any one of claims 8 to 10, wherein the preset platform is used to batch store the prompt words uploaded by the user as batch data packets; the method further comprises: If it is determined that there is no local data packet, obtaining the online data packet and the batch data packet from the preset platform; A preset data packet is determined from the online data packets and the batch data packets.
12. The method according to claim 11, wherein: The determining of the preset data packet from the online data packet and the batch data packet includes: Determine the amount of data in the online data packet as a first amount of data, and determine the amount of data in the batch data packet as a second amount of data; A preset data packet is determined from the online data packets and the batch data packets according to the first data volume and the second data volume.
13. A data processing device based on a large model service, the device being applied to an intelligent agent, the device comprising: An acquisition unit, used for acquiring historical prompt words when starting the big model service, and performing consumption processing on the historical prompt words based on the big model service; wherein the historical prompt words represent prompt words consumed within a preset historical time period; A determination unit, configured to determine a target prompt word from a preset Kafka queue according to the historical prompt words; wherein the preset Kafka queue includes all prompt words, and the target prompt word represents a prompt word other than the historical prompt words; A processing unit is used to perform consumption processing on the target prompt word based on the large model service.
14. The device according to claim 13, wherein: The determining unit comprises: An identification determination module, used to determine identification information of the historical prompt word; wherein the identification information represents the sorting position of the prompt word in a preset Kafka queue; The target determination module is used to determine the target prompt word from the preset Kafka queue according to the identification information of the historical prompt word.
15. The device according to claim 14, wherein: The target determination module comprises: A first determination submodule is used to determine target historical data according to the identification information of the historical prompt word; wherein the target historical data is the historical prompt word; The second determination submodule is used to determine the target prompt word from the preset Kafka queue according to the identification information of the target historical data.
16. The device according to claim 15, wherein: The first determining submodule is specifically used for: sorting the historical prompt words according to the sorting positions corresponding to the identification information of the historical prompt words; According to the sorting result, the historical prompt words arranged at the preset position are determined as the target historical data.
17. The device according to claim 15 or 16, wherein: The second determining submodule is specifically used for: According to the identification information of the target historical data, determine the target identifier from the preset Kafka queue; wherein the target identifier is arranged after the identification information of the target historical data; The prompt word data corresponding to the target identifier is determined as the target prompt word.
18. The device according to any one of claims 14 to 17, wherein: The acquisition unit comprises: The history consumption module is used to consume the history prompt words in sequence based on the large model service according to the identification information of the history prompt words.
19. The device according to any one of claims 13 to 18, wherein: The historical prompt words are stored in a preset data packet, which is a local data packet stored locally; the acquisition unit includes: The local acquisition module is used to acquire the historical prompt words in the local data packet if it is determined that there is a local data packet.
20. The device according to claim 19, wherein The preset data packet is an online data packet stored in a preset platform, and the preset platform is used to receive the prompt words uploaded by the user and send the prompt words uploaded by the user to a preset Kafka queue; The acquisition unit comprises: An online acquisition module, used to acquire an online data packet from the preset platform if it is determined that no local data packet exists; The online storage module is used to store the online data package locally and obtain the historical prompt words in the online data package.
21. The apparatus according to claim 20, further comprising: A queue acquisition unit, configured to acquire a target prompt word from the preset Kafka queue according to the sorting position of the prompt word in the preset Kafka queue if the online data packet does not exist in the preset platform; The data storage unit is used to store the target prompt word in the local data package and the online data package respectively.
22. The device according to claim 21, wherein The data storage unit comprises: A local storage module, used for storing the target prompt word in the local data packet; The data uploading module is used to upload the local data packet to the preset platform according to the preset data packet uploading cycle, and store it as an online data packet.
23. The device according to any one of claims 20 to 22, wherein the preset platform is used to batch store the prompt words uploaded by the user as batch data packets; the device further comprises: A data packet acquisition unit, configured to acquire the online data packet and the batch data packet from the preset platform if it is determined that no local data packet exists; The data packet determining unit is used to determine a preset data packet from the online data packet and the batch data packet.
24. The device according to claim 23, wherein: The data packet determining unit comprises: A data volume determination module, configured to determine the data volume in the online data packet as a first data volume, and determine the data volume in the batch data packet as a second data volume; The data packet determination module is used to determine a preset data packet from the online data packet and the batch data packet according to the first data amount and the second data amount.
25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.
26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.
27. A computer program product, wherein: The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 12 when being executed by a processor.
