Data transmission system and method applied to chat robot
By building geofences in chatbots and real-time monitoring of user locations, predicting intent and optimizing resource preloading, the problems of chatbot data transmission delay and resource waste are solved, the initiative and accuracy of services are improved, and the resource-constrained devices are adapted.
Patent Information
- Application Number
- CN202510655682.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-08-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing chatbots have problems with data transmission delay and waste of computing resources during user interaction, especially in the same scenario, multiple users repeatedly request service type access.
By deploying a GPS system within a chatbot to build a geofence, extract and classify geographic names, calculate behavioral feature vectors, monitor user locations in real time, predict intent and optimize resource preloading, and achieve dynamic response.
It improves the initiative and accuracy of the service, reduces the computing power consumption of real-time interaction, adapts to devices that are limited in resources, and optimizes the user experience.
Smart Images

Figure CN120508599A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of interactive transmission technology, and in particular to a data transmission system and method applied to a chat robot. Background Art
[0002] Natural language processing (NLP) is a core technology for chatbots, enabling computers to understand, process, and generate natural human language. Early NLP techniques were rule-based. With the advancement of technology, machine learning and deep learning methods have become widely used. These methods, such as neural networks, recurrent neural networks (RNNs), and their variants, long short-term memory (LSTM), and gated recurrent units (GRUs), can handle more complex language semantics and grammar, providing the foundation for chatbots to accurately understand and respond to user input. Advances in artificial intelligence (AI) are driving chatbots from simple rule-based matching to intelligent conversations. These include machine learning algorithms for model training and optimization, enabling chatbots to learn language patterns and user behavior patterns based on large amounts of data, thereby improving conversational accuracy and intelligence. Reinforcement learning is used to continuously optimize conversational strategies through interaction with the environment and reward mechanisms.
[0003] However, when chatbots interact with users today, the traditional question-and-answer model requires multiple round-trip interactions, which leads to huge delays in data transmission and affects the user interaction experience. In addition, in the same scenario, multiple users may request access to the same service type multiple times, which greatly wastes system computing resources. Summary of the Invention
[0004] The purpose of the present invention is to provide a data transmission system and method for chat robots to solve the problems raised in the prior art.
[0005] To achieve the above object, the present invention provides the following technical solutions: A data transmission method applied to a chat robot, the method comprising the following steps: S100, deploying a GPS system within the chatbot, using the GPS system to construct geofences, extracting a geographic name of each geofence within the GPS system, classifying all geographic names, generating a scene label based on the classification, and marking the scene label in each geofence; Furthermore, the specific steps of generating scene labels based on classification and marking them in each geo-fence are as follows: S101. Extracting original coordinates for different geographic areas within the GPS system to construct an original coordinate sequence, arbitrarily selecting two coordinates from the original coordinate sequence, connecting the two selected coordinates to form an infinitely extended straight line, determining the positional relationship between the remaining coordinates in the original coordinate sequence and the straight line, and determining that the two selected coordinates form a straight line as a geo-fence boundary for the corresponding geographic area when all remaining coordinates are on the same side of the straight line; determining that the two selected coordinates form a straight line that is not a geo-fence boundary for the corresponding geographic area when the remaining coordinates are on both sides of the straight line; repeatedly traversing all selected coordinates in the original coordinate sequence, performing the same operation, extracting all geo-fence boundaries for the geographic area, and using all geo-fence boundaries to form a geo-fence for the corresponding geographic area; S102. Extract all vertex coordinates of each geofence in the GPS system, select one vertex coordinate as A1, and mark the vertices of the geofence in clockwise order as {A1, A2, A3...An}. Calculate the area of each geofence using the vertex coordinates using the following formula: ; In the formula, Area represents the area of the geofence, n represents the total number of vertices of the geofence, and lat i Indicates the dimension of the i-th geofence vertex, lng i Indicates the longitude of the i-th geofence vertex, lat i+1 Indicates the dimension of the i+1th geofence vertex, lng i+1 Indicates the longitude of the i+1th geofence vertex; calculates the area of all geofences in the GPS system in sequence; Set a minimum geofence area threshold based on manual experience, use the minimum geofence area threshold to judge the calculated areas of all geofences, and remove geofences that are smaller than the minimum geofence area threshold; S103. Extract the geographic name of each geofence from the GPS system, use a natural language processing algorithm to extract keywords for each geographic name in advance, classify geofences with the same keywords into the same scene type, and classify all geofences; mark the keywords of each category as scene tags in the geofence.
[0006] By digitizing physical spaces through GPS geofencing and combining them with geographic name classifications (such as "shopping mall," "hospital," and "school"), we achieve a semantic understanding of the user's environment, providing a foundation for subsequent scenario-based services. Scenario tags (such as "shopping," "medical treatment," and "education") can be directly linked to specific service types, enabling chatbots to quickly identify potential needs based on user location and improve targeted service.
[0007] S200, extracting the user's requested service type and average number of conversations in different scenario types from the chatbot's historical log; and calculating the user's behavioral feature vectors in different geographic fences; Furthermore, the specific steps for calculating the user's behavior feature vectors within different geo-fences are as follows: S201. Extract the user's requested service types and conversation turns in different scenario types from the chatbot's historical logs, and calculate the user's weight score for each requested service for each scenario type using the formula: ; In the formula, f j Indicates the weight score of each request service type, Count j Indicates the number of occurrences of each request service type, N h represents the conversation turn of the jth requested service in the hth session, and m represents the total number of requested service types; S202, using the same method to calculate the weights of users for different request service types, and construct the user's behavior characteristics in each scenario type as Ft=[f1, f2, f3, ..., f m ], f1, f2, f3, ..., f m Represents the weight score of the user for the 1st, 2nd, 3rd, ..., mth request service type; similarly, constructs the user's behavioral characteristics in different scenario types to form a user behavior feature set.
[0008] By extracting metrics such as "service request type" and "average number of conversations" from historical logs, we convert user behavior in different scenarios into computable feature vectors (e.g., restaurant request rate, navigation request rate, conversation duration), enabling a digital representation of user preferences. Behavioral feature vectors reflect user habits in specific scenarios, providing personalized data support for subsequent intent prediction.
[0009] S300, the chatbot device monitors the user's geographic location in real time, determines the user's geographic fence within the GPS system, and extracts the scene type of the geographic fence type; Furthermore, the specific steps for extracting the scene type of the geo-fence type are as follows: S301, the chat robot device monitors the user's geographic location in real time, and obtains the user's real-time geographic location (lat s , lng s ), starting from the user's real-time geographic location, a ray is emitted to the right, and the number of points where the ray intersects with the first geofence boundary within the GPS system is determined. If the number is odd, the user is considered to be within the first geofence; if the number is plural, the user is considered to be outside the first geofence; S302: When it is determined that the user is located within a geographic fence, a scene tag of the type of geographic fence is extracted to obtain the scene type S in which the user is located in real time.
[0010] By using real-time GPS data to determine the user's geographic location and combining it with contextual tags (e.g., "Airport - Transportation Hub"), the chatbot can dynamically respond to environmental changes, avoiding misjudgments based on static information. Real-time positioning triggers pre-defined service logic for the corresponding scenario, shortening response time to user needs.
[0011] S400: Calculate the request probability of different service types within the scenario type where the user is located, and then use the real-time data of the scenario type where the user is located to modify the request probability to predict the user's intention; Furthermore, the specific steps for using real-time data of the user's scene type to modify the request probability and predict the user's intention are as follows: S401: For the user's real-time scenario type S, collect the number of visits to each requested service type per day in the past D days for the corresponding scenario, then add the time decay coefficient to calculate the basic probability of each requested service type. The formula is: ; In the formula, P base (j|S) represents the basic probability of the jth requested service type under scenario type S, Fre d (j) represents the number of visits to the jth request service type on the dth day, λ represents the time decay coefficient and is set manually, and e is a natural constant. Repeat the calculation to obtain the basic probability of each request service type in scenario type S; S402: Collect the number of visits to each requested service type in the past hour in the scenario type S where the real-time user is located, and make real-time corrections to the basic probability of each requested service type. The formula is: ; In the formula, P final (j|S) represents the final probability of the jth request service type after real-time correction, Mfre(j) represents the number of visits to the jth request service type in the past hour, and α represents the weighting coefficient set by manual experience. The basic probability of each request service type under scenario type S is repeatedly corrected in real time to obtain the final probability. The user intent is filtered based on the size of the final probability, and the request service type with the largest final probability is regarded as the user's most significant intention.
[0012] The system calculates service request probabilities based on historical behavioral characteristics and incorporates real-time data (such as holiday mall traffic) to refine predictions, improving the accuracy of intent assessment. This proactive recommendation of potential services reduces the need for users to manually input their needs and optimizes the interactive experience. Furthermore, a real-time data correction mechanism can address temporary changes (such as a surge in taxi requests during heavy rain), allowing the system to quickly adjust service priorities and avoid relying solely on historical data.
[0013] S500: The chat robot extracts service resources of different request service types, collects the sizes of different service resources, and calculates the preloading priorities of service resources of different request service types using the request probability and the service resource sizes; the chat robot preloads the service resources according to the preloading priorities; Furthermore, the specific steps for calculating the service resource preloading priority of different request service types using the request probability and service resource size are as follows: S501. The chat robot extracts service resources of different request service types under scenario type S, collects sizes of different service resources, and calculates preloading priorities of service resources of different request service types using request probabilities and service resource sizes. The formula is: ; In the formula, Q j represents the preloading priority of the jth request service type, R j represents the service resource size of the jth request service type, C j T represents the amount of locally cached resources in the service resource of the jth request service resource, j represents the total amount of resources required for the service resources of the jth requested service type; S502. Similarly, the preloading priority of each requested service type is calculated under the scene type S in which the user is in real time, and the chat robot preloads the service resources of each requested service type in descending order according to the preloading priority.
[0014] By calculating the preloading priority of service resources for each requested service type, high-priority resources are cached first to balance memory usage and response speed. Caching resources according to priority can ensure that the service resources corresponding to the user's intent are met first, improving the user experience.
[0015] S600: When the user interacts with the chatbot in real time, service resources corresponding to the user intention are extracted from the preloaded service resources according to the predicted user intention and transmitted.
[0016] Furthermore, the specific steps of extracting the service resources corresponding to the user intention from the preloaded service resources for transmission according to the predicted user intention are as follows: S601. When a user interacts with a chatbot in real time, when the user is in scenario type S, the chatbot pushes and transmits the preloaded service resources of the requested service type, arranges the recommended transmission order of the preloaded service resources according to the user's intention, and pushes the service resources with the most significant intention of the user first; the preloaded service resources are transmitted and shared among all chatbots in the geographic fence where the user is located.
[0017] Directly retrieve pre-loaded corresponding resources based on predicted intent (for example, when a user asks about the exit at a "subway station", map slices and route text are quickly returned), ensuring that the service content is highly matched with the needs.
[0018] The data transmission system used in chatbots includes a data acquisition module, a geo-fencing module, a behavior feature module, a user scenario type judgment module, a user intent inference module, a resource preloading module, and an interaction transmission module. The data collection module is used to extract the user's requested service type and average number of conversations in different scenario types from the chat robot's historical log; The geofence module is used to deploy a GPS system in the chatbot, construct a geofence using the GPS system, extract the geographical name of each geofence in the GPS system, and classify all geographical names; The behavior feature module is used to calculate the behavior feature vectors of users in different geographic fences by using the requested service types and average conversation times of users in different scenario types; The user scenario type determination module is used by the chatbot device to monitor the user's geographic location in real time, determine the user's geographic fence within the GPS system, and extract the scenario type of the geographic fence type; The user intention inference module is used to calculate the request probability of different service types within the scenario type where the user is located, and then use the real-time data of the scenario type where the user is located to modify the request probability to predict the user intention; The resource preloading module is used to calculate the service resource preloading priority of different request service types by using the request probability and service resource size; the chat robot preloads the service resources according to the preloading priority; The interactive transmission module is used to extract service resources corresponding to user intentions from preloaded service resources according to predicted user intentions for transmission when a user interacts with the chat robot in real time.
[0019] The geofence module includes a geofence generation unit, a geofence screening unit and a marking unit; The geo-fence generation unit is used to extract original coordinates for different geographical areas in the GPS system, construct an original coordinate sequence, determine the original coordinate sequence to obtain geo-fence boundaries, and obtain all geo-fences in the GPS system; The geo-fence screening unit is used to calculate the area of each geo-fence and screen the geo-fences using a minimum geo-fence area threshold; The marking unit is used to classify all geo-fences; and mark the keywords of each category as scene tags in the geo-fence.
[0020] The user intention inference module includes a basic probability unit, a real-time correction unit, and a user intention unit; The basic probability unit is used to collect the number of visits to each requested service type every day in the past D days of the corresponding scenario, and then add the time decay coefficient to calculate the basic probability of each requested service type; The real-time correction unit is used to collect the number of visits of each requested service type in the scene type S in which the real-time user is located in the past hour, and to perform real-time correction on the basic probability of each requested service type; The user intention unit is used to filter and obtain the user intention according to the size of the final probability, and take the requested service type with the largest final probability as the user's most significant intention.
[0021] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention realizes passive scene perception through real-time GPS + geo-fencing, which can predict needs without the user explicitly telling the location, greatly improving service initiative.
[0022] 2. This invention uses a two-layer prediction mechanism of "historical feature vector + real-time data correction" to reduce the misjudgment rate caused by environmental changes compared to models that rely solely on historical data.
[0023] 3. The present invention uses a preloading strategy to shift computing pressure to non-interactive periods, reducing computing power consumption during real-time interaction and adapting to resource-constrained devices such as mobile phones and smart speakers. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a module distribution diagram of a data transmission system for a chat robot according to the present invention; Figure 2 Schematic diagram of the steps of the data transmission method applied to a chat robot according to the present invention; Figure 3 Schematic diagram of geo-fencing of the data transmission method of the present invention applied to a chatbot. DETAILED DESCRIPTION
[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0026] Example: Figure 1-Figure 3 As shown, the present invention provides a technical solution. A data transmission method applied to a chat robot, the method comprising the following steps: S100, deploying a GPS system within the chatbot, using the GPS system to construct geofences, extracting a geographic name of each geofence within the GPS system, classifying all geographic names, generating a scene label based on the classification, and marking the scene label in each geofence; The specific steps to generate scene labels based on classification and mark them in each geofence are: S101. Extracting original coordinates for different geographic areas within the GPS system to construct an original coordinate sequence, arbitrarily selecting two coordinates from the original coordinate sequence, connecting the two selected coordinates to form an infinitely extended straight line, determining the positional relationship between the remaining coordinates in the original coordinate sequence and the straight line, and determining that the two selected coordinates form a straight line as a geo-fence boundary for the corresponding geographic area when all remaining coordinates are on the same side of the straight line; determining that the two selected coordinates form a straight line that is not a geo-fence boundary for the corresponding geographic area when the remaining coordinates are on both sides of the straight line; repeatedly traversing all selected coordinates in the original coordinate sequence, performing the same operation, extracting all geo-fence boundaries for the geographic area, and using all geo-fence boundaries to form a geo-fence for the corresponding geographic area; S102. Extract all vertex coordinates of each geofence in the GPS system, select one vertex coordinate as A1, and mark the vertices of the geofence in clockwise order as {A1, A2, A3...An}. Calculate the area of each geofence using the vertex coordinates using the following formula: ; In the formula, Area represents the area of the geofence, n represents the total number of vertices of the geofence, and lat i Indicates the dimension of the i-th geofence vertex, lng i Indicates the longitude of the i-th geofence vertex, lat i+1 Indicates the dimension of the i+1th geofence vertex, lng i+1 Indicates the longitude of the i+1th geofence vertex; calculates the area of all geofences in the GPS system in sequence; Set a minimum geofence area threshold based on manual experience, use the minimum geofence area threshold to judge the calculated areas of all geofences, and remove geofences that are smaller than the minimum geofence area threshold; S103. Extract the geographic name of each geofence from the GPS system, use a natural language processing algorithm to extract keywords for each geographic name in advance, classify geofences with the same keywords into the same scene type, and classify all geofences; mark the keywords of each category as scene tags in the geofence.
[0027] By digitizing physical spaces through GPS geofencing and combining them with geographic name classifications (such as "shopping mall," "hospital," and "school"), we achieve a semantic understanding of the user's environment, providing a foundation for subsequent scenario-based services. Scenario tags (such as "shopping," "medical treatment," and "education") can be directly linked to specific service types, enabling chatbots to quickly identify potential needs based on user location and improve targeted service.
[0028] S200, extracting the user's requested service type and average number of conversations in different scenario types from the chatbot's historical log; and calculating the user's behavioral feature vectors in different geographic fences; The specific steps for calculating the user's behavior feature vectors within different geo-fences are: S201. Extract the user's requested service types and conversation turns in different scenario types from the chatbot's historical logs, and calculate the user's weight score for each requested service for each scenario type using the formula: ; In the formula, f j Indicates the weight score of each request service type, Count j Indicates the number of occurrences of each request service type, N h represents the conversation turn of the jth requested service in the hth session, and m represents the total number of requested service types; S202, using the same method to calculate the weights of users for different request service types, and construct the user's behavior characteristics in each scenario type as Ft=[f1, f2, f3, ..., f m ], f1, f2, f3, ..., f m Represents the weight score of the user for the 1st, 2nd, 3rd, ..., mth request service type; similarly, constructs the user's behavioral characteristics in different scenario types to form a user behavior feature set.
[0029] By extracting metrics such as "service request type" and "average number of conversations" from historical logs, we convert user behavior in different scenarios into computable feature vectors (e.g., restaurant request rate, navigation request rate, conversation duration), enabling a digital representation of user preferences. Behavioral feature vectors reflect user habits in specific scenarios, providing personalized data support for subsequent intent prediction.
[0030] S300, the chatbot device monitors the user's geographic location in real time, determines the user's geographic fence within the GPS system, and extracts the scene type of the geographic fence type; The specific steps to extract the scene type of the geo-fence type are: S301, the chat robot device monitors the user's geographic location in real time, and obtains the user's real-time geographic location (lat s , lng s ), starting from the user's real-time geographic location, a ray is emitted to the right, and the number of points where the ray intersects with the first geofence boundary within the GPS system is determined. If the number is odd, the user is considered to be within the first geofence; if the number is plural, the user is considered to be outside the first geofence; S302: When it is determined that the user is located within a geographic fence, a scene tag of the type of geographic fence is extracted to obtain the scene type S in which the user is located in real time.
[0031] By using real-time GPS data to determine the user's geographic location and combining it with contextual tags (e.g., "Airport - Transportation Hub"), the chatbot can dynamically respond to environmental changes, avoiding misjudgments based on static information. Real-time positioning triggers pre-defined service logic for the corresponding scenario, shortening response time to user needs.
[0032] S400: Calculate the request probability of different service types within the scenario type where the user is located, and then use the real-time data of the scenario type where the user is located to modify the request probability to predict the user's intention; The specific steps for using real-time data from the user's scenario type to modify the request probability and predict the user's intention are as follows: S401: For the user's real-time scenario type S, collect the number of visits to each requested service type per day in the past D days for the corresponding scenario, then add the time decay coefficient to calculate the basic probability of each requested service type. The formula is: ; In the formula, P base (j|S) represents the basic probability of the jth requested service type under scenario type S, Fre d(j) represents the number of visits to the jth request service type on the dth day, λ represents the time decay coefficient and is set manually, and e is a natural constant. Repeat the calculation to obtain the basic probability of each request service type in scenario type S; S402: Collect the number of visits to each requested service type in the past hour in the scenario type S where the real-time user is located, and make real-time corrections to the basic probability of each requested service type. The formula is: ; In the formula, P final (j|S) represents the final probability of the jth request service type after real-time correction, Mfre(j) represents the number of visits to the jth request service type in the past hour, and α represents the weighting coefficient set by manual experience. The basic probability of each request service type under scenario type S is repeatedly corrected in real time to obtain the final probability. The user intent is filtered based on the size of the final probability, and the request service type with the largest final probability is regarded as the user's most significant intention.
[0033] The system calculates service request probabilities based on historical behavioral characteristics and incorporates real-time data (such as holiday mall traffic) to refine predictions, improving the accuracy of intent assessment. This proactive recommendation of potential services reduces the need for users to manually input their needs and optimizes the interactive experience. Furthermore, a real-time data correction mechanism can address temporary changes (such as a surge in taxi requests during heavy rain), allowing the system to quickly adjust service priorities and avoid relying solely on historical data.
[0034] S500: The chat robot extracts service resources of different request service types, collects the sizes of different service resources, and calculates the preloading priorities of service resources of different request service types using the request probability and the service resource sizes; the chat robot preloads the service resources according to the preloading priorities; The specific steps for calculating the service resource preloading priority of different request service types using request probability and service resource size are as follows: S501. The chat robot extracts service resources of different request service types under scenario type S, collects sizes of different service resources, and calculates preloading priorities of service resources of different request service types using request probabilities and service resource sizes. The formula is: ; In the formula, Q j represents the preloading priority of the jth request service type, R j represents the service resource size of the jth request service type, C j T represents the amount of locally cached resources in the service resource of the jth request service resource, j represents the total amount of resources required for the service resources of the jth requested service type; S502. Similarly, the preloading priority of each requested service type is calculated under the scene type S in which the user is in real time, and the chat robot preloads the service resources of each requested service type in descending order according to the preloading priority.
[0035] By calculating the preloading priority of service resources for each requested service type, high-priority resources are cached first to balance memory usage and response speed. Caching resources according to priority can ensure that the service resources corresponding to the user's intent are met first, improving the user experience.
[0036] S600: When the user interacts with the chatbot in real time, service resources corresponding to the user intention are extracted from the preloaded service resources according to the predicted user intention and transmitted.
[0037] The specific steps for extracting the service resources corresponding to the user intent from the preloaded service resources and transmitting them according to the predicted user intent are as follows: S601. When a user interacts with a chatbot in real time, when the user is in scenario type S, the chatbot pushes and transmits the preloaded service resources of the requested service type, arranges the recommended transmission order of the preloaded service resources according to the user's intention, and pushes the service resources with the most significant intention of the user first; the preloaded service resources are transmitted and shared among all chatbots in the geographic fence where the user is located.
[0038] Directly retrieve pre-loaded corresponding resources based on predicted intent (for example, when a user asks about the exit at a "subway station", map slices and route text are quickly returned), ensuring that the service content is highly matched with the needs.
[0039] The data transmission system used in chatbots includes a data acquisition module, a geo-fencing module, a behavior feature module, a user scenario type judgment module, a user intent inference module, a resource preloading module, and an interaction transmission module. The data collection module is used to extract the user's requested service type and average number of conversations in different scenario types from the chat robot's historical log; The geofence module is used to deploy a GPS system in the chatbot, construct a geofence using the GPS system, extract the geographical name of each geofence in the GPS system, and classify all geographical names; The behavior feature module is used to calculate the behavior feature vectors of users in different geographic fences by using the requested service types and average conversation times of users in different scenario types; The user scenario type determination module is used by the chatbot device to monitor the user's geographic location in real time, determine the user's geographic fence within the GPS system, and extract the scenario type of the geographic fence type; The user intention inference module is used to calculate the request probability of different service types within the scenario type where the user is located, and then use the real-time data of the scenario type where the user is located to modify the request probability to predict the user intention; The resource preloading module is used to calculate the service resource preloading priority of different request service types by using the request probability and service resource size; the chat robot preloads the service resources according to the preloading priority; The interactive transmission module is used to extract service resources corresponding to user intentions from preloaded service resources according to predicted user intentions for transmission when a user interacts with the chat robot in real time.
[0040] The geofence module includes a geofence generation unit, a geofence screening unit and a marking unit; The geo-fence generation unit is used to extract original coordinates for different geographical areas in the GPS system, construct an original coordinate sequence, determine the original coordinate sequence to obtain geo-fence boundaries, and obtain all geo-fences in the GPS system; The geo-fence screening unit is used to calculate the area of each geo-fence and screen the geo-fences using a minimum geo-fence area threshold; The marking unit is used to classify all geo-fences; and mark the keywords of each category as scene tags in the geo-fence.
[0041] The user intention inference module includes a basic probability unit, a real-time correction unit, and a user intention unit; The basic probability unit is used to collect the number of visits to each requested service type every day in the past D days of the corresponding scenario, and then add the time decay coefficient to calculate the basic probability of each requested service type; The real-time correction unit is used to collect the number of visits of each requested service type in the scene type S in which the real-time user is located in the past hour, and to perform real-time correction on the basic probability of each requested service type; The user intention unit is used to filter and obtain the user intention according to the size of the final probability, and take the requested service type with the largest final probability as the user's most significant intention.
[0042] Example: Using Figure 3The geofence generation method shown here constructs all geofences within the GPS system. The real-time user coordinates are monitored as (40.0801, 116.5985). A ray is constructed from the user coordinates to the right. The first geofence intersection is determined to be one, confirming that the user is within the "Beijing Capital International Airport" geofence and determining the scene type as "Transportation Station." Assume that the service types requested in the user's history include flight status query, gate navigation, and baggage policy query; the occurrence times are 58, 42, and 35 respectively; the average conversation turns are 2.3, 4.1, and 1.8 respectively. The weight scores of the three service types are calculated to be 0.54, 1.01, and 0.71 respectively. The user behavior feature vector is constructed as Ft={0.54, 1.01, 0.71}. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
Claims
1. A data transmission method applied to a chatbot, characterized in that: The method comprises the following steps: S100, deploying a GPS system within the chatbot, using the GPS system to construct geofences, extracting a geographic name of each geofence within the GPS system, classifying all geographic names, generating a scene label based on the classification, and marking the scene label in each geofence; S200, extracting the user's requested service type and average number of conversations in different scenario types from the chatbot's historical log; and calculating the user's behavioral feature vectors in different geographic fences; S300, the chatbot device monitors the user's geographic location in real time, determines the user's geographic fence within the GPS system, and extracts the scene type of the geographic fence type; S400: Calculate the request probability of different service types within the scenario type where the user is located, and then use the real-time data of the scenario type where the user is located to modify the request probability to predict the user's intention; S500: The chat robot extracts service resources of different request service types, collects the sizes of different service resources, and calculates the preloading priorities of service resources of different request service types using the request probability and the service resource sizes; the chat robot preloads the service resources according to the preloading priorities; S600: When the user interacts with the chatbot in real time, service resources corresponding to the user intention are extracted from the preloaded service resources according to the predicted user intention and transmitted.
2. The data transmission method for a chat robot according to claim 1, characterized in that: The specific steps of generating scene labels according to classification and marking each geo-fence in S100 are: S101. Extracting original coordinates for different geographic regions within the GPS system to construct an original coordinate sequence, arbitrarily selecting two coordinates from the original coordinate sequence, connecting the selected two coordinates to form an infinitely extended straight line, and determining a positional relationship between the remaining coordinates in the original coordinate sequence and the straight line. When all remaining coordinates are on the same side of the straight line, determining that the two selected coordinates form a straight line that serves as a geo-fence boundary for the corresponding geographic region; and determining that the two selected coordinates form a straight line that serves as a geo-fence boundary for the corresponding geographic region when the remaining coordinates are on both sides of the straight line. Repeat the traversal to select all coordinates in the original coordinate sequence, perform the same operation, extract all geo-fence boundaries of the geographic area, and use all geo-fence boundaries to form a geo-fence of the corresponding geographic area; S102. Extract all vertex coordinates of each geofence in the GPS system, select one vertex coordinate as A1, and mark the vertices of the geofence in clockwise order as {A1, A2, A3...An}. Calculate the area of each geofence using the vertex coordinates using the following formula: ; In the formula, Area represents the area of the geofence, n represents the total number of vertices of the geofence, and lat i Indicates the dimension of the i-th geofence vertex, lng i Indicates the longitude of the i-th geofence vertex, lat i+1 Indicates the dimension of the i+1th geofence vertex, lng i+1 Indicates the longitude of the i+1th geofence vertex; calculates the area of all geofences in the GPS system in sequence; Set a minimum geofence area threshold based on manual experience, use the minimum geofence area threshold to judge the calculated areas of all geofences, and remove geofences that are smaller than the minimum geofence area threshold; S103. Extract the geographic name of each geofence from the GPS system, use a natural language processing algorithm to extract keywords for each geographic name in advance, classify geofences with the same keywords into the same scene type, and classify all geofences; mark the keywords of each category as scene tags in the geofence.
3. The data transmission method for a chat robot according to claim 2, characterized in that: The specific steps of calculating the user's behavior feature vectors within different geo-fences in S200 are: S201. Extract the user's requested service types and conversation turns in different scenario types from the chatbot's historical logs, and calculate the user's weight score for each requested service for each scenario type using the formula: ; In the formula, f j Indicates the weight score of each request service type, Count j Indicates the number of occurrences of each request service type, N h represents the conversation turn of the jth requested service in the hth session, and m represents the total number of requested service types; S202, using the same method to calculate the weights of users for different request service types, and construct the user's behavior characteristics in each scenario type as Ft=[f1, f2, f3, ..., f m ], f1, f2, f3, ..., f m Represents the weight score of the user for the 1st, 2nd, 3rd, ..., mth request service type; similarly, constructs the user's behavioral characteristics in different scenario types to form a user behavior feature set.
4. The data transmission method for a chat robot according to claim 3, characterized in that: The specific steps of extracting the scene type of the geo-fence type in step S300 are: S301, the chat robot device monitors the user's geographic location in real time, and obtains the user's real-time geographic location (lat s , lng s ), starting from the user's real-time geographic location, a ray is emitted to the right, and the number of points where the ray intersects with the first geofence boundary within the GPS system is determined. If the number is odd, the user is considered to be within the first geofence; if the number is plural, the user is considered to be outside the first geofence; S302: When it is determined that the user is located within a geographic fence, a scene tag of the type of geographic fence is extracted to obtain the scene type S in which the user is located in real time.
5. The data transmission method for a chat robot according to claim 4, characterized in that: The specific steps of using the real-time data of the scene type in which the user is located in S400 to modify the request probability and predict the user intention are as follows: S401: For the user's real-time scenario type S, collect the number of visits to each requested service type per day in the past D days for the corresponding scenario, then add the time decay coefficient to calculate the basic probability of each requested service type. The formula is: ; In the formula, P base (j|S) represents the basic probability of the jth requested service type under scenario type S, Fre d (j) represents the number of visits to the jth request service type on the dth day, λ represents the time decay coefficient and is set manually, and e is a natural constant. Repeat the calculation to obtain the basic probability of each request service type in scenario type S; S402: Collect the number of visits to each requested service type in the past hour in the scenario type S where the real-time user is located, and make real-time corrections to the basic probability of each requested service type. The formula is: ; In the formula, P final (j|S) represents the final probability of the jth request service type after real-time correction, Mfre(j) represents the number of visits to the jth request service type in the past hour, and α represents the weighting coefficient set by manual experience. The basic probability of each request service type under scenario type S is repeatedly corrected in real time to obtain the final probability. The user intent is filtered based on the size of the final probability, and the request service type with the largest final probability is regarded as the user's most significant intention.
6. The data transmission method for a chat robot according to claim 5, characterized in that: The specific steps of calculating the service resource preloading priority of different request service types by using the request probability and service resource size in S500 are: S501. The chat robot extracts service resources of different request service types under scenario type S, collects sizes of different service resources, and calculates preloading priorities of service resources of different request service types using request probabilities and service resource sizes. The formula is: ; In the formula, Q j represents the preloading priority of the jth request service type, R j represents the service resource size of the jth request service type, C j T represents the amount of locally cached resources in the service resource of the jth request service resource, j represents the total amount of resources required for the service resources of the jth requested service type; S502. Similarly, the preloading priority of each requested service type is calculated under the scene type S in which the user is in real time, and the chat robot preloads the service resources of each requested service type in descending order according to the preloading priority.
7. The data transmission method for a chat robot according to claim 6, characterized in that: The specific steps of extracting the service resources corresponding to the user intention from the preloaded service resources according to the predicted user intention in S600 and transmitting them are: S601. When a user interacts with a chatbot in real time, when the user is in scenario type S, the chatbot pushes and transmits the preloaded service resources of the requested service type, arranges the recommended transmission order of the preloaded service resources according to the user's intention, and pushes the service resources with the most significant intention of the user first; the preloaded service resources are transmitted and shared among all chatbots in the geographic fence where the user is located.
8. A data transmission system for a chatbot, characterized in that: The data transmission system includes a data acquisition module, a geo-fencing module, a behavior feature module, a user scenario type judgment module, a user intention inference module, a resource preloading module, and an interactive transmission module; The data collection module is used to extract the user's requested service type and average number of conversations in different scenario types from the chat robot's historical log; The geofence module is used to deploy a GPS system in the chatbot, construct a geofence using the GPS system, extract the geographical name of each geofence in the GPS system, and classify all geographical names; The behavior feature module is used to calculate the behavior feature vectors of users in different geographic fences by using the requested service types and average conversation times of users in different scenario types; The user scenario type determination module is used by the chatbot device to monitor the user's geographic location in real time, determine the user's geographic fence within the GPS system, and extract the scenario type of the geographic fence type; The user intention inference module is used to calculate the request probability of different service types within the scenario type where the user is located, and then use the real-time data of the scenario type where the user is located to modify the request probability to predict the user intention; The resource preloading module is used to calculate the service resource preloading priority of different request service types by using the request probability and service resource size; the chat robot preloads the service resources according to the preloading priority; The interactive transmission module is used to extract service resources corresponding to user intentions from preloaded service resources according to predicted user intentions for transmission when a user interacts with the chat robot in real time.
9. The data transmission system for a chat robot according to claim 8, characterized in that: The geo-fence module includes a geo-fence generation unit, a geo-fence screening unit and a marking unit; The geo-fence generation unit is used to extract original coordinates for different geographical areas in the GPS system, construct an original coordinate sequence, determine the original coordinate sequence to obtain geo-fence boundaries, and obtain all geo-fences in the GPS system; The geo-fence screening unit is used to calculate the area of each geo-fence and screen the geo-fences using a minimum geo-fence area threshold; The marking unit is used to classify all geo-fences; and mark the keywords of each category as scene tags in the geo-fence.
10. The data transmission system for a chat robot according to claim 8, characterized in that: The user intention inference module includes a basic probability unit, a real-time correction unit and a user intention unit; The basic probability unit is used to collect the number of visits to each requested service type every day in the past D days of the corresponding scenario, and then add the time decay coefficient to calculate the basic probability of each requested service type; The real-time correction unit is used to collect the number of visits of each requested service type in the scene type S in which the real-time user is located in the past hour, and to perform real-time correction on the basic probability of each requested service type; The user intention unit is used to filter and obtain the user intention according to the size of the final probability, and take the requested service type with the largest final probability as the user's most significant intention.