Data transmission method
By using waiting queue and data merging technology in the 5G message sending platform, the problem of interface pressure when chatbots send a large number of messages is solved, and the effective reduction of chatbot interface pressure and improvement of processing efficiency is achieved.
Patent Information
- Application Number
- CN202411752326.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-28
AI Technical Summary
When a chatbot sends a large number of messages, the 5G message sending platform will receive a large number of receipt information, resulting in excessive pressure on the reception interface of the chatbot.
By introducing a wait queue mechanism in the 5G message sending platform, the pending data is written to the wait queue and the data identifies the same data, reducing the number of calls to the target chatbot interface.
It effectively reduces the interface pressure of chatbot and improves the processing efficiency of the 5G message sending platform.
Smart Images

Figure CN119544651A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of data transmission, and in particular, relates to a method for data transmission. Background Art
[0002] After the chatbot sends a message to the 5G message sending platform, the 5G message sending platform forwards the message to the terminal. After receiving the message, the terminal sends receipt information to the 5G message sending platform. The 5G message sending platform calls the chatbot's receiving interface to feedback the receipt information sent by the terminal to the chatbot.
[0003] However, when the chatbot sends a large number of messages, the 5G message sending platform will receive a large amount of receipt information in a short period of time. Or when multiple terminals access a chatbot, the 5G message sending platform frequently calls the chatbot's receiving interface in a short period of time, causing excessive pressure on the chatbot's receiving interface. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment, storage medium and program product for data transmission, which can reduce the interface pressure of chatbot.
[0005] In a first aspect, an embodiment of the present application provides a method for data transmission, which is applied to a 5G message sending platform, and the method includes:
[0006] Acquire data to be processed and data identifiers corresponding to the data to be processed;
[0007] Determine a target chatbot corresponding to the data to be processed;
[0008] Writing the to-be-processed data into a waiting queue, wherein the waiting queue includes at least one to-be-processed data corresponding to the target chatbot within a preset query cycle;
[0009] Merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data;
[0010] The target data is sent to the target chatbot.
[0011] In a possible implementation, before writing the to-be-processed data into the waiting queue, the method further includes:
[0012] Determining whether the preset level corresponding to the target chatbot is a first preset value;
[0013] The step of writing the to-be-processed data into a waiting queue comprises:
[0014] When the preset level corresponding to the target chatbot is the first preset value, the to-be-processed data is written into the waiting queue.
[0015] In a possible implementation manner, after determining whether the preset level corresponding to the target chatbot is a first preset value, the method further includes:
[0016] When the preset level corresponding to the target chatbot is a second preset value, the to-be-processed data is sent to the target chatbot.
[0017] In a possible implementation, the data to be processed includes a message sender identifier; and determining a target chatbot corresponding to the data to be processed includes:
[0018] The target chatbot corresponding to the message sender identifier is searched in the correspondence relationship between the message sender identifier and the chatbot.
[0019] In a possible implementation, before merging the data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data, the method further includes:
[0020] According to the correspondence between the query cycle and the preset level, determining the target preset level corresponding to the preset query cycle;
[0021] Obtain the target name of the target waiting queue corresponding to the target preset level;
[0022] The step of merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data includes:
[0023] Obtain the target waiting queue according to the target name;
[0024] For the target waiting queue, data with the same data identifier in at least one to-be-processed data in the target waiting queue are merged to obtain at least one target data.
[0025] In a possible implementation manner, before determining the target preset level corresponding to the preset query period according to the correspondence between the query period and the preset level, the method further includes:
[0026] Recording the name of the waiting queue and the preset level of the waiting queue in a recording queue;
[0027] The determining, according to the correspondence between the query period and the preset level, a target preset level corresponding to the preset query period includes:
[0028] According to the corresponding relationship, the target preset level corresponding to the preset query period is searched in the preset level corresponding to the record queue.
[0029] In a possible implementation, recording the name of the waiting queue and the preset level of the waiting queue in the recording queue includes:
[0030] Determining whether the name of the waiting queue and the preset level of the waiting queue have been stored in the record queue;
[0031] In a case where the name of the waiting queue and the preset level of the waiting queue are not stored in the recording queue, the name of the waiting queue and the preset level of the waiting queue are recorded in the recording queue.
[0032] In a possible implementation manner, sending the target data to the target chatbot includes:
[0033] Rename the waiting queue to obtain a sending queue;
[0034] The target data in the sending queue is sent to the target chatbot.
[0035] In a possible implementation, the method further includes:
[0036] The name of the target waiting queue and the preset level of the target waiting queue are deleted in the record queue.
[0037] In a possible implementation, the sending queue includes a target data sending time; after sending the target data in the sending queue to the target chatbot, the method further includes:
[0038] Obtain the locally stored sending queue according to the preset scanning cycle;
[0039] Obtain the local time and the target data sending time in the sending queue;
[0040] Determine whether there is a sending abnormality in the sending queue according to the local time and the sending time;
[0041] When there is a sending abnormality in the sending queue, sending the target data in the sending queue to the target chatbot;
[0042] Delete the send queue.
[0043] In a possible implementation, merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data includes:
[0044] Get the preset data number threshold;
[0045] The to-be-processed data with the same data identifier in the waiting queue are merged according to the preset data number threshold to obtain at least one target data.
[0046] In a second aspect, an embodiment of the present application provides a data transmission device, which is applied to a 5G message sending platform, and the device includes:
[0047] An acquisition module, used to acquire data to be processed and a data identifier corresponding to the data to be processed;
[0048] A determination module, used to determine a target chatbot corresponding to the data to be processed;
[0049] A writing module, used for writing the to-be-processed data into a waiting queue, wherein the waiting queue includes at least one to-be-processed data corresponding to the target chatbot within a preset query cycle;
[0050] A merging module, used for merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data;
[0051] The sending module is used to send the target data to the target chatbot.
[0052] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0053] When the processor executes the computer program instructions, it implements the method for data transmission as described in any one of the first aspects.
[0054] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for data transmission as described in any one of the first aspects is implemented.
[0055] In a sixth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the data transmission method as described in any one of the first aspects.
[0056] A method, apparatus, device, storage medium and program product for data transmission according to an embodiment of the present application. After receiving the data to be processed, the 5G message sending platform determines the target chatbot corresponding to the data to be processed. The data to be processed is stored in a waiting queue. Then, the 5G message sending platform can merge the data to be processed in the waiting queue according to the same data identifier, and send the merged target data to the target chatbot. In this way, the number of calls to the target chatbot interface is reduced, thereby reducing the interface pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0058] Figure 1 It is a flowchart of a method for forwarding receipt information provided in the prior art;
[0059] Figure 2 It is a flowchart of a data transmission method provided by an embodiment of the present application;
[0060] Figure 3 is a schematic diagram of the system structure using the data transmission method provided by the embodiment of the present application;
[0061] Figure 4 It is a flowchart of a sending queue sending method provided in an embodiment of the present application;
[0062] Figure 5 is an exemplary schematic diagram of a data transmission method provided in an embodiment of the present application;
[0063] Figure 6 It is a structural schematic diagram of a data transmission device provided in an embodiment of the present application;
[0064] Figure 7 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0065] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0066] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0067] At present, when the chatbot sends 5G messages, it can split the number of user numbers, for example, split 10,000 user numbers into groups of 100. Then it sends the same request to the terminal based on the user number. The request carries the same message content and has the same message ID. After receiving the message sent by the chatbot, the terminal returns a receipt to the chatbot.
[0068] Specifically, Figure 1 As shown in the figure, the 5G terminal and the chatbot transmit data through the 5G message sending platform. The 5G message sending platform includes the IP Multimedia Subsystem (IMS) core network, the 5G Message Center (5G Message Center, 5G MC), the Messaging Application Affinity Protocol (MaaP) module, the receipt receiving module and the receipt forwarding module.
[0069] Among them, the 5G terminal sends the receipt to the IMS core network, the IMS core network sends the receipt to the 5GMC, the 5GMC sends the receipt to the MaaP, the MaaP sends the receipt to the receipt receiving module, the receipt receiving module sends the receipt to the receipt forwarding module, and the receipt forwarding module sends the receipt to the chatbot.
[0070] In this way, the 5G message sending platform will receive a large number of receipts within a certain period of time, and at the same time, the 5G message sending platform will forward the received receipts to the chatbot. In a relatively short period of time, the 5G message sending platform frequently calls the chatbot interface, consuming a large amount of resources of the 5G message sending platform and bringing huge pressure to the chatbot interface.
[0071] In order to solve the problems existing in the prior art, the embodiments of the present application provide a method, apparatus, device, storage medium and program product for data transmission. Figure 2 A method for data transmission provided in an embodiment of the present application is introduced. The method is applied to a 5G message sending platform, and the method for data transmission includes:
[0072] S201. Obtain data to be processed and data identifiers corresponding to the data to be processed.
[0073] The data identifier is the message ID. The data to be processed may be a receipt sent by the terminal to the 5G message sending platform.
[0074] S202: Determine a target chatbot corresponding to the data to be processed.
[0075] Among them, when the chatbot sends a request to the 5G message sending platform, the request can carry the chatbot identifier. After receiving the request forwarded by the 5G message sending platform, the 5G terminal returns a receipt to the 5G message sending platform. The receipt will carry the above-mentioned chatbot identifier, so that the 5G message sending platform can identify the target chatbot corresponding to the receipt.
[0076] S203, writing the data to be processed into the waiting queue.
[0077] The waiting queue includes at least one to-be-processed data corresponding to the target chatbot in a preset query cycle. Each chatbot corresponds to a waiting queue.
[0078] Each waiting queue can store a preset number of pending data. After receiving the pending data, the 5G message sending platform determines the waiting queue corresponding to the target chatbot, and preferentially selects the waiting queue that has stored data in the waiting queue corresponding to the target chatbot, and stores the latest received pending data in the selected waiting queue. If the waiting queues that have stored data have stored a preset number of pending data, then in the waiting queue corresponding to the target chatbot, a waiting queue that does not store data is randomly selected, and the latest received pending data is stored in the selected waiting queue.
[0079] Specifically, the waiting queue can be implemented using the redis list data structure, storing the data to be processed and the waiting queue in the form of key-value pairs.
[0080] For example, the key is ${QueuePre}.${level}.${chatbotId}, {level} is the preset level corresponding to the chatbot, {chatbotId} is the identifier of the chatbot, and the value is the set of data to be processed.
[0081] S204: Merge data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data.
[0082] S205: Send target data to the target chatbot.
[0083] It can be understood that after merging the data with the same data identifier in the waiting queue, at least one target data is obtained. When sending the target data to the target chatbot, the number of times the 5G message sending platform calls the chatbot interface is the same as the number of target data, thereby reducing the number of times the 5G message sending platform calls the chatbot interface and reducing the interface pressure of the chatbot.
[0084] Using the above method, after receiving the data to be processed, the 5G message sending platform determines the target chatbot corresponding to the data to be processed. The data to be processed is stored in the waiting queue. Then, the 5G message sending platform can merge the data to be processed in the waiting queue according to the same data identifier, and send the merged target data to the target chatbot. In this way, the number of calls to the target chatbot interface is reduced, thereby reducing the interface pressure.
[0085] The data to be processed includes a message sender identifier, and the above S202, determining the target chatbot corresponding to the data to be processed, can be specifically implemented as follows:
[0086] The target chatbot corresponding to the message sender ID is searched in the correspondence between the message sender ID and the chatbot.
[0087] The message sender identifier is the chatbot identifier in the above embodiment.
[0088] In this way, the target chatbot corresponding to each data to be processed can be accurately found according to the message sender identifier in the data to be processed, thereby ensuring accurate transmission of data.
[0089] In some embodiments of the present application, before the above S203, writing the to-be-processed data into the waiting queue, the method further includes:
[0090] It is determined whether the preset level corresponding to the target chatbot is a first preset value.
[0091] Among them, the preset level is set in advance according to actual business needs.
[0092] In one example, the preset level can be A, B, C, and D. A corresponds to 0 minutes, B corresponds to 1 minute, C corresponds to 10 minutes, and D corresponds to 30 minutes. If the preset level corresponding to chatbot is A, the 5G message sending platform directly forwards the data to be processed to chabot after receiving it; if the preset level corresponding to chatbot is B, the 5G message sending platform waits for 1 minute after receiving the data to be processed and forwards it to chabot; if the preset level corresponding to chatbot is C, the 5G message sending platform waits for ten minutes after receiving the data to be processed and forwards it to chabot; if the preset level corresponding to chatbot is D, the 5G message sending platform waits for 30 minutes after receiving the data to be processed and forwards it to chabot.
[0093] According to the preset level value of the target chatbot, the data to be processed can be divided into the following two cases:
[0094] Case 1: When the preset level corresponding to the target chatbot is the first preset value, the data to be processed is written into the waiting queue.
[0095] The fact that the preset level corresponding to the target chatbot is the second preset value indicates that the preset levels corresponding to the target chatbot are level B, level C, and level D.
[0096] Case 2: When the preset level corresponding to the target chatbot is the second preset value, the data to be processed is sent to the target chatbot.
[0097] The fact that the preset level corresponding to the target chatbot is the second preset value indicates that the preset level corresponding to the target chatbot is level A.
[0098] The method provided in the embodiment of the present application is used to determine whether the preset level corresponding to the target chatbot is a first preset value, wherein, when the preset level corresponding to the target chatbot is the first preset value, it indicates that the target chatbot can delay receiving the data to be processed, and therefore the data to be processed can be written into the waiting queue, and the frequency of chatbot interface calls can be reduced by using the waiting queue data to be processed and uniformly processing the data to be processed. When the preset level corresponding to the target chatbot is a second preset value, it indicates that the target chatbot receives the data to be processed immediately. Therefore, the 5G message sending platform directly forwards the data to be processed. In this way, according to the chatbot's real-time requirements for the data to be processed, the 5G message sending platform determines the processing method for the data to be processed, which is more in line with actual needs.
[0099] The following combination Figure 3 The system architecture shown introduces two ways of processing the data to be processed by the 5G message sending platform, such as Figure 3 As shown, the 5G message sending platform includes the IMS core network, 5GMC, Maap, receipt receiving module, receipt forwarding module and receipt merging processing service module.
[0100] After receiving the receipt, the receipt receiving module determines whether the preset level of the chatbot corresponding to the receipt is the first preset value.
[0101] When the chatbot's preset level is the first preset value, it means that the chatbot can delay receiving the receipt, so the receipt receiving module sends the receipt to the receipt merging processing service module, the receipt merging processing service module writes the receipt into the waiting queue, and then merges the receipts with the same data identifier in the waiting queue, and sends the merged receipt to the chatbot.
[0102] When the preset level of the chatbot is the second preset value, it means that the chatbot receives the receipt in real time, so the receipt receiving module sends the receipt to the receipt forwarding module, and the receipt forwarding module sends the receipt to the chatbot in real time.
[0103] In some embodiments of the present application, the 5G message sender may search for a corresponding preset level of waiting queue locally according to a preset query cycle, and merge the pending data in the found waiting queue. Based on this, before the above S204, merging the data with the same data identifier in at least one pending data in the waiting queue to obtain at least one target data, the method further includes:
[0104] Step A: According to the correspondence between the query cycle and the preset level, determine the target preset level corresponding to the preset query cycle.
[0105] Among them, multiple preset query cycles are pre-set in the 5G message sending platform, and the time intervals corresponding to the preset query cycles and preset levels are the same.
[0106] Continuing with the above example, when the preset level is level B, the preset query period corresponding to the preset level is 1 minute. That is, the 5G message sending platform queries the waiting queue with the preset level of level B stored locally every 1 minute.
[0107] Step B: Obtain the target name of the target waiting queue corresponding to the target preset level.
[0108] The queue name is the key value in the above embodiment.
[0109] Accordingly, merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data includes:
[0110] Get the target waiting queue according to the target name.
[0111] For the target waiting queue, data with the same data identifier in at least one to-be-processed data in the target waiting queue are merged to obtain at least one target data.
[0112] Using the method provided in the embodiment of the present application, according to the relationship between the preset level and the query cycle, the target waiting queue corresponding to the preset level of the target is searched locally according to each preset query cycle. In this way, the data to be processed in the target waiting sequence found can be merged every preset query cycle. In this way, since the preset query cycle is set according to the preset level, the 5G message sending platform can forward the data to be processed according to the preset query cycle corresponding to each chatbot, meeting the timeliness requirements of different chatbots for the data to be processed.
[0113] The 5G message sending platform can use the record queue to record the waiting queue for writing the data to be processed, and then the 5G message sending platform searches for the target waiting queue in the waiting queue that has been written to be processed recorded in the record queue. Specifically, before the above step A, according to the correspondence between the query cycle and the preset level, determines the target preset level corresponding to the preset query cycle, the method also includes:
[0114] The name of the waiting queue and the preset level of the waiting queue are recorded in the recording queue.
[0115] The record queue stores the corresponding relationship between the record queue name, the waiting queue name, and the preset level of the waiting queue in the form of a key-value pair. Specifically, a set data structure can be used to construct the record queue.
[0116] In an example, the key of the record queue is ${recordQueuePre}.${level}, {level} is the preset level corresponding to the chatbot, and value is the key of the record waiting queue.
[0117] After the 5G message sending platform receives the data to be processed, it can convert the data to the data format corresponding to the waiting queue. Specifically, you can use the lua script to execute the following command to set the element in the queue to receiptValue:
[0118] lpush${QueuePre}.${level}.${chatbotId}receiptValue;
[0119] Then, write the waiting queue into the record queue through the following command:
[0120] sadd${recordQueuePre}.${level}${QueuePre}.${level}.${chatbotId}.
[0121] Step A, according to the correspondence between the query cycle and the preset level, determining the target preset level corresponding to the preset query cycle, can be specifically implemented as follows:
[0122] According to the corresponding relationship, the target preset level corresponding to the preset query cycle is searched in the preset level corresponding to the record queue.
[0123] The 5G message sending platform includes multiple record queues, each record queue corresponds to a preset level, and each preset level corresponds to a chatbot. Therefore, the 5G message sending platform can search for a record queue of a preset level in multiple record queues stored locally.
[0124] In this way, by recording the waiting queue in which the data to be processed has been written, the subsequent 5G message sending platform can search for the target waiting queue in the waiting queue recorded in the recording queue, avoiding the 5G message sending platform from traversing all waiting queues stored locally, thereby improving the search efficiency.
[0125] It should be noted that, since the 5G message sending platform can receive the data to be processed in real time, after receiving each data to be processed, it needs to be written into the corresponding waiting queue, and whenever the data to be processed in the waiting queue is updated, the 5G message sending platform updates the record queue accordingly. Specifically, the name of the waiting queue and the preset level of the waiting queue in the above record queue can be implemented as follows:
[0126] It is determined whether the name of the waiting queue and the preset level of the waiting queue are stored in the record queue.
[0127] In a case where the name of the waiting queue and the preset level of the waiting queue are not stored in the recording queue, the name of the waiting queue and the preset level of the waiting queue are recorded in the recording queue.
[0128] The value of the record queue stores the key of the waiting queue, and the key of the waiting queue includes the name of the waiting queue and the preset level of the waiting queue.
[0129] In this way, each time the 5G message sending platform receives a piece of data to be processed, it searches the record queue for the name of the waiting queue to which the data to be processed is written. If no waiting queue with the same name is found, the name of the waiting queue and the preset level of the waiting queue can be written into the record queue. This ensures the accuracy of the data stored in the record queue and avoids duplicate records.
[0130] It should be noted that after determining the waiting queue that needs to be sent, the 5G message sending platform can rename the waiting queue to obtain the sending queue; and send the target data in the queue to the target chatbot.
[0131] Specifically, the 5G message sending platform can rename the waiting queue as the sending queue by modifying the key of the waiting queue.
[0132] In one example, the key of the waiting queue is ${QueuePre}.${level}.${chatbotId}. By modifying the key, the key of the waiting queue is renamed to {sendingQueuePre}.${level}.${chatbotId}.{nowTime}. {nowTime} is the timestamp of the current time. In this way, the 5G message sending platform can rename the waiting queue to the sending queue.
[0133] Accordingly, after determining the waiting queue to be renamed, the 5G message sending platform deletes the name of the target waiting queue and the preset level of the target waiting queue in the recording queue, thereby avoiding conflicts between the waiting queue recorded in the recording queue and the sending queue.
[0134] After sending the target data to the target chatbot, the 5G message sending platform scans the sending queues that have not completed data transmission locally according to the preset scanning cycle. Figure 4 As shown, specifically, after sending the target data in the queue to the target chatbot, the method further includes:
[0135] S401. Obtain a locally stored sending queue according to a preset scanning period.
[0136] Among them, the preset scanning period is set based on experience.
[0137] It is understandable that after the waiting queue is renamed as the sending queue, the 5G message sending platform sends the target data according to the target data sending time in the sending queue, that is, {nowTime} in the above embodiment. However, due to some reasons, the 5G message sending platform may fail to send the target data, so the 5G message sending platform will locally store the sending queue that has not been successfully sent.
[0138] S402: Obtain the local time and the target data sending time in the sending queue.
[0139] The target data sending time is {nowTime} in the above embodiment.
[0140] S403: Determine whether there is a sending abnormality in the sending queue according to the local time and the sending time.
[0141] Among them, whether there is a sending abnormality in the sending queue can be determined by judging the time sequence of the local time and the sending time.
[0142] Specifically, if the local time is before the sending time, there is no abnormality in the sending queue; if the local time is after the sending time, there is a sending abnormality in the sending queue.
[0143] In one example, if the local time is 12:00 on September 30, 2024, and the target data sending time in the sending queue is 12:02 on September 30, 2024, the 5G message sending platform determines that there is no abnormality in the sending queue. If the target data sending time in the sending queue is 11:55 on September 30, 2024, the 5G message sending platform determines that there is a sending abnormality in the sending queue.
[0144] S404: When there is a sending abnormality in the sending queue, forward the target data in the sending queue to the target chatbot.
[0145] S405: Delete the sending queue.
[0146] Using the method provided in the embodiment of the present application, for the local sending queue, the 5G message sending platform may fail to send the target data to the target chatbot on time at the target data sending time due to some reasons. Therefore, every preset scanning cycle, the 5G message sending platform can scan the local sending queue to obtain the target data sending time in the sending queue. By comparing the local time with the target data sending time, it can be determined whether there is a sending abnormality in the sending queue. In the case of an abnormality in the sending queue, the target data in the sending queue can be resent to ensure the normal transmission of data.
[0147] In some embodiments of the present application, the user can set a preset data number threshold in the chatbot, and through the preset data number threshold, the 5G message sending platform can merge the pending data with the same data identifier in the waiting queue according to the preset data number threshold to obtain at least one target data, thereby ensuring the normal transmission of data.
[0148] The preset data entry number threshold is the maximum number of to-be-processed data contained in one target data.
[0149] The following combination Figure 5 The internal process of the receipt merging processing service provided in the embodiment of the present application is introduced.
[0150] like Figure 5 As shown, the method includes:
[0151] S501, the receipt merging processing thread writes the receipt queue.
[0152] It should be noted that, in the embodiment of the present application, the receipt merging processing service module includes a receipt merging processing thread, a level timing task unit, a compensation timing task unit, a receipt queue, a receipt sending queue, a record queue and a thread pool.
[0153] The receipt queue is the waiting queue in the above embodiment.
[0154] S502: The receipt merging processing thread records the receipt queue.
[0155] Among them, recording the receipt queue is to record the waiting queue into the record queue in the above embodiment. The specific method of writing into the record queue refers to the relevant description in the above embodiment, which will not be repeated here.
[0156] S503: The level-based scheduled task unit queries the record queue according to the level-based scheduled task.
[0157] Among them, the level timing task includes multiple preset query cycles. The 5G message sending platform searches for the record queue of the preset level corresponding to the preset query cycle according to the preset query cycle in the level timing task.
[0158] S504: Record the queue and return the receipt queue name set.
[0159] The value of the record queue includes the key value of the receipt queue, and the key value of the receipt queue includes the name of the receipt queue.
[0160] S505: Rename the receipt queue.
[0161] Specifically, the method for renaming the receipt queue refers to the relevant description in the above embodiment, which will not be repeated here.
[0162] S506. Delete the record.
[0163] Among them, the 5G message sending platform deletes the renamed receipt queue in the record queue.
[0164] S507: The sending queue returns a receipt sending queue set to the level timed task.
[0165] S508. The hierarchical timing task unit is encapsulated into a task and submitted to the thread pool.
[0166] Among them, the 5G message sending platform encapsulates the receipt sending queue name set as a task through the hierarchical timing task unit and sends it to the thread pool.
[0167] S509: The compensation timing task unit executes query according to the compensation timing task.
[0168] Among them, the compensation timing task unit executes the process of the 5G message sending platform in the above embodiment to query and resend the sending queue according to the preset scanning cycle.
[0169] S510, the sending queue returns a receipt sending queue set.
[0170] S511. The compensation timing task unit is encapsulated into a task and submitted to the thread pool.
[0171] S512: The thread pool requests a receipt from the sending queue.
[0172] The thread pool includes a set of sending queue names and sending tasks, and the thread pool can request a response receipt from the sending queue according to the sending queue name.
[0173] S513: The sending queue returns a receipt to the thread pool.
[0174] S514: The thread pool merges the receipts and sends them to the chatbot.
[0175] By adopting the method provided in the embodiment of the present application, for chatbots that require receipts, preset levels are set for different chatbots, and receipts corresponding to different chatbots are accumulated according to the waiting times corresponding to the different preset levels. By merging the receipts, the number of receipts sent by the 5G message sending platform to the chatbot can be reduced, thereby reducing the number of chatbot interface calls and reducing interface pressure.
[0176] Based on the same concept, the embodiment of the present application provides a data transmission device, which is applied to a 5G message sending platform, such as Figure 6 As shown, the device comprises:
[0177] An acquisition module 601 is used to acquire data to be processed and a data identifier corresponding to the data to be processed;
[0178] A determination module 602 is used to determine a target chatbot corresponding to the data to be processed;
[0179] A writing module 603 is used to write the to-be-processed data into a waiting queue, wherein the waiting queue includes at least one to-be-processed data corresponding to the target chatbot within a preset query cycle;
[0180] A merging module 604 is used to merge data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data;
[0181] The sending module 605 is used to send the target data to the target chatbot.
[0182] In a possible implementation, the device further includes:
[0183] A judging module, used for judging whether the preset level corresponding to the target chatbot is a first preset value;
[0184] The writing module 603 is specifically configured to write the to-be-processed data into the waiting queue when the preset level corresponding to the target chatbot is the first preset value.
[0185] In a possible implementation, the writing module 603 is specifically configured to send the to-be-processed data to the target chatbot when the preset level corresponding to the target chatbot is a second preset value.
[0186] In a possible implementation, the data to be processed includes a message sender identifier; the determination module 602 is specifically configured to:
[0187] The target chatbot corresponding to the message sender identifier is searched in the correspondence relationship between the message sender identifier and the chatbot.
[0188] In a possible implementation, the device further includes:
[0189] A search module, used to determine a target preset level corresponding to the preset query period according to a correspondence between the query period and the preset level;
[0190] The acquisition module 601 is further used to acquire the target name of the target waiting queue corresponding to the target preset level;
[0191] The merging module 604 is specifically used for:
[0192] Obtain the target waiting queue according to the target name;
[0193] For the target waiting queue, data with the same data identifier in at least one to-be-processed data in the target waiting queue are merged to obtain at least one target data.
[0194] In a possible implementation, the device further includes:
[0195] A recording module, used for recording the name of the waiting queue and the preset level of the waiting queue in a recording queue;
[0196] Find modules, specifically for:
[0197] According to the corresponding relationship, the target preset level corresponding to the preset query period is searched in the preset level corresponding to the record queue.
[0198] In a possible implementation, the recording module is specifically used to:
[0199] Determining whether the name of the waiting queue and the preset level of the waiting queue have been stored in the record queue;
[0200] In a case where the name of the waiting queue and the preset level of the waiting queue are not stored in the recording queue, the name of the waiting queue and the preset level of the waiting queue are recorded in the recording queue.
[0201] In a possible implementation, the sending module 605 is specifically configured to:
[0202] Rename the waiting queue to obtain a sending queue;
[0203] The target data in the sending queue is sent to the target chatbot.
[0204] In a possible implementation, the device further includes:
[0205] The deleting module is used to delete the name of the target waiting queue and the preset level of the target waiting queue in the record queue.
[0206] In a possible implementation, the sending queue includes a target data sending time;
[0207] The acquisition module 601 is further used to acquire the locally stored sending queue according to a preset scanning period;
[0208] The acquisition module 601 is further used to acquire the local time and the target data sending time in the sending queue;
[0209] A judging module, configured to judge whether there is a sending abnormality in the sending queue according to the local time and the sending time;
[0210] The sending module 605 is further configured to send the target data in the sending queue to the target chatbot when there is a sending abnormality in the sending queue;
[0211] A deleting module is used to delete the sending queue.
[0212] In a possible implementation, the merging module 604 is specifically configured to:
[0213] Get the preset data number threshold;
[0214] The to-be-processed data with the same data identifier in the waiting queue are merged according to the preset data number threshold to obtain at least one target data.
[0215] It should be noted that the data transmission device is a device corresponding to the above-mentioned method for data transmission, and all implementation methods in the above-mentioned method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.
[0216] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0217] The electronic device may include a processor 701 and a memory 702 storing computer program instructions.
[0218] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0219] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.
[0220] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0221] The processor 701 implements any one of the data transmission methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .
[0222] In one example, the electronic device may further include a communication interface 703 and a bus 704. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 704 and communicate with each other.
[0223] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0224] Bus 704 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 704 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0225] In addition, in combination with the data transmission method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data transmission methods in the above embodiment is implemented.
[0226] In combination with the data transmission method in the above embodiments, an embodiment of the present application may provide a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any data transmission method in the above embodiments.
[0227] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0228] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0229] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0230] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0231] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for data transmission, characterized in that: Applied to a 5G message sending platform, the method includes: Acquire data to be processed and data identifiers corresponding to the data to be processed; Determine a target chatbot corresponding to the data to be processed; Writing the to-be-processed data into a waiting queue, wherein the waiting queue includes at least one to-be-processed data corresponding to the target chatbot within a preset query cycle; Merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data; The target data is sent to the target chatbot.
2. The method according to claim 1, characterized in that Before writing the to-be-processed data into a waiting queue, the method further comprises: Determining whether the preset level corresponding to the target chatbot is a first preset value; The step of writing the to-be-processed data into a waiting queue comprises: When the preset level corresponding to the target chatbot is the first preset value, the to-be-processed data is written into the waiting queue.
3. The method according to claim 2, characterized in that After determining whether the preset level corresponding to the target chatbot is the first preset value, the method further includes: When the preset level corresponding to the target chatbot is a second preset value, the to-be-processed data is sent to the target chatbot.
4. The method according to claim 1, characterized in that: The data to be processed includes a message sender identifier; and determining a target chatbot chatbot corresponding to the data to be processed includes: The target chatbot corresponding to the message sender identifier is searched in the correspondence relationship between the message sender identifier and the chatbot.
5. The method according to claim 1, characterized in that: Before merging the data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data, the method further includes: According to the correspondence between the query cycle and the preset level, determining the target preset level corresponding to the preset query cycle; Obtain the target name of the target waiting queue corresponding to the target preset level; The step of merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data includes: Obtain the target waiting queue according to the target name; For the target waiting queue, data with the same data identifier in at least one to-be-processed data in the target waiting queue are merged to obtain at least one target data.
6. The method according to claim 5, characterized in that Before determining the target preset level corresponding to the preset query period according to the correspondence between the query period and the preset level, the method further includes: Recording the name of the waiting queue and the preset level of the waiting queue in a recording queue; The determining, according to the correspondence between the query period and the preset level, a target preset level corresponding to the preset query period includes: According to the corresponding relationship, the target preset level corresponding to the preset query period is searched in the preset level corresponding to the record queue.
7. The method according to claim 1, characterized in that The sending the target data to the target chatbot includes: Rename the waiting queue to obtain a sending queue; The target data in the sending queue is sent to the target chatbot.
8. The method according to claim 7, characterized in that The method further comprises: The name of the target waiting queue and the preset level of the target waiting queue are deleted in the record queue.
9. The method according to claim 7, characterized in that: The sending queue includes the target data sending time; After sending the target data in the sending queue to the target chatbot, the method further includes: Obtain the locally stored sending queue according to the preset scanning cycle; Obtain the local time and the target data sending time in the sending queue; Determine whether there is a sending abnormality in the sending queue according to the local time and the sending time; When there is a sending abnormality in the sending queue, sending the target data in the sending queue to the target chatbot; Delete the send queue.
10. The method according to claim 1, characterized in that The step of merging data with the same data identifier in at least one to-be-processed data in the waiting queue to obtain at least one target data includes: Get the preset data number threshold; The to-be-processed data with the same data identifier in the waiting queue are merged according to the preset data number threshold to obtain at least one target data.
Citation Information
Patent Citations
Message processing method and apparatus
CN107231294A
Message forwarding method and device, storage medium and electronic device
CN112714159A
Data management method and device, storage medium and electronic equipment
CN113329091A
Data reporting method, device and equipment
CN114168605A
Information processing method and device, electronic equipment and storage medium
CN116132376A